Harness Engineering: an environment for an autonomous agent
A harness-engineering hub: a five-layer environment, the four-phase route a task travels, barriers vs conventions, and the lessons-ledger as the autonomy core. With an interactive explorer and a series map — how to set up any project so a coding agent runs a task from framing to push with almost no supervision.
A harness is an environment, not a prompt
Four phases: how a task travels from framing to push
Agent Harness — a universal template
STACK- & AGENT-AGNOSTICGive the agent not just a task but an environment that guides it: the contract (what to read), the living plan (what not to forget), sensors (what may not ship), lessons (what not to repeat), the closing ritual. Every step either reads a source of truth or writes an artifact. The human plugs in at 4 points: give the task · approve the sketch · say "wrong" · say "commit".
The R-codes in the step cards are rules Claude Code accumulated from corrections across different projects; I collected them into one personal playbook and wired it globally, so they load every session. Each code shows its meaning inline.
Task arrives
One thread = one task; never mix contexts.
Flow walk: how a task moves
Honest about this flow: it isn't a strict line. Phase C is a loop; /wrong, escalation and commit are event-driven; conditional steps fire on a trigger and are often skipped. Only the 🟥 barriers are truly enforced — the rest rests on the agent's discipline.
Barriers vs conventions: what actually gets enforced
🟥 Barrier
- Enforced mechanically: pre-commit / CI
- e.g. JS/TS: dependency-cruiser, knip, madge, tsc
- Not covered? Your own check script
🟦 Convention
- Rests on the agent's discipline
- Stated in AGENTS.md, but unchecked
- Code style, "no drive-by rewrites"
🟨 Conditional
- Fires only on a trigger
- ExecPlan, worktree, escalation, /wrong
- Often — and correctly — skipped
Lessons-ledger: corrections as code
/wrong "<mistake>"
→ normalize:
machine-catchable? → sensor # computational (barrier)
needs judgement? → lessons/<boundary>/ # inferential (nudge)
→ maintain: matured inferential → promote → sensor
health metric = lessons promoted to sensors, NOT notebook sizeSeries map: the 9 rollout phases
| Phase | What | Recipe |
|---|---|---|
| Entry | Pick a mode: A / B / B+ / C | dev-modes-with-ai — done ✓ |
| 0 | Audit an existing project: baseline + environment | project-audit — done ✓ |
| 1 | Context engineering: AGENTS.md, ADR | agents-md-setup — done ✓ |
| 2 | ExecPlan for multi-hour tasks | execplan-long-tasks — done ✓ |
| 3 | Architectural barriers, strict types | architectural-constraints — done ✓ |
| 5 | Garbage collection: drift, debt | harness-garbage-collection — done ✓ |
| 5.5 | Lessons-ledger: corrections as code | lessons-ledger — done ✓ |
| 6 | Skills: reusable SKILL.md | agent-skills-library — done ✓ |
| 7 | Workflow: one thread, worktrees, subagents | agent-workflow-worktrees — done ✓ |
| 8 | Scaling: template repo, golden path | harness-template-golden-path — done ✓ |
| ★ | Tool: stack → tools, DoD, artifacts | harness-configurator — done ✓ |
Where to start: cheap → contentious
Rollout order (recommended)
Result
A harness-engineering hub: you understand that a harness is a five-layer environment, how a task flows through four phases, why only barriers are enforced (not text), and how the lessons-ledger turns corrections into code. Next: a per-phase recipe series and an entry point via choosing your development mode.