← Skills Library
Audit & Review

Repo Maintenance

Audit and clean up repositories: prune bloated CLAUDE.md files, find stub/empty tests, identify CI cost optimizations, and create PRs for all changes.

How It Works

Repo Maintenance · Workflow
Audit CLAUDE.md, tests, dead code, CI — then PR the cleanup.
TriggerMaintain repo(s) · One repo path or --all across ~/Documents/Dev
1
Prune CLAUDE.md to <= 200 lines
Keep conventions + invariants; move narrative to tier-2 files
2
Audit tests & dead code
Delete stub/expect(true) tests; grep exports with no consumer
3
Trim deps & optimize CI
Remove unimported packages; cache deps, drop double push+PR triggers
4
Verify before opening PRGATE
wc -l <= 200, no stub-test grep hits, suite passes
failRe-run the audit step that regressed
Open maintenance PR · One PR per repo — changes + what was kept and why
  1. Maintain repo(s): One repo path or --all across ~/Documents/Dev
  2. Prune CLAUDE.md to <= 200 lines: Keep conventions + invariants; move narrative to tier-2 files
  3. Audit tests & dead code: Delete stub/expect(true) tests; grep exports with no consumer
  4. Trim deps & optimize CI: Remove unimported packages; cache deps, drop double push+PR triggers
  5. Verify before opening PR: wc -l <= 200, no stub-test grep hits, suite passes
  6. Open maintenance PR: One PR per repo — changes + what was kept and why
ↆ download card

Invocation Triggers

/repo-maintenanceclean up repoprune CLAUDE.mdrepo cleanup

Use Cases

  • Clean up a repo that has accumulated tech debt over time
  • Prune an oversized CLAUDE.md to the 200-line limit
  • Find and fix stub/empty tests that are polluting coverage

The Problem

Every repo accumulates rot you stop noticing. The CLAUDE.md grows to 400 lines of narrative nobody reads. Test files sit there with expect(true).toBe(true) and pass for green checks they never earned. CI runs the full suite on every push AND every PR, burning minutes for zero extra coverage. None of it screams — it just quietly taxes every session and every build until someone goes looking.

What It Does

  1. 1
    Audit and prune CLAUDE.md

    Runs wc -l on the file. If it is over 200 lines, it strips narrative explanations and context derivable from the code, keeps conventions and invariants and commands, and moves detail to tier-2 files.

  2. 2
    Hunt stub and empty tests

    Greps every test file for real assertions. Files with fewer than 3 real test functions, expect(true).toBe(true) padding, or TODO/skip markers get real tests or get deleted.

  3. 3
    Scan for dead code and unused deps

    Finds exported functions and types with no consumer anywhere in the codebase, including test files. Lists packages that are installed but imported nowhere. Removes only what has no remaining reference.

  4. 4
    Find CI cost wins

    Reviews the workflows for double-triggering on push and PR, missing dependency caching, and redundant jobs. Moves tests to PR-only and adds caching where it is missing.

  5. 5
    Verify, then open the PR

    Runs the test suite to confirm nothing broke, then opens a PR per repo with a before/after line count, the removed stubs and dead code, and an explicit list of what was kept and why.

What You Get / What It Doesn't Do

What you get
  • A PR per repo with the full diff and a what-changed summary
  • CLAUDE.md under 200 lines, with detail moved to tier-2 files
  • Stub tests removed or replaced with real behavior tests
  • A CI config that runs on PR only and caches dependencies
  • An explicit list of what was deliberately kept and why
What it doesn't do
  • Rewrite business logic or refactor working code
  • Delete an export it cannot prove is unused
  • Merge its own PRs — you review the diff first
  • Run git-filter-repo on you — it flags large binaries, you decide

Tips

Point it at one repo first

Run a single path before --all. You want to see what its pruning judgment looks like on a repo you know cold before you let it loose on the whole Dev directory.

Read the what-was-kept section

The PR lists what it refused to touch and why. That section is where you catch a too-aggressive dead-code call or a CLAUDE.md line that should have stayed.

The 200-line ceiling is hard

If everything in CLAUDE.md feels load-bearing, that is context inflation, not a complex project. The fix is tier-2 files, not an exception to the limit.

Get the Skill

Elite SkillELITE

Unlock the full Repo Maintenance SKILL.md — drop it into ~/.claude/skills/ and trigger it by name.

What you unlock
  • A PR per repo with the full diff and a what-changed summary
  • CLAUDE.md under 200 lines, with detail moved to tier-2 files
  • Stub tests removed or replaced with real behavior tests
  • A CI config that runs on PR only and caches dependencies
...
Skills Library

29 more production skills ready to install.

Browse All Skills