Przejdź do treści
Biblioteka skilli
Programowanie · Przegląd i audyt

cleanup-code

/cleanup-code

Porządkuje bazę kodu w 11 wymiarach jakości, m.in. martwy kod, duplikacja, słabe typy i zależności cykliczne, z oceną pewności i bramkami build oraz test.

Licencja
MIT
Ostatnia zmiana repozytorium
26.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
5
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 26.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Porządkuje bazę kodu w 11 wymiarach jakości, m.in. martwy kod, duplikacja, słabe typy i zależności cykliczne, z oceną pewności i bramkami build oraz test.

Wyzwalacze z opisu

clean up the codebaseremove dead codefix code quality

Argumenty

/cleanup-code [scope] [--dimensions d1,d2,...] [--changed]
Oryginalny opis (EN)

Comprehensive codebase cleanup across 11 quality dimensions: dead code, duplication, weak types, circular deps, defensive cruft, legacy code, AI slop, type consolidation, security, performance, and async patterns. Analyzes code with confidence scoring and verifies changes with build/test gates. Use when codebase has accumulated tech debt, after major feature work, before releases, or when code quality metrics are declining. Trigger with "/cleanup-code-code", "clean up the codebase", "remove dead code", "fix code quality".

Jak działa

  1. Environment Detection
  2. Prerequisites
  3. Overview
  4. Instructions
  5. Output
  6. Error Handling
  7. Examples
  8. Resources
Sekcje z nagłówków SKILL.md, w oryginale · 171 linii, 833 słów
Podgląd SKILL.md
---
name: cleanup-code
description: 'Comprehensive codebase cleanup across 11 quality dimensions: dead code,
  duplication,

  weak types, circular deps, defensive cruft, legacy code, AI slop, type consolidation,

  security, performance, and async patterns. Analyzes code with confidence scoring
  and

  verifies changes with build/test gates. Use when codebase has accumulated tech debt,

  after major feature work, before releases, or when code quality metrics are declining.

  Trigger with "/cleanup-code-code", "clean up the codebase", "remove dead code",
  "fix code quality".

  '
allowed-tools: Read, Write, Edit, Glob, Grep, Bash(git:*), Bash(npm:*), Bash(npx:*),
  Bash(pnpm:*), Bash(python3:*), Bash(tsc:*), Bash(wc:*), Bash(ls:*), AskUserQuestion
version: 1.7.0
author: Jeremy Longshore <jeremy@intentsolutions.io>
license: MIT
tags:
- code-quality
- cleanup
- refactoring
- dead-code
- deduplication
- type-safety
- security
argument-hint: '[scope] [--dimensions d1,d2,...] [--changed]'
compatibility: Designed for Claude Code
---
# Codebase Cleanup

Systematic code cleanup across 11 quality dimensions, ordered by risk. Each finding includes
confidence scoring (HIGH/MEDIUM/LOW) and all changes are verified through build/test gates.

## Environment Detection

!`git rev-parse --show-toplevel 2>/dev/null && echo "---" && git diff --stat HEAD~5 2>/dev/null | tail -5`
!`ls package.json pyproject.toml Cargo.toml go.mod Makefile 2>/dev/null | head -5`
!`cat package.json 2>/dev/null | head -3; echo "---"; ls tsconfig.json .eslintrc* 2>/dev/null`

## Prerequisites

- Git repository with clean working tree (no uncommitted changes)
- Language toolchain installed (Node.js/Python/Go/Rust as applicable)
- Optional: `knip`, `madge`, `jscpd`, `ruff`, `bandit` for tool-verified scanning

## Overview

This skill orchestrates cleanup across **11 dimensions**, each with a dedicated agent.
Dimensions are ordered LOW → HIGH risk. See [dimensions reference](references/dimensions.md)
for full detection criteria, verification steps, and risk profiles.

**The 11 Dimensions** (by risk level):

| # | Dimension | Key | Risk | Auto-apply? |
|---|-----------|-----|------|-------------|
| 1 | Dead code removal | `dead` | LOW | Yes (after build) |
| 2 | AI slop removal | `slop` | LOW | Comments only |
| 3 | Weak type elimination | `types` | MED | Yes (after typecheck) |
| 4 | Security cleanup | `security` | MED | Flag only |
| 5 | Legacy code removal | `legacy` | MED | With confirmation |
| 6 | Type consolidation | `typecons` | MED | Yes (after typecheck) |
| 7 | Defensive code cleanup | `defensive` | MED | Flag only |
| 8 | Performance optimization | `perf` | MED | Flag only |
| 9 | DRY deduplication | `dry` | HIGH | Flag only (>=10 lines) |
| 10 | Async pattern fixes | `async` | HIGH | Flag only |
| 11 | Circular dep untangling | `circular` | HIGH | Flag only |

## Instructions

### Step 1: Safety Checkpoint

Before any changes:

1. Verify clean git state: `git status --porcelain` must be empty (or stash changes)
2. Record baseline: `git rev-parse HEAD` as rollback point
3. Run existing tests to confirm green baseline
4. See [safety protocol](references/safety.md) for revert procedures

### Step 2: Determine Scope

Parse user arguments to set scope:

