The model General skill. No context.

The repository What the code is today.

The workspace

What only your team knows, and how it has agreed to work.

An agent needs all three to start work oriented. The first two arrive on their own. The third has to be built, and this page is a field guide to building it, at version 2.0.

I built a workspace like this for the team I develop with. This page describes the pattern, not that project. Nothing in it depends on a language, a cloud or a vendor. If your team works with coding agents on software that already exists, you can build one.

Version 1.0 worked for me. Version 2.0 is designed so a teammate can use it without asking me anything. If you knew 1.0, start with what changed.

The idea

1 Why it exists

Without your team’s context, an agent guesses. Its guesses read as confidently as its facts.

The model brings general skill. The repository says what the software is today. Neither one knows which repository a change belongs in, which branch your team abandoned, or what you mean by an everyday word.

That knowledge usually lives in a few people’s heads. Those people get good results from an agent, and everyone else gets guesses. The workspace writes the knowledge down, so working well with an agent becomes a team practice instead of a private skill.

The first minutes of a session
MomentWithout a workspaceWith one
Where the change goesThe agent picks the repository that looks right.The contract names the right one and warns about the look-alike.
Your wordsIt searches for “the nightly job” and finds nothing.An alias table maps the phrase to the name the code uses.
Old decisionsIt revives an approach your team already rejected.A decision record says what was rejected, and why.
The procedureEach person prompts it their own way.A playbook gives every person and every tool the same steps.
Getting stuckIt asks you, every time.You answer once, in the workspace, and nobody asks again.

2 What it holds, and what it refuses

A workspace grows until nobody reads it. A written boundary stops the growth.

It holdsIt refuses
Facts nobody can derive from the code: which system is the real one, what replaced what, and the quirks of your tracker and your deploys.Summaries of what the code already says plainly.
How the software works, written for a person: the architecture, the data flow, how sign-in works across your apps.Coaching the agent on things it already does well.
Team agreements: how you size, review and finish work.Ticket status. That belongs in your tracker.

The test. Before you write something down, ask whether a capable model would get it right from the code alone. If it would, leave it out. If it would get it wrong, and wrong is costly, write it down.

Cheap insurance stays, even when a model usually gets the answer right. A one-line warning that prevents a costly mistake earns its place.

When adding and deleting are otherwise equal, delete. Correct an existing page before you write a new one.

Finished work moves to an archive. It stays in the repository, but a search-ignore file hides it from agent search, so old plans stop showing up as current advice.

Two places hide team knowledge without anyone noticing. One is the agent’s private memory on one person’s machine. The other is the always-loaded rules file, which grows until every session pays for rules it never uses. Move team facts out of private memory, and keep the always-loaded layer to routing and the traps.

The structure

3 It sits beside your code

The workspace is its own repository. It points at your code repositories; it does not contain them.

The workspace Contract, guide, playbooks, docs, gates. No product code. Service repository Own history, own reviews. Web app repository Own history, own reviews. Another team’s repository Read-only reference. each pinned at a commit a merge moves the pin
The workspace pins each code repository at an exact commit. The code stays authoritative in its own repository, and every doc describes a known version.

Submodule. A git feature that includes one repository inside another, fixed at an exact commit.

Your code keeps its own repositories, history and reviews. The workspace includes each one as a pinned reference, such as a git submodule. When a change merges upstream, the workspace moves its pin forward.

The split pays off three ways. Code reviewers never see workspace churn. One workspace can describe several repositories, including ones your team does not own. And every claim in it describes a known version of the code.

Design it so nobody needs access to everything. A newcomer who can reach only two of the repositories should still get working docs and passing checks.

One way to lay it out. The roles matter more than the names.

AGENTS.md
The contract: rules every agent reads.
GUIDE.md
The front door for people.
README.md
The task router: “I want to…” and where to go.
INDEX.md
Topics, plus search aliases.
docs/decisions/
Decision records: why the hard calls went the way they did.
docs/playbooks/
Procedures an agent can run.
docs/howto/
Steps a person follows.
docs/tutorials/
Do-once lessons for newcomers.
docs/<area>/
How each part of your system works.
wrappers/
Thin pointers in each tool’s own format. Most tools expect a fixed folder.
checks/
Drift gates, run before each commit and after each push.
evals/
Test cases for the playbooks.
archive/
Finished work, hidden from agent search.
src/
Your code repositories, pinned.

