Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Detect stale TODOs, unused imports, and dead code.
.claude/skills/notque-code-cleanup/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-10 | ✗→✓ | ▲ Improved | 109% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 145% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 125% | 0% |
| case-14 | ✗→✓ | ▲ Improved | 123% | 0% |
| case-15 | ✗→✓ | ▲ Improved | 118% | 0% |
Scan repositories for 9 categories of technical debt (TODOs, unused imports, dead code, missing type hints, deprecated functions, naming inconsistencies, high complexity, duplicate code, missing docstrings), prioritize findings by impact/effort ratio with time estimates, and generate structured markdown reports with exact file:line references. Can apply safe auto-fixes when the user grants explicit permission.
Focused cleanup -- User says "Clean up the API handlers in src/api/". Read project config, scan src/api/ for all 9 categories, prioritize (5 unused imports auto-fixable, 2 stale TODOs >90d, 1 high-complexity function), present tiered report with auto-fix commands.
Broad debt scan -- User says "What's the state of technical debt in this repo?". Identify languages and source directories, run all applicable scans, group 47 findings into Quick Wins (12), Important (8), Polish (27), generate full report with effort estimates: 2h quick wins, 6h important, 4h polish.
Auto-fix request -- User says "Fix all the unused imports and sort them". Verify ruff/goimports available, scan for F401 and I001 violations only, report 23 unused imports across 8 files, user confirms, apply fixes, run tests, show diff.
| Signal | Load These Files | Why | |---|---|---| | writing the cleanup report | report-template.md | Loads detailed guidance from report-template.md. | | running per-language scans: unused imports, dead code, debug statements | scan-commands.md | Loads detailed guidance from scan-commands.md. | | checking which cleanup tools are installed per language | tools.md | Loads detailed guidance from tools.md. |
Goal: Determine what to scan and verify tooling is available.
Step 1: Read project context
Step 2: Determine scan scope
Step 3: Verify tool availability
Check which analysis tools are installed so you know what scans are possible before starting. Report missing tools with install commands.
bash# Python tools command -v ruff && echo "ruff: available" || echo "ruff: MISSING (pip install ruff)" command -v vulture && echo "vulture: available" || echo "vulture: MISSING (pip install vulture)" # Go tools command -v gocyclo && echo "gocyclo: available" || echo "gocyclo: MISSING (go install github.com/fzipp/gocyclo/cmd/gocyclo@latest)" command -v goimports && echo "goimports: available" || echo "goimports: MISSING (go install golang.org/x/tools/cmd/goimports@latest)"
If critical tools are missing, offer to proceed with partial scan using available tools (grep, git blame are always available).
Gate: Scope defined, languages identified, tool availability known. Proceed only when gate passes.
Goal: Detect all cleanup opportunities within scope using deterministic tools.
Run applicable scans based on language and scope. See references/scan-commands.md for full command reference.
Core scans (all languages):
Extended scans (if tools available):
Collect all output with exact file:line references -- never summarize away specifics, because the user needs precise locations to act on findings. For each scan, record:
If a scan tool is unavailable, note it as skipped and continue with remaining scans. Never abort the entire scan because one tool is missing.
Gate: All applicable scans complete with raw output collected. Proceed only when gate passes.
Goal: Rank findings by impact/effort ratio and categorize. Never present a flat unsorted list -- a critical 90-day-old security TODO buried among trivial missing docstrings wastes the user's attention.
Step 1: Assign impact and effort
| Issue Type | Impact | Effort | Priority Score | |------------|--------|--------|----------------| | Stale TODOs (>90 days) | High | Low | 8 | | Unused imports | Medium | Trivial | 10 | | Deprecated functions | High | Medium | 6 | | High complexity (>20) | High | High | 5 | | Dead code | Medium | Low | 7 | | Missing type hints | Medium | Medium | 5 | | Duplicate code | High | High | 5 | | Missing docstrings | Medium | Medium | 5 | | Naming inconsistencies | Low | Medium | 3 | | Magic numbers | Low | Low | 5 |
Step 2: Group into tiers
Step 3: Estimate total effort per tier
Include time estimates so the user can plan their cleanup budget:
| Issue Type | Time per Instance | |------------|-------------------| | Unused imports | 1-2 min (auto-fix) | | Stale TODOs | 5-15 min each | | Dead code removal | 5-10 min each | | Magic numbers | 2-5 min each | | Missing type hints | 10-20 min per function | | Missing docstrings | 5-15 min per function | | Naming fixes | 10-30 min per violation | | High complexity refactor | 30-120 min per function | | Duplicate code elimination | 30-90 min per instance | | Deprecated function replacement | 15-60 min per usage |
Multiply by instance count for tier totals.
Gate: All findings categorized and prioritized with effort estimates. Proceed only when gate passes.
Goal: Present findings in structured, actionable format.
This skill defaults to read-only scan and report. Do not modify any files during this phase.
Generate report with this structure:
See references/report-template.md for complete template.
Print the complete report to stdout so the user can inspect every finding in full.
If the user provided --output {file} flag, also write report to the specified file.
For each finding in the report:
Remove any intermediate scan outputs at completion, keeping only the final report.
Gate: Report delivered with all findings, exact references, and actionable suggestions.
Goal: Apply safe, deterministic fixes.
MUST have explicit user permission before proceeding. Never auto-enter this phase -- the user expected a report, not file modifications, and changes may conflict with in-progress work.
Step 1: Confirm scope with user
Before applying any fixes, confirm exactly what will be changed:
markdownWill apply these auto-fixes: - Remove {N} unused imports across {N} files - Sort imports in {N} files - Format {N} files {N} files will be modified. Proceed? (y/n)
Step 2: Apply auto-fixes
Apply fixes in order of safety (most safe first):
bash# Python - safe fixes only ruff check . --select F401,I001 --fix # Remove unused imports, sort ruff format . # Consistent formatting # Go - safe fixes only goimports -w . # Remove unused imports, sort, format gofmt -w . # Consistent formatting go mod tidy # Clean up go.mod/go.sum
Apply only fixes flagged as safe by ruff in this phase. Keep variable names, function structure, and semantic behavior unchanged.
Step 3: Validate fixes
Run the project's existing test suite to verify nothing broke:
bash# Python pytest # Run full test suite ruff check . # Verify no new lint issues # Go go test ./... # Run full test suite go build ./... # Verify build succeeds golangci-lint run # Verify no new lint issues
Step 4: Show diff and results
bashgit diff --stat # Summary of changes git diff # Full diff for review
Present results:
markdown## Fix Results - Files modified: {N} - Imports removed: {N} - Tests: PASS ({N} tests) - Lint: CLEAN Review diff above. Commit when satisfied.
Step 5: Handle failures
If tests fail after auto-fix:
git checkout .Keep the repository in a working state after the cleanup pass.
Gate: All auto-fixes applied, tests pass, diff shown to user. Repository is in a clean, working state.
Cause: ruff, vulture, gocyclo, or other tool not installed Solution:
Cause: Cannot use git blame for TODO aging Solution: Continue scan but mark all TODO ages as "unknown". Warn user that age-based triage is unavailable.
Cause: Auto-fix changed behavior that tests depend on Solution:
git checkout .Cause: Files are read-only, locked, or user did not grant write permission Solution:
${CLAUDE_SKILL_DIR}/references/scan-commands.md: Language-specific scan commands and expected output${CLAUDE_SKILL_DIR}/references/report-template.md: Full structured report template${CLAUDE_SKILL_DIR}/references/tools.md: Tool installation, versions, and capabilities| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-17 | pass→pass | 15,146 | 7,653 | -49% | 1 | 1 | 0% | 2,191 | 4,035 | +84% | 0 | 0 | — |
case-01 | fail→fail | 9,783 | 6,494 | -34% | 1 | 1 | 0% | 1,608 | 3,193 | +99% | 0 | 0 | — |
case-02 | fail→fail | 3,313 | 6,310 | +90% | 1 | 1 | 0% | 337 | 3,199 | +849% | 0 | 0 | — |
case-03 | fail→fail | 3,329 | 6,630 | +99% | 1 | 1 | 0% | 378 | 3,219 | +752% | 0 | 0 | — |
case-04 | fail→fail | 6,599 | 7,040 | +7% | 1 | 1 | 0% | 951 | 3,202 | +237% | 0 | 0 | — |
case-05 | pass→pass | 13,104 | 5,096 | -61% | 1 | 1 | 0% | 2,124 | 3,711 | +75% | 0 | 0 | — |
case-06 | fail→fail | 12,720 | 7,091 | -44% | 1 | 1 | 0% | 2,115 | 4,025 | +90% | 0 | 0 | — |
case-07 | pass→pass | 9,526 | 6,155 | -35% | 1 | 1 | 0% | 1,634 | 3,869 | +137% | 0 | 0 | — |
case-08 | fail→fail | 12,272 | 5,770 | -53% | 1 | 1 | 0% | 1,938 | 3,769 | +94% | 0 | 0 | — |
case-09 | pass→pass | 13,081 | 5,230 | -60% | 1 | 1 | 0% | 1,980 | 3,718 | +88% | 0 | 0 | — |
case-10 | fail→pass | 12,072 | 4,717 | -61% | 1 | 1 | 0% | 1,736 | 3,621 | +109% | 0 | 0 | — |
case-11 | fail→fail | 10,604 | 3,212 | -70% | 1 | 1 | 0% | 1,582 | 3,409 | +115% | 0 | 0 | — |
case-12 | fail→pass | 10,096 | 4,536 | -55% | 1 | 1 | 0% | 1,493 | 3,665 | +145% | 0 | 0 | — |
case-13 | fail→pass | 10,895 | 3,881 | -64% | 1 | 1 | 0% | 1,569 | 3,534 | +125% | 0 | 0 | — |
case-14 | fail→pass | 11,749 | 6,493 | -45% | 1 | 1 | 0% | 1,753 | 3,913 | +123% | 0 | 0 | — |
case-15 | fail→pass | 11,883 | 6,609 | -44% | 1 | 1 | 0% | 1,815 | 3,950 | +118% | 0 | 0 | — |
case-16 | fail→pass | 11,810 | 4,789 | -59% | 1 | 1 | 0% | 1,904 | 3,622 | +90% | 0 | 0 | — |
case-18 | fail→pass | 11,865 | 6,289 | -47% | 1 | 1 | 0% | 1,956 | 3,897 | +99% | 0 | 0 | — |
case-19 | pass→pass | 13,328 | 7,437 | -44% | 1 | 1 | 0% | 2,003 | 4,013 | +100% | 0 | 0 | — |
case-20 | fail→fail | 20,525 | 29,185 | +42% | 1 | 1 | 0% | 3,812 | 7,638 | +100% | 0 | 0 | — |
case-21 | fail→fail | 12,449 | 9,396 | -25% | 1 | 1 | 0% | 2,270 | 4,634 | +104% | 0 | 0 | — |
case-22 | fail→fail | 22,027 | 10,886 | -51% | 1 | 1 | 0% | 3,170 | 3,787 | +19% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 17 counted toward the lift figure. The other 5 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +32 percentage points is the difference between those two pass rates over the 17 comparable cases. 2 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.