- **Full codebase** (default): scan all source files
- **Specific path**: `cleanup src/api/` — limit to directory
- **Changed files only**: `--changed` flag — `git diff --name-only HEAD~10`
- **Specific dimensions**: `--dimensions dead,types,security`
- **Single dimension**: `cleanup --dimensions dry`

Exclude from all scans: `node_modules/`, `dist/`, `build/`, `.git/`, vendor dirs, generated files.

### Step 3: Execute Dimensions

For each selected dimension (in risk order):

1. **Scan** using patterns from [patterns reference](references/patterns.md)
2. **Score confidence** — HIGH (certain, safe to fix), MEDIUM (likely, needs review), LOW (possible, flag only)
3. **Apply or flag** based on the dimension's auto-apply policy (see table above)
4. **Verify** — run build/typecheck/tests after each dimension with auto-apply

Use [tools reference](references/tools.md) for language-specific tool commands (knip, madge, ruff, jscpd, etc.).

### Step 4: Build Verification Gate

After each auto-applied dimension:

```text
# TypeScript/JavaScript
npx tsc --noEmit 2>&1 | tail -20
npm test 2>&1 | tail -30

# Python
python3 -m py_compile <changed_files>
python3 -m pytest --tb=short 2>&1 | tail -30

# General
git diff --stat  # Show what changed
```

If verification fails, revert that dimension: `git checkout -- .`

### Step 5: Generate Report

Produce a cleanup report in this format:

```
## Cleanup Report

**Scope:** [path or "full codebase"]
**Baseline:** [commit hash]
**Dimensions:** [list of dimensions run]

### Summary
| Dimension | Findings | Applied | Flagged | Confidence |
|-----------|----------|---------|---------|------------|
| dead      | 12       | 10      | 2       | HIGH       |
| types     | 8        | 8       | 0       | HIGH       |
| security  | 3        | 0       | 3       | MEDIUM     |

### Changes Applied
- [file:line] description of change

### Flagged for Review
- [file:line] description + reasoning + suggested fix

### Lines Removed: N | Lines Modified: N | Files Touched: N
```

## Output

A structured cleanup report containing:

- Summary table with findings per dimension (count, applied, flagged, confidence)
- List of changes applied with file:line references
- List of flagged items with reasoning and suggested fixes
- Stats: lines removed, lines modified, files touched

## Error Handling

| Error | Recovery |
|-------|----------|
| Dirty git state | Ask user to commit or stash first |
| Build fails after cleanup | `git checkout -- .` to revert dimension |
| No test command found | Skip verification, flag all as "unverified" |
| Tool not installed | Fall back to grep patterns (see references/patterns.md) |
| Confidence unclear | Default to flag-only, never auto-apply |

## Examples

**Full cleanup:**

```
/cleanup-code
```

**Security-focused:**

```
/cleanup-code --dimensions security,async
```

**Changed files only:**

```
/cleanup-code src/api/ --changed
```

**Single dimension deep-dive:**

```
/cleanup-code --dimensions dead
```

## Resources

- [All 11 Dimensions](references/dimensions.md) — detection criteria, verification, risk profiles
- [Tool Reference](references/tools.md) — language-specific cleanup tools
- [Grep Patterns](references/patterns.md) — detection patterns by dimension
- [Safety Protocol](references/safety.md) — revert procedures, confidence scoring
Pliki w paczce (5)
  • SKILL.md 6 KB
  • references/dimensions.md 9 KB
  • references/patterns.md 6 KB
  • references/safety.md 4 KB
  • references/tools.md 4 KB

Wersje

RepozytoriumWynikLicencja
Ta strona · jeremylongshore/tons-of-skills-marketplace100MIT
rowansci/rowan-python86MIT

Identyczna treść występuje jeszcze w 1 innych folderach na GitHubie. Tu pokazujemy jedną, najlepiej ocenioną kopię.

Migawka bazy z 28.10.2026 · wersja paczki 0efbf1afed24 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100run-ts-cleanup
    Porządkuje bazę kodu TypeScript: usuwa martwy kod, nieużywane zależności, bezwartościowy kod z generatorów AI i słabe typy.
  • 100code-quality
    Uruchamia analizę jakości kodu: złożoność cyklomatyczna, code smells, naruszenia SOLID, martwy kod, duplikacja i ocena utrzymywalności pliku lub katalogu.
  • 100slop-scan
    Skanuje bazę kodu pod kątem długu technicznego i martwego kodu, domyślnie tylko w ostatnich zmianach.
  • 90prune
    Audytuje kod pod kątem martwego kodu, duplikacji, nieużywanych zależności i śmieci, a potem bezpiecznie usuwa to, co nie zasługuje na miejsce.
  • 100refactor
    Audytuje bazę kodu pod kątem jakości, usuwa duplikację i martwy kod, poprawia abstrakcje i spójność, nie zmieniając zewnętrznego zachowania.
  • 100code-audit
    Prowadzi ustrukturyzowany audyt jakości kodu z zewnętrznymi narzędziami i ręcznym przeglądem: duplikacja, martwy kod, dług techniczny, a wynikiem są artefakty Empirica (ustalenia, cele, decyzje).

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.