agentsclimarketplace

Rig tidy

Skill agent-rig/rig/skills/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.

Install
npx -y skills add agent-rig/rig --skill rig-tidy

Assembled 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 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.

    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~${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."

  4. 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.

  5. Verify. Run the test command from .rig/config.json (test.command, default npm 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.

  6. Report. Lines removed, files touched, anything skipped and why.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.