setup-harness
Skill2 starsChanged 6 months agoMITView on GitHub
Build agent harness infrastructure (Constrain, Inform, Verify, Correct) on a project step by step. Generates AGENTS.md as the canonical rules file with a CLAUDE.md import stub, configures Claude Code permissions and a session-end verify hook, scaffolds optional CI gates, and seeds a Past Failures section for the "1 failure = 1 prevention rule" loop. Optimized for Claude Code; AGENTS.md is the cross-tool standard so OpenAI Codex reads the same file. Use when user wants to set up agent guardrails, harden an AI coding agent setup, write or improve AGENTS.md/CLAUDE.md, configure agent permissions/hooks, or asks "how do I make my agent safer", "set up harness engineering", "configure agent rules for this project".
- Reads credentials
- Deletes or force-pushes
- Commits and pushes
2 other projects use a version of this.
Adopted by
Most recently taken up by
- Firzus/agent-skillstheir own version, first seen Oct 13, 2026
- LeadGrowGTM/loop-engineertheir own version, first seen Oct 8, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- LeadGrowGTM/loop-engineer★ 13same name
- Firzus/agent-skills★ 4same 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 repository17 other files it gives its agents.
- create-nextjs-specificationSkill
- create-product-demoSkill
- find-github-repoSkill
- find-npm-packageSkill
- image-styleSkill
- nextjs-route-scaffoldSkill
- perfect-promptSkill
- place-meSkill
- review-meSkill
- setup-aeo-geoSkill
- songwritingSkill
- step-by-stepSkill
- stock-analysisSkill
- study-meSkill
- teach-meSkill
- three-linesSkill
- visualstormingSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 6 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Write CLAUDE.md containing one line: @AGENTS.md (Claude Code import directive).
- Very specific: line 23
Create .claude/settings.json from templates/settings.json.
- Very specific: line 33
strict: Stop hook runs pnpm lint && pnpm typecheck && pnpm test --run.
- Very specific: line 35
Never use PostToolUse to run tests/typecheck — runs on every edit, kills throughput.
- Distinctive: line 43
After any agent mistake, ask user: "Add a one-line prevention rule to Past Failures?"
- Distinctive: line 46
No edit-count hook, no automated doom-loop counter — agents do not self-track edits, and a hook adds maintenance with little real-world …
- Distinctive: line 51
Failure → rule: every confirmed agent mistake earns one Past Failures line.
- Very specific: line 52
Read before write: never overwrite AGENTS.md, CLAUDE.md, .claude/settings.json, or workflows.
- Distinctive: line 53
Stage skip warning: if user wants Stage 3 before Stage 2, confirm: "Skipping Constrain leaves the agent unbounded.
- Distinctive: line 59
Run Stage 1 → confirm AGENTS.md + CLAUDE.md.
- Distinctive: line 60
Ask: "Continue to Stage 2 (permissions)?"
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.
Files
Harness Engineering Setup
Build harness in 3 stages, ordered by impact. Stop after any stage if user is satisfied — each delivers value standalone. See REFERENCE.md for theory.
Stage 1 — Inform (AGENTS.md + CLAUDE.md stub)
- Detect project stack from
package.json,Cargo.toml,pyproject.toml,go.mod. - Draft
AGENTS.md(≤ 60 lines) using templates/AGENTS.md. Pre-fill Project Stack only. - Mark Forbidden and Past Failures as
# DRAFT — review required. - Write
CLAUDE.mdcontaining one line:@AGENTS.md(Claude Code import directive). - Show diff. Require explicit confirmation before save.
- Warn: "ETH Zurich research: LLM-generated AGENTS.md drops agent performance 3% and raises cost 20%. Past Failures must come from real incidents — leave empty if none."
Pnpm is the standard. AGENTS.md fixes Package manager: pnpm. Refuse to set otherwise.
Stage 2 — Constrain (permissions)
- Create
.claude/settings.jsonfrom templates/settings.json. permissions.allow: read/edit/write/test/git basics.permissions.deny:rm -rf *,curl *,wget *,sudo *,chmod 777 *,git push --force *,Read(.env*),Read(**/secrets/**).- No
PreToolUsehooks.permissions.denyis the single defense layer for dangerous commands.
Stage 3 — Verify (Stop hook required, CI optional)
Pick one variant from templates/settings.json:
- lite (default): Stop hook runs
pnpm lintonce at session end. - strict: Stop hook runs
pnpm lint && pnpm typecheck && pnpm test --run.
Never use PostToolUse to run tests/typecheck — runs on every edit, kills throughput.
Optional: Scaffold .github/workflows/agent-pr-checks.yml from templates/agent-pr-checks.yml. Hooks give immediate feedback per session. CI is the merge gate.
Correct (no extra files)
Failure handling lives inside AGENTS.md Past Failures and the workflow rule:
- After any agent mistake, ask user: "Add a one-line prevention rule to Past Failures?"
- On repeated failure, restart in a clean context (new session). Do not patch forward.
No edit-count hook, no automated doom-loop counter — agents do not self-track edits, and a hook adds maintenance with little real-world payoff. Add later only after observing repeated incidents.
Operating Rules
- 60-line rule: AGENTS.md ≤ 60 lines. To add a line, remove a line.
- Failure → rule: every confirmed agent mistake earns one Past Failures line.
- Read before write: never overwrite
AGENTS.md,CLAUDE.md,.claude/settings.json, or workflows. Show diff, ask, then write. - Stage skip warning: if user wants Stage 3 before Stage 2, confirm: "Skipping Constrain leaves the agent unbounded. Proceed?"
Quick Start
User says "set up harness on this project":
- Run Stage 1 → confirm AGENTS.md + CLAUDE.md.
- Ask: "Continue to Stage 2 (permissions)?"
- Continue stage by stage until user stops.
Reference
- 4 pillars deep dive: REFERENCE.md
- AGENTS.md template: templates/AGENTS.md
- CLAUDE.md import stub: templates/CLAUDE.md
- Settings template (lite + strict): templates/settings.json
- CI workflow template: templates/agent-pr-checks.yml
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
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.

