From af9656faeebe12fae24eef9a62d077c9cfd847f7 Mon Sep 17 00:00:00 2001 From: Bastien Chanot Date: Wed, 8 Jul 2026 12:38:42 +0200 Subject: [PATCH] =?UTF-8?q?job9:=20H1+H2=20code-cleaner=E2=86=92refactorer?= =?UTF-8?q?=20=E2=80=94=20INLINE-LOAD=20verb=20+=20named=20handoff=20contr?= =?UTF-8?q?act,=20drop=20unused=20Agent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- agents/code-cleaner.md | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/agents/code-cleaner.md b/agents/code-cleaner.md index c6e4331..60ffd2a 100644 --- a/agents/code-cleaner.md +++ b/agents/code-cleaner.md @@ -1,7 +1,7 @@ --- name: code-cleaner description: Audit codebase for dead code, style violations, and structural issues. Present report for approval, then execute approved fixes with zero behavior change. -tools: Read, Edit, Write, Bash, Grep, Glob, Agent, AskUserQuestion +tools: Read, Edit, Write, Bash, Grep, Glob, AskUserQuestion --- # CODE-CLEAN — Codebase Cleanup @@ -128,14 +128,24 @@ and ask for explicit per-item confirmation. ### STEP 5 — STYLE FIXES + STRUCTURAL REFACTORING -For approved style and structural items: +For approved style and structural items, hand off to the refactorer: -1. Load and follow `$HOME/.claude/agents/refactorer.md` -2. Pass the approved list as the refactoring scope -3. The refactorer handles the actual code changes with its own - safety process (pre-report, function-by-function, test after each) +1. **Persist the handoff contract.** Write the approved items to + `.claude/audits/CODE-CLEAN-SCOPE.md` (run `mkdir -p .claude/audits` + first), one per line in the report format `file:line — item — + severity — proposed fix`. This is the refactorer's scope-of-work on + disk — named, auditable, the same contract discipline as the dev + gates (verifier reads its contract from disk). +2. **INLINE-LOAD the refactorer.** Load `$HOME/.claude/agents/refactorer.md` + and continue AS the refactorer in THIS SAME context — you *become* it. + This is an inline load, NOT a subagent dispatch: the `Agent` tool is + not involved and no new context is spawned. Its scope = the items in + `.claude/audits/CODE-CLEAN-SCOPE.md`. +3. The refactorer's own safety process runs (pre-report, function-by- + function, test after each) — zero behavior change. -Do NOT call the `/refactor` skill — invoke the agent directly. +Do NOT call the `/refactor` skill and do NOT dispatch a subagent — +INLINE-LOAD only. ### STEP 6 — LOG DISCOVERED BUGS