A reusable template for building products with AI agents.
This repo is not a product. It is the machine that builds products. You give it an approved BRD and UI reference. It drives those inputs to shipped code β through specs, design, plans, and QA-gated builds. A human approves every important step.
It is platform-agnostic. Claude Code, Codex CLI, OpenCode, and Cursor all read the same rules, use the same skills, and work the same queue.
flowchart TB
IDEA([π‘ Your idea / BRD / Figma]) --> P0
subgraph PIPELINE["π Pipeline layer β define the product (phases 0β4)"]
P0["Phase 0 Β· Business<br>/kickoff /brd /prd /features /forecast"]
P1["Phase 1 Β· Design<br>/design (Figma is law when linked)"]
SG["Required SRS gate<br>/srs-authoring (human approval)"]
P2["Phase 2 Β· Traceability<br>/trace (living matrix)"]
P3["Phase 3 Β· Tech plan<br>/tech-plan (human picks the stack)"]
P4["Phase 4 Β· Dev plan<br>/dev-plan /epic β epics"]
P0 --> P1 --> SG --> P2 --> P3 --> P4
end
P4 --> P5
subgraph BUILD["π¨ Execution layer β build it (phase 5, loops per epic)"]
P5["/build<br>scheduler picks current epic tasks"] --> PR["peer review<br>(different model)"]
PR --> QA["/qa<br>independent QA gate"]
QA --> CP["/checkpoint<br>π§ human approves"]
CP -->|sets current_epic| P5
end
CP --> SHIP([π development β main])
Two layers, one rule: every arrow ends at a human gate before it moves on.
Prefer it visual and interactive? Open
harness/docs/harness-flow.html in a browser β the full
flow chart of the harness, one self-contained file.
Any platform enters through the same two doors.
flowchart LR
subgraph PLATFORMS["Agent platforms"]
CC[Claude Code]
CX[Codex CLI]
OC[OpenCode]
CU[Cursor]
end
subgraph ENTRY["Entry points"]
AG["AGENTS.md<br>the constitution<br>(16 rules, loaded every turn)"]
CL["CLAUDE.md<br>thin Claude adapter<br>(@AGENTS.md)"]
end
subgraph ROLES["harness/agents/ β 10 roles"]
AN[analyst] --- DE[designer]
AR[architect] --- TL[team-lead]
DB[dev-backend] --- DF[dev-frontend]
QAA[qa] --- DO[devops]
PM[pm] --- OR[orchestrator]
end
CC --> CL --> AG
CX --> AG
OC --> AG
CU --> AG
AG --> ROLES
- Claude Code:
.claude/agentsand.claude/skillsare symlinks intoharness/. Agents become subagents. Skills become/commands. Native. - Other platforms: they read
AGENTS.mdand reach the same files by path. Headless runs go throughharness/adapters/run-<platform>.sh, which logs cost + session JSON intoworkspace/runs/andmetrics.csv.
One task moves through four hands. Never fewer.
sequenceDiagram
participant TL as team-lead
participant DEV as developer
participant PEER as peer reviewer<br>(different model)
participant QA as qa agent<br>(fresh context)
participant H as π§ human
TL->>DEV: task spec (the spec IS the prompt)
DEV->>DEV: own branch + worktree, TDD, commit early
DEV->>PEER: status: review-requested
PEER->>DEV: approve (or changes-requested)
Note over PEER: merges task PR β epic branch
DEV-->>QA: when the whole epic is built
QA->>QA: run the flow Β· test the tests Β· audit vs spec
QA->>H: /checkpoint β demo + QA report
H->>TL: approve / remap / rework
Who does what:
| Role | One job | Never does |
|---|---|---|
| analyst | BRD, PRD, features, forecast | write code |
| designer | design system, screens, prototype | write product code |
| architect | tech plan + ADRs (options, human decides) | pick the stack alone |
| team-lead | dev plan, epic + task specs, final code review | implement features |
| developer Γ2 | one task, one branch, TDD | touch files outside the spec |
| qa | independent verification, merge gate | edit product code |
| pm | SRS, priorities, feedback routing | technical specs |
| devops | CI/CD, releases, rollback | product features |
| orchestrator | scheduler, budgets, handoffs | write product code |
Skills are on-demand manuals. Nothing loads until it is needed. That keeps every session cheap.
flowchart TB
T["Turn starts"] --> A["AGENTS.md loads<br>(always β it is small)"]
A --> N{"Task needs a<br>capability?"}
N -->|no| W[Just work]
N -->|yes| S["Load ONE skill<br>harness/skills/<name>/SKILL.md"]
S --> R["References load even later<br>(skill's references/ folder)"]
- Where: all 37 skills live in
harness/skills/<name>/SKILL.md. - When: a pipeline step starts (
/brd,/qa, β¦) or a capability is needed (git-flow, TDD, EARS, rate-limit handoff). - Who: each agent card lists its
skills:β its usual toolbox. - On Claude Code every skill is also a slash command, via the
.claude/skillssymlink.
flowchart LR
subgraph EVERY_SESSION["Read at every session start"]
ST["workspace/state.yaml<br>phase Β· epics Β· blockers Β· history"]
end
subgraph LONG_TERM["Reusable harness memory (harness/memory/)"]
LE["lessons/<area>.md<br>L-area-nnn"]
AD["decisions/<br>HADRs"]
GR["graphiti/<br>optional knowledge graph"]
end
W[Work happens] -->|after every stage| ST
W -->|QA fail, surprise, rework| LE
W -->|accepted harness decision| AD
LE -->|"recurs twice β promoted"| RULE["rule in a SKILL.md<br>then a git hook"]
- Session tracking:
workspace/state.yamlis the single resume point. Any platform, any session: read state β announce position β continue./statusdoes this and refreshes the dashboard. - Lessons compound: every mistake becomes a lesson. A lesson that repeats becomes a rule. A rule that matters becomes a hook. This is how the harness gets better with every project.
- ADRs are forever: decisions are reversed by new ADRs, never edited.
Two kinds. Both are files, so nothing is ever lost.
A. Phase / agent handoff β every finished artifact ends with a
Handoff block (harness/templates/process/handoff.md): what was decided, what is open,
what the next stage must not change. The next agent reads it first.
B. Rate-limit handoff β when a platform hits its usage window:
flowchart LR
C1["Claude Code<br>at ~80% window"] -->|freeze| F["handoff packet<br>harness/handoffs/*.yaml<br>+ last green commit"]
F -->|resume| C2["Codex CLI"]
C2 -->|if also limited| C3["OpenCode"]
The statusline script watches the 5-hour and weekly windows. At the
threshold, work freezes into a packet and the next platform in
harness.yaml: platforms picks it up. Nothing is lost.
One static HTML file. No server, no login, no dependency.
make dashboard # rebuild β workspace/dashboard/index.htmlIt shows: pipeline phases Β· every epic and task with status, worker β
reviewer, and dependencies Β· blockers Β· open questions Β· costs vs budget Β·
links to every spec, QA report, and checkpoint. /status and
/checkpoint refresh it automatically.
Daily driving needs three commands:
| Command | Question it answers |
|---|---|
make status |
where are we? |
make next PLATFORM=codex |
what runs now, with explicit model routing? |
make review |
what waits for review? |
Step 0 β get the skeleton
# new repo (or branch) from this template, then:
pip install -r requirements.txt # pyyaml
make hooks # git hooks (branch protection, no AI trailers)
git branch development main # integration branch
git remote add template <this-template-repo-url> # for /harness-sync
make validate # both validators must passStep 1 β prepare the required entry artifacts
| Required input | Put it at |
|---|---|
| Approved, non-placeholder BRD | workspace/docs/business/BRD.md |
| Approved UI reference (Figma, prototype, generated design, Stitch export, or screenshots) | record it in workspace/docs/design/README.md |
An existing SRS may be placed at workspace/spec/srs.md, but it must still
pass /srs-authoring review and the human SRS approval gate.
Step 2 β after both entry artifacts are approved, run the pipeline
/kickoff "<your product idea>"
Then follow the loop. Each command tells you the next one:
/brd β /prd β /features β /forecast (human approves each)
β /design β /srs-authoring (human approves the build law)
β /trace β /tech-plan (human picks foundational choices)
β /dev-plan (human approves the epic map)
β /build β /qa E00 β /checkpoint E00 (walking skeleton ships)
β /epic E01 β /build β /qa β /checkpoint β β¦repeat per epic
Lost? Run /status. It reads the state, checks it against reality,
and tells you the single next action.
Your job as the human: answer batched questions, pick the stack,
approve checkpoints. Everything else is the machine's job.
Full playbook: harness/docs/HUMAN-GUIDE.md.
The harness improves through a fixed ladder β never by drive-by edits:
- Something goes wrong β
/lessonrecords it (L-<area>-nnn). - It happens again β the lesson is promoted to a rule in the
relevant
SKILL.md(human approves β rules are code). - Deterministic rules become git hooks in
harness/hooks/. - New capability needed β
skills/skill-authoringdefines how to add a skill properly. - Every harness change must pass
make validate(DAG + constitution checks: IDs, frontmatter, peer rule, dead paths, lesson files).
Structural changes (new roles, new phases) go through a HADR in
harness/memory/decisions/ like any other significant decision.
Product ADRs live separately in workspace/plan/03-technical/decisions/.
Across repos (template β your project repos), /harness-sync moves
improvements both ways β each direction human-gated:
flowchart LR
T["π Template repo<br>(this skeleton +<br>universal seed lessons)"]
P1["π¦ Project A repo<br>own memory, lessons,<br>state, specs"]
P2["π¦ Project B repo"]
T -->|"clone (inherits all seeds)"| P1
T -->|clone| P2
T -.->|"/harness-sync pull<br>(harness files only)"| P1
P1 -.->|"/harness-sync promote<br>(universal lessons β PR)"| T
Each project keeps its own memory (workspace/state.yaml,
harness/memory/). Only universal lessons β rules that would help any
product β travel back to the template as inherited seeds. Project
content (specs, state, product lessons) never leaves its repo.
Every folder carries its own README.md answering three questions:
why it exists Β· how it works Β· what it does NOT cover. The validator
fails if one is missing. The map below is the short version.
| Path | What lives there |
|---|---|
AGENTS.md |
the constitution β 16 rules, IDs, pipeline (start here) |
CLAUDE.md |
Claude Code adapter (@AGENTS.md + symlink notes) |
harness.yaml |
policy: platforms, model tiers, budgets, human gates |
harness/agents/ |
10 role cards / subagents |
harness/skills/ |
35 skills (pipeline drivers + capabilities) |
harness/workflows/ |
12 step-by-step processes |
harness/orchestrator/ |
scheduler, validators, metrics, dashboard |
harness/adapters/ |
run-claude.sh Β· run-codex.sh Β· run-opencode.sh |
harness/hooks/ |
git hooks + rate-limit statusline |
harness/memory/ |
lessons, ADRs, graphiti schema |
harness/mcp/ |
external platform guides (Figma, DB, Jira, Slackβ¦) |
harness/docs/ |
harness guide, human guide, visual flow |
harness/templates/ |
canonical artifact templates (see its README) |
workspace/docs/ |
product BRD and design canon |
workspace/plan/ |
phase 0β4 artifacts of YOUR product |
workspace/spec/ |
the SRS β law once approved |
workspace/epics/ |
the work queue: epic + task specs |
workspace/state.yaml |
pipeline position β the resume point |
workspace/dashboard/ |
the PM console (generated) |
workspace/runs/ |
headless run logs β the audit trail |
Deep dive: harness/docs/harness-guide.md Β·
Constitution: AGENTS.md Β·
Human playbook: harness/docs/HUMAN-GUIDE.md