For three phases, everyone wrote. Now someone has to build the place where the building happens — and prove it works before a single feature counts on it.
Phase 3 builds the factory, then pushes the thinnest real thing all the way through it — to catch the factory's defects while they're still cheap.
Every idea below is paired with the real thing — examples come from a fictional but fully worked engagement, Harbor Mutual, a regional insurer.
Why this phase exists at all
You don't build features yet — you build the factory that builds them
Three phases settled what to build and how it should be shaped. None of it has run. Foundation is the hinge: the place where the words become a working machine, with one real part already moving through it.
The product of this phase isn't a feature. It's a factory — a repo with rules, an automated pipeline that checks every change, and the rails an AI agent runs on so nobody has to remember the discipline. Every future change rides those rails.
Build the factory and stop there, and you've proven nothing. So Foundation also runs the thinnest possible slice of real software all the way through — to prove the factory actually works, with software, not with a diagram.
Harbor had a signed problem, signed requirements, and a chosen architecture — and not one line of it running anywhere.
"A working factory with one part already moving through it: a portal claim flows end-to-end in Harbor's own dev environment, through the real pipeline, with the claim-to-decision clock ticking."
Not a feature. A factory — and proof it runs.
You ship a pipeline that's green because nothing real ever ran through it. The defects stay hidden until Build, when every change trips over them.
Go deeper — the full method
This is the hinge: the phase where the documents stop and the software starts. The harness gets installed, the rails get built, the build loop runs for the first time, and the walking skeleton becomes running code in the client's own dev environment. Foundation closes, and the engagement crosses out of the gated phases and into the continuous Build loop.
Phase 3 answers four questions, and nothing else:
- Is the harness real and adapted? The kit installed into the client repo, CLAUDE.md rewritten in the client's own domain, owned by the Setup Owner and reviewed by a deputy.
- Are the rails real and enforced? CI hard gates, the grader workflow, the correctness workflow, the security workflow, the deploy pipeline, branch protection, the Bicep dev environment, secrets in the client's vault.
- Does the loop actually run? The first specs go Intent → Delegate → Discern → merged → deployed — including at least one HIGH-risk spec — so the loop is proven before Build scales it.
- Is the architecture real? The walking skeleton from Phase 2, running end-to-end in the client's dev environment through the real pipeline — proven by software, not by documents.
The full feature backlog, the test and production environments, and any feature breadth beyond the thinnest skeleton are out of scope — they belong to the Build loop and the hardening passes. Foundation builds the narrowest possible real thing on top of the real rails. Its product is not a feature; it is a working factory with one part already moving through it.
You ship a pipeline that is green because nothing real ever ran through it. The defects stay hidden until Build, when every change trips over them.
The rules the agent works inside
Install the rulebook — then rewrite it in the client's own words
An AI agent is only as good as the context it loads when it starts work. The firm has a reusable starter kit. But a generic starter makes the agent guess the domain — and guesses differ every run.
The kit lands as a working starting point, not a blank repo: the rulebook, the templates, the checking agents, the pipeline files. It's built and improved between engagements — the client never pays to build it, only to adapt it.
The real work is the adaptation: rewriting the project's rulebook in the client's own domain — their terms, their tech stack, what counts as risky, what "done" means. And it happens in the open, as reviewed changes the client's own engineer reads — their first concrete look at how the pod works.
The kit was scaffolded in, then the rulebook was rewritten in Harbor's language — reviewed by Wes Carter, Harbor's lead engineer:
"The domain glossary in Harbor's words (FNOL, PolicyOne, the snapshot replica, the regulatory clock), the .NET / Angular / SQL Server / Azure standards, the risk tiers, and the Definition of Checked."
Wes reviewing those changes was the engagement's first real handoff — rehearsed months before the close.
The kit installed but not adapted. A generic rulebook means the agent guesses Harbor's domain, and guesses differ per run. The adaptation in the open is the point of the phase, not a formality to rush past.
Go deeper — the full method
The harness is the project's CLAUDE.md, specs, skills, agents, hooks, and settings — the context and rules every AI agent loads when it starts work in the repo. The kit is the firm's reusable engagement starter: templates, the grader and security-reviewer agents, hooks, pipeline YAML, Bicep starters. It is built and improved between engagements — every engagement ends with a retro that feeds improvements back into it — and lives in the firm's own standard repo. Phase 3 installs it into the client's repo and adapts it. The client never pays to build the kit — only to adapt it.
Claude scaffolds the repo from the kit: the CLAUDE.md template, the spec template, settings, skills, the grader and security-reviewer agents, the Stop hook, the workflow YAML, the Bicep starters. Then Claude adapts CLAUDE.md to the client: the domain glossary in the client's own words, the stack standards, the risk taxonomy, the gated paths, the Definition of Checked. A generic CLAUDE.md means agents guess the domain, and guesses differ per run.
The adaptation happens as reviewed PRs the client's lead engineer reads — these are the client team's first concrete look at how the pod works, months before the close transfer. This is Setup Owner craft, reviewed by the deputy.
A generic CLAUDE.md means agents guess the domain, and guesses differ per run. The adaptation in the open is the point of the phase, not a formality to rush past.
Why discipline can't be a habit
Build rails, so nobody has to remember the rules
You could ask everyone to always run the tests, always get a second reviewer, always check the work against the spec. People forget. Rails don't. The discipline gets built into the machinery, so every change rides it automatically.
- Automated checks — build, tests, lint, coverage run on every proposed change before it can merge.
- A fresh reviewer agent — an AI that didn't write the code reads it against the spec and posts a verdict. It advises; a human decides.
- A "you can't stop" rule — a script that refuses to let an agent finish its turn while the build is broken. "Done" stops being the agent's opinion.
- Locked merging — no change merges without the checks green, the reviewer having run, and approval from someone who didn't write it.
Tom Reilly, Harbor's platform engineer, reviewed the five pipeline pieces — the ones he'd operate after the pod left — then locked merging down:
Nobody at Harbor has to remember any of that. Every change runs on the rails by default.
Go deeper — the full method
The rails are all of the enforcement taken together: the CI gates, the grader, branch protection, and the deploy pipeline. Called rails because nobody has to remember them — every change runs on them.
- CI — continuous integration: the automated checks (build, tests, lint, test coverage) that run on every proposed change before it can merge. Hard gates.
- The grader — a fresh AI agent that did not write the code. It reads the spec and the change and posts a check-by-check verdict on the pull request. It is required to run, but its verdict advises — the human Checker decides.
- The Stop hook — a script that fires when an agent tries to finish its turn. If tests fail or the build is broken, it refuses to let the agent stop. "Done" stops being the agent's opinion.
- Branch protection — repository settings that make the gates mandatory:
no change can merge without CI green, the grader having run, and an approval from someone who
didn't write it.
risk:highadds the security workflow and a named sign-off.
The whole point is that discipline is built into the machinery, not held in anyone's head. The client's platform engineer reviews the workflows — they operate them after the pod leaves — and the Setup Owner (or a named client admin) turns branch protection on.
The code that builds the factory itself
The environment and the pipeline are the riskiest code — so a human reads every line
This is the phase where the AI writes the most code in the whole opening. And the most heavily guarded — because this code is the factory. Get a feature wrong and you fix the feature. Get the pipeline wrong and you've poisoned every change that follows.
The cloud environment is defined in version-controlled files, not clicked together by hand — so it can be rebuilt, reviewed, and reasoned about. Same for the pipeline.
Both are rated HIGH risk on purpose: a human reviews every single change. They're hard to undo and they run in production later. The AI drafts; the Setup Owner's deputy and the client's own platform engineer read them before they merge. The AI is never the sole approver of the factory it built.
Claude drafted the environment definition and the pipeline; Rob (Setup Owner) and Tom (Harbor's platform engineer) reviewed every change.
"App hosting, the buffered queue, and a private, read-only, fully-audited connection to the snapshot replica — provisioned from code, not from clicks."
No part of it was hand-built off the rails to save a day.
A secret in the repo. A key in a commit isn't an edit you undo — it's a rotation event and an audit-log review. Secrets live in the client's vault from day one: never in code, never in the rulebook, never in a spec.
Go deeper — the full method
This is the phase where Claude writes the most code in the whole opening — and where that code is under the tightest gating, because the code is the factory. The risk taxonomy puts IaC and pipeline changes at HIGH for exactly this reason. IaC / Bicep is infrastructure as code: the cloud environment defined in version-controlled files instead of clicked together by hand. Bicep is Azure's language for doing this.
Claude drafts the Bicep for the dev environment; HIGH risk, human-reviewed on every change; the environment provisions from code, not from clicks. Secrets land in the client's Key Vault and GitHub secrets — never in code, never in CLAUDE.md, never in a spec. The data-flow brief goes to client security: what goes to the API, what doesn't, where the keys live, who can see usage.
What Claude never does: merge IaC or pipeline without human review, act as the sole approver of harness work, put a secret anywhere near the repo, or hand-build the skeleton off the rails to save a day. The Setup Owner's deputy and the client's DevOps read the IaC and pipeline before they merge — the both-eyes rule applied to the foundation.
A secret in the repo: a key in a commit is a rotation event and an audit-log review, not an edit. The client's vault from day one, never in code, never in CLAUDE.md, never in a spec.
The thinnest thing that proves the architecture
Build a walking skeleton, not a feature
The temptation is to build something impressive. Resist it. What proves the architecture is the thinnest possible end-to-end slice — bones, no muscle — that touches every layer the design promised.
A walking skeleton is the narrowest path that runs the whole way through: in one end, out the other, touching every architectural seam once. It proves the architecture works in practice, not on paper.
Everything past that thinnest path is Build scope wearing a Foundation badge. Width here delays the rails being proven and the gate being reached. Hold the skeleton to bones.
Harbor's skeleton was four slices — and deliberately nothing more:
"A portal claim creates a queue entry → a coverage check reads the replica → a test-mode acknowledgment → a metric event. End to end, no width."
One of those slices just emits the success metric — which means Harbor's claim-to-decision clock is measurable from day one of Build, not retrofitted at the end.
"While we're here, add…" Every slice beyond the thinnest path is Build scope. It delays the proof Phase 3 exists to deliver. Let the backlog carry the rest.
Go deeper — the full method
The walking skeleton is the thinnest end-to-end slice of the system, built first to prove the architecture works in practice, not on paper. It is the narrowest path that runs the whole way through: in one end, out the other, touching every architectural seam once.
Everything past that thinnest path is Build scope wearing a Foundation badge. A feature-rich skeleton — "while we're here, add…" — delays the rails being proven and the gate being reached. Hold the skeleton to the thinnest end-to-end path and let the backlog carry the rest.
The slice that emits the outcome metric gets special attention: it makes the engagement's success metric measurable from day one of Build, so the scorecard has real data before the second feature merges — the metric is not a Phase 9 retrofit.
The skeleton is the thinnest end-to-end slice that proves the architecture. Every slice added beyond that is Build scope wearing a Foundation badge — it delays the rails being proven and the gate being reached.
Why the skeleton runs the full discipline
The skeleton is the loop's dress rehearsal — nothing gets skipped
It's tempting to hand-build the skeleton fast, off the rails, "because it's just the skeleton." That's exactly backwards. The skeleton is precisely where the build loop must be proven — on software that's cheap to get wrong.
Every skeleton slice runs the full loop: someone writes down exactly what's wanted, an agent builds it inside set bounds, then the checks and a non-author prove it before it merges and ships.
And at least one slice must run the HIGH-risk path — tightest bounds, security review, a named sign-off — so the riskiest path is proven before Build ever depends on it. A skeleton built off the rails teaches the team nothing and hides the rails' defects until they're expensive.
The replica-read slice was HIGH risk — it touched the regulated integration:
The HIGH path got proven on cheap software, before any real feature relied on it working.
Go deeper — the full method
The build loop is the per-spec cycle — Intent (decide and write what you
want), Delegate (an agent builds it inside set bounds), Discern (checks and a non-author prove
it) — that replaces batch implementation phases. A spec is one feature,
described in one file in the repo (specs/NNNN-name.md): the goal, what is in and
out of scope, testable acceptance checks, and a risk tier. No spec, no build.
Each skeleton slice runs the full loop: the slice triaged into a ready spec (Intent), the agent in plan mode first — reading the repo and proposing an approach but not changing files until a human approves — bounded per spec, the Stop hook refusing to finish on a failing build (Delegate), then the CI gates and grader on the PR and a human Checker (someone who didn't write the change) on the merge (Discern).
At least one slice runs the HIGH-risk path: tight agent permissions, the security
workflow firing on the risk:high label and running the security-reviewer agent, a
named human sign-off recorded in the PR. The HIGH path of the loop gets proven before Build ever
relies on it. The skeleton is the loop's dress rehearsal — nothing gets skipped because it is
"only the skeleton."
A rail that's never failed safely isn't proven
Break the rails on purpose — before they break by accident
A pipeline that's green because nothing real ever stressed it has proven nothing. The rails are proven by a change breaking and being caught — not by the configuration files merely existing.
So you force each failure deliberately and watch the rail hold:
- A deliberately failing test — does the "you can't stop" rule actually block?
- A planted mismatch between code and spec — does the reviewer agent actually catch and post it?
- A known-bad deploy — does the pipeline actually restore the last good version?
A rail that has never failed safely has not been proven. This is a deliberate shakedown, not an accident waiting to happen in Build week three.
The rails got shaken down on purpose — and one defect surfaced early, for cheap:
"The coverage gate miscounted generated files on the very first real slice — found and fixed while it cost an hour, not in Build week three when it would have blocked every change."
Each rail was forced to fail and proven to catch it: the stop rule blocked, the reviewer posted the miss, the deploy rolled back clean.
Go deeper — the full method
The rails get a deliberate shakedown: the Stop hook is proven to actually block a failing build, the grader is proven to actually post on a real PR, deploy-dev is proven to roll back cleanly. A rail that has never failed safely has not been proven.
Force each failure deliberately: a failing test proves the Stop hook blocks, a PR with a planted spec mismatch proves the grader posts the miss, and a known-bad deploy proves the pipeline restores the last good version. The setup review merges any harness corrections found during the week (Setup Owner + deputy).
A pipeline that exists but was never exercised — CI that is green because nothing real ran through it — has proven nothing. The rails are proven by a spec breaking and being caught, not by the YAML being present. This is the day the Build cadences get scheduled and two flow limits get set: the WIP cap (how much work may be in flight at once) and the review-wait tripwire (the wait-time threshold that, once crossed, stops new work starting until the review queue clears).
Now watch the whole thing happen
The two weeks, end to end
You've got the ideas; here's the actual rhythm at Harbor. The two weeks split cleanly: week one is the rails (access, the kit, the environment, the pipeline), week two is the skeleton (the four slices riding the loop, the architecture proven, the rails shaken down, the gate). Step through it.
Get the keys, and prove they work
The access checklist closes: the pod gets repo access, the Setup Owner gets the power to lock merging, automation is turned on, and secrets start landing in the client's vault. The AI access procured back in Phase 0 gets a live smoke test — does Claude Code actually run on the client's seats and keys? — before anyone depends on it.
Install the rulebook, rewrite it in the client's words
The kit gets scaffolded into the client's repo — a working starting point, not a blank page. Then the rulebook gets adapted to the client's domain, stack, and risk tiers, as reviewed changes the client's lead engineer reads. Their first concrete look at how the pod works.
Provision from code, never from clicks
The AI drafts the cloud environment as version-controlled files — HIGH risk, human-reviewed on every change. Secrets land in the client's vault. A data-flow brief goes to security: what reaches the API, what doesn't, where the keys live, who can see usage.
Build the rails and lock them on
Five workflows get built and reviewed by the client's platform engineer: the automated checks, the reviewer agent, the correctness review, the security review, and the deploy. Then merging gets locked down — checks green, reviewer ran, non-author approval; risky changes add security plus a named sign-off. The Phase 2 security gates get wired in.
Real software hits the rails for the first time
The first skeleton slice runs the full loop end to end: written down, built by a bounded agent in plan mode, checked, approved by a non-author, deployed to dev automatically. Anything broken in the rails surfaces here, while it's cheap — at Harbor, a coverage-gate defect, fixed in an hour. End of week one: one slice live in dev through the real pipeline.
Prove the riskiest path before Build needs it
The slice touching the riskiest seam runs the loop at HIGH risk: tight permissions, the security workflow firing, the security-reviewer agent reading the change, a named human sign-off recorded. At Harbor that was the regulated replica read — proven before Build ever relied on the HIGH path working.
Finish the skeleton — including the metric
The rest of the slices ride the loop. The slice that emits the success metric gets special attention — it makes the engagement's number measurable from day one of Build. Any security gate these slices touch fires on its first qualifying change; if none touch it, a throwaway probe change proves it fires anyway.
Connect the bones and walk them
The slices connect into a running skeleton in dev. The Quality Engineer verifies it against the Phase 2 definition: does it actually prove the architecture, end to end, under the rails? A first automated smoke journey walks the same path a user would — the thinnest proof the whole thread holds together.
Break the rails on purpose
A deliberate shakedown: force a failing build to prove the stop rule blocks, plant a spec mismatch to prove the reviewer posts the miss, ship a known-bad deploy to prove the rollback works. The setup review merges any harness corrections. The Build cadences get scheduled and two flow limits get set.
Working software in the client's environment
The automated gate check runs. The sponsor watches the walking skeleton run in their own dev environment, through the real pipeline, with the outcome metric ticking — working software, not slides. The Build handoff gets drafted, sign-off gets recorded, and the engagement crosses out of the gated opening into the continuous Build loop. Billing milestone.
Go deeper — the full method
The default calendar is two weeks (10 business days) — the longest of the opening phases, because it builds the factory and runs the first software through it. Week one is the rails: access, the kit install, the environment, the pipeline. Week two is the skeleton: the four slices riding the loop, the architecture proven end-to-end, the rails shaken down, the gate.
Week one — the rails
- Day 1, kickoff and access. The Phase 0/1 access checklist closes: contributor access for the pod, branch-protection admin for the Setup Owner, GitHub Actions enabled, runner policy agreed, secrets provisioning started in the client's Key Vault. The Anthropic access procured in Phase 0 gets a live smoke test — Claude Code actually runs on the client's seats and keys. The Phase 2 open questions get their owners and due dates re-confirmed.
- Day 2, the kit install, in the open. Claude scaffolds the client repo from the kit; CLAUDE.md gets adapted to the client's domain, stack, risk taxonomy, and Definition of Checked — as reviewed PRs the client's lead engineer reads.
- Day 3, the dev environment. Claude drafts the Bicep; HIGH risk, human-reviewed on every change; provisions from code. Secrets land in the client's vault; the data-flow brief goes to security.
- Day 4, the pipeline. The five workflows get built and reviewed by client DevOps (CI, grader, correctness, security, deploy-dev). Branch protection turns on. The build-time security gates from the Phase 2 threat review get wired into the security workflow.
- Day 5, the first slice through the loop. The first skeleton spec runs the full build loop: Intent, Delegate (plan mode, bounded, the Stop hook), Discern (CI + grader, a human Checker), then the automatic deploy to dev. Anything broken in the rails gets found and fixed here, while it is cheap. End of week one: one slice live in dev.
Week two — the skeleton
- Day 6, the first HIGH-risk slice. The slice that touches the riskiest seam
runs the loop at HIGH risk: tight agent permissions, the security workflow firing on
risk:high, a named sign-off in the PR. The HIGH path gets proven before Build relies on it. - Day 7, the remaining slices. The rest ride the loop. The metric-emitting slice gets special attention. Any build-time security gate these slices touch fires on its first qualifying PR — proven, not just configured; if none touch a gate, a probe PR proves it.
- Day 8, the skeleton, end-to-end. The slices connect into the running skeleton in dev. The QE verifies it against the Phase 2 walking-skeleton definition. A first E2E smoke journey walks the whole thread.
- Day 9, harden the rails, not the features. The deliberate shakedown. The setup review merges harness corrections. The Build cadences get scheduled and the WIP cap and review-wait tripwire get set.
- Day 10, gate, demo, and the handoff into Build. The automated gate check runs. The exit demo: the sponsor sees the walking skeleton running in their own dev environment, through the real pipeline, with the outcome metric ticking. The Build handoff gets drafted; gate sign-off recorded; billing milestone. The engagement enters the Build loop.
Access or secrets provisioning stalls → a gating dependency, surfaced at steering on day one, not absorbed silently. The dev environment fights the IaC → expected friction, exactly what Phase 3 exists to discover before Build. A skeleton slice exposes a design gap → good; re-open the relevant ADR explicitly rather than patching around it. The client wants to widen the skeleton → that is Build scope; hold to the thinnest path.
How it goes wrong
The failure modes, and the defense against each
Every one of these has happened to someone. Knowing them by name is half the defense — and Harbor's structure caught some of them in the act.
| The trap | What it looks like | The defense | At Harbor |
|---|---|---|---|
| "It's just the skeleton" | Hand-building the skeleton fast, off the rails, to save a day | The skeleton is where the loop must be proven. Every slice runs the full discipline. | All four slices rode the full loop |
| The pipeline that never ran | CI green because nothing real ever went through it | Prove rails by a change breaking and being caught, not by the YAML being present. | Caught — the day-9 shakedown |
| The kit, not adapted | A generic rulebook the agent has to guess against | Rewrite it in the client's words, in the open. Guesses differ per run. | Adapted in PRs Wes reviewed |
| Factory code merged unread | Environment or pipeline merged without review "to move faster" | HIGH risk, human-reviewed every change. Setup Owner is never sole approver. | Rob + Tom read every change |
| A secret in the repo | A key in a commit — the one unrecoverable mistake | Client's vault from day one; never in code, the rulebook, or a spec. | No secret touched the repo |
| The feature-rich skeleton | "While we're here, add…" — Build scope in a Foundation badge | Hold to the thinnest end-to-end path; let the backlog carry the rest. | Held to four bones-only slices |
| The demo on a laptop | A localhost demo that proves only that the code compiles | Demo in the client's own dev environment, through the real pipeline. | Ran in Harbor's dev environment |
Go deeper — the full method
- Skipping the loop "because it's just the skeleton." The skeleton is precisely where the loop must be proven. A skeleton hand-built off the rails teaches the team nothing and hides the rails' defects until Build, when they are expensive.
- A pipeline that exists but was never exercised. CI that is green because nothing real ran through it. The rails are proven by a spec breaking and being caught, not by the YAML being present. A rail that has never failed safely has not been proven.
- The kit installed but not adapted. A generic CLAUDE.md means agents guess the domain, and guesses differ per run. The adaptation in the open is the point of the phase.
- IaC or pipeline merged without review to move faster. HIGH risk because they are hard to undo and run in production later. The Setup Owner is never the sole approver of their own foundation — the deputy and the client's DevOps read every change.
- A secret in the repo. The one unrecoverable mistake: a key in a commit is a rotation event and an audit-log review, not an edit. The client's vault from day one.
- A feature-rich skeleton. Every slice beyond the thinnest end-to-end path is Build scope wearing a Foundation badge — it delays the rails being proven and the gate being reached.
- Deferring the deputy. "I'll name a deputy later" means the Setup Owner is approving their own foundation right now. The deputy is named on day one.
- The demo on a laptop. The exit demo runs in the client's own dev environment, through the real pipeline, or it has not proven what Phase 3 exists to prove. A localhost demo proves the code compiles, not that the factory works.
When Phase 3 is done
The opening ends, and the factory takes over
Foundation closes with a working factory and one part already moving through it: the rails proven by failing safely, the skeleton running in the client's own environment, the success metric already ticking. The four gated phases are done; from here, every change rides the continuous Build loop. Where to go next: