Rig tidy
Copy-in kit of config-driven agent skills, agents, and CI templates — native to Claude Code and adaptable to any AGENTS.md-reading agent.
npx -y skills add agent-rig/rig --skill rig-tidyAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 14 days oldThe repository was created 14 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
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'.
SKILL.md
3.1 KB, as published. Nobody here has run it
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 canonicalreviewerrole (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
-
Parse the arguments.
- scope: directory to audit (default: the default source scope from
.rig/config.json(sourceScope[0], defaultsrc)). - 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
- scope: directory to audit (default: the default source scope from
-
Show what will be audited.
git log --oneline -${commits} git diff HEAD~${commits} --stat -- ${scope} | tail -20 -
Audit the diff via a fresh-context subagent. Spawn a
revieweragent (mapped throughagents.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~${commits} -- ${scope}for cleanup candidates. Categories: (a) dead code — exported symbols with no callers in the tree, internal helpers used once; (b) unused imports; (c) stale comments — TODOs completed by the diff, comments describing prior behavior, doc lines that no longer match the code; (d) duplicates — near-identical helpers, repeated inline expressions that could collapse; (e) inconsistencies — naming drift, mixed patterns introduced during the window.For each finding give file:line, the category, one-line justification, and the proposed deletion or merge. Skip anything you're not confident about. If the window is clean, say so."
-
Apply the high-confidence findings. For each item the reviewer flagged with concrete file:line + proposed edit, apply the Edit. Skip anything ambiguous and surface it to the user instead.
-
Verify. Run the test command from
.rig/config.json(test.command, defaultnpm test):<test.command>If anything fails, revert the offending edits (
git checkout -- <file>) and report which removal broke tests so the user can decide whether to keep or rework. -
Report. Lines removed, files touched, anything skipped and why.