The Repo
The structure that makes AI-navigable context possible. Every folder is organized around what the agent needs to do its job — not what looks clean to a human reader.
How the Repo Is Organized
Every directory serves a purpose the agent can reason about. Root-level files orient the agent to the project. The steering/ folder is the org's encoded knowledge — standards, node definitions, templates. The docs/ folder is where active work lives. The mcp/ folder connects the agent to your tools. Deeper components activate when your org's adoption stage calls for them.
productharnesstemplate/
│
├── PRODUCTHARNESSTEMPLATE.md ← Master context file — agent reads this first
├── SETUP.md ← Agent-executable setup sequence
├── README.md ← Human-readable overview
├── package.json ← Dependencies: Storybook, Playwright, etc.
├── .env.example ← Required environment variables with descriptions
├── sync-manifest.json ← [Full integration] Component readiness tracker
│
├── steering/ ← Org's encoded knowledge (tool-agnostic)
│ ├── loops/ ← Definition of "done" per Double Loop node
│ │ ├── discovery.md ← Discovery loop: 7 node sections (menu, not gates)
│ │ └── delivery/ ← Delivery loop: one file per node
│ │ ├── 1-implementation.md
│ │ ├── 2-automated-verification.md
│ │ ├── 3-e2e-ac-execution.md
│ │ ├── 4-deploy.md
│ │ ├── 5-observability.md
│ │ └── 6-impact.md
│ │
│ ├── templates/ ← Work product templates: what artifacts look like here
│ │ ├── requirements.md
│ │ ├── user-story.md
│ │ ├── design-brief.md
│ │ ├── vendor-evaluation.md
│ │ ├── executive-briefing.html
│ │ └── discovery/ ← Discovery work-product templates (per node)
│ │ ├── problem-framing.md
│ │ ├── opportunity-assessment.md
│ │ ├── solution-discovery.md
│ │ ├── validation-evidence.md
│ │ ├── pitch-business-case.md
│ │ └── prfaq.md
│ │
│ ├── standards/ ← Technical solution decisions encoded for the agent
│ │ ├── infrastructure.md ← IaC patterns, resource naming, environment setup
│ │ ├── database.md ← DB selection, ORM conventions, migration patterns
│ │ ├── cicd.md ← Pipeline structure, required gates, environment promotion
│ │ ├── authentication.md ← Auth provider, token handling, RBAC approach
│ │ ├── api.md ← REST/GraphQL conventions, error formats, versioning
│ │ ├── security.md ← Secrets management, scanning, data classification
│ │ └── testing.md ← Coverage thresholds, test pyramid, test data strategy
│ │
│ ├── file-organization.md ← How to keep the repo organized over time
│ └── production-patterns.md ← [Production connection] Frontend/component conventions
│
├── mcp/ ← MCP server configuration templates
│ ├── atlassian.json ← Jira / Confluence integration
│ ├── figma.json ← Figma design system integration
│ └── playwright.json ← Browser testing / validation
│
├── docs/ ← Product work — active set + archive
│ ├── work/ ← ACTIVE features (the working set)
│ │ └── <feature>/ ← one folder = one feature's full Double Loop trail
│ │ ├── problem.md ← discovery: problem framing
│ │ ├── validation.md ← discovery: validation evidence
│ │ ├── requirements.md ← authoritative spec + acceptance criteria
│ │ ├── decision-*.md ← feature-scoped decisions
│ │ ├── handoff.md ← completed handoff at the crossing
│ │ └── prototypes/ ← validation prototypes
│ ├── decisions/ ← Architecture decisions (cross-feature ADRs)
│ ├── _shipped/ ← ARCHIVE: shipped/abandoned features, by period
│ │ └── <period>/<feature>/ ← keeps the working set small as features pile up
│ └── technical/ ← [Production connection] Technical context
│ └── stack-context.md ← Production stack reference
│
├── src/ ← [Production connection] Mirrors production structure
│ └── components/
│
├── .storybook/ ← Storybook configuration
│ ├── main.ts
│ └── preview.ts
│
├── engineering-handoff-checklist.md ← PM → Engineering handoff criteria
│
└── scripts/
├── setup.sh ← Setup verification script
└── sync-to-prod.sh ← [Full integration] Sync validated components to production
Items marked [Production connection] activate when the repo is connected to your production codebase. Items marked [Full integration] activate when the sync pipeline is in place. Everything else is active from the start.
Requirements as Code
The phrase "requirements as code" is sometimes used loosely — requirements that are machine-readable, or requirements that look like code syntax. That's not what it means here.
It means requirements that behave like code: they live in a version-controlled repository, they are modified through branches and pull requests, they carry a complete history of every change and the context behind it, and they are co-located with the AI coding agent that acts on them. When requirements are files in this repo — not documents in a wiki, not cards in a backlog — they inherit the full properties of the Git workflow that the rest of the team already uses.
Every change to a requirement is a commit. Every commit has an author, a timestamp, and a message. When a requirement changes after design has started, the change is visible — not discovered when a test fails. When a product decision is challenged three sprints later, the original intent and the reasoning are in the history, not in someone's memory.
A PM proposing changes to requirements creates a branch and opens a pull request. Engineers, designers, and QA can review the changes before they're merged — the same way they review code changes. Comments are attached to specific lines. Discussions are permanent. The agreed-upon requirements are the merged result.
An AI coding agent operating in this repo has the requirements as live context — not a document it was handed a copy of. When a PM asks the agent to generate test cases, create backlog stories, or check for gaps in the acceptance criteria, the agent is working from the authoritative source, not a copy. This is the difference between an agent that can take reliable action and one that produces output that has to be manually verified every time.
PMs writing requirements in this repo are working in the same environment — IDE or CLI with an AI coding agent — where engineers write code, designers reference component specs, and QA engineers review acceptance criteria. This isn't a requirement to learn engineering tools. It's a convergence point: one environment where every role's work lives, where the agent has full context, and where Git provides the coordination layer for all of it.
The backlog is a mirror. The wiki is a broadcast channel. The repo is the source. Requirements as code means the source is version-controlled, agent-readable, and co-located with the work it governs.
How the Repo Stays Navigable Over Time
The obvious objection to requirements-as-code is that a single repository grows without bound — hundreds of features, and the agent drowns. It's the same objection every codebase has already answered, and the answer is the same here: separate the working set from the archive, and let git be the deep history.
Active work lives in docs/work/<feature>/ — one folder per feature, holding that feature's entire Double Loop trail. The instant a feature ships or is killed, it moves to docs/_shipped/<period>/<feature>/. So docs/work/ only ever shows what's in flight, no matter how many features have come before. You retrieve past work by path or by git when you need it — you don't carry it in the working set.
This also makes context selection cheap. Because a feature is one folder and the steering layer is small and stable, the agent loads the relevant feature folder plus the two or three standards the task touches — not the whole repository. The master context file is an index that points to context, not a payload that contains it.
Each feature is a single directory containing its problem framing, discovery artifacts, requirements, decisions, handoff, and prototypes. "Everything about this feature" is a path, not a search — and a shipped feature archives as one folder move. As features multiply, by-artifact-type folders (all requirements together, all decisions together) crowd and scatter a feature's trail; feature-folders don't.
Every work file carries status: active | shipped | abandoned, plus feature, artifact, and updated. Status is how tooling and the agent select only active context — and how the archive step knows what to move.
The move to _shipped/ is encoded in the Delivery loop's Impact node: at close, the agent sets the status and moves the folder. A scheduled governance check flags any feature left active after its delivery work merged — the drift the structure can't prevent on its own. Structure makes the right thing easy; governance catches the misses.
A repository that grows forever isn't a flaw unique to requirements-as-code — it's the condition every codebase already lives in. The discipline is the same: keep the working set small, let history be the archive, and make the agent select context by path rather than read everything.
The Files That Drive Everything
Three files do the most work in the repo. They orient the agent, guide setup, and govern the handoff from the design workspace to engineering.
This is the most important file in the repo. It is the first thing the agent reads and gives it complete context: what ProductHarness is, how the repo is organized, what conventions to follow, which MCP servers are available and when to invoke them, and what the four guiding principles are. It acts as the persistent system-level steering document for every agent interaction in this project.
Why it matters: any agentic coding tool will find and read this file first regardless of tool-specific conventions. It's the universal entry point. Teams don't need to rename or configure anything to get agent orientation — it's there by default.
The agent reads this file when prompted with "finish setting things up." It contains a structured sequence the agent can follow autonomously: checking Node.js, installing dependencies, copying and prompting for environment variables, configuring MCP servers, and verifying the setup is complete. The only human input required is values the agent can't know — API tokens and org identifiers.
Why it matters: setup is a one-time process that every new project goes through. Without SETUP.md, setup requires technical knowledge and manual steps. With it, any team member can get a working harness in one session.
The structured checklist the PM completes before marking work ready for engineering pickup. Covers requirements completeness, acceptance criteria format, open questions, backlog stories, test case generation, and Storybook validation status. It's the explicit accountability mechanism that prevents ambiguous or incomplete work from reaching engineering.
Why it matters: the checklist makes the handoff condition explicit and auditable. Both PM and engineering can see exactly what was verified before handoff — and when something breaks, the checklist is the first place to look for what was or wasn't confirmed.
Organizational Memory, Encoded for AI
The steering/standards/ files are where the org's engineering decisions live — written once in a form the agent can read and apply every time it generates code. An engineer working on a new service doesn't need to know the org's infrastructure patterns from memory. A PR reviewer doesn't need to catch a non-standard auth implementation — the agent used the right pattern at generation time. These files are how that happens.
Steering documents are organizational memory encoded for AI. A steering document that reflects how the org worked eighteen months ago is not neutral — it actively steers the agent in the wrong direction.
IaC tool choice, project and stack structure, resource naming conventions, state management, environment separation patterns. Governs how infrastructure-as-code is generated and structured. When a new service needs cloud resources, the agent applies these patterns by default — not whatever it generates from general knowledge.
Approved databases by use case, ORM or query library, migration tooling, naming conventions, indexing standards, connection and pooling patterns. The difference between generated database code that matches production and code that an engineer has to rewrite on every review.
Standard pipeline structure, required gates (lint, test, security scan, build), environment promotion process, approval requirements before production, rollback procedure. Ensures agent-generated CI configuration follows the org's actual deployment process — not a generic template.
Auth provider, token type and handling, session management, RBAC approach, how new services integrate auth from day one. One of the highest-risk standards to get wrong — a new service that implements auth incorrectly creates a security gap that may not surface until it's exploited.
REST vs. GraphQL decision criteria, endpoint naming, HTTP status code usage, error response envelope, versioning strategy, pagination, rate limiting. Governs how API contracts are generated — ensuring every new endpoint follows the same conventions that existing consumers depend on.
Secrets management tool and patterns, required security scanning in CI, dependency vulnerability policy, data classification levels and handling requirements. The most compliance-sensitive standard — may require legal or security team review when updated. Governs how the agent handles any sensitive data or credential-adjacent logic.
Required coverage thresholds, test pyramid ratios, test data strategy, what must pass before a PR is mergeable, performance baseline requirements. The document that converts "tests pass" from a vague signal into a specific standard the agent can generate against and CI can verify.
What Activates at Each Stage
The harness is designed to activate incrementally. Every team starts with the core setup. Additional components — production connection, sync pipeline — activate when the org is ready for them. Nothing breaks when you start at the beginning; nothing is blocked when you're ready to go further.
| Component | Starting Out | Production Connection | Full Integration |
|---|---|---|---|
| PRODUCTHARNESSTEMPLATE.md | ✓ | ✓ | ✓ |
| SETUP.md | ✓ | ✓ | ✓ |
| steering/loops/ | ✓ | ✓ | ✓ |
| steering/templates/ | ✓ | ✓ | ✓ |
| steering/standards/ | ✓ | ✓ | ✓ |
| mcp/ configuration templates | ✓ | ✓ | ✓ |
| docs/work/ + docs/_shipped/ | ✓ | ✓ | ✓ |
| .storybook/ configuration | ✓ | ✓ | ✓ |
| engineering-handoff-checklist.md | ✓ | ✓ | ✓ |
| steering/production-patterns.md | — | ✓ | ✓ |
| docs/technical/stack-context.md | — | ✓ | ✓ |
| src/ (mirrors production structure) | — | ✓ | ✓ |
| sync-manifest.json | — | — | ✓ |
| scripts/sync-to-prod.sh | — | — | ✓ |
The production connection stage is what closes the Demo Gap — when the design repo is anchored to the production codebase, generated components follow the patterns engineering actually uses. The full integration stage adds the sync pipeline that moves validated components from the design workspace into production feature branches.
Moving between stages is additive and non-destructive. Starting out gives you the full steering document infrastructure and PM workflow immediately. Adding the production connection requires a production repo reference. Adding the sync pipeline requires the production connection to already be in place — and it activates automatically once the production repo path is recorded.