Code Clean
Overview
Audit a repository for cleanup opportunities, summarize findings, and ask for explicit approval before any edits.
Workflow
- •
Project discovery
- •Identify languages and tooling by scanning for configs and scripts.
- •Check for:
package.jsonscripts (lint,typecheck,format),pyproject.toml,ruff.toml,mypy.ini,.golangci.yml,Cargo.toml,.eslintrc*,eslint.config.*,tsconfig*.json,Makefile. - •Prefer project-provided commands when available; otherwise fall back to heuristic scans.
- •
TODO scan
- •Use
rgto findTODO|FIXME|HACK|XXXwith file + line context. - •Group findings by file.
- •Ask the user for disposition per item: complete, keep, or remove.
- •Use
- •
Dead code candidates
- •Prefer evidence from compiler/linter output (e.g.,
tscunused checks,go vet,ruffF401/F841) when those tools are available in the repo. - •If only heuristic evidence exists, label as “candidate” and explain uncertainty.
- •For each candidate, describe what it does, why it appears unused, and the safest removal approach.
- •Prefer evidence from compiler/linter output (e.g.,
- •
Lint issues
- •Run project lint commands only when they exist (e.g.,
npm run lint,pnpm lint,yarn lint,make lint). - •Do not run
--fixunless the user explicitly requests it. - •If no lint entrypoint is found, report that lint was skipped.
- •Run project lint commands only when they exist (e.g.,
- •
Structure review
- •Provide a short prioritized list of structural concerns.
- •If no meaningful structural issues are found, explicitly say so.
Output format
- •Summary counts: TODOs, dead code candidates, lint issues.
- •Sections:
- •TODOs (grouped by file)
- •Dead code candidates (with evidence and confidence)
- •Lint results (command run or “skipped”)
- •Structure notes (prioritized, short list)
- •Explicit questions for any change requests.
Safety guardrails
- •Never modify files without explicit user approval.
- •Prefer evidence-based findings; label uncertain items as candidates.
- •Skip vendor/build/generated directories and large dependency trees (e.g.,
node_modules,vendor,dist,build,target,.git,.venv,.tox,coverage,.cache).