4 Write it once, every tool reads it

Each rule and procedure lives in one file. Every tool, and every published copy, points back at it.

The playbook One procedure, plain markdown. The only copy. Claude Code A skill file that points here. GitHub Copilot A prompt file that points here. Codex Opens the playbook by its path. opencode Reads the same skill files. The wiki copy For people who never clone. a thin pointer published one way
A procedure lives in one file. Each tool gets a thin pointer to it, and the wiki copy is published from it, so no reader gets a different answer.

Most agent tools have their own format for commands and rules. Write a procedure into each format and the copies drift apart. Instead, write it once as plain markdown, and give each tool a wrapper of a few lines that points at it.

Rules work the same way. One contract file holds the rules every tool reads, and each tool’s own settings file imports it instead of repeating it.

Path-scoped rule. A rules file that applies only to matching paths, such as front-end components or deploy configuration.

Some rules apply only to certain files. Keep those in path-scoped rule files. Some tools load them on their own. For the rest, a hook shows the matching file when the agent edits a covered path.

People who never clone the repository still need some of it, such as the decision records and the team’s agreements. Publish those to your wiki one way, with a banner that names the source. Edits go to the source, and the next publish carries them.

5 Two front doors, one set of docs

People and agents need different entrances. They do not need different documents.

A person New to the team. An agent A fresh session. Guide and task router The why, and where to go. Contract and index The rules, then the fact. The same docs One home per fact. Nothing written twice.
People enter through a guide and a task router, and agents through the contract and a topic index. Both arrive at the same documents.

A person wants the reasons and a route to the task. An agent wants the rules and the fastest path to a fact. So each gets its own entrance: a guide and a task router for people, the contract and a topic index for agents.

Behind both entrances is one set of documents. Nothing is written twice for two audiences, so a fact that changes, changes once.

A task router: the first screen of the workspace
I want to…Go to
Build a feature or a large changeThe ladder: grill, spec, plan, execute (section 8).
Make a small, reversible fixTest-first, with no ceremony.
Debug something hard or slowA repeatable feedback loop. Never guess at a fix.
Answer a questionResearch. Save the findings only if they hold up.
I don’t know where to goThe guide’s list of where answers live.

Start with those five rows; they cover most work. Add a row when someone asks where to go and the answer is not there.

Short requests should expand to full procedures. The workspace defines what each one means, so the same words do the same thing for everyone.

Asking in one line
You sayThe agent does
“Pick up ticket 1234 and fix it.”Reads the ticket, checks its claims, takes the bug path and opens a draft for review.
“Verify it locally.”Starts a local environment, clicks through the change and captures what it shows.
“Do the bookkeeping.”After a merge: closes subtasks, moves the pin, refreshes the maps and cleans up.

6 Three kinds of guidance

A reader should know from the folder name what kind of help they are about to get.

KindReaderWhenExample
PlaybookAn agent, or a person through oneEvery time the task comes upFix a bug test-first
How-toA personWhile doing one taskReview a teammate’s pull request
TutorialA newcomerOnceA first agent task, end to end
ReferenceAnyoneWhen looking something upHow sign-in works across the apps
Decision recordAnyone about to reopen a choiceBefore changing directionWhy the repositories are pinned, not copied

Diátaxis. A public framework that sorts documentation by what the reader needs: to learn, to do a task, to look something up, or to understand why.

The split follows Diátaxis. Playbooks are the how-tos an agent can run, which is why they get their own folder. Keep one term per concept: when two words name the same kind of document, retire one.

Every page opens with one sentence saying what it is for and who reads it. A page that reports a finding or a decision also opens with an “In short” line a reader can stop after. A gate checks that the line is there.

7 Finding things

Choose the lookup that fits what you already know. Don’t stack them.

