agentleFS
uprinteruprinter/ai-agents-team/.claude/skills/harness-cleaner/SKILL.md

harness-cleaner

Skill1 starsChanged 24 days agoMITView on GitHub

Audit and shrink the agent definitions, AGENTS.md and process rules in this repo: size against budget, duplicated rules, contradictions. Use when a size-budget check fails, after adding rules, on a weekly or monthly cleanup, or when the user says cleanup, audit, bloat or contradiction.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run python3 .claude/scripts/check_harness.py.

    line 12
  2. Very specific:

    Stale rules and fold-ins: Run the stale-rule probe and read the role evidence in .claude/process/fold-in-review.md.

    line 15
  3. Very specific:

    Proposals: Write one line per change: file, rule, action (merge, remove, point), bytes saved.

    line 16
  4. Very specific:

    Close: After approved edits, regenerate ports (.opencode/sync-agents.py, .codex/sync-agents.py), run check_harness.py --ratchet-budget, …

    line 17

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Harness cleaner

Agent definitions and AGENTS.md load in full on every spawn, so each byte costs on every run. This skill finds what to merge or remove. It proposes; the stakeholder approves each change.

Run

  1. Run python3 .claude/scripts/check_harness.py. Budget breaches print as exceeds budget. List the five largest files and their growth since the last budget commit: git log -p --follow -3 -- .claude/scripts/size-budget.json.
  2. Duplicates. For each file in step 1, list rules restated elsewhere. Search (→ RP-nn) citations that appear in AGENTS.md and in an agent file, and rules in an agent file that .claude/process/*.md or a preloaded skill already state. Keep one source of truth; replace the other with a pointer.
  3. Contradictions. Group the rules by situation (dispatch, review, merge, status, wiki, copy, GitLab). Spawn one fresh general-purpose agent per group with the rule texts only. Ask: "List pairs of instructions that cannot both be followed. Quote both." Check each reported pair against the files before you act on it.
  4. Stale rules and fold-ins. Run the stale-rule probe and read the role evidence in .claude/process/fold-in-review.md. Propose at most one batch of insurance rules and at most one role fold-in per run.
  5. Proposals. Write one line per change: file, rule, action (merge, remove, point), bytes saved. Present them to the stakeholder in the decision-protocol format. Apply only approved changes.
  6. Close. After approved edits, regenerate ports (.opencode/sync-agents.py, .codex/sync-agents.py), run check_harness.py --ratchet-budget, then check_harness.py and the unit tests. Commit the lowered budget with the edits.

Done when every file is at or under its budget, every contradiction pair has a disposition (fixed, or kept with a reason), and the commit carries the lowered size-budget.json.

Raising a budget

A rule that must grow its file raises that file's entry in .claude/scripts/size-budget.json by hand. The commit message names the reason and what was considered for removal. --ratchet-budget never raises.

Weekly digest

Run python3 .claude/scripts/agent_digest.py once a week, or at the start of a cleaner run. It reads Claude Code's own subagent transcripts, so it costs no tokens and needs no change to any agent. A flag (!) names an agent whose volume fell, whose tool errors, steps or duration rose, or whose runs did not finish, against the four weeks before.

A flag is a lead, not a verdict. Open the agent's latest transcripts, find what changed, and check whether a recent edit to its definition or to a shared rule explains it (git log -p -- .claude/agents/<name>.md). A drop to zero can mean the agent was not needed that week.

Rules that no run cites cannot be found this way: an obeyed rule is never quoted. Do not guess dead rules.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.