← ClaudeAtlas

rig-tidylisted

Run post-merge code cleanup: audit recent changes for dead code, duplicates, and stale comments, then safely remove them. Triggers on: 'cleanup', 'simplify', 'clean up code', 'remove dead code', 'post-merge cleanup'.
agent-rig/rig · ★ 3 · AI & Automation · score 70
Install: claude install-skill agent-rig/rig
# Post-Merge Cleanup Audit and clean up the diff from the last N commits. Catches dead code, unused imports, stale comments, and obvious duplicates that slipped in during rapid development. ## Configuration Reads `.rig/config.json`: - `sourceScope[0]` — the default directory to audit when no scope is given (default: `src`). - `test.command` — the suite run in the verify step (default: `npm test`). - `agents.reviewer` — the project's name for the canonical `reviewer` role (default: `reviewer`). If the file is absent, use the defaults above and note you're running unconfigured. ## Arguments The user invoked this with: $ARGUMENTS ## What to do 1. **Parse the arguments.** - **scope**: directory to audit (default: the default source scope from `.rig/config.json` (`sourceScope[0]`, default `src`)). - **commits**: number of recent commits to review (default: `10`) Examples: - `/rig-tidy` → default scope, 10 commits - `/rig-tidy path/to/dir 5` → that directory, 5 commits - `/rig-tidy 20` → default scope, 20 commits 2. **Show what will be audited.** ```bash git log --oneline -${commits} git diff HEAD~${commits} --stat -- ${scope} | tail -20 ``` 3. **Audit the diff via a fresh-context subagent.** Spawn a `reviewer` agent (mapped through `agents.reviewer`) with this prompt (don't do the audit inline — the implementer context is too close to the code to spot dead-on-arrival abstractions): > "Audit the diff `git diff HEAD~${c