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:
Bastien Chanot
2026-08-26 21:59:40 +02:00
parent ad4985f410
commit 6c69ae1670
3 changed files with 10 additions and 15 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ name: code-clean
description: | description: |
Full codebase cleanup: dead code, style/norm enforcement, structural Full codebase cleanup: dead code, style/norm enforcement, structural
issues. Two-phase: read-only audit, then approved fixes only 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 Triggers: "code-clean", "remove dead code", "cleanup", "nettoyage du
code", "code hygiene". code", "code hygiene".
Targeted refactor without audit → /refactor. Bugs found → logged to Targeted refactor without audit → /refactor. Bugs found → logged to
+2 -2
View File
@@ -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": 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)"}
] ]
+7 -12
View File
@@ -317,15 +317,10 @@ NEXT: review `git diff .claude/memory/`, then `/commit-change`
## TDD note (skill itself) ## TDD note (skill itself)
v1 ships without baseline test scenarios per superpowers:writing-skills Baseline RED scenarios were run and their counters are embedded: the
Iron Law. Recommended before relying on the skill in production: RED-2/RED-5/RED-6 guards live in the body above, and `tests/` holds the
fixtures (red3-negation, red4-journal, red6-orphan) plus
1. RED: spawn subagent, give it a real `.claude/memory/` snapshot, ask `run-deterministic.sh` and `run-behavioral.md`. New rationalizations a
"prune obsolete entries". Document what it does naturally. subagent finds → add the fixture and its counter to the "Common
2. GREEN: invoke `/prune-memory` on the same snapshot. Verify it mistakes" / "Failure paths" tables (`tests/BACKLOG.md` tracks candidates).
follows STEP 0–4 + respects append-only rule. STEP 2's approval gate remains the human safety net regardless.
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.