@warren-dean/code-kit 0.36.1 → 0.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -44,6 +44,7 @@ Rules in `CLAUDE.md` and agent prompts are advice. Over a long session, or acros
44
44
  - a contract or schema changes with no record of who changed it or why;
45
45
  - code gets written before anyone checked it against the spec, or a screen before it was designed;
46
46
  - an agent declares "done" with failing type checks, or with work nobody committed;
47
+ - a fix ships with no test, so the bug comes back, or an agent skips or deletes a failing test to get to green;
47
48
  - someone force-pushes, commits to `main`, adds a dependency, or runs a deploy nobody asked for.
48
49
 
49
50
  code-kit catches each of these, most at the moment it would happen: the hook refuses the edit or command and tells the agent why and what to do instead. A file a shell command writes is caught straight after the command, and the agent is told to revert it. The rules live in one reviewed file, not in every prompt, so they hold for every agent and every session. They are guard rails for agents, not a sandbox: see [What verify proves, and its limits](#what-verify-proves-and-its-limits).
@@ -77,7 +78,7 @@ code-kit catches each of these, most at the moment it would happen: the hook ref
77
78
  - no secret files (`.env`, `secrets/`, keys and keystores) anywhere in the branch's history, including ones committed and deleted again, and, where gitleaks is installed, no secrets in any commit's content;
78
79
  - no test weakened (deleted, skipped or focused, cut down, or its snapshot rewritten) without the person's `tests` approval in the log;
79
80
  - with a running budget, a branch that changes the infrastructure files changes the cost register too, and one that takes an environment past its budget has the person's `cost` approval in the log;
80
- - a fix (a plan story with `**Fixes:**`, or a `<lane>/fix-…` branch) comes with a test that fails without it, as the bug, and passes with it;
81
+ - a fix (a plan story with `**Fixes:**`, or a `<lane>/fix-…` branch) comes with a test that fails without it, as the bug, and passes with it. The test has to fail on an assertion: one that fails only because it calls something the fix adds proves nothing, and verify asks for one through the existing code;
81
82
  - the project's checks pass.
82
83
 
83
84
  A project without `.claude/code-kit.json` isn't governed at all. An invalid config fails closed: nothing but the config itself can be written until it's fixed.
@@ -122,15 +123,20 @@ Set it up at the start of a new build, straight from the architecture docs, or b
122
123
  - **In Claude Code**, as a plugin. It's installed once per machine and governs only projects that have `.claude/code-kit.json`.
123
124
  - **On every edit, shell command and finish** in those projects, through Claude Code hooks:
124
125
 
125
- | Hook | Runs | Enforces |
126
- | ---------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------ |
127
- | `PreToolUse` Edit/Write | `hooks/guard-paths.mjs` | lanes, protected paths, spec-check and design gates |
128
- | `PreToolUse` Bash | `hooks/guard-bash.mjs` | shell rules, dependencies, approval log and secret scan on commit |
129
- | `PostToolUse` Edit/Write | `hooks/post-edit-check.mjs` | layer rules and the project's `postEdit` commands |
130
- | `PostToolUse` Bash | `hooks/lane-audit.mjs` | ownership of files a shell command wrote, reported for revert |
131
- | `PreToolUse` Agent | `hooks/guard-agent.mjs` | one agent per lane at a time, across every session |
132
- | `Stop`, `SubagentStop` | `hooks/stop-check.mjs` | proof before finishing; a lane's finish frees the lane |
133
- | `SessionStart`, `SessionEnd` | `hooks/session.mjs` | the session recorded as the lead or a working session; as it ends, it leads nothing, and its lanes are freed |
126
+ | Hook | Runs | Enforces |
127
+ | ------------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------ |
128
+ | `PreToolUse` Edit/Write | `hooks/guard-paths.mjs` | lanes, protected paths, spec-check and design gates |
129
+ | `PreToolUse` Bash | `hooks/guard-bash.mjs` | shell rules, dependencies, approval log and secret scan on commit |
130
+ | `PostToolUse` Edit/Write | `hooks/post-edit-check.mjs` | layer rules and the project's `postEdit` commands |
131
+ | `PostToolUse` Bash | `hooks/lane-audit.mjs` | ownership of files a shell command wrote, reported for revert |
132
+ | `PreToolUse` Agent | `hooks/guard-agent.mjs` | one agent per lane at a time, across every session |
133
+ | `Stop`, `SubagentStop` | `hooks/stop-check.mjs` | proof before finishing; a lane's finish frees the lane |
134
+ | `SessionStart`, `SessionEnd` | `hooks/session.mjs` | the session recorded as the lead or a working session; as it ends, it leads nothing, and its lanes are freed |
135
+ | `SessionStart`, `SessionEnd` | `hooks/team-session.mjs` | with a hosted team provider, the session's live link, and the project's report as it starts | |
136
+ | `UserPromptSubmit` | `hooks/lead-prompt.mjs` | `/code-kit:lead [stream]`, typed by the person, makes the session the lead |
137
+ | `WorktreeCreate` | `hooks/worktree-create.mjs` | a lane agent gets its lane's worktree, reused by each of its stories |
138
+ | `SubagentStop` | `hooks/worktree-done.mjs` | an agent's own worktree goes when it changed nothing |
139
+ | every tool call, `SubagentStop` | `hooks/act.mjs` | the event log of each act and a lane's hand-back, for recovery after a crash |
134
140
 
135
141
  - **For the main session and every subagent**, including agents in worktrees under `.claude/worktrees/`.
136
142
  - **In front of you, in the terminal and the Desktop app,** through the code-kit mod (Claude Code 2.1.287 or later; see [In the session](#in-the-session)). It shows and acts, and never enforces: the hooks above do that everywhere, the mod or not.
@@ -216,7 +222,7 @@ spec-design works an idea into a specification with you before any code exists.
216
222
 
217
223
  It writes `docs/brief.md` (with the decision log and open questions), `docs/specs/NN-<area>.md`, `docs/architecture.md`, `docs/standards.md`, `docs/principles.md` and `docs/plan.md`. Those are exactly what `/code-kit:init docs/` turns into lanes, layers and standards, and what lanes spec-check against. Run it again to resume where it left off, to change a decision, or to spec a new feature in an existing codebase.
218
224
 
219
- Requirements are headings (`### BOOK-4 Cancel a booking`). Stories are `### ST-12` headings in the plan with `**Lane:**`, `**Requirements:**`, `**Depends on:**` and `**Status:**` lines (`templates/plan.md`). The lane `lead` marks the lead's own stories, such as contracts and spikes, which the lead builds itself instead of dispatching; the lane `design` marks a design story, which the lead designs with you (`/code-kit:design`) before any screen that depends on it is built; `**Requirements:** none` marks a story that delivers no requirement. `**Status:** dropped` takes a story out of the plan without deleting it (folded into another, or no longer wanted): it's never dispatched, never waited on, and covers no requirement. Those two formats are what the build loop below runs on.
225
+ Requirements are headings (`### BOOK-4 Cancel a booking`). Stories are `### ST-12` headings in the plan with `**Lane:**`, `**Requirements:**`, `**Depends on:**` and `**Status:**` lines (`templates/plan.md`). A story may also carry `**Slice:**` (the feature it's part of: a free lane builds the open slice's stories first), `**Size:**` small, medium or large (with `harness.agents.lanes.model` set to `story`, it picks the lane agent's model, Haiku, Sonnet or Opus, raised for security requirements, fixes and send-backs, since most stories don't need the session's model), `**Fixes:**` for a bug fix (verify then needs a test that fails without it), and, on a design story, `**Screens:**`, the screens it designs. The lane `lead` marks the lead's own stories, such as contracts and spikes, which the lead builds itself instead of dispatching; the lane `design` marks a design story, which the lead designs with you (`/code-kit:design`) before any screen that depends on it is built; `**Requirements:** none` marks a story that delivers no requirement. `**Status:** dropped` takes a story out of the plan without deleting it (folded into another, or no longer wanted): it's never dispatched, never waited on, and covers no requirement. Those two formats are what the build loop below runs on.
220
226
 
221
227
  ## Set up a project
222
228
 
@@ -234,6 +240,10 @@ Requirements are headings (`### BOOK-4 Cancel a booking`). Stories are `### ST-1
234
240
  - new ones, even in the same file, do;
235
241
  - the baseline only ever shrinks: re-recording drops what's been fixed and refuses anything new.
236
242
 
243
+ **Standards.** Rules written as prose in the principles couldn't say which one a change broke, or how much it mattered. So init suggests the project's standards in `docs/standards.md`: from the specs, architecture and threat model, or, for existing code, from the code, each with its evidence ("41 of 43 modules reach the database through repositories"). You approve, edit or drop each before anything is written. Each is graded required or recommended, and applied as firmly as code-kit can: enforced by a rule whose refusal names it, checked in review, or given as advice. Each lane agent gets only its own layers' standards. `code-kit standards` lists them and what's wrong with them (spec 22).
244
+
245
+ **A QA lane.** Each lane writes its own unit tests, but nobody owned whether a whole journey across lanes still works. When the product has screens, or journeys that cross lanes, init adds a `qa` lane whose `test-engineer` agent owns the end-to-end suites, with a check that runs them when they change.
246
+
237
247
  **No specs yet?** Leave `docs.specs` out, and lanes aren't held to a spec-check report. Add it once specs exist.
238
248
 
239
249
  ## The agents and skills it creates
@@ -316,12 +326,13 @@ With `team` in the config, what of the team needs you is among what waits: your
316
326
 
317
327
  What waits for you there:
318
328
 
319
- - **A held call.** An agent installing a new package, writing or committing a protected file, or a lane changing the kit, where the approval is yours. Rather than stopping the agent, the call waits while the band asks ("web wants to install dayjs · 1:53"). **Approve** opens the confirmation and, once you confirm, the same call runs; **Refuse**, or no answer within `harness.hold.minutes` (2 unless set), refuses it as before. What the lead decides (`approvals.delegate`) is never held for you: the lane asks the lead, which approves it on its merits. Nothing is held under `claude -p` or the SDK, where nobody can answer.
329
+ - **A held call.** An agent installing a new package, writing or committing a protected file, or a lane changing the kit, where the approval is yours. Rather than stopping the agent, the call waits while the band asks ("web wants to install dayjs · 1:53"). **Approve** opens the confirmation and, once you confirm, the same call runs; **Refuse**, or no answer within `harness.hold.minutes` (2 unless set), refuses it as before. What the lead decides (`approvals.delegate`) is never held for you: the lane asks the lead, which approves it on its merits. Nothing is held under `claude -p` or the SDK, where nobody can answer. Set `harness.hold.minutes` to 0 and no call is held: each is refused at once, as under `claude -p`.
320
330
  - **Approvals agents asked for.** **Approve…** opens a confirmation with a reason prefilled from the request, which you keep or rewrite. When it isn't clear what it's for, **Ask about it**: the answer comes from a side call over the lead's conversation and code-kit's facts about the request, shown in the pane and never added to the lead's session, and follow-ups carry on the aside. A request waits until it's answered, its file is committed by someone who could, or it's dropped (at most a week); on its card, **Not needed** drops it.
321
331
  - **Questions from the lead** ("The lead asks: which weather provider?"), asked with `code-kit ask`: what it can't settle and only you can. **Answer…** opens it as a card with each of the lead's options and what it does, and **Something else…** for your own words; your answer is recorded and sent to the lead. A question can hold its story, which then reads `waiting on you`: nothing dispatches or reviews it, and the stories that depend on it wait, until you answer.
322
332
  - **Your brief's open questions**, each with who decides and what it holds up (from the table's Owner and Blocks columns; one owned by the lead alone isn't yours, and doesn't show). **Answer…** sends your answer to the lead, which records it in the brief's decisions, and **Ask about it** in the answer box explains it first, beside the conversation; **Later** puts one off until the next session.
323
333
  - **A bug report for code-kit**, with `harness.report.on`, drafted by an agent code-kit got in the way of. It holds only code-kit's own facts (its version, the rule, what it said, the command), with the project's folders and email addresses taken out. **Read it** shows the exact text; **Send** files it on code-kit's GitHub with your own `gh` (a comment, if it's filed already; without `gh`, you get the link to file it); **Discard** drops it.
324
334
  - **Stories waiting for review**, with the loop off: **Review** asks the lead to run `/code-kit:review` on the branch, and **Merge** runs `verify`, checks included, then merges if it passes. While the loop runs, a lane's finished work is the lead's to review and merge, so it never waits here.
335
+ - **A merged worktree with changes left in it**, listing the files: **Keep** leaves it until the next session, and **Discard** removes it, kept as a patch under `.claude/state/discarded`. Only you can discard.
325
336
  - **Warnings:** a finish check failing in this session, or a story using more than three times the median of the stories finished this session (once three have finished), each with **Lanes** to open the pane; and background agents paused once the plan's 5-hour use passes `harness.background.pauseAtPercent` (80% unless set).
326
337
 
327
338
  Every decision belongs to the session that raised it: it's shown, asked and answered there, and its answer goes to that session's lead. Another session's band shows only how many wait there ("1 decision in session kim/7f3a91c2, answered there"). Only what's holding work up is a decision: a call Claude Code's own permission check refused (its auto mode, a deny rule) shows on that lane's card in the pane as its activity, and the lead asks you with `code-kit ask` only if there's no other way. `code-kit decisions` lists this session's.
@@ -341,25 +352,26 @@ The loop keeps the build moving between your prompts, under `harness.autonomy`.
341
352
  - **It doesn't cut into a conversation.** When you talk with the lead about something other than the build (a question, a discussion, another task), the loop waits until you've been quiet for `harness.loop.quietMinutes` (10) before it prompts again; the band says so, with **Carry on**. Asking the lead to carry on with the build holds nothing.
342
353
  - **Each step is checked first.** code-kit's records can lag the work, so before it prompts the lead the loop reads the project itself (the step's branches against the base, the merge queue, the agents at work, the latest commits and the lead's last replies) and a small model judges whether the step is still due. One that isn't (merged already, under way, or one the lead said why it won't take, with nothing changed since) is held as a note with **Ask now**, and checked again once the project moves. A step the lead said waits, or didn't take, is held the same way, so speaking to the lead doesn't bring it back. `harness.loop.check` switches the check off.
343
354
  - **A step that doesn't move.** One the lead was prompted with three times in a row that is still next shows as a note, not a decision: "Merge lead/st-1: still next after 3 prompts to the lead", with **Ask again** if you want it.
355
+ - **Usage limits.** A lead turn that ends on Claude's usage limit, a rate limit or an API error did nothing, so the loop prompts nothing and restarts no quiet lane until it can work again: until the used-up limit resets, or, where Claude Code reports no reset, after 5 minutes, then 10, 20 and at most 60. The band says when it will try again, with **Try now**, and speaking to the lead ends the wait. Without it, the loop would prompt into the limit and count every quiet lane as stalled.
344
356
  - **A lean lead.** A lane writes its full report, with its commands and their output, to `.claude/state/reports/<branch>.md`, and hands the lead a few lines naming it; the stop hook won't let a lane on a story branch finish without it, or with a hand-back of more than ten lines, and the lead reads the file when it reviews. Lanes don't message the lead while they work. When a milestone finishes, the lead's context is compacted before the next one (`harness.compact.milestone`: you're asked by default, or it's done at once): the summary keeps what's in flight and what waits on you, and drops the finished stories' detail.
345
357
  - **Token use.** A long-lived agent rereads its whole context on every request, which is most of what a build costs. So each lane agent builds one story; one past `agents.lanes.contextLimit` is told to wrap up, and the lead carries its story on with a fresh agent that reads its report (`code-kit worktrees release` frees the branch). The lead's context is compacted between turns once it's past `compact.at`. The loop reads the lead's replies with Sonnet, and the reviewers run on Sonnet by default.
346
358
  - **Designs.** A design story is handed to the lead once a session; while you and the lead design it, the loop leaves it to you.
347
359
  - **One session leads.** The loop runs in the project's lead session: the one that started when no other led, or the one you chose with **Lead from here** (or `/code-kit:lead`). See [Several sessions in one project](#several-sessions-in-one-project).
348
- - **Modes.** **Pause** and **Resume** stop and start it. Under `propose`, each step waits for **Go**; under `off`, the loop does nothing. When every story is done, the band says so and the loop stops.
360
+ - **Modes.** **Pause** and **Resume** stop and start it. A pause is recorded (`code-kit loop pause`), so other tools' background work in the project, such as Context Graph's card writer, pauses with it, and a pause another tool records pauses the loop too, within seconds. Under `propose`, each step waits for **Go**; under `off`, the loop does nothing. When every story is done, the band says so and the loop stops.
349
361
  - **The Decide pane.** Nothing pops up over the conversation: a decision waits in the band and Needs you, with a notification, until you open it with **d**, its line in Needs you, or `/lanes decide`. The Decide pane sits beside the conversation and shows one decision at a time, all of it: the whole question, why it's yours, the story and requirements, what was happening, and each option on its number with what it does. A question that takes your own words has a box for them, and an **Ask about it** box first. **n** and **p** move between decisions; each stays in view as others come and go.
350
362
  - **Stalled lanes.** A lane agent with no tool call for `harness.stall.nudgeMinutes` (5) is messaged, unless its work is done (it handed back, or its branch is in review or the merge queue). At `stall.restartMinutes` (10) the lead is asked to stop it and dispatch its story again, at most `stall.maxRestarts` (2) times; after that the lead decides how the story goes on (a narrower brief, smaller stories, or handing it back), and the band shows a note.
351
- - **The reviewer agent**, with `harness.agents.reviewer.on`. A finished branch is first reviewed in the background by code-kit's reviewer agent, which the lead starts: it runs `verify` and the review checklist, read-only, and grades each finding blocker, concern or nit. The lead's review prompt then carries the findings, and a blocker means the branch is sent back. The pane shows each review, running with its clock or what it found. If the reviewer hasn't reported within 15 minutes, or the plan's 5-hour use is past `harness.background.pauseAtPercent`, the lead reviews without it.
352
- - **The merge queue** (`code-kit queue`). A branch the lead's review passes joins the queue. Branches merge one at a time, in the order they passed, each verified against the base as it is then: the lead merges where `approvals.delegate.merge` is on under `autonomous`, otherwise the band shows the head with **Merge** for you. Who may merge is read from the config committed on the base, so a branch can't grant itself merges. The queue records the commit each review passed, and merges exactly that commit: a branch that moves on after its review leaves the queue (`moved`) for the lead to review it again. A head that conflicts or fails verify goes back to its lane. A merged lane's worktree is removed when it holds nothing uncommitted. Where `branches.publish` is set, each merge then reaches the remote's base: pushed, or, where the remote only takes pull requests, as one code-kit opens and (where you delegate pushing) merges. A story's branch merges only into the base, through the queue: an agent's `git merge` of it into any other branch (an integration branch such as `lead/next`) is refused, since the story would look unmerged and its worktree would never be cleaned up. The pane lists the queue, and lanes whose branch waits in it read `queued`.
363
+ - **The reviewer agent**, with `harness.agents.reviewer.on`: a second, independent read of each finished branch, so the lead isn't the only one checking its own lanes' work, without holding the lead up. A finished branch is first reviewed in the background by code-kit's reviewer agent, which the lead starts: it runs `verify` and the review checklist, read-only, and grades each finding blocker, concern or nit. The lead's review prompt then carries the findings, and a blocker means the branch is sent back. The pane shows each review, running with its clock or what it found. If the reviewer hasn't reported within 15 minutes, or the plan's 5-hour use is past `harness.background.pauseAtPercent`, the lead reviews without it.
364
+ - **The merge queue** (`code-kit queue`). A branch the lead's review passes joins the queue. Branches merge one at a time, in the order they passed, each verified against the base as it is then: the lead merges where `approvals.delegate.merge` is on under `autonomous`, otherwise the band shows the head with **Merge** for you. Who may merge is read from the config committed on the base, so a branch can't grant itself merges. The queue records the commit each review passed, and merges exactly that commit: a branch that moves on after its review leaves the queue (`moved`) for the lead to review it again. A head that conflicts or fails verify goes back to its lane. A merged lane's worktree is removed when it holds nothing uncommitted. Where `branches.publish` is set, each merge then reaches the remote's base: pushed, or, where the remote only takes pull requests, as one code-kit opens and (where you delegate pushing) merges. A story's branch merges only into the base, through the queue: an agent's `git merge` of it into any other branch (an integration branch such as `lead/next`) is refused, since the story would look unmerged and its worktree would never be cleaned up. The pane lists the queue, and lanes whose branch waits in it read `queued`. Some branches break the base when merged alone, such as a new API and the change that updates its callers: the lead queues them together with `code-kit queue add <branch> --with <branch>`, and the group waits until every member has passed review, is verified as one tree, and merges together. When a group fails, what's down to one member (it doesn't merge onto the base, or breaks its own lane's rules) sends that member back alone, and its partners keep their places and their reviews until its fix rejoins; only a failure of the merged tree's checks sends the whole group back, since nothing says which member caused it. A check that couldn't run (its tool isn't installed, an install failed, a run ran out of time) says nothing against a branch, so the branch keeps its place. One merge runs at a time, whichever session starts it.
353
365
  - **After a crash.** Every agent's tool calls are recorded before and after they run, per story, in `.claude/state/events/` (paths, commands, results and commits; never file contents or prompts, and never sent anywhere). When a session or an agent stops mid-story, `next` checks each call left open against git before it chooses any work: a commit or a merge that happened is recorded as done, an edit or a test can simply run again, and a command that can't safely run twice and that git can't settle (a migration, a deploy) goes to the lead to find out, never run again on its own. The fresh agent that carries the story on is briefed from the log (`code-kit replay <story> --brief`), even when the stopped one wrote no report, and lanes commit after each step whose tests pass, so a crash loses at most one step. A merged story's log goes 30 days after it merges.
354
366
  - **The first merge.** There's none for you: setting up commits the rules you approved straight onto the base, and in a project set up before that, the lead puts them there itself (`code-kit queue rules`) before its first merge.
355
367
 
356
368
  ### The pane
357
369
 
358
- **`/lanes`** opens it; `/lanes` again, or Escape, closes it. It stays current within 2 seconds of a commit, a branch change, a plan edit or an agent starting or stopping. It's one page of panels with no tabs, each starting with a status line (its name, its state in a word or two, a count at the right), and a panel with nothing to say takes no room:
370
+ **`/lanes`** opens it; `/lanes` again, or Escape, closes it. It stays current within 2 seconds of a commit, a branch change, a plan edit or an agent starting or stopping. It's one page of panels with no tabs, each starting with a status line (its name, its state in a word or two, a count at the right), and a panel with nothing to say takes no room. With an invalid config, the pane says so in one line, with `code-kit check` to see why, and draws no lanes until it's fixed:
359
371
 
360
372
  - **Build**: is the build moving? The milestone being built and a bar of its requirements by state, counted from the trail: tested, built but untested, in progress and todo, each its own glyph and colour, with the counts beside it ("Milestone 3: Booking · 9 of 14 tested · 3 untested"). A milestone whose stories are all merged with requirements untested says untested, not done. Beneath it, the loop's next step, with **Pause** or **Resume** on **p**.
361
373
  - **Needs you**: everything waiting on you, and only here in the pane, most urgent first. The first is open with its story, what it's for and its buttons; the rest are a line each, and choosing one opens it in its place. **Why…** shows its full card: what you asked for, the story and its requirements, what was happening, what's already settled, why the lead couldn't settle it, and each option with what it does.
362
- - **Lanes**: where each story is. Each lane at work is a card, the lead's first: its character, the story, its state, its agent's current tool with a clock (amber once quiet, red when stalled), its tokens, and two small pictures. Its **trail**: a cell per requirement the story cites, coloured as in the Trail, so you see coverage grow as it moves. Its **map**: a chip per layer its changed files are in, red while a layer rule or another refusal is unresolved there, amber where a changed file's Context Graph card isn't written or is out of date. A card also says the background review's state, a note from the loop (nudged, restarted, stalled) and, with Context Graph, edits made without understanding. Lanes with nothing at work fold into one line ("resting: api, data, qa"). When the cards don't fit, the lanes are swimlanes on a shared time axis, a line each.
374
+ - **Lanes**: where each story is. Each lane at work is a card, the lead's first: its character, the story, its state, its agent's current tool with a clock (amber once quiet, red when stalled), its tokens, and two small pictures. Its **trail**: a cell per requirement the story cites, coloured as in the Trail, so you see coverage grow as it moves. Its **map**: a chip per layer its changed files are in, red while a layer rule or another refusal is unresolved there, amber where a changed file's Context Graph card isn't written or is out of date. A card also says the background review's state, a note from the loop (nudged, restarted, stalled) and, with Context Graph, edits made without understanding. Lanes with nothing at work fold into one line ("resting: api, data, qa"). When the cards don't fit, the lanes are swimlanes on a shared time axis, a line each. Beneath the lanes, the stories ready to start, each with its lane, the lead's own named as such.
363
375
  - **Queue**: the merge queue while it isn't empty: each branch, its story, the commit its review passed and its state, and what it merged or sent back lately, and why.
364
376
  - **Log**: the build's latest events, a line each ("14:02 ✓ ST-4 merged · web"), yours in yellow.
365
377
 
@@ -380,7 +392,7 @@ The pane has three layouts: inline above the prompt when the terminal can't dock
380
392
  ### Other views
381
393
 
382
394
  - **Refusals** a code-kit hook gives an agent are drawn as cards: what was refused, the rule, what to do, and Approve… where your approval would allow it. The full text is a press away.
383
- - **`/harness`** opens the harness settings: how the lead loop acts, how long a call waiting on your approval is held, when a stalled lane is nudged and restarted, the reviewer agent and its model, the lane agents' model, the use at which background agents pause, and whether agents draft bug reports for code-kit. Changing one asks your reason, writes `.claude/code-kit.json` and logs a `kit` approval. Lanes, paths and rules still change through `/code-kit:init`.
395
+ - **`/harness`** opens the harness settings: how the lead loop acts, how long a call waiting on your approval is held, when a stalled lane is nudged and restarted, the reviewer agent and its model, the lane agents' model, the use at which background agents pause, and whether agents draft bug reports for code-kit, and, in its Approvals section, who decides each approval. Changing one asks your reason, writes `.claude/code-kit.json` and logs a `kit` approval. Lanes, paths and rules still change through `/code-kit:init`.
384
396
  - **`/approvals`** lists the approvals waiting (one per approval and lane, with every file it covers), the approvals in force with minutes left, and every approval given, newest first: who gave it (you, or the lead within your delegated rules), its reason, and the files and branches it covered, merged or not. A request stops waiting once an approval is given for it, or its file is committed by someone who could; a read-only agent such as the reviewer never asks.
385
397
  - **`/verify-branch`** runs `code-kit verify` on this branch. Neither it nor `/approvals` calls the model.
386
398
 
@@ -395,6 +407,7 @@ Once init has switched the rules on, the lead runs the build in a loop:
395
407
  /code-kit:decide # decide what lanes asked for: approve, offer something better, or bring it to you
396
408
  /code-kit:review ST-12 # check a finished branch, then merge or send it back
397
409
  /code-kit:status # where the build stands against the spec
410
+ /code-kit:design # design a design story's screens with you, before any is built
398
411
  /code-kit:promote # with streams: decide what goes into core, from what two streams share
399
412
  ```
400
413
 
@@ -402,12 +415,13 @@ Once init has switched the rules on, the lead runs the build in a loop:
402
415
  - **Decide** takes what a lane asked for and couldn't do itself: a package, a migration, a protected file, a UX question. The lead judges it against the story's requirements, the spec, the principles and the architecture, and approves it, tells the lane what to use instead, or brings it to you when it crosses a guardrail. See [Who decides what](#who-decides-what).
403
416
  - **Review** runs `verify` on the branch, then checks each requirement: built end to end, proved by a test, matching the spec-check report, and nothing beyond the story. It ends with merge, send back with the list of problems, or a question for you.
404
417
  - **Status** traces every requirement to its story, branch and tests. It shows what's done, in review, ready and blocked, which requirements no test names, and where the plan's status lines are out of date.
418
+ - **Design** works a design story's screens through with you, in the project's design tool (Paper, Figma, Pencil) or as HTML under `design/`. A lane has no connection to the design tool and used to build screens from the spec's words, so as you approve each screen it exports every state into `design/<area>/<screen>/<state>` (the tool's code and a PNG) and records them, with their hashes, in the design register the design gate reads. The screen's lane is briefed with those files, and the review compares each built state with its design. A register entry that names only an artboard doesn't open the gate: `code-kit next` names such entries, and `/code-kit:design --hand-over` exports them once you confirm each is still the approved design (spec 24).
405
419
 
406
420
  ## Several sessions in one project
407
421
 
408
422
  You can open several Claude Code sessions in one project: one building the plan, others auditing, checking merges or looking into something ad hoc. code-kit treats each session as a member of the team, as it treats each developer in a team:
409
423
 
410
- - **One lead session.** The loop runs there, and the plan's stories are dispatched from it. The first session to start leads; one started while it's open is a working session. When the lead session ends, no other takes over by itself: the next session to start leads, or you choose one with **Lead from here** or `/code-kit:lead`. `code-kit who` says which this session is.
424
+ - **One lead session.** The loop runs there, and the plan's stories are dispatched from it. The first session to start leads; one started while it's open is a working session. When the lead session ends, no other takes over by itself: the next session to start leads, or you choose one: type `/code-kit:lead` in the session you want, and it leads from that moment (or use **Lead from here** in its band). An agent can't move the lead itself; typing the command is your choice. `code-kit who` says which this session is.
411
425
  - **Working sessions stay quiet.** Their band shows only their own: their refusals and held calls, their lead's questions, their task. No loop prompts, no other session's decisions or notifications. Every rule still applies.
412
426
  - **Ad hoc work records a task.** A working session records what it's doing before it changes code, with the paths it'll change: `code-kit task "Integration readiness" --touches "src/integrations/**"`. The task leases those paths: another session's agents writing there are refused, naming the session and its task. `code-kit sessions` lists the sessions and their tasks; `task done` ends one, and `task take <session>` moves a task whose session ended to yours.
413
427
  - **Each in its own worktree.** A working session that changes code works in a worktree of its own (`claude --worktree`); its writes in the main checkout are refused, so its uncommitted files never block another session's git. Where git does refuse because of another session's uncommitted files, code-kit says whose they are.
@@ -419,19 +433,30 @@ Spec: `docs/specs/23-the-team.md`.
419
433
 
420
434
  One product in one repository can have separate product lines (offerings for different users, each with its own roadmap) built by separate squads, or sessions, at once. Declare them as `streams` in the config, and the project is built as a modular monolith: per technical layer, a **core** the streams share and a **module** per stream.
421
435
 
422
- - **A lead per stream.** Each stream has its own lead session, plan file, specs and lanes, and they lead at once: `/code-kit:lead <stream>`. Each lead's loop and `code-kit next` give it only its own stream's stories, and it writes only its own stream's plan and specs. The first lead works in the main checkout, the others in a worktree each, on `lead/<stream>`.
436
+ **Why.** Without streams a project has one lead, one plan and lanes cut by technical layer. Two sessions meant for two product lines fight over the lead, the lead's loop hands each the other line's stories, and one line's API story holds the API lane while the other line's waits. Streams add the second axis, the product line (Team Topologies' stream-aligned teams, with a platform team owning what they build on), so each line moves at its own pace while the code stays one codebase, and what the lines share is built once, in core.
437
+
438
+ - **A lead per stream.** Each stream has its own lead session, plan file, specs and lanes, and they lead at once: type `/code-kit:lead <stream>` in the session that should lead it. Each lead's loop and `code-kit next` give it only its own stream's stories, and it writes only its own stream's plan and specs. The first lead works in the main checkout, the others in a worktree each, on `lead/<stream>`.
423
439
  - **Streams kept apart.** A layer with `stream` is that stream's module; one without is core. A module may import core and its own stream's modules, never another stream's, and core never imports a module: the hooks refuse both, and the refusal says to ask for it in core rather than copy it.
424
440
  - **Core has one owner.** A stream with `platform: true` owns core's lanes: the other streams ask it for changes with `code-kit core ask "<what>" --story ST-n`, and their story waits on its decision. Without a platform stream, core's lanes are in no stream, and the streams take them in turns.
425
- - **Shared capability noticed.** code-kit raises a candidate for core when it sees the same code in two streams' modules (names aside), an import of another stream's module refused, a copy into a module, module code that repeats core, or a requirement another stream's spec already has. `code-kit promote` lists them; the platform's lead decides each (`/code-kit:promote`), and a promotion is a platform story. Set `harness.promote.coreClones` to `refuse` and verify refuses a branch whose module code repeats core's.
426
- - **Project-wide still.** One merge queue, one approval log, one set of standards and checks.
441
+ - **Shared lists take additions from any stream.** Some core files are lists every stream's stories add to: an allow-list of routes, a catalogue of narration lines, a registry. Asking core for each new entry costs a core story, a core lane and a merge together for one line, and holds the stream's story meanwhile. Name such a file a shared list in `anyActor`, with `"adds": true` and its owner as reviewer: `{ "glob": "services/api/tests/allowed_routes.py", "reviewer": "api", "adds": true }`. Any lane then adds its entries in its own branch. Changing or removing an entry already there is still the owner's: the edit is refused as it's made, and `verify` refuses a branch that does it, saying to ask core.
442
+ - **Shared capability noticed.** code-kit raises a candidate for core when it sees the same code in two streams' modules (names aside), an import of another stream's module refused, a copy into a module, module code that repeats core, or a requirement another stream's spec already has. `code-kit promote` lists them; the platform's lead decides each (`/code-kit:promote`), and a promotion is a platform story. Module code that repeats core's is its own stream's lead's to decide, since switching to core's is the module's work. To keep the list to what's worth a lead's time, a clone is one candidate per pair of files, tests are left out (they repeat their setup by nature), it takes 100 tokens alike by default (`harness.promote.tokens`), and a scan of the whole project (`code-kit promote scan`) withdraws open clones it no longer finds. Set `harness.promote.coreClones` to `refuse` and verify refuses a branch whose module code repeats core's.
443
+ - **Each lead sees its own stream.** In the mod, a stream's lead sees its stream's build: the Build panel's milestone and bar, the Lanes panel (its lanes and the shared core lanes), what's ready, and the Trail are its own, and each says the stream ("Lanes: play"). The other streams are a line each, with who leads them and what their lanes are on, and the shared core lanes a line with whose turn it was. A session that leads nothing offers each stream to lead from here, with **Lead `<stream>`**. The Code map labels each layer core or its stream's module.
444
+ - **Project-wide still.** One merge queue, one approval log, one set of standards and checks. The queue is every stream's, so it doesn't wait on one session: the lead in the main checkout merges its head first, and any other stream's lead merges it whenever its own stream has only waiting to do. A stream's lead keeps its own worktree after its `lead/<stream>` branch merges.
427
445
 
428
446
  A project without `streams` is one stream holding every lane, and works as before. `spec-design` and `init` ask once whether the product has separate product lines, and only then lay out core and modules.
429
447
 
448
+ **Turning streams on in a project that started as one:**
449
+
450
+ 1. Run `/code-kit:init`. When the brief, specs or plan name more than one product line, it asks whether separate squads or sessions build them (or tell it so). On a yes it drafts `streams`, a lane per line in each technical layer, a module layer per line, and a plan file per stream under `docs/plan/`, and shows the difference before anything is enforced.
451
+ 2. Where the code isn't split into core and modules yet, init doesn't move it: it writes the move as stories, lower layers first, a few files each. Until a story moves a file, it stays with the lane that owns it today.
452
+ 3. Open a session per stream and type `/code-kit:lead <stream>` in each. The first leads from the main checkout; each other one is told to lead from a worktree of its own on `lead/<stream>` and moves itself there (or start it with `claude --worktree`). Its writes in the main checkout are refused until it does.
453
+ 4. `code-kit streams` lists the streams, their lanes and leads; `code-kit who` says which stream this session leads.
454
+
430
455
  Spec: `docs/specs/31-streams-and-platform.md`.
431
456
 
432
457
  ## Teams (preview)
433
458
 
434
- For several people in one repository, each with their own agents. Not every developer works in a team, so it's off until you set it up: `/code-kit:init` asks whether others work in the repository, and `/code-kit:team-init` sets the team up (or changes it, or takes it out) at any time, asking for the tech lead and each lane's owners and showing what it writes first. Everything goes through GitHub; there's no server:
459
+ For several people in one repository, each with their own agents. Without it, two developers' agents can take the same story or edit the same files, and work drifts from what the team agreed until someone reads every branch by hand. Teams add who owns what, who's working on what right now, and what was agreed. Not every developer works in a team, so it's off until you set it up: `/code-kit:init` asks whether others work in the repository, and `/code-kit:team-init` sets the team up (or changes it, or takes it out) at any time, asking for the tech lead and each lane's owners and showing what it writes first. With GitHub as the provider (the default) everything goes through GitHub, with no server:
435
460
 
436
461
  - **Owners and claims.** A lane's owners are the only ones whose agents work it. Making a story's branch claims the story, through a ref in the shared repository, so two people can't both take it. The lead says what files the story will change (`team claim --lease`), and each commit adds what it changed; another person's agent editing a leased file is refused with who holds it. A story that carries out an intent says so on its claim (`team claim --intent`).
437
462
  - **Drift holds a merge.** With a hosted provider that checks each push for drift, and whose setting says what blocks a merge (a finding against a spec or decision, any finding, or nothing), the merge queue holds a branch while it has an open finding at that level. `queue`, `queue merge` and `next` say which finding, that the tech lead decides, and how it clears: resolved on the provider, or a push the drift check no longer finds conflicting. GitHub alone checks no drift, so it never holds; a provider that can't be reached holds nothing, and code-kit says so.
@@ -439,7 +464,8 @@ For several people in one repository, each with their own agents. Not every deve
439
464
  - **Since you last looked.** `code-kit team since` says, by person, what was pushed, opened, merged, reviewed, claimed and intended. The Team pane shows it.
440
465
  - **`/team`** opens the Team pane: the tech lead, who you are, and what coordinates the team (GitHub, or a hosted provider, and whether it's live). Its tabs: **People**, each person with their lanes, where they're at work (with a live provider), claims, pull requests and intents; **Since you looked**; **Claims**, with Keep and Release on yours, and Release and Reassign for the tech lead; **Intents**, with Agree and Drop for the tech lead; **Drift**, when the provider checks for it; and **Setup**, the team's config and what GitHub still needs.
441
466
  - **Stale claims** (nothing pushed for three working days) are flagged, never released on their own: the holder keeps or releases it, and the tech lead can reassign it.
442
- - **GitHub does its part.** `code-kit team codeowners --write` writes CODEOWNERS from the config, and `"board": { "owner", "number" }` mirrors the plan onto a GitHub Project.
467
+ - **GitHub does its part.** `code-kit team codeowners --write` writes CODEOWNERS from the config, and `"board": { "owner", "number" }` mirrors the plan onto a GitHub Project. Writing to the board needs the `project` permission on your `gh` sign-in (`gh auth refresh -s project`).
468
+ - **When GitHub can't be reached**, claims and leases can't be checked, and code-kit says so; every local rule still holds. A hosted provider with `fallback: "github"` hands its operations to GitHub while it's down.
443
469
 
444
470
  It's a preview: it's tested end to end against a stand-in for GitHub, and has been run once against a real private repository (claims, leases, intents as discussions, decision records, since-you-last-looked and the Project board). Spec: `docs/specs/16-teams.md`.
445
471
 
@@ -516,7 +542,7 @@ code-kit cost [--json] # each environmen
516
542
  code-kit decisions [--json] [--all] # what waits on you in this session, and a count in each other one; --all lists every session's
517
543
  code-kit who # which session this is, whether it leads the project, and its task
518
544
  code-kit sessions [--json] # the sessions working the project, which one leads, and each one's task
519
- code-kit sessions lead [stream] # make this session the lead, or its stream's lead (the person's own act, as Lead from here)
545
+ code-kit sessions lead [stream] # make this session the lead, or its stream's lead (the person's own act: /code-kit:lead runs it as they send it)
520
546
  code-kit sessions stream <name> # a working session joins a stream (the person's own act)
521
547
  code-kit streams [--json] # the project's streams: each one's lanes, plan and lead, and the core lanes they share
522
548
  code-kit core [--json] # change requests to core; core ask "<what>" --story ST-n asks the platform, core accept <id> --story ST-n | core decline <id> --reason "…" decides
@@ -568,39 +594,39 @@ code-kit approve <name>... --reason "…" [--lane name] [--delegated [--story ST
568
594
 
569
595
  `.claude/code-kit.json`. Globs use `*` (one segment), `**` (any depth), `**/` (zero or more folders), `?` and `{a,b}`. Patterns under `shell` are regular expressions.
570
596
 
571
- | Field | Required | What it is |
572
- | ------------------------------ | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
573
- | `version` | yes | `1` |
574
- | `docs.specs` | no | Folder of specs. With it, a lane needs a spec-check report before writing code on a branch |
575
- | `docs.principles`, `docs.plan` | no | The engineering principles and the implementation plan |
576
- | `docs.costs` | no | The cost register (spec 29), default `docs/costs.md`: one table, `\| Item \| Provider \| Environment \| Size \| Monthly \| Basis \|`, a row per paid thing with its monthly estimate as a number and where the price came from, dated. Any agent may write it once `cost` is set |
577
- | `docs.decisions` | no | Where agreed intents are recorded as numbered decision records (`code-kit intend record`); default `docs/decisions` |
578
- | `docs.standards` | no | The project's standards (spec 22), default `docs/standards.md`: each a `### <id> <title>` heading with `level` (required or recommended), `applied` (enforced, checked or advice), `layers`, `why`, `source` and, when enforced, `enforced by` naming the layer rule, protected path, check or shell rule that refuses a breach. The id's prefix is its category: `PRI-` principles, `PAT-` patterns, `ARC-` architecture, `CON-` conventions, `POL-` policies. Each lane agent is given the ones for its layers; a refusal from an enforcing rule names the standard; reviews check the checked ones. Protect the file with the `standards` approval: removing a standard, or weakening a required one, always needs the person's, whatever is delegated |
579
- | `lead.paths` | yes | What the main session writes. `.claude/**` and `.mcp.json` are always added. |
580
- | `lead.outside` | no | Paths outside the repository the lead may write, e.g. `../shared-lib/**`. Claude's memory is always included, and the session's own folder in Claude Code's temporary folder (`/tmp/claude-<uid>/<project>/<session id>/`: its scratchpad and tool output), which the lanes may write too; another session's isn't. |
581
- | `anyActor` | no | Paths every writer may change (e.g. the lockfile), read-only agents included. `.claude/state/**` is always included. An entry may be `{ "glob", "reviewer" }` to name the lane (or `"lead"`) that reviews changes to it; otherwise the lead reviews them, and `who` and `trace` say so. |
582
- | `streams` | no | Spec 31: `{ "<name>": { lanes, plan, specs?, platform?, label? } }`, the product lines built at once, each with its own lead session. `lanes` are the stream's (each lane in one stream; a lane in none is a core lane the streams share in turns); `plan` its plan file or folder, inside `docs.plan`; `specs` the spec files it builds (globs); `platform: true` makes the stream the owner of core, and then every lane must be in a stream. Leave it out for one product line. |
583
- | `lanes.<name>` | yes (may be `{}`) | `{ agent, paths, exclude?, owners?, label? }`: the agent name maps a subagent to its lane; `label` names what the lane delivers ("Screens", "API contract"; one line, at most 60 characters), for a team provider's report, and is otherwise taken from the lane's name; `owners` (GitHub handles) are the people whose sessions work it, in a team (needs `team`). A worktree with a `.lane` file holding the lane name makes the main session that lane. |
584
- | `protected[]` | no | `{ glob, approval, why }`: logged on every commit. Anyone but the lead needs an approval: the lead's where `approvals.delegate.protected` names it, otherwise a person's (see [Approvals](#approvals)). `.claude/**` is always protected as `kit`. |
585
- | `designGate` | no | `{ register, screens: [{ glob, not? }], howTo }`: screen files wait until the register (`{ "screens": [{ "file": … }] }`) holds their exported designs; an entry naming only a design tool's artboard doesn't open the gate. Init sets it for every lane that owns screens; `/code-kit:design` adds approved designs |
586
- | `layers[]` | no | `{ name, paths, mayImport, denyPackages?, label?, stream? }`: the first layer whose paths match a file owns it. A layer may always import itself. With `streams`, `stream` makes the layer that stream's module: it may import core and its own stream's layers, never another stream's, and a layer without `stream` (core) may import no module, whatever `mayImport` says. `label` names what the layer delivers ("Data", "Service"; one line, at most 60 characters), for a team provider's report, and is otherwise taken from the layer's name. |
587
- | `importAliases` | no | `{ "@app/domain": "packages/domain/src" }`: resolves non-relative imports to repository paths |
588
- | `shell.block[]` | no | `{ pattern, why, person?, command? }`: never run. `person: true` marks a person's act, which the lead may do for them with `approvals.lead` on. `command: true` matches the pattern from the start of each command the line runs (after a package runner such as `npx` or `pnpm exec`, and inside `sh -c` or `eval`), with quoted text masked unless the pattern has quotes, so a grep, a heredoc or a message that mentions it isn't refused. Without it the pattern reads the whole line, except a read's quoted arguments: `grep "<command>" docs` doesn't run it |
589
- | `shell.restricted[]` | no | `{ pattern, lanes, why }`: only the lead and these lanes. A read's quoted arguments don't count, as for `shell.block` |
590
- | `postEdit[]` | no | `{ files, exclude?, run }`: after each edit of a matching file. `{file}` is the file. Exit 127 (tool not installed) is skipped. |
591
- | `tests[]` | no | Globs naming the test files, in place of the conventions, for every rule that asks what a test is: weakened tests, a fix's tests, the tests that name a requirement, the code map and the security review. Default: a file named as a test (`*.test.*`, `*.spec.*`, `*.smoke.*`, `test_*.py`, `*_test.go`, `*_test.py`) or in a test folder (`test/`, `tests/`, `__tests__/`, `e2e/`, `smoke/`). Proving a fix keeps the files named as tests and takes the rest back, test-folder helpers included; with `tests` set, the files it names are the ones kept. |
592
- | `regression.prepare` | no | A command run in a fresh checkout before a fix's tests run there without the fix, such as `npm ci`. The checkout's `node_modules` and virtualenvs are copied in first (a copy-on-write clone where the disk has one), so it can't change the checkout's own. The merge queue runs it too, in the merged tree's checkout, when its manifests or lockfiles differ from the installs copied in; without it, the queue runs the install the lockfile calls for. |
593
- | `checks[]` | no | `{ name, files, exclude?, run[], each?, owners?, ifMissing?, timeoutSeconds? }`: before finishing, when matching files changed. `each` runs the commands in every changed folder matching that glob. `owners` limits who may change the files (the lead always may). `ifMissing: "fail"` makes a missing tool an error (the default is to skip the check, which `verify` and a merge list as not run). `timeoutSeconds` (240 unless set) is how long each command may run; one that runs out of time leaves its branch at the head of the merge queue rather than sending it back. |
594
- | `adapters` | no | `{ "<adapter>": false }` switches off an adapter that would otherwise be detected; `true` says the project wants that tool, so until it's set up here `next` gives its setup before any code. See [Adapters](#adapters). |
595
- | `approvals.lead` | no | `true` lets the lead act on what the person says in chat, for when `!` isn't available (on a phone, say): it records their approvals with `code-kit approve`, and runs `shell.block` commands marked `person`. Default `false`. See [Approvals](#approvals). |
596
- | `approvals.delegate` | no | `false`, or `{ protected?: [approval names], merge?: true, push?: true, tests?: true, dependencies?: { licences?, minWeeklyDownloads?, maxMonthsSinceRelease?, allowInstallScripts?: true \| false \| [kinds] } }`: what the lead decides, inside the guardrails you keep: the protected approvals it grants, and packages it approves for a story, with `code-kit approve --delegated`; with `merge`, merges into a protected branch with `code-kit merge --delegated`; with `push`, pushes the protected branch, never by force (yours unless you set it, since a push can deploy; read from the config committed on that branch); with `tests`, weakened tests on a lane's branch. Left out, the lead decides everything technical: every protected approval but `spec`, `design`, `ci` and `kit`, packages, merges and weakened tests (WHO-1); `false` keeps everything for you. Lanes ask the lead for these, never you. npm packages are also checked against the npm registry, and a Python lane's against PyPI; the defaults are MIT, Apache-2.0, BSD and ISC, 10,000 weekly downloads, a release within 18 months, and no install scripts. See [Approvals](#approvals). |
597
- | `setup` | no | The version of init's setup the project has (3 now). Without it, or lower, `next` names what the project is missing (the design gate, design stories before screens, a QA lane, a security reviewer) and starts no new story until re-running init adds it |
598
- | `cost` | no | The running budget (spec 29): `{ currency, monthly, load?, paths? }`. `currency` is a three-letter code (USD, AUD, EUR); `monthly` maps each environment (`prod`, `dev`, …, not `all`) to what it may cost a month; `load` says in words what the budget plans for; `paths` are the infrastructure files, whatever defines them, and a branch that changes one changes the register too. A commit that takes an environment past its budget needs the person's `cost` approval, whatever is delegated |
599
- | `team` | no | Preview. For several people in one repository: `{ techLead, staleDays?, intents?, board?, provider?, report? }`. `techLead` is the GitHub handle of the person who owns the plan, specs and contracts; `staleDays` is how many working days without a push make a claim stale (default 3); `intents` is the discussion category intents go in (default `Intents`; create it once in the repository's Settings › Discussions); `board` is `{ owner, number }`, a GitHub Project the plan is mirrored onto; `provider` is `"github"` (default), `{ command, fallback? }` for another team provider, or, in preview, a hosted provider's adapter as `{ "<name>": "<https address>" }`, which keeps the intents (Discussions only when `intents` is set) and has GitHub as its fallback; with `fallback: "github"`, claims go through GitHub whenever that provider can't be reached; `report` (default true) is whether the project reports its facts (stories' stages, send-backs, the requirement trail, the specs' titles and outcome lines, approvals, token use, the rules, the design register and the sessions at work; never code) to a provider that isn't GitHub. A provider may also supply an organisation's standards (`standards`, answering `{ standards, waivers, version }`, each standard in `docs.standards`' fields, each waiver `{ standard, paths?, expires?, reason?, approvedBy? }`): they apply as if in the project's file, which may extend or tighten one but weaken a required one only under a waiver. See docs/specs/16-teams.md, docs/specs/21-hub-adapter-and-reports.md and docs/specs/22-standards.md. |
600
- | `branches.protected` | no | Default `["main", "master"]` |
601
- | `branches.publish` | no | How a merge reaches the remote's base: `push` (the base is pushed, fast-forward only) or `pull-request` (for a base the remote only lets change through pull requests: code-kit opens one from `code-kit/publish-<base>` after each merge, and merges it where `approvals.delegate.push` is on, otherwise it waits for you). Left out, code-kit leaves pushing the base to you |
602
- | `execution.unrepeatable` | no | Patterns (regular expressions) for commands that can't safely run twice, such as a seed or a deploy. With migrations, the commands `shell.block` and `shell.restricted` name, and `git push`, an interrupted one is never run again on its own after a crash: the lead finds out what happened first (spec 26) |
603
- | `harness` | no | What the mod's harness does in the session: `autonomy` (`autonomous`, `propose`, `off` or `vibe`; default `autonomous`; `vibe` is autonomous with every decision the lead's, see [Vibe](#vibe)), `loop.quietMinutes` (while you talk with the lead about something else, how long the loop waits after you last spoke, 0 to 120; default 10), `loop.check` (check each step against the project before the lead is prompted with it; default `true`), `hold.minutes` (how long a call waiting on your approval is held, 0 to 10; default 2), `stall.nudgeMinutes` and `stall.restartMinutes` (default 5 and 10), `stall.maxRestarts` (default 2), `agents.reviewer.on` (default `false`) and `agents.reviewer.model` (code-kit's reviewer and the security reviewer; default `sonnet`), `agents.lanes.model` (the model each lane agent starts on, unless the lead's call or the lane's agent file names one: a model, or `story` for each story's `**Size:**` in the plan, raised for security requirements, fixes and send-backs; default the session's), `slices.open` (how many of the plan's slices are in focus: a free lane builds an open slice's stories first; default 1), `promote.tokens` (with `streams`, how many tokens of code alike, names aside, make a clone a candidate for core; default 60) and `promote.coreClones` (what verify does with module code that repeats core's: `note` or `refuse`; default `note`), `background.pauseAtPercent` (default 80), `compact.at` (compact the lead's context between turns once it's past this share of its window; default 40, 0 for never), `compact.milestone` (when a milestone finishes, compact the lead's context: `ask`, `auto` or `off`; default `ask`), `agents.lanes.contextLimit` (the context a lane agent may reach before it hands its story to a fresh agent; default 250,000 tokens), `notify.on` (a system notification when something new needs you; default `true`), `motion` (whether the pane's characters, clocks and the lead's rail move while work flows: `while-active` or `off`; default `while-active`) and `report.on` (agents draft bug reports for code-kit, which you send or discard; default `false`). Change them with `/harness` or `code-kit settings set`. |
597
+ | Field | Required | What it is |
598
+ | ------------------------------ | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
599
+ | `version` | yes | `1` |
600
+ | `docs.specs` | no | Folder of specs. With it, a lane needs a spec-check report before writing code on a branch |
601
+ | `docs.principles`, `docs.plan` | no | The engineering principles and the implementation plan |
602
+ | `docs.costs` | no | The cost register (spec 29), default `docs/costs.md`: one table, `\| Item \| Provider \| Environment \| Size \| Monthly \| Basis \|`, a row per paid thing with its monthly estimate as a number and where the price came from, dated. Any agent may write it once `cost` is set |
603
+ | `docs.decisions` | no | Where agreed intents are recorded as numbered decision records (`code-kit intend record`); default `docs/decisions` |
604
+ | `docs.standards` | no | The project's standards (spec 22), default `docs/standards.md`: each a `### <id> <title>` heading with `level` (required or recommended), `applied` (enforced, checked or advice), `layers`, `why`, `source` and, when enforced, `enforced by` naming the layer rule, protected path, check or shell rule that refuses a breach. The id's prefix is its category: `PRI-` principles, `PAT-` patterns, `ARC-` architecture, `CON-` conventions, `POL-` policies. Each lane agent is given the ones for its layers; a refusal from an enforcing rule names the standard; reviews check the checked ones. Protect the file with the `standards` approval: removing a standard, or weakening a required one, always needs the person's, whatever is delegated |
605
+ | `lead.paths` | yes | What the main session writes. `.claude/**` and `.mcp.json` are always added. |
606
+ | `lead.outside` | no | Paths outside the repository the lead may write, e.g. `../shared-lib/**`. Claude's memory is always included, and the session's own folder in Claude Code's temporary folder (`/tmp/claude-<uid>/<project>/<session id>/`: its scratchpad and tool output), which the lanes may write too; another session's isn't. |
607
+ | `anyActor` | no | Paths every writer may change (e.g. the lockfile), read-only agents included. `.claude/state/**` is always included. An entry may be `{ "glob", "reviewer" }` to name the lane (or `"lead"`) that reviews changes to it; otherwise the lead reviews them, and `who` and `trace` say so. With `"adds": true` it's a shared list: any lane adds entries to it, and only its owner changes or removes what's already there (see [Streams](#streams-several-product-lines-in-one-product)). |
608
+ | `streams` | no | Spec 31: `{ "<name>": { lanes, plan, specs?, platform?, label? } }`, the product lines built at once, each with its own lead session. `lanes` are the stream's (each lane in one stream; a lane in none is a core lane the streams share in turns); `plan` its plan file or folder, inside `docs.plan`; `specs` the spec files it builds (globs); `platform: true` makes the stream the owner of core, and then every lane must be in a stream. Leave it out for one product line. |
609
+ | `lanes.<name>` | yes (may be `{}`) | `{ agent, paths, exclude?, owners?, label? }`: the agent name maps a subagent to its lane; `label` names what the lane delivers ("Screens", "API contract"; one line, at most 60 characters), for a team provider's report, and is otherwise taken from the lane's name; `owners` (GitHub handles) are the people whose sessions work it, in a team (needs `team`). A worktree with a `.lane` file holding the lane name makes the main session that lane. |
610
+ | `protected[]` | no | `{ glob, approval, why }`: logged on every commit. Anyone but the lead needs an approval: the lead's where `approvals.delegate.protected` names it, otherwise a person's (see [Approvals](#approvals)). `.claude/**` is always protected as `kit`. |
611
+ | `designGate` | no | `{ register, screens: [{ glob, not? }], howTo }`: screen files wait until the register (`{ "screens": [{ "file": … }] }`) holds their exported designs; an entry naming only a design tool's artboard doesn't open the gate. Init sets it for every lane that owns screens; `/code-kit:design` adds approved designs |
612
+ | `layers[]` | no | `{ name, paths, mayImport, denyPackages?, label?, stream? }`: the first layer whose paths match a file owns it. A layer may always import itself. With `streams`, `stream` makes the layer that stream's module: it may import core and its own stream's layers, never another stream's, and a layer without `stream` (core) may import no module, whatever `mayImport` says. `label` names what the layer delivers ("Data", "Service"; one line, at most 60 characters), for a team provider's report, and is otherwise taken from the layer's name. |
613
+ | `importAliases` | no | `{ "@app/domain": "packages/domain/src" }`: resolves non-relative imports to repository paths |
614
+ | `shell.block[]` | no | `{ pattern, why, person?, command? }`: never run. `person: true` marks a person's act, which the lead may do for them with `approvals.lead` on. `command: true` matches the pattern from the start of each command the line runs (after a package runner such as `npx` or `pnpm exec`, and inside `sh -c` or `eval`), with quoted text masked unless the pattern has quotes, so a grep, a heredoc or a message that mentions it isn't refused. Without it the pattern reads the whole line, except a read's quoted arguments: `grep "<command>" docs` doesn't run it |
615
+ | `shell.restricted[]` | no | `{ pattern, lanes, why }`: only the lead and these lanes. A read's quoted arguments don't count, as for `shell.block` |
616
+ | `postEdit[]` | no | `{ files, exclude?, run }`: after each edit of a matching file. `{file}` is the file. Exit 127 (tool not installed) is skipped. |
617
+ | `tests[]` | no | Globs naming the test files, in place of the conventions, for every rule that asks what a test is: weakened tests, a fix's tests, the tests that name a requirement, the code map and the security review. Default: a file named as a test (`*.test.*`, `*.spec.*`, `*.smoke.*`, `test_*.py`, `*_test.go`, `*_test.py`) or in a test folder (`test/`, `tests/`, `__tests__/`, `e2e/`, `smoke/`). Proving a fix keeps the files named as tests and takes the rest back, test-folder helpers included; with `tests` set, the files it names are the ones kept. |
618
+ | `regression.prepare` | no | A command run in a fresh checkout before a fix's tests run there without the fix, such as `npm ci`. The checkout's `node_modules` and virtualenvs are copied in first (a copy-on-write clone where the disk has one), so it can't change the checkout's own. The merge queue runs it too, in the merged tree's checkout, when its manifests or lockfiles differ from the installs copied in; without it, the queue, and the fix check, run the install the lockfile calls for. |
619
+ | `checks[]` | no | `{ name, files, exclude?, run[], each?, owners?, ifMissing?, timeoutSeconds? }`: before finishing, when matching files changed. `each` runs the commands in every changed folder matching that glob. `owners` limits who may change the files (the lead always may). `ifMissing: "fail"` makes a missing tool an error (the default is to skip the check, which `verify` and a merge list as not run). `timeoutSeconds` (240 unless set) is how long each command may run; one that runs out of time leaves its branch at the head of the merge queue rather than sending it back. |
620
+ | `adapters` | no | `{ "<adapter>": false }` switches off an adapter that would otherwise be detected; `true` says the project wants that tool, so until it's set up here `next` gives its setup before any code. See [Adapters](#adapters). |
621
+ | `approvals.lead` | no | `true` lets the lead act on what the person says in chat, for when `!` isn't available (on a phone, say): it records their approvals with `code-kit approve`, and runs `shell.block` commands marked `person`. Default `false`. See [Approvals](#approvals). |
622
+ | `approvals.delegate` | no | `false`, or `{ protected?: [approval names], merge?: true, push?: true, tests?: true, dependencies?: { licences?, minWeeklyDownloads?, maxMonthsSinceRelease?, allowInstallScripts?: true \| false \| [kinds] } }`: what the lead decides, inside the guardrails you keep: the protected approvals it grants, and packages it approves for a story, with `code-kit approve --delegated`; with `merge`, merges into a protected branch with `code-kit merge --delegated`; with `push`, pushes the protected branch, never by force (yours unless you set it, since a push can deploy; read from the config committed on that branch); with `tests`, weakened tests on a lane's branch. Left out, the lead decides everything technical: every protected approval but `spec`, `design`, `ci` and `kit`, packages, merges and weakened tests (WHO-1); `false` keeps everything for you. Lanes ask the lead for these, never you. npm packages are also checked against the npm registry, and a Python lane's against PyPI; the defaults are MIT, Apache-2.0, BSD and ISC, 10,000 weekly downloads, a release within 18 months, and no install scripts. See [Approvals](#approvals). |
623
+ | `setup` | no | The version of init's setup the project has (3 now). Without it, or lower, `next` names what the project is missing (the design gate, design stories before screens, a QA lane, a security reviewer) and starts no new story until re-running init adds it |
624
+ | `cost` | no | The running budget (spec 29): `{ currency, monthly, load?, paths? }`. `currency` is a three-letter code (USD, AUD, EUR); `monthly` maps each environment (`prod`, `dev`, …, not `all`) to what it may cost a month; `load` says in words what the budget plans for; `paths` are the infrastructure files, whatever defines them, and a branch that changes one changes the register too. A commit that takes an environment past its budget needs the person's `cost` approval, whatever is delegated |
625
+ | `team` | no | Preview. For several people in one repository: `{ techLead, staleDays?, intents?, board?, provider?, report? }`. `techLead` is the GitHub handle of the person who owns the plan, specs and contracts; `staleDays` is how many working days without a push make a claim stale (default 3); `intents` is the discussion category intents go in (default `Intents`; create it once in the repository's Settings › Discussions); `board` is `{ owner, number }`, a GitHub Project the plan is mirrored onto; `provider` is `"github"` (default), `{ command, fallback? }` for another team provider, or, in preview, a hosted provider's adapter as `{ "<name>": "<https address>" }`, which keeps the intents (Discussions only when `intents` is set) and has GitHub as its fallback; with `fallback: "github"`, claims go through GitHub whenever that provider can't be reached; `report` (default true) is whether the project reports its facts (stories' stages, send-backs, the requirement trail, the specs' titles and outcome lines, approvals, token use, the rules, the design register and the sessions at work; never code) to a provider that isn't GitHub. A provider may also supply an organisation's standards (`standards`, answering `{ standards, waivers, version }`, each standard in `docs.standards`' fields, each waiver `{ standard, paths?, expires?, reason?, approvedBy? }`): they apply as if in the project's file, which may extend or tighten one but weaken a required one only under a waiver. See docs/specs/16-teams.md, docs/specs/21-hub-adapter-and-reports.md and docs/specs/22-standards.md. |
626
+ | `branches.protected` | no | Default `["main", "master"]` |
627
+ | `branches.publish` | no | How a merge reaches the remote's base: `push` (the base is pushed, fast-forward only) or `pull-request` (for a base the remote only lets change through pull requests: code-kit opens one from `code-kit/publish-<base>` after each merge, and merges it where `approvals.delegate.push` is on, otherwise it waits for you). Left out, code-kit leaves pushing the base to you |
628
+ | `execution.unrepeatable` | no | Patterns (regular expressions) for commands that can't safely run twice, such as a seed or a deploy. With migrations, the commands `shell.block` and `shell.restricted` name, and `git push`, an interrupted one is never run again on its own after a crash: the lead finds out what happened first (spec 26) |
629
+ | `harness` | no | What the mod's harness does in the session: `autonomy` (`autonomous`, `propose`, `off` or `vibe`; default `autonomous`; `vibe` is autonomous with every decision the lead's, see [Vibe](#vibe)), `loop.quietMinutes` (while you talk with the lead about something else, how long the loop waits after you last spoke, 0 to 120; default 10), `loop.check` (check each step against the project before the lead is prompted with it; default `true`), `hold.minutes` (how long a call waiting on your approval is held, 0 to 10; default 2), `stall.nudgeMinutes` and `stall.restartMinutes` (default 5 and 10), `stall.maxRestarts` (default 2), `agents.reviewer.on` (default `false`) and `agents.reviewer.model` (code-kit's reviewer and the security reviewer; default `sonnet`), `agents.lanes.model` (the model each lane agent starts on, unless the lead's call or the lane's agent file names one: a model, or `story` for each story's `**Size:**` in the plan, raised for security requirements, fixes and send-backs; default the session's), `slices.open` (how many of the plan's slices are in focus: a free lane builds an open slice's stories first; default 1), `promote.tokens` (with `streams`, how many tokens of code alike, names aside, make a clone a candidate for core, tests left out; default 100) and `promote.coreClones` (what verify does with module code that repeats core's: `note` or `refuse`; default `note`), `background.pauseAtPercent` (default 80), `compact.at` (compact the lead's context between turns once it's past this share of its window; default 40, 0 for never), `compact.milestone` (when a milestone finishes, compact the lead's context: `ask`, `auto` or `off`; default `ask`), `agents.lanes.contextLimit` (the context a lane agent may reach before it hands its story to a fresh agent; default 250,000 tokens), `notify.on` (a system notification when something new needs you; default `true`), `motion` (whether the pane's characters, clocks and the lead's rail move while work flows: `while-active` or `off`; default `while-active`) and `report.on` (agents draft bug reports for code-kit, which you send or discard; default `false`). Change them with `/harness` or `code-kit settings set`. |
604
630
 
605
631
  Add `.claude/approvals/`, `.claude/state/` and `.claude/code-kit.draft.json` to `.gitignore`, and `.claude/approval-log.jsonl merge=union` to `.gitattributes`, so merging branches that both logged changes keeps every entry. Commit `.claude/code-kit.baseline.json` if the project has one.
606
632
 
@@ -643,7 +669,7 @@ Every refusal that an approval would allow is recorded as a request in `.claude/
643
669
 
644
670
  ### Who decides what
645
671
 
646
- You're the product owner: you set the guardrails and decide what crosses them, which is the specs, the screens' visual design, CI and the pipelines, the kit, product questions the spec doesn't answer, and anything with production, cost or strategy implications. The lead is the technical lead and decides everything technical. With no `approvals.delegate`, that's the default: the lead approves packages within the registry rules, every protected change but `spec`, `design`, `ci` and `kit`, merges into the base (merging isn't releasing; your pipelines decide what reaches production), and weakened tests on a lane's branch after its review. `approvals.delegate` draws the line differently where you want it to: what it names is the lead's, the rest is yours, and `false` keeps everything for you. Change it in the Settings tab's Approvals section, or `code-kit settings set approvals.<name> lead|person --reason "…"`.
672
+ You're the product owner: you set the guardrails and decide what crosses them, which is the specs, the screens' visual design, CI and the pipelines, the kit, product questions the spec doesn't answer, and anything with production, cost or strategy implications. The lead is the technical lead and decides everything technical. With no `approvals.delegate`, that's the default: the lead approves packages within the registry rules, every protected change but `spec`, `design`, `ci` and `kit`, merges into the base (merging isn't releasing; your pipelines decide what reaches production), and weakened tests on a lane's branch after its review. `approvals.delegate` draws the line differently where you want it to: what it names is the lead's, the rest is yours, and `false` keeps everything for you. Change it in `/harness`, whose Approvals section lists each approval as yours or the lead's, or with `code-kit settings set approvals.<name> lead|person --reason "…"`.
647
673
 
648
674
  ```json
649
675
  "approvals": { "delegate": { "protected": ["schema", "truth"], "dependencies": {} } }
@@ -670,6 +696,8 @@ code-kit approve pillow --lane api --delegated --story ST-138 --reason "MED-5 ne
670
696
 
671
697
  ## Vibe
672
698
 
699
+ Under `autonomous`, every guardrail that stays yours (a spec, a design, CI, a package past the registry rules) stops the build until you come back. Vibe is for a build you want done without you. `/code-kit:init` offers it as the fourth answer to how hands-off the build is; switch to it later in `/harness`, or with `code-kit settings set harness.autonomy vibe --reason "…"`.
700
+
673
701
  Once the spec is done and code-kit is set up, `"harness": { "autonomy": "vibe" }` hands the whole build to the lead. The loop runs as under `autonomous`, and every decision the person would make is the lead's: the specs for later milestones, the screens' designs, CI, the kit, the standards, weakened tests (its own branches included), packages (beyond the registry's rules too, recorded with the rules each breaks), merges and pushes to the base (never by force). Whatever `approvals.delegate` says is set aside. The lead answers the brief's open questions and spec-design's, spec-check's and review's itself, recording each in the brief's decision log.
674
702
 
675
703
  The person is asked only for what nobody else can give: `code-kit ask "…" --needs account|key|payment|outside` (an account with a service provider, an API key or secret, a payment, an act outside the repository such as DNS). Under vibe, `code-kit ask` refuses a question without `--needs`, and the lead builds everything else meanwhile. The project's `shell.block` rules, and the person's own acts (pausing the loop, choosing the lead session, changing the harness settings), stay as they are. What vibe gives up: nobody but the lead looks at a decision before it's built on, and a push to the base can deploy.