agentleFS
aayushhzzaayushhzz/harness-builder/SKILL.md

harness-builder

Skill0 starsChanged 9 days agoMITView on GitHub

Build a self-improving agent harness for any project. Triggers - build agent harness, make agent reliable, self-improving agent, harness for project, add contract and checks to agent, stop agent saying done when not done.

5 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions5 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 5

    1. YSAA1/harness-workflow★ 3same name
    2. JohnnySun/skills★ 2same name
    3. li-xisheng/claude-skills★ 2same name
    4. duniecdawid/ultra-claude★ 0same name
    5. MahmudurRahman36/claude-skills★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repositoryOne other file it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

19 rules. About 0 are common, 7 are distinctive, and 12 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 12

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Ask the user only for:

    line 7
  2. Very specific:

    Read package.json, Makefile, pyproject.toml, Cargo.toml, go.mod, CI config.

    line 14
  3. Very specific:

    Do one step at a time. Verify each before the next.

    line 40
  4. Very specific:

    Write harness/contract.md from templates/contract.md.

    line 42
  5. Very specific:

    If AGENTS.md exists, strip line 1 (# AGENTS.md) from templates/AGENTS.md and append the ## Harness section (never overwrite it).

    line 44
  6. Distinctive:

    Keep AGENTS.md under 60 lines (if appending exceeds 60 lines, move detailed existing rules into linked docs).

    line 46
  7. Distinctive:

    Write the tool list into the contract.

    line 52
  8. Very specific:

    Write harness/PROGRESS.md from templates/PROGRESS.md.

    line 53
  9. Very specific:

    Write harness/checks.sh from templates/checks.sh.

    line 54
  10. Distinctive:

    Run it on the untouched repo.

    line 56
  11. Distinctive:

    If red, stop and ask the user.

    line 57
  12. Very specific:

    Write harness/walls.json from templates/walls.json.

    line 58
  13. Very specific:

    Add harness/traces/ and harness/status.json to .gitignore, and log any unconfirmed runner fields in harness/README-unverified.md.

    line 61
  14. Very specific:

    Run Self-improvement setup below, log any unconfirmed hook/SDK fields in harness/README-unverified.md, and confirm every UNVERIFIED item …

    line 63
  15. Very specific:

    Start from templates/PROPOSALS.md.

    line 78
  16. Very specific:

    Do not edit harness/walls.json.

    line 84
  17. Distinctive:

    Do not edit a gate to pass it.

    line 85
  18. Distinctive:

    Stop at the retry cap or budget.

    line 86
  19. Very specific:

    Commit after each completed unit.

    line 88

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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

Intake

  • Ask the user only for:
    1. Project path.
    2. Task.
    3. Runner: Claude Code | Agent SDK | Managed Agents | other (follow the shared contract in references/runners.md).
    4. Risk: read-only | branch writes | prod.
      • For read-only tasks, only .claude/settings.json (read-only permissions) and harness/checks.sh are needed; use the full harness below for branch writes and prod.
  • Infer everything else from the repo (default <CONTACT> to the user if none is found; ask for Managed Agents <model id> only when using Managed Agents).
  • Read package.json, Makefile, pyproject.toml, Cargo.toml, go.mod, CI config.
  • Detect test, typecheck, lint, build commands.
  • Detect protected paths: migrations, infra, secrets, lockfiles, CI config.

Triage

  • Skip if no failure history exists.
  • Classify each failure from transcripts, logs, git history, bug reports.
SymptomClassFix file
Wrong task, scope creepcontractharness/contract.md
Breaks project rulesmapAGENTS.md
Wrong or misread tooltooltool definitions
Forgets decisionsstateharness/PROGRESS.md
Says done when notsensorharness/checks.sh
Retries same fixexitcontract budget and retry cap
Touches forbidden fileswallharness/PROPOSALS.md (human applies to harness/walls.json)
Right tools, right info, still fails for a human toomodelno harness change
  • Triage test, in order, per failure:
    1. Could it see the info?
    2. Could it do the action?
    3. Could it tell it was wrong?
  • Any "no" = harness bug. Fix the harness, not the prompt.

Build

Do one step at a time. Verify each before the next. Fill every setup <PLACEHOLDER> across all created files before the first run (note: unit <id>: <summary> is a runtime commit template; verify no setup placeholders remain before Step 9).

  1. Write harness/contract.md from templates/contract.md.
    • Each task-specific done_when item names a test that fails before and passes after.
  2. If AGENTS.md exists, strip line 1 (# AGENTS.md) from templates/AGENTS.md and append the ## Harness section (never overwrite it). If it does not exist, create it from templates/AGENTS.md.
    • Link detailed docs next to the code they govern.
    • Keep AGENTS.md under 60 lines (if appending exceeds 60 lines, move detailed existing rules into linked docs).
    • Confirm Stop rules contain every rule under "Write these rules into AGENTS.md".
  3. Define tools.
    • One job per tool.
    • Cap output size.
    • Exit nonzero with a message on failure.
    • Write the tool list into the contract.
  4. Write harness/PROGRESS.md from templates/PROGRESS.md.
  5. Write harness/checks.sh from templates/checks.sh.
    • Fill TEST_CMD, TYPECHECK_CMD, LINT_CMD, BUILD_CMD from detected commands.
    • Run it on the untouched repo. It must run green.
    • If red, stop and ask the user.
  6. Write harness/walls.json from templates/walls.json.
    • Fill every key in walls.json.
    • Copy and run the runner scripts from templates/hooks/ (Claude Code) or templates/sdk/ (Agent SDK) per references/runners.md.
    • Add harness/traces/ and harness/status.json to .gitignore, and log any unconfirmed runner fields in harness/README-unverified.md.
  7. Set retry cap 2 and a time/token budget (default 30 minutes, 100000 tokens) in both harness/contract.md and AGENTS.md.
  8. Run Self-improvement setup below, log any unconfirmed hook/SDK fields in harness/README-unverified.md, and confirm every UNVERIFIED item before Step 9.
  9. Dry run the agent on one trivial unit.
    • Confirm a trace file appears in harness/traces/.
    • Confirm checks.sh ran.
    • Append a fake failure event to a new trace in harness/traces/. Start a run. Confirm the agent follows IMPROVE.md, adds one HARNESS-LOG.md row and leaves checks.sh green. Delete the fake trace, revert any drill harness edit/regression check, remove any drill rows in HARNESS-LOG.md/PROPOSALS.md, reset harness/PROGRESS.md and harness/status.json, and revert the trivial unit's code/commit afterwards.

Self-improvement setup

  • harness/traces/
    • One file per run: <run_id>.jsonl.
    • One event per line. Match templates/trace-event.schema.json.
  • harness/HARNESS-LOG.md
    • One row per harness change. Start from templates/HARNESS-LOG.md.
  • harness/IMPROVE.md
    • Copy templates/IMPROVE.md verbatim.
  • harness/PROPOSALS.md
    • Start from templates/PROPOSALS.md. Log every proposed walls.json change here.
  • Runner hooks. Follow references/runners.md.
    • Hook 1: append a trace event on every tool call.
    • Hook 2: on stop, run harness/checks.sh and write gate_result (plus failure/escalate on fail/cap).

Write these rules into AGENTS.md

  • Do not edit harness/walls.json. Propose changes in harness/PROPOSALS.md.
  • Do not edit a gate to pass it.
  • Stop at the retry cap or budget. Escalate.
  • Irreversible actions require human approval: deploy, delete, migrate, send, publish, force-push.
  • Commit after each completed unit. Message: unit <id>: <summary>.
  • Record every decision, dead end, and blocker in harness/PROGRESS.md.

Report to user

Send one message containing:

  • Files created.
  • checks.sh result.
  • Dry-run result.
  • Unresolved UNVERIFIED items (if any).
  • Open questions.

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.