You haveUse
An exact name: a class, a route, an endpointA symbol lookup that returns the file and the line.
A topic, but no nameThe topic index and its search aliases.
A repository you want to get to knowIts code map: a generated list of components and routes, each with a file and line.
A distinctive name in a known repositoryPlain text search.
An outside systemThe architecture model: who calls it, and what data crosses.
Search aliases, with invented examples
You sayThe code says
the nightly jobReconciliationWorker
a holdAccountFreeze
the big reportQuarterlyExport

The alias table is often the most useful thing a workspace gives an agent. People and code use different words for the same thing, and a search for the everyday word finds nothing.

Code maps help people as much as agents. A newcomer can scan a repository’s shape without opening a source file.

Outside systems get the same treatment. A register lists every system you call, and a text model records each call and the class of data it carries. The maps and diagrams are generated from the model. Figure 1 on my home page shows that loop.

How work flows

8 Size the work first

Process should scale with the work. A size gate decides how much each change gets.

A change skips the ceremony when it is all four of these:

  • Small
  • Easy to reverse
  • In one repository
  • Under a day of work

Then write a failing test, make it pass, and ship it. Everything else climbs a ladder, and stops climbing as soon as the work allows.

Size gate Small, reversible, one repo, under a day? Test-first fix Test, fix, ship. Decision record Why, and what it cost. Grill Settle questions. Spec What will be true. Plan Checked slices. Execute Run and verify. yes no a hard call red-team: a fresh session attacks the plan
A size gate decides how much process a change gets. Small work goes straight to a test; larger work climbs the ladder, and a fresh critic attacks the plan before anything is built on it.
  1. Bound it. Write the goal and the non-goals before touching anything. Agents tend to do more than you asked, and non-goals stop that.
  2. Grill. The agent interviews you about the design until the open questions are settled.
  3. Spec. Write down what will be true when the work is done.
  4. Plan. Break the work into slices an agent can run, each with its own checks.
  5. Red-team. A fresh session with no stake in the plan attacks it. Done means every finding is triaged, not that none were found.
  6. Execute. Run the slices, verify each one, and record what happened.

Decision record. Often called an ADR, for architecture decision record: a short page naming a choice, its options and what it gave up.

A call that is hard to reverse becomes a decision record. The next person, or the next agent, reads why before reopening it.

Work that runs for weeks gets one folder for its hub, its open questions, its specs and its plans. Very large work, with its own conditions for stopping, gets a short requirements document above the ladder.

9 Done means verified

An agent’s “done” is a claim. The workspace says what evidence the claim needs.

A change is done when all of these hold:

  • Tests come first, and they fail before the fix.
  • The build is clean against where it started. Only new warnings count, so old ones can’t hide new ones.
  • The change is checked in the running app, on a disposable local environment.
  • An impact check lists what else the changed paths touch.
  • Every claim in the report is marked verified or inferred.

A report, marked

Fixed: the Export button on the orders page did nothing.

verified
The new test fails before the fix and passes after it.
verified
On the local environment, Export now downloads the file.
inferred
The invoices page uses the same handler. Not checked.

Verified means the agent ran something and saw the result. Inferred means it reasoned its way there. Both are useful. Mixing them up is how a confident wrong answer gets merged.

A bug that shows on screen gets a screenshot or a short video, captured on the local environment. A person approves each bug report before it is filed.

10 A local environment per working copy

Each working copy of the code gets its own disposable environment, so parallel sessions never share test data.

Working copy A One task, one branch. Working copy B Another task, alongside. Slot 1 Own database, test user. Slot 2 Same schema, its own data. Shared database Never a target. never
Each working copy gets its own slot, so parallel sessions never share test data, and no slot ever points at a shared database.

Working copy. A separate checkout of a repository on its own branch. Git calls an extra one a worktree.

Agents work in parallel, each on its own branch in its own working copy. If they share one local database, one session’s test data breaks another session’s test.

So each working copy gets a slot: a local environment with the real schema, its own database and a seeded test user. One command starts the slot or reuses it, and another takes it down.

The slots look after themselves. Idle slots are reclaimed, and a session’s slot comes down when the session ends. A slot also refuses to run code from a branch that has fallen behind.

A slot never points at shared data. Where a service would call out, a local stand-in answers, and the browser asks before it leaves the local environment.

Fixtures reset the test data before each run, so a regression suite gives the same answer twice. An agent can run that suite on a slot and draft bug reports, with captioned video, for a person to approve.

11 Review before people see it

An agent reviews the branch before any person does, and the pull request opens as a draft.

Finished branch Tests pass. Agent review One reviewer per concern, each in a fresh session. Review record Findings and verdict. Draft pull request A person publishes it. Deferred findings Each one tied to a ticket. required first not fixed now
An agent review runs one reviewer per concern and leaves a record. The pull request needs that record and opens only as a draft, and a person decides when others see it.

Several reviewers run over the finished branch, one per concern: correctness, architecture, security, reuse and drift in the docs. Each reviewer is a separate session that sees only the ticket and the change. None sees the conversation that wrote the code, so none inherits the author’s reasoning.

Before the reviewers run, a build-and-lint pass compares the branch with its base, so only new problems count.

The review leaves a record of which reviewers finished and what each one found. A hook refuses to open a pull request for a commit with no record. The agent opens it only as a draft, and a person reads it and publishes it.

On a teammate’s pull request, each finding is checked against the code before anything is posted, and a person approves every comment.

A finding that won’t be fixed now is deferred to a ticket. A gate flags a deferred finding whose ticket closed without a fix.

When a defect gets past a review anyway, an escape review asks what kind of miss it was. The fix goes into the review itself, so the next defect of that kind gets caught.

12 Unattended runs and model tiers

An agent can run a plan alone when the plan says how it will know it’s done, and what to do when it isn’t.

What a hand-off plan contains

Success criteria
What is true when it’s done, stated so a script could check it.
Verification
The exact commands the agent runs itself.
Non-goals
What it must not touch, and how far a change may reach.
Recovery
By default, halt and report. Do not improvise.
Model tier
Which tier runs each step.
You The goal. Driver The strongest model. Plans, decides, reviews. Worker Builds a slice to plan. Mechanical Reads, lists, sweeps. a slice a sweep only conclusions come back: file, line, finding
The strongest model makes the judgment calls. Cheaper tiers do bounded work and sweeps, and only conclusions come back, never whole files.
TierDoesFor example
DriverJudgment: design, review, what to do nextWriting the plan
WorkerBounded work against a planBuilding one slice
MechanicalReading and sweepingFinding every caller of a function

Name the tier for every task you hand off. A helper that quietly inherits the strongest model costs the most and gains nothing. A hook refuses a handoff that names no tier.

Delegating saves context, not tokens. A helper reads widely so the main session doesn’t have to. The bill drops only when the helper runs on a cheaper tier or at lower effort.

Where judgment is needed, nudge instead of forcing. A hook can suggest a cheaper tier when a request looks mechanical, and the session decides.

13 Work survives a handoff

A second person can pick up a task midstream, because each kind of state has exactly one home.

HomeHoldsFor example
The workspaceWhat lasts: facts, process, decisionsHow a release is cut
The ticketWhy this one piece of work existsThe report and the agreed fix
A handoff noteWhere the work stoppedWhat’s done, what’s next, what to watch

The workspace is not a status tracker. Ticket status changes daily, and a workspace that copied it would be wrong by morning.

A fresh session, or a teammate, reads all three and carries on. After the merge, one request closes the loop: “do the bookkeeping” handles the subtasks, the pin, the generated maps and the leftover branches.

The safety net

14 Drift gates

Generated maps and docs go stale quietly. Gates make the staleness fail loudly.

Instruction contract One file, every tool. Generated code maps Each name, file and line. The work Agent and person. Drift gates Dead link, stale map, missing name: the merge stops. Eval cases Guard playbooks. a failure teaches the suite no change without a case
Every generated artifact is paired with a gate that fails the merge when the artifact stops matching the code.
GateFails when
LinksA link points at a file or heading that no longer exists.
FreshnessA page is past its review date and the commit edits it.
SymbolsA doc names a class or function the code no longer has.
CoverageA part of the system has no doc at all.
Call chainsA front-end call has no matching back-end endpoint.
ArchitectureA call reaches an unregistered system or carries unclassified data.
Tracker schemaSomeone moved a field that the agent’s ticket updates depend on.
SecretsA staged file contains a credential.

CI. Continuous integration: the checks a server runs after every push.

Run the gates before each commit and again in CI. A teammate who never installed the hooks is still caught after the push.

A commit gate checks a snapshot of exactly what is being committed, not the folder around it. Another session’s unsaved edits can’t make it pass or fail.

Green means nothing is dangling. It never means a document is true. A page that contradicts last week’s decision passes every gate. Catching that takes a scheduled audit and a reader who checks.

15 Hooks in the agent’s runtime

Hooks act at the moment of the action. They remind where judgment is needed, and refuse where a mistake is costly.

Hook. A small script the agent tool runs on its own at a set moment, such as before an edit or when a session starts.

MomentWhat the hook doesKind
Session startWarns when a pinned repository is behind its main branch, and lists pages past their review date.Reminds
Before an editShows the path-scoped rules for the file. Refuses edits to a shelved repository unless the session opted in.Reminds, refuses
After an editNames the other layers of the same call chain that may need the change too.Reminds
Before stagingRefuses “stage everything”, because another session may have edits in the same folder.Refuses
Before a handoffRefuses a delegated task that names no model tier.Refuses
Before a pull requestRefuses a branch that has no review record.Refuses
Before the browser leavesAsks before it visits anything outside the local environment.Asks

A rule written only in prose gets broken. When the same mistake shows up twice, turn the rule into a hook.

Each hook has its own test cases, which run like any other test. Without them, a hook can stop firing and nobody notices.

Keep secrets out of the agent’s shell. Load each one only for the command that needs it, and scan every commit for credentials.

16 Testing the guidance

A small change to a playbook can change what an agent does. Eval cases catch that before it ships.

Eval case A request, a scaffold and its graders. With the playbook The change under test. Without it The bare model. Graders compare Keep it only if it beats the bare model. Push gate No recorded pass, no push. a pass is recorded
Each eval case runs with the playbook and without it. A playbook stays only while it beats the bare model, and a change to it ships only with a recorded pass.

Eval. Short for evaluation: a repeatable test of how an agent behaves on a set task.

An eval case

Request
“The Export button on the orders page does nothing. Fix it.”
Scaffold
A small repository where the button is broken in a known way.
Graders
It takes the bug path. It reproduces the failure before editing. It adds a regression test.
Fails if
It edits code before it has a reproduction.

A wording change can change which procedure an agent picks. Without cases, nobody notices until the agent starts doing the wrong thing.

Each case runs twice: with the playbook and without it. A playbook stays only while it beats the bare model. If it doesn’t, the model has caught up, and the playbook is noise.

A gate refuses a push that changes a playbook unless its cases have a passing run on record. A routing suite checks that everyday requests reach the right playbook. A before-and-after run shows what each change made better or worse.

Run the cases on the smaller models you hand work to. A playbook that routes correctly only on the biggest model fails as soon as a cheaper one picks it up.

When an agent goes wrong in real work, the failure becomes a new case before the fix merges. New playbooks follow the same rule: write one only after a baseline test shows the bare model failing at the task.

17 Changing the machinery

Docs change freely. The scripts, hooks and CI that check them take a stricter path.

A doc change Most of the work. Script, hook or CI The workspace’s tools. Its own branch CI on three systems. Main branch The gates run again after every push. committed directly a direct push is refused merged once green
Docs go straight to the main branch and are checked after the push. Scripts, hooks and CI take their own branch and must pass on Windows, macOS and Linux first.

A doc change goes straight to the main branch, and the gates check it after the push. Low friction is the point: fixing a doc should cost almost nothing.

A change to the machinery is different, because a broken gate stops everyone. It goes to its own branch first and merges only after CI passes on Windows, macOS and Linux. A hook refuses a direct push of machinery to the main branch.

A nightly job clones the workspace from nothing and follows the README, the way a new teammate would. A step that works only on the author’s machine fails there first.

Adopting it

18 How you know it works

The measure is a person, not the workspace: a teammate ships a real fix through it without asking the author anything.

“I had to ask a person” The question itself. Logged as a gap Not as user error. Fixed in the workspace By whoever hit it. the same question is not asked twice
A question someone had to ask a person is logged as a gap in the workspace, not as user error, and fixed so nobody asks it twice.

Every question a teammate has to ask is evidence. It marks context the workspace failed to carry, so log it as a gap and fix it where the next person will look.

Size and polish measure nothing. A large, well-made workspace that people route around has failed.

The first real test is a teammate cloning it from zero with only the README. Every stumble becomes a doc fix. After that, the nightly clone keeps the test running.

Ownership has to spread too. Whoever finds a gap fixes it, with their own agent. A workspace that only its author edits is still a notebook.

19 What changed in 2.0

Version 1.0 worked for its author. Version 2.0 is built for the next person.

AspectVersion 1.0Version 2.0
Built forThe author’s own sessionsAny teammate, with any supported tool, on Windows or macOS
Front doorThe contract and a practices pageA guide and a task router for people, and the contract for agents
ScopeExplained much of what a model can read for itselfA written boundary: what it holds and what it refuses
GuidanceOverlapping folders and namesThree kinds of guidance, one term each
Finished workStayed in search resultsArchived and hidden from agent search
SetupAssumed the author’s machine and accountsSettings in one file per project, and checks that run anywhere
ReviewNo required recordAgent reviewers first, with a record, then a draft for a person
Local checksOne shared local environmentA disposable slot for each working copy
Playbook changesNo per-playbook testsGated by eval cases, against a no-playbook baseline
Machinery changesCommitted straight to the main branch, like docsTheir own branch, with CI on three operating systems
SuccessNot definedA teammate ships without asking, and every question asked is a logged gap

Models got better at reading code, and that changed what is worth writing down. Version 1.0 spent many pages on things a model now works out for itself. Version 2.0 cut those and kept what a model cannot derive. As models improve, a good workspace gets smaller and sharper.

One thing is deliberately not built: an installer that sets up a workspace for a new project. It waits until a second team actually needs one. A generator nobody runs is exactly the unused tooling this pattern exists to prevent.

20 Start your own

Start with the facts only you know. Add machinery when you hit the problem it solves.

WhenAdd
Day oneA contract file with the facts a model can’t derive. Your repositories, pinned beside it.
First weekA task router with five rows. A link check before each commit.
First monthPlaybooks for the three tasks you repeat most, with a thin wrapper per tool. A question log.
When docs start to driftFreshness and symbol gates, in CI as well as before commits. An archive for finished work.
When agents run in parallelA disposable local environment for each working copy.
When playbooks change oftenEval cases, a no-playbook baseline, and a gate that requires a pass.
When a gate breaks for everyoneIts own branch and cross-platform CI for the machinery.
When a second team asksA template or an installer. Not before.

Don’t build the whole thing up front. Each piece earns its place by fixing a problem you have actually hit.

21 Glossary

Agent
An AI coding tool that reads, edits and runs code in a session.
Contract
The one rules file every tool reads, often named AGENTS.md.
Task router
A table that turns “I want to…” into the right procedure.
Playbook
A procedure, in plain markdown, that an agent can run on request.
Wrapper
A few lines in one tool’s format that point at a playbook.
Hub
The index page at the top of a docs area, giving its reading order.
Search alias
An everyday word mapped to the name the code uses.
Code map
A generated list of a repository’s components and routes, each with a file and line.
Pin
The exact commit of a code repository that the workspace points at.
Drift gate
An automated check that fails when a doc stops matching the code.
Hook
A script the agent tool runs at a set moment, such as before an edit.
Eval case
A test for a playbook: a request, a scaffold and graders.
Decision record
A short page on a hard-to-reverse choice, its options and what it gave up. Often called an ADR.
Size gate
The test that sends small work straight to a failing test.
Hand-off plan
A plan an agent can run alone, with success criteria, checks, non-goals and a recovery rule.
Slot
A disposable local environment for one working copy.
Review record
The note an agent review leaves: which reviewers ran and what each found.
Bookkeeping
The cleanup after a merge: subtasks, pins, maps and leftover branches.
Question log
The record of every question someone had to ask a person. Each one is a gap.