forked from bchanot/claude
fix(prune-memory,code-clean): stale v1-untested note reflects real tests/; executor attribution code-cleaner (refactorer inline); audit-only fixture matches flow
This commit is contained in:
@@ -3,7 +3,7 @@ name: code-clean
|
||||
description: |
|
||||
Full codebase cleanup: dead code, style/norm enforcement, structural
|
||||
issues. Two-phase: read-only audit, then approved fixes only
|
||||
(refactorer agent).
|
||||
(code-cleaner executor; refactorer inline for style/structural items).
|
||||
Triggers: "code-clean", "remove dead code", "cleanup", "nettoyage du
|
||||
code", "code hygiene".
|
||||
Targeted refactor without audit → /refactor. Bugs found → logged to
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[
|
||||
{"id": 1, "prompt": "Clean up the codebase — remove dead code and enforce style", "expected": "Two-phase: audit report first (read-only), wait for approval, then execute approved fixes via refactorer agent"},
|
||||
{"id": 1, "prompt": "Clean up the codebase — remove dead code and enforce style", "expected": "Two-phase: audit report first (read-only), wait for approval, then execute approved fixes via the code-cleaner executor (refactorer inline-loaded for style/structural items)"},
|
||||
{"id": 2, "prompt": "Cleanup just the src/utils/ folder", "expected": "Scoped audit of src/utils/ only, list dead code + style violations, get approval, fix"},
|
||||
{"id": 3, "prompt": "Find dead code in this project but don't change anything yet", "expected": "Audit-only mode: produce report at .claude/audits/, do not execute fixes, BUGS-FOUND.md if bugs detected"}
|
||||
{"id": 3, "prompt": "Find dead code in this project but don't change anything yet", "expected": "Audit-only mode: report persisted to .claude/tasks/plans/ and presented inline; no fixes, no commit; bugs listed in the report (BUGS-FOUND.md is written only by the PHASE 2 executor)"}
|
||||
]
|
||||
|
||||
@@ -317,15 +317,10 @@ NEXT: review `git diff .claude/memory/`, then `/commit-change`
|
||||
|
||||
## TDD note (skill itself)
|
||||
|
||||
v1 ships without baseline test scenarios per superpowers:writing-skills
|
||||
Iron Law. Recommended before relying on the skill in production:
|
||||
|
||||
1. RED: spawn subagent, give it a real `.claude/memory/` snapshot, ask
|
||||
"prune obsolete entries". Document what it does naturally.
|
||||
2. GREEN: invoke `/prune-memory` on the same snapshot. Verify it
|
||||
follows STEP 0–4 + respects append-only rule.
|
||||
3. REFACTOR: log any new rationalizations the subagent finds; add
|
||||
counters to the "Common mistakes" / "Failure paths" tables.
|
||||
|
||||
Until TDD is done, the skill is v1-untested. STEP 2 approval gate is
|
||||
the human safety net.
|
||||
Baseline RED scenarios were run and their counters are embedded: the
|
||||
RED-2/RED-5/RED-6 guards live in the body above, and `tests/` holds the
|
||||
fixtures (red3-negation, red4-journal, red6-orphan) plus
|
||||
`run-deterministic.sh` and `run-behavioral.md`. New rationalizations a
|
||||
subagent finds → add the fixture and its counter to the "Common
|
||||
mistakes" / "Failure paths" tables (`tests/BACKLOG.md` tracks candidates).
|
||||
STEP 2's approval gate remains the human safety net regardless.
|
||||
|
||||
Reference in New Issue
Block a user