pge-harness
Overview
Run feature work as three file-coordinated agents with zero shared context:
Planner -> Generator -> Evaluator. All coordination is through files on disk, never shared memory.
Project specifics come ONLY from .harness/adapter.md; this skill is project-agnostic.
Core principle: the builder never grades its own work. A fresh, no-context Evaluator is the sole
correctness authority. Human review fires only where a check is not machine-decidable.
When to use
- You have a planned batch of features to implement mostly autonomously on a branch.
- You want clean per-feature rollback (one green commit each) and fresh-eyes verification.
- Any project type - web, CLI, HTTP API, library - via the per-project adapter.
Default is fully autonomous. Human gates are opt-in (see below).
Three layers (what makes it portable)
- This skill (A) - the methodology. Invariant. Contains zero project specifics.
.harness/adapter.md (B) - all project specifics, by field name. Written once per project (see
references/bootstrap.md). Fields: BOOT/SMOKE, BUILD/SETUP, CODE TESTS, LIVE VERIFY,
HUMAN-GATE, GUARDRAILS, STYLE, COMMITS. The LIVE VERIFY strategy is one of:
web -> playwright-mcp, cli -> invoke+assert, http-api -> call, library -> unit-only.
.harness/<goal>/spec.md (C) - per goal: feature list + intent ("what good looks like") +
dependency graph + per-feature gate flag. High-level, NOT a test matrix. Template:
references/spec-template.md.
This skill references the adapter only by field NAME. Example: "Start the app with BOOT/SMOKE;
verify each feature with LIVE VERIFY + CODE TESTS; if HUMAN-GATE applies, write review.md and
wait; commit per COMMITS."
The three agents
- Planner (human + assistant, a planning session). Produces a HIGH-LEVEL
spec.md (and bootstraps
the adapter on first use), then STOPS and hands off. Do NOT keep building in the planning session.
- Generator (a FRESH session - a NEW agent, separate from the Planner). Start it new so it carries
ZERO planning context: it reads ONLY
spec.md + the adapter, never the planning conversation. Then
one continuous session, no resets: build one feature at a time; run only the trivial BOOT/SMOKE;
make NO correctness judgment. Dispatch a FRESH Evaluator per feature, apply its findings, handle
gates. Commit only on Evaluator-certified green, one feature per commit. Follow STYLE.
- Evaluator (a fresh no-context subagent per dispatch). The sole correctness authority. Brief:
references/evaluator-rubric.md.
The loop (per feature)
Before the loop: create + checkout a dedicated branch, and pick a short <goal> slug for this run
(e.g. phase3) - its coordination files live in .harness/<goal>/.
- Build the feature in the working tree.
- Run
BOOT/SMOKE so you never hand rubble to the Evaluator. This is NOT a correctness call.
- Dispatch a fresh Evaluator: a new subagent (Agent/Task tool, no inherited context) whose brief is
references/evaluator-rubric.md + this feature's spec slice + the adapter. It writes findings.md.
- Red? Read
findings.md, fix, dispatch a NEW fresh Evaluator. Loop until green.
- Human-gated? The Evaluator will have written its question to
review.md instead of passing it.
Handle it per Human gate protocol (below).
- Green + signed off -> commit. Update
progress.html.
- Next feature.
End of run: one holistic Evaluator pass (2-3 passes) across the whole change for cross-feature
regressions; findings -> fix -> re-verify.
Dependency-aware human gates
Gates are opt-in - default is fully autonomous. Two controls: the adapter's HUMAN-GATE says HOW
a human observes this project's output (and none = no judgable surface, so every feature runs auto
regardless of its flag); the per-feature gate: auto | human-gated in spec.md decides WHICH
features gate. Gating is independent of depends-on (a feature may be gated with no deps, or have deps
with no gate).
Protocol. When the Evaluator hits a check it cannot decide, IT writes the question into review.md
with a blank VERDICT: line (it never guesses). Then:
- Attended: pause, ask the human, apply their verdict.
- Unattended: park this feature and anything that
depends-on it; keep building independent features;
leave the open review.md question + an amber badge in progress.html. When the human fills each
VERDICT:, do a follow-up pass to apply it, re-verify, and commit.
"Block" = do not START a feature until every feature in its depends-on is green + committed and any
upstream gate is signed. Commit a gated feature only after its verdict is in. Fully idle only if
everything left is behind a pending gate.
File contracts (all on disk, under .harness/<goal>/)
| File |
Direction |
Content |
spec.md |
Planner -> Generator |
high-level features + intent + dependency graph + gate flags |
| repo + git |
Generator |
one green commit per feature, on a dedicated branch |
findings.md |
Evaluator -> Generator |
pass/fail + evidence + repro |
review.md |
Evaluator <-> human |
judgment questions + verdicts |
progress.html |
-> human |
per-feature log (template: references/progress-template.html) |
Code is edited in-place in the existing repo (not a fresh app/ dir).
Guardrails (categories; specifics from the adapter's GUARDRAILS)
- Local only - never push/merge/deploy unless the goal says so.
- Isolate and clean up test data; leave the workspace as found.
- Restart the app after edits to cached assets before testing.
- Scope process kills to the dev-server PID/port.
- Commit hygiene per
COMMITS; never commit .harness/ artifacts.
New project? Bootstrap once
First use in a repo: detect the stack and draft .harness/adapter.md, then confirm with the human.
See references/bootstrap.md. After that, every future goal in the project reuses the adapter.
Common mistakes
- Generator grading its own work - the smoke is NOT a correctness check; only the Evaluator certifies.
- Pre-writing exhaustive edge cases in
spec.md - keep it high-level; the Evaluator derives them.
- Reusing the same Evaluator subagent - each dispatch must be fresh, no context.
- Running the Generator in the planning session - it then drags the planning context along (defeats
zero shared context). Sequence: plan -> write
spec.md -> start a NEW session for the build.
- Blocking on a gate nothing depends on - defer it and keep building.
- Putting project specifics in this skill - they belong in the adapter.
1---2name: pge-harness3description: Use when implementing a planned batch of features (two or more) mostly autonomously on a branch - overnight or attended - in any project (web, CLI, API, or library), where each feature is independently verified before its own commit and the human is pulled in only for checks a machine cannot decide. Use this whenever someone wants to build several features and verify each, run an unattended or overnight build, knock out a multi-feature goal or spec one feature at a time, have a fresh agent QA every feature before commit, or points at a .harness/ adapter or spec.md - even if they never say "harness". Not for a single edit or bugfix, a one-page build, writing a plan, brainstorming, or reviewing an existing diff.4---56# pge-harness78## Overview910Run feature work as three file-coordinated agents with zero shared context:11**Planner -> Generator -> Evaluator**. All coordination is through files on disk, never shared memory.12Project specifics come ONLY from `.harness/adapter.md`; this skill is project-agnostic.1314Core principle: **the builder never grades its own work.** A fresh, no-context Evaluator is the sole15correctness authority. Human review fires only where a check is not machine-decidable.1617## When to use1819- You have a planned batch of features to implement mostly autonomously on a branch.20- You want clean per-feature rollback (one green commit each) and fresh-eyes verification.21- Any project type - web, CLI, HTTP API, library - via the per-project adapter.2223Default is fully autonomous. Human gates are opt-in (see below).2425## Three layers (what makes it portable)2627- **This skill (A)** - the methodology. Invariant. Contains zero project specifics.28- **`.harness/adapter.md` (B)** - all project specifics, by field name. Written once per project (see29 references/bootstrap.md). Fields: `BOOT/SMOKE`, `BUILD/SETUP`, `CODE TESTS`, `LIVE VERIFY`,30 `HUMAN-GATE`, `GUARDRAILS`, `STYLE`, `COMMITS`. The `LIVE VERIFY` strategy is one of:31 web -> `playwright-mcp`, cli -> `invoke+assert`, http-api -> `call`, library -> `unit-only`.32- **`.harness/<goal>/spec.md` (C)** - per goal: feature list + intent ("what good looks like") +33 dependency graph + per-feature gate flag. High-level, NOT a test matrix. Template:34 references/spec-template.md.3536This skill references the adapter only by field NAME. Example: "Start the app with `BOOT/SMOKE`;37verify each feature with `LIVE VERIFY` + `CODE TESTS`; if `HUMAN-GATE` applies, write `review.md` and38wait; commit per `COMMITS`."3940## The three agents4142- **Planner** (human + assistant, a planning session). Produces a HIGH-LEVEL `spec.md` (and bootstraps43 the adapter on first use), then STOPS and hands off. Do NOT keep building in the planning session.44- **Generator** (a FRESH session - a NEW agent, separate from the Planner). Start it new so it carries45 ZERO planning context: it reads ONLY `spec.md` + the adapter, never the planning conversation. Then46 one continuous session, no resets: build one feature at a time; run only the trivial `BOOT/SMOKE`;47 make NO correctness judgment. Dispatch a FRESH Evaluator per feature, apply its findings, handle48 gates. Commit only on Evaluator-certified green, one feature per commit. Follow `STYLE`.49- **Evaluator** (a fresh no-context subagent per dispatch). The sole correctness authority. Brief:50 references/evaluator-rubric.md.5152## The loop (per feature)5354Before the loop: create + checkout a dedicated branch, and pick a short `<goal>` slug for this run55(e.g. `phase3`) - its coordination files live in `.harness/<goal>/`.56571. Build the feature in the working tree.582. Run `BOOT/SMOKE` so you never hand rubble to the Evaluator. This is NOT a correctness call.593. Dispatch a fresh Evaluator: a new subagent (Agent/Task tool, no inherited context) whose brief is60 `references/evaluator-rubric.md` + this feature's spec slice + the adapter. It writes `findings.md`.614. Red? Read `findings.md`, fix, dispatch a NEW fresh Evaluator. Loop until green.625. Human-gated? The Evaluator will have written its question to `review.md` instead of passing it.63 Handle it per Human gate protocol (below).646. Green + signed off -> commit. Update `progress.html`.657. Next feature.6667End of run: one holistic Evaluator pass (2-3 passes) across the whole change for cross-feature68regressions; findings -> fix -> re-verify.6970## Dependency-aware human gates7172Gates are **opt-in** - default is fully autonomous. Two controls: the adapter's `HUMAN-GATE` says HOW73a human observes this project's output (and `none` = no judgable surface, so every feature runs `auto`74regardless of its flag); the per-feature `gate: auto | human-gated` in `spec.md` decides WHICH75features gate. Gating is independent of `depends-on` (a feature may be gated with no deps, or have deps76with no gate).7778**Protocol.** When the Evaluator hits a check it cannot decide, IT writes the question into `review.md`79with a blank `VERDICT:` line (it never guesses). Then:80- Attended: pause, ask the human, apply their verdict.81- Unattended: park this feature and anything that `depends-on` it; keep building independent features;82 leave the open `review.md` question + an amber badge in `progress.html`. When the human fills each83 `VERDICT:`, do a follow-up pass to apply it, re-verify, and commit.8485"Block" = do not START a feature until every feature in its `depends-on` is green + committed and any86upstream gate is signed. Commit a gated feature only after its verdict is in. Fully idle only if87everything left is behind a pending gate.8889## File contracts (all on disk, under `.harness/<goal>/`)9091| File | Direction | Content |92|---|---|---|93| `spec.md` | Planner -> Generator | high-level features + intent + dependency graph + gate flags |94| repo + git | Generator | one green commit per feature, on a dedicated branch |95| `findings.md` | Evaluator -> Generator | pass/fail + evidence + repro |96| `review.md` | Evaluator <-> human | judgment questions + verdicts |97| `progress.html` | -> human | per-feature log (template: references/progress-template.html) |9899Code is edited in-place in the existing repo (not a fresh `app/` dir).100101## Guardrails (categories; specifics from the adapter's `GUARDRAILS`)102103- Local only - never push/merge/deploy unless the goal says so.104- Isolate and clean up test data; leave the workspace as found.105- Restart the app after edits to cached assets before testing.106- Scope process kills to the dev-server PID/port.107- Commit hygiene per `COMMITS`; never commit `.harness/` artifacts.108109## New project? Bootstrap once110111First use in a repo: detect the stack and draft `.harness/adapter.md`, then confirm with the human.112See references/bootstrap.md. After that, every future goal in the project reuses the adapter.113114## Common mistakes115116- Generator grading its own work - the smoke is NOT a correctness check; only the Evaluator certifies.117- Pre-writing exhaustive edge cases in `spec.md` - keep it high-level; the Evaluator derives them.118- Reusing the same Evaluator subagent - each dispatch must be fresh, no context.119- Running the Generator in the planning session - it then drags the planning context along (defeats120 zero shared context). Sequence: plan -> write `spec.md` -> **start a NEW session** for the build.121- Blocking on a gate nothing depends on - defer it and keep building.122- Putting project specifics in this skill - they belong in the adapter.