kw-code-cleanup
Code Cleanup Phase
Adds a cleanup phase at the end of the current GSD milestone based on real diagnostics. This skill ONLY creates the phase — it does NOT execute it.
Rules
- Always run diagnostics BEFORE proposing the phase.
- Scope to code touched in the current milestone, not the entire codebase.
- Always confirm with the user before creating the phase.
Workflow
Step 1: Detect context
Read these files in parallel:
.planning/STATE.md— active milestone name and version.planning/ROADMAP.md— phase list and max phase number
Extract: milestone version (e.g., v1.2), milestone name, and the phase numbers belonging to it.
Step 2: Run diagnostics
Run these commands in parallel:
npm run lint 2>&1
npm outdated 2>&1
Parse the results:
- Lint: count errors by rule (
no-explicit-any,exhaustive-deps,no-empty, etc.) and total warnings - Outdated: separate into safe updates (within semver range, "Wanted" column) vs major bumps ("Latest" column)
Step 3: Present findings and propose phase
Show the user a summary like:
Milestone vX.Y — Diagnostics:
- Lint: N errors (breakdown by rule), M warnings
- Deps: N safe updates, M major (don't touch)
Proposed phase — Code Cleanup vX.Y:
[x] Fix lint errors in files touched during the milestone
[x] Type any in modified code
[x] Apply safe dependency updates (npm update)
[x] Fix exhaustive-deps in new/modified components
[x] Clean build as final validation
Adapt the checklist based on what the diagnostics actually found. If lint is clean, don't include lint tasks. If no safe dependency updates exist, skip that task.
Ask: "Confirm this phase? You can remove tasks that don't apply."
Step 4: Create the phase
After user confirms, run:
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" phase add "Code Cleanup: technical cleanup vX.Y"
Replace vX.Y with the actual milestone version from Step 1.
The CLI will:
- Add the phase entry to
.planning/ROADMAP.md - Create the phase directory under
.planning/phases/ - Return JSON with
phase_number,slug, anddirectory
Step 5: Confirm
Tell the user:
- Phase number and name that was added
- Remind them to plan it with
/gsd:plan-phase Nwhen feature phases are done - Remind them it won't execute until they explicitly run
/gsd:execute-phase N
More from kwazema/claude-skills
kw-gsd-fortify
>
10kw-cubic
>
9kw-stack-audit
>
9kw-update-skills
>
9kw-vite-checker-setup
>
9kw-check-migrations-supabase
Review pending Supabase changes (migrations + edge functions), explain each one, and deploy after user confirmation. Use when the user says "push migrations", "aplicar migraciones", "db push", "push migraciones", "check migrations", "deploy functions", "check edge functions", "desplegar funciones", "check supabase", or wants to apply pending database migrations or deploy edge functions.
9