Cookbook: you write the specs, Indaba reviews them
The other cookbooks hand an idea to agents and let them write the specification. This one is for the opposite habit:
you write every specification, by hand, the way spec-driven development (SDD) means it, and Indaba is the second
pair of eyes. You build an application one feature at a time: a login window, a list window, a window to add,
change and delete. For each feature, Indaba has two agents argue over your spec before any code exists, and over the
code once it does. When three features have gone through that loop, you write the loop down as a workflow.ai.yml, and
from then on the process is kept by Indaba: you write the spec, and the run does the rest the same way every time.
Every spec, word for word, and each step in the order you do it, are in the tutorial. This page explains the process and the three workflow files.
This is the way of working Indaba suggests for an application you will keep (the recipe was run end to end with real agents: see "How this recipe was checked"). How it compares with the other cookbooks, and what each of them shows: Choose a way of working.
What gets built#
contacts-app: the shared contact list of a small office, a JSON API and three windows (web pages), on Node 22 with no runtime dependencies.
| Feature | Spec | Window | Built |
|---|---|---|---|
| 001 Login | specs/001-login/spec.md |
/login: username, password, sign in; sign out everywhere |
by you, reviewed by Indaba |
| 002 Contact list | specs/002-contact-list/spec.md |
/contacts: search, sort by column, pages |
by you, reviewed by Indaba |
| 003 Contact window | specs/003-contact-edit/spec.md |
/contacts/new, /contacts/<id>: add, change, delete; told when someone else saved first |
by you, reviewed by Indaba |
| 004 Export | specs/004-export/spec.md |
an Export CSV button on the list | by the workflow.ai.yml you wrote |
Around the code, the documents every later person and agent reads:
| File | Is | Written by |
|---|---|---|
.specify/memory/constitution.md |
the principles every feature obeys; it outranks everything else | you, once |
AGENTS.md, CLAUDE.md |
the layout, the commands and the rules for coding agents | you, once |
specs/<NNN-name>/spec.md |
what one feature must do, in cases a tester can check | you, per feature |
workflow.ai.yml |
the process, kept: review the spec, tests first, code, test gate, review the code | you, after feature 003 |
The folder layout is spec-kit's (specs/<NNN-name>/, .specify/memory/constitution.md), so
spec-kit can be added later, but nothing here needs it installed.
The process#
once for each feature after three features
constitution, AGENTS.md -> write spec.md -> review-spec -> fix -> ... -> implement -> review-code -> workflow.ai.yml
(you) (Indaba) (you) (you, or (Indaba) (Indaba keeps
your agent) the process)
- Write the spec. User stories with Given / When / Then scenarios, numbered requirements (
FR-001...), the window's layout and states, the exact requests and answers, edge cases, and what is out of scope. - Review the spec with
contacts-review-spec.workflow.ai.yml. Two agents read it against the constitution,AGENTS.mdand the earlier specs, and debate until both accept the same list of findings: a requirement no test could check, a missing failure case, an unstated limit, a window state nobody described, a security gap. Nothing is changed; you read the findings. - Fix the spec, commit, and review again until what is left is only findings you decided to accept.
- Implement: yourself, or by giving your coding agent the feature's spec (the tutorial has the prompt). Tests first, as the constitution says.
- Review the code with
contacts-review-code.workflow.ai.yml: Indaba runsnpm test, then two agents debate the code against the spec. - After three features, keep the process:
contacts.workflow.ai.yml, saved asworkflow.ai.yml, does steps 4 and 5 for the next spec you write, and starts with a spec gate.
Why review before code: a gap found in a spec costs a sentence; the same gap found in code costs a test, a change and a second review. In this process the spec is the one document a person owns. Agents write tests and code from it and are told never to edit it, so the review is how it gets a second reader.
What you need#
- Node 22 or newer, npm, and git with your name and email set (the process workflow commits).
- Indaba:
npm install -g indaba@next, or writenpx indaba@nextwherever this page writesindaba. - One agent. The roles use Claude over ACP and fall back to the
claude-codeCLI when ACP cannot start. See Logging in to an ACP agent and Using the alpha. A second, different agent (Codex, Gemini) as the second reviewer gives a more independent review: change thetesterrole's runner and agent. - A terminal for the runs: the debates use
arbiter: "human", which asks you only when the agents cannot agree.
A debate calls each of its two agents once per round, for up to four rounds. The two review workflows tell the agents to
begin their first reply with CRITIQUE:, so a review needs at least two rounds: four agent calls, at most eight. The
spec gate in workflow.ai.yml lets a reviewer answer AGREEMENT: at once, so it can settle in one round: two calls.
The three workflow files#
| File | Steps | Run it | Changes |
|---|---|---|---|
contacts-review-spec.workflow.ai.yml |
spec_review: a debate of reviewer and tester over spec.md |
after each draft of a spec | nothing |
contacts-review-code.workflow.ai.yml |
verify (npm test), then code_review: a debate over src/, public/, test/ against the spec |
after each feature is implemented | nothing |
contacts.workflow.ai.yml, saved as workflow.ai.yml |
check_spec, spec_gate, tasks, tests, implement, verify, code_review, with three checkpoint_* commits |
for each new spec, from feature 004 | the branch indaba/specs/<NNN-name> |
Each file names its feature once, at the top:
artifacts:
feature: "specs/001-login" # the feature directory to review: change it for each spec
The goals refer to it as ${{ artifacts.feature }}, so changing that one line points the whole file at the next
feature. indaba run has no option to pass a value in, which is why the line is in the file.
Commit before every run. Each review runs in a git worktree made from your last commit, so an uncommitted draft is
not what the agents read. The debates are read-only: the step declares permissions: { level: read }, and its scope guard
(indaba plan shows "may only change nothing") fails the step if anything in the worktree changed, whichever agent changed it.
Reviewing a spec#
git add specs/001-login && git commit -m "001-login: draft"
indaba run contacts-review-spec.workflow.ai.yml
indaba watch latest --plain # in another terminal while it runs, or afterwards: the board at the end is the debate
How to read the result:
- The debate's messages are the review. In the first round each agent lists up to five findings and begins with
CRITIQUE:. From then on,AGREEMENT:means "I accept the other reviewer's findings as the result" (not "the spec is good"), andCRITIQUE:means a finding is missing, wrong or badly worded. This is the review debate pattern; without it, two reviewers who find the same problems never settle. completedmeans they settled on one list. Read it on the board (indaba watch latest --plain, or the dashboard). The transcript file of a debate is written inside the worktree, which is removed when the run ends, so the board is where the messages stay; a copy of the debate is also kept in.indaba/discussions/<traceId>.<stepId>.json, which the web view (indaba ui) shows, but the web view does not show the board itself yet.- When they cannot settle, the human arbiter shows you the transcript and asks
acceptorreject. Either answer ends the review; the findings are still the messages. Your ruling is appended to.indaba-decisions/<workflow>.jsonl. Commit that folder: it is the record of who decided what, and an identical re-run reuses the ruling instead of asking again. - Fix, commit, run again. Each finding is either fixed in the spec, or accepted on purpose. Write an accepted one into the spec ("Out of scope: ...", or an edge case that says what happens) so the next review does not raise it again.
Implementing a feature#
The process does not mind who writes the code, as long as the tests come first and spec.md is not edited. Give your
coding agent (Claude Code, Codex, ...) the feature's directory and the rules; the tutorial has the exact prompt. It reads
AGENTS.md itself, and that file points it at the constitution. Then:
npm test
git add . && git commit -m "001-login: implemented"
Reviewing the code#
indaba run contacts-review-code.workflow.ai.yml
verify runs npm test in the worktree. If it fails, the run fails and no agent is called: fix the tests first.
Then code_review debates the code against the spec, with the same AGREEMENT: / CRITIQUE: meaning as the spec
review. Fix what you agree with, commit, and run it again if you changed much. A finding that says the spec is wrong
is fixed in the spec first, then in the code.
Keeping the process: workflow.ai.yml#
After feature 003 you have done the same thing three times. Save
examples/contacts.workflow.ai.yml at the root of the project as
workflow.ai.yml and commit it. It is the loop above, with the implementing done by agents:
| Step | Who | Does | May change |
|---|---|---|---|
check_spec |
shell | fails with No committed spec at specs/<feature>/spec.md when the feature line is wrong or the spec is not committed |
|
spec_gate |
reviewer + tester | debate whether anything in your spec blocks building it | nothing |
tasks |
architect | specs/<feature>/tasks.md: the work in order, tests first, each task naming its file and requirement ids |
specs/*/tasks.md |
checkpoint_tasks |
shell | commits, and points indaba/specs/<feature> at the commit |
|
tests |
tester | a test for every requirement and scenario, failing for now | test/**, specs/*/tasks.md |
checkpoint_tests |
shell | commits | |
implement |
implementer | the code, until the tests pass; never test/, package.json or spec.md |
src/**, public/**, specs/*/tasks.md |
checkpoint_code |
shell | commits | |
verify |
shell | npm test; a failure goes back to implement, with the end of the test output in its prompt, at most 3 times |
|
code_review |
reviewer + tester | debate the code against the spec | nothing |
Three choices in it are worth knowing:
- The spec gate is a go or no-go, not a list of findings. Its goal makes
AGREEMENT:mean "nothing in the spec blocks building it" (which is also what the engine tells debaters anAGREEMENTis). When a reviewer finds a blocker it answersCRITIQUE:, the debate does not settle, and the human arbiter asks you:acceptbuilds anyway,rejectends the run before any test or code is written. If both find nothing that blocks the build, the gate settles in the first round and the run goes on. - Checkpoints. Every agent step runs in one worktree, and the scope guard compares it with its last commit. Each
checkpoint_*step commits, sotestsis judged only on what it wrote; a tester that touchessrc/fails withGuard diff_within_scope failed: Changes outside the allowed scope (test/**, specs/*/tasks.md). - The result is a branch. The worktree is removed when the run ends; the commits are on
indaba/specs/<feature>(for exampleindaba/specs/004-export). Merge it when you are happy with the review.
For each new feature:
# write specs/004-export/spec.md (review it with contacts-review-spec while you draft), then
# change the feature line in workflow.ai.yml to "specs/004-export"
git add . && git commit -m "004-export: spec"
indaba validate workflow.ai.yml && indaba plan workflow.ai.yml
indaba run workflow.ai.yml
git log --oneline indaba/specs/004-export # tasks, tests, code (a second code commit after a retry)
git merge indaba/specs/004-export
The two review files stay useful: contacts-review-spec while you draft each spec, and contacts-review-code after any
change you make by hand.
When it goes wrong#
| What you see | Why | Do |
|---|---|---|
| The review talks about an old version of the spec | The draft was not committed | Commit, run again |
check_spec fails: No committed spec at ... |
The feature line names a directory that does not exist, or the spec is not committed | Fix the line in workflow.ai.yml, or commit the spec |
A run ends escalated at spec_gate |
You answered reject |
Fix the blockers in the spec, commit, run again |
Guard diff_within_scope failed |
An agent wrote outside its step's files | Read which file in the message; run again, or narrow the goal |
verify fails three times, then escalated |
The code cannot pass the tests, or a test contradicts the spec | Read the board for a question from implement; fix the test or the spec, commit, run again |
npm test never ends |
A test leaves a server open when it fails | The constitution's rule II: tests close what they open in t.after |
| A second run overwrote the branch | Each checkpoint moves indaba/specs/<feature> |
Merge or rename the branch before you run the same feature again |
How this recipe was checked#
The tutorial's constitution, AGENTS.md, package.json and final specs 001 to 004 were put in an empty folder, and the
kept workflow.ai.yml was run on each spec in turn (001, 002, 003, then 004), with real agents: Claude Code for every
role, on Windows 11 with Node 22. After each run the branch was merged and npm test run on the result. (In the tutorial
you build 001 to 003 yourself; here the same workflow built them, which is the harder test for 004: it exports the list the
earlier code built.)
| Feature | Spec gate | Tests after the run | Test gate | Code review |
|---|---|---|---|---|
| 001 login | settled in 1 round | 106 pass | passed | settled in 3 rounds |
| 002 contact list | settled in 1 round | 194 pass | failed once, sent back to implement, passed |
4 rounds, not settled |
| 003 contact edit | settled in 1 round | 290 pass | passed | settled in 3 rounds |
| 004 export | settled in 1 round | 345 pass | passed | 4 rounds, not settled |
What this showed:
- The chain works as written:
check_spec, the spec gate, tasks, tests, code,npm testand the code review ran, eachcheckpoint_*step committed, and the result was the branchindaba/specs/<feature>. Theverifyfailure of 002 went back toimplementand the second attempt passed. - The code reviews found real problems in the generated code, for example that parallel wrong passwords in 001 all pass
the lockout check before any failure is counted, and that
__proto__was not rejected as an unknown field in 003. Nothing was fixed in these runs; fixing what you agree with is the step after the review. - The two reviews that did not settle ended
escalated, because the run had no terminal for the human arbiter. Run with a terminal and the arbiter asks youacceptorreject, as described above.
What was not checked: the windows (public/) were never opened in a browser; the agents' tests of the pages were run, not
the pages. Only Claude Code was used, so a debate between two different agents was not tried with this workflow.
Cost. The runs above showed tokens unknown, cost unknown, so this page gives no figure for them. On Windows the
acp claude preset needs npx, a .cmd shim that Indaba does not start (see
ACP agents), so every call fell back to claude-code, and at the time that runner did not
read usage from the CLI. It does now: a claude-code step reports the tokens (the cache reads and writes counted in the
input) and the cost the CLI prints, and indaba watch shows them. A one-step run of it after that change showed
27756 in / 4 out, $0.0465; the four runs above were not repeated, so there is still no figure for this recipe. The
other CLI runners (codex, cursor, antigravity, opencode) report nothing yet, so a step on them stays unknown.
See which runners report usage.
On this machine the run was marked failed after every step had completed, because Windows refused to remove the task
worktree at the end ("Permission denied"); the branch and the commits were intact. If you see that, check the steps, not
only the final line. Real agents word their findings differently every time, so yours will differ.
See also#
- Tutorial: every spec, step by step: the texts of the constitution,
AGENTS.mdand all four specs, and the commands in order. - Cookbook: CRUD, step by step: the same kind of app with agents writing the specs, spec-kit's skills,
an acceptance test and mutation testing, any of which can be added to your
workflow.ai.yml. - Spec-driven development a year on: how this way of working relates to Spec Kit, OpenSpec, BMAD and Kiro, what has been measured, and workflow shapes for a bug fix and a change across components.
- Workflow format: debates, the arbiter, permissions, guards, retries.