@warren-dean/code-kit 0.21.0 → 0.22.1
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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +20 -0
- package/README.md +46 -23
- package/bin/code-kit.mjs +271 -21
- package/hooks/guard-agent.mjs +36 -0
- package/hooks/guard-bash.mjs +23 -11
- package/hooks/guard-paths.mjs +11 -0
- package/hooks/hooks.json +20 -0
- package/hooks/lane-audit.mjs +38 -1
- package/hooks/lib/adapters/hub/client.mjs +177 -25
- package/hooks/lib/config.mjs +148 -5
- package/hooks/lib/decisionstore.mjs +89 -0
- package/hooks/lib/harness.mjs +7 -0
- package/hooks/lib/hook.mjs +7 -0
- package/hooks/lib/instructions.mjs +1 -1
- package/hooks/lib/laneclaims.mjs +89 -0
- package/hooks/lib/loop-state.mjs +20 -2
- package/hooks/lib/next.mjs +34 -1
- package/hooks/lib/plan.mjs +3 -1
- package/hooks/lib/questions.mjs +23 -5
- package/hooks/lib/regression.mjs +2 -1
- package/hooks/lib/rules.mjs +18 -12
- package/hooks/lib/schedule.mjs +86 -0
- package/hooks/lib/sessions.mjs +223 -0
- package/hooks/lib/snapshot.mjs +9 -3
- package/hooks/mod/decisions.mjs +1 -28
- package/hooks/mod/loop.mjs +8 -0
- package/hooks/mod/mission.mjs +21 -19
- package/hooks/mod/register.mjs +118 -41
- package/hooks/mod/register.test.ts +244 -73
- package/hooks/mod/view.mjs +98 -47
- package/hooks/post-edit-check.mjs +3 -0
- package/hooks/session.mjs +24 -0
- package/hooks/stop-check.mjs +12 -0
- package/package.json +1 -1
- package/skills/decide/SKILL.md +1 -1
- package/skills/dispatch/SKILL.md +2 -2
- package/skills/init/SKILL.md +1 -1
- package/skills/lead/SKILL.md +28 -0
- package/skills/next/SKILL.md +1 -1
- package/skills/spec-design/SKILL.md +2 -1
- package/skills/team-init/SKILL.md +1 -1
- package/templates/claude-md.md +3 -1
- package/templates/plan.md +2 -1
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"name": "code-kit",
|
|
10
10
|
"source": "./",
|
|
11
11
|
"description": "Keeps AI coding agents inside your project's rules, from idea to merged code: spec design, lanes, layer rules, protected paths with an approval log, spec-check and design gates, proof-before-finish checks, dispatch, review, build status and CI verification, configured per project from its docs",
|
|
12
|
-
"version": "0.
|
|
12
|
+
"version": "0.22.1",
|
|
13
13
|
"category": "development",
|
|
14
14
|
"tags": ["guardrails", "architecture", "lanes", "layers", "spec-driven", "ci", "multi-agent"],
|
|
15
15
|
"license": "MIT"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "code-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.1",
|
|
4
4
|
"description": "Keeps AI coding agents inside your project's rules, from idea to merged code: spec design, lanes, layer rules, protected paths with an approval log, spec-check and design gates, proof-before-finish checks, dispatch, review, build status and CI verification, configured per project from its docs",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Warren Langeveldt"
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
What changed in each release of code-kit, newest first. Versions follow the plugin manifest and the npm package `@warren-dean/code-kit`. Each release is also on [GitHub Releases](https://github.com/warrendeanlangeveldt/code-kit/releases).
|
|
4
4
|
|
|
5
|
+
## 0.22.1 (2026-10-23)
|
|
6
|
+
|
|
7
|
+
For projects on the hosted team provider, which is in preview:
|
|
8
|
+
|
|
9
|
+
- A session shows as live only when its own link to the provider is up. Before, one session's link made every session on the checkout look live.
|
|
10
|
+
- `code-kit team provider status` checks each part of the setup: this machine's sign-in, the config in the checkout and on the base branch, the MCP server, whether the provider sees the repository, and whether this session is linked. Each part that fails says what to do, and the last line says whether the repository is connected.
|
|
11
|
+
- `/code-kit:team-init` links the session it runs in once it connects, so there's no restart.
|
|
12
|
+
|
|
13
|
+
## 0.22.0 (2026-10-23)
|
|
14
|
+
|
|
15
|
+
A team's roles are settled by default: the lead decides what's technical, a lane runs one story at a time, and several sessions can work one project without their decisions crossing.
|
|
16
|
+
|
|
17
|
+
- With no `approvals.delegate`, the lead decides new packages within the registry rules, protected changes other than the specs, designs, CI and the kit, merges into the base, and a weakened test on a lane's branch after its review. A weakened test on the lead's own branch is still yours. Change who decides each one in the Settings tab's Approvals section, or with `code-kit settings set approvals.<name> lead|person`.
|
|
18
|
+
- The loop asks the lead, not you, about steps it didn't take and lanes that stalled. Those show in the band as notes.
|
|
19
|
+
- A lane runs one story at a time across the whole project. Starting a second agent for a busy lane is refused, and `code-kit lanes` shows what each lane is running.
|
|
20
|
+
- A story can belong to a slice (`**Slice:** <name>`). Lanes build the open slice's stories first (`harness.slices.open`, 1 by default), and take other ready work when the slice has none for them.
|
|
21
|
+
- Several sessions in one project: one leads and runs the loop, and the others are working sessions that stay quiet. A working session records its task and the paths it changes with `code-kit task`, and works in a worktree of its own. When git is blocked by another session's uncommitted files, the refusal names that session. `code-kit who`, `code-kit sessions` and `/code-kit:lead` are new.
|
|
22
|
+
- A decision belongs to the session that raised it. It's asked and answered only there, and other sessions see a count. This fixes the lead's questions appearing in every open session, and answers reaching the wrong lead. Calls Claude Code's own permission check refused no longer pile up as decisions; they show in the Lanes pane.
|
|
23
|
+
- Reports to a team provider now carry the plan's slices (report version 3).
|
|
24
|
+
|
|
5
25
|
## 0.21.0 (2026-10-21)
|
|
6
26
|
|
|
7
27
|
A project can keep its engineering rules as named standards, and code-kit applies each as firmly as it can.
|
package/README.md
CHANGED
|
@@ -59,7 +59,7 @@ code-kit catches each of these, most at the moment it would happen: the hook ref
|
|
|
59
59
|
- no force-push, pushing to or committing on protected branches, `--no-verify`, destructive deletes, or piping downloads into a shell;
|
|
60
60
|
- no new dependency without an approval, for that package and that lane: the lead's, for a story it judged needs it, where dependencies are delegated, otherwise a person's; the approval also covers the manifest and lockfile changes the install makes;
|
|
61
61
|
- no forged approvals;
|
|
62
|
-
- no commit that weakens a test (deletes it, skips or focuses it, removes cases or assertions, or rewrites a snapshot) without the
|
|
62
|
+
- no commit that weakens a test (deletes it, skips or focuses it, removes cases or assertions, or rewrites a snapshot) without a `tests` approval: the lead's on a lane's branch, after its review, where tests are delegated (the default), and the person's on the lead's own branches;
|
|
63
63
|
- the project's own blocked commands (deploys, releases) and lane-restricted commands (shared local services).
|
|
64
64
|
- **Proof before finishing:** before any agent finishes, the plugin runs:
|
|
65
65
|
- an ownership audit of every uncommitted change;
|
|
@@ -120,13 +120,15 @@ Set it up at the start of a new build, straight from the architecture docs, or b
|
|
|
120
120
|
- **In Claude Code**, as a plugin. It's installed once per machine and governs only projects that have `.claude/code-kit.json`.
|
|
121
121
|
- **On every edit, shell command and finish** in those projects, through Claude Code hooks:
|
|
122
122
|
|
|
123
|
-
| Hook
|
|
124
|
-
|
|
|
125
|
-
| `PreToolUse` Edit/Write
|
|
126
|
-
| `PreToolUse` Bash
|
|
127
|
-
| `PostToolUse` Edit/Write
|
|
128
|
-
| `PostToolUse` Bash
|
|
129
|
-
| `
|
|
123
|
+
| Hook | Runs | Enforces |
|
|
124
|
+
| ---------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------ |
|
|
125
|
+
| `PreToolUse` Edit/Write | `hooks/guard-paths.mjs` | lanes, protected paths, spec-check and design gates |
|
|
126
|
+
| `PreToolUse` Bash | `hooks/guard-bash.mjs` | shell rules, dependencies, approval log and secret scan on commit |
|
|
127
|
+
| `PostToolUse` Edit/Write | `hooks/post-edit-check.mjs` | layer rules and the project's `postEdit` commands |
|
|
128
|
+
| `PostToolUse` Bash | `hooks/lane-audit.mjs` | ownership of files a shell command wrote, reported for revert |
|
|
129
|
+
| `PreToolUse` Agent | `hooks/guard-agent.mjs` | one agent per lane at a time, across every session |
|
|
130
|
+
| `Stop`, `SubagentStop` | `hooks/stop-check.mjs` | proof before finishing; a lane's finish frees the lane |
|
|
131
|
+
| `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 |
|
|
130
132
|
|
|
131
133
|
- **For the main session and every subagent**, including agents in worktrees under `.claude/worktrees/`.
|
|
132
134
|
- **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.
|
|
@@ -319,30 +321,31 @@ What waits for you there:
|
|
|
319
321
|
- **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.
|
|
320
322
|
- **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.
|
|
321
323
|
- **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.
|
|
322
|
-
- **A call Claude Code's own permission check refused** (its auto mode, a deny rule), which code-kit can't approve past: "Claude Code refused the lead's `pnpm db:generate`". **Put it in the prompt** puts the command in your prompt after `!` for you to run, **Done it** tells the lead you ran or allowed it, and **Not now** tells it to carry on with other work.
|
|
323
324
|
- **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
325
|
- **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.
|
|
325
326
|
- **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
327
|
|
|
328
|
+
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 in the Lanes pane as that lane's activity, and the lead asks you with `code-kit ask` only if there's no other way. `code-kit decisions` lists this session's.
|
|
329
|
+
|
|
327
330
|
Each button has a digit: type it in an empty prompt to press it. The band keeps one line per kind ("2 approvals waiting"); the Decisions tab says how many of each kind, then lists a short card for each decision, five at a time (**j** and **k** move), with the selected one in full below.
|
|
328
331
|
|
|
329
|
-
- **Notifications.** When something new needs you (an approval, a question from the lead, the lead waiting on you, a
|
|
332
|
+
- **Notifications.** When something new needs you (an approval, a question from the lead, the lead waiting on you, a step or a merge that's yours), code-kit raises a system notification through your notification channel, once per decision, from the session the decision belongs to: "code-kit: the lead asks you". What was already waiting when the session started isn't announced. It needs Claude Code 2.1.301 or later; turn it off with `notify.on`.
|
|
330
333
|
|
|
331
334
|
### The lead loop
|
|
332
335
|
|
|
333
336
|
The loop keeps the build moving between your prompts, under `harness.autonomy`. `/code-kit:init` asks you how hands-off you want it. Until you've chosen, its first step waits in the band ("code-kit can keep the build moving between your prompts") with **Keep going**, **Ask each time** and **Off**, and your answer is recorded as your setting.
|
|
334
337
|
|
|
335
338
|
- **Each step.** Once the lead has finished a turn, with the lead idle and nothing typed in the prompt, the loop asks `code-kit next` and prompts the lead to dispatch the ready stories, review a finished one, or build its own. It never prompts the same step twice while nothing has changed, and never a story an agent is still on: one its lane agent is building, or a reviewer is reviewing, waits until that agent finishes ("waiting: ST-10 is still with its agent").
|
|
336
|
-
- **It reads the lead's reply first.** Before prompting again, the loop reads the lead's last reply with a side call over the lead's own conversation. A reply that waits on you (a question, a design to look at, an approval), or a turn you stopped, holds the loop until you answer or speak to the lead: the band says what the lead waits on, and its question is asked in Claude Code's own question dialog. A step the lead didn't take
|
|
339
|
+
- **It reads the lead's reply first.** Before prompting again, the loop reads the lead's last reply with a side call over the lead's own conversation. A reply that waits on you (a question, a design to look at, an approval), or a turn you stopped, holds the loop until you answer or speak to the lead: the band says what the lead waits on, and its question is asked in Claude Code's own question dialog. A step the lead didn't take shows in the band as a note, with its reason and **Ask again**.
|
|
337
340
|
- **Stories waiting on other work.** When the lead says a story isn't due yet because it waits on work still going (a paired story a lane is building, a rebuild, a check running), the loop parks that story and leaves it out of every step, so a step naming it with others prompts only the others. It wakes when its own branch or state moves, or when a story it waits on (one the lead named, or an unfinished one building on it) changes state; that story's commits along the way don't wake it, nor do other lanes'. A story the lead's turn left exactly where it stood is parked too, whatever the reply said. After 30 minutes with nothing moving, the lead is asked once more.
|
|
338
|
-
- **A step that doesn't move.** One the lead was prompted with
|
|
341
|
+
- **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.
|
|
339
342
|
- **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.
|
|
340
343
|
- **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.
|
|
341
344
|
- **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.
|
|
342
|
-
- **One session
|
|
345
|
+
- **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).
|
|
343
346
|
- **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.
|
|
344
|
-
- **Choices in Claude Code's dialog.** A decision you settle by choosing (how hands-off the loop is, a step to take
|
|
345
|
-
- **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, and
|
|
347
|
+
- **Choices in Claude Code's dialog.** A decision you settle by choosing (how hands-off the loop is, a step to take under `propose`, a stale claim, a question from the lead with answers offered) is asked in Claude Code's own question dialog while the lead is idle, once; dismissed, it stays in the band and the Decisions tab. Approvals, send-backs and settings, which need your reason, stay in the pane.
|
|
348
|
+
- **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.
|
|
346
349
|
- **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.
|
|
347
350
|
- **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. The pane lists the queue, and lanes whose branch waits in it read `queued`.
|
|
348
351
|
- **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.
|
|
@@ -383,11 +386,23 @@ Once init has switched the rules on, the lead runs the build in a loop:
|
|
|
383
386
|
/code-kit:status # where the build stands against the spec
|
|
384
387
|
```
|
|
385
388
|
|
|
386
|
-
- **Dispatch** picks the stories whose dependencies are done. It checks that no open question blocks them and that their contracts exist, then starts each lane agent in its own worktree on the branch `<lane>/st-<n>`, in parallel. Each brief names the story's requirements and acceptance criteria. Lanes spec-check first, build end to end, name requirement IDs in their test titles, and commit.
|
|
389
|
+
- **Dispatch** picks the stories whose dependencies are done, one per lane: a lane runs one story at a time across the whole project, and the open slice's stories go first (a story's `**Slice:**`, the feature it's part of; `harness.slices.open`). It checks that no open question blocks them and that their contracts exist, then starts each lane agent in its own worktree on the branch `<lane>/st-<n>`, every free lane in parallel. A second agent for a lane that's running one is refused. Each brief names the story's requirements and acceptance criteria. Lanes spec-check first, build end to end, name requirement IDs in their test titles, and commit.
|
|
387
390
|
- **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).
|
|
388
391
|
- **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.
|
|
389
392
|
- **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.
|
|
390
393
|
|
|
394
|
+
## Several sessions in one project
|
|
395
|
+
|
|
396
|
+
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:
|
|
397
|
+
|
|
398
|
+
- **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.
|
|
399
|
+
- **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, dialogs or notifications. Every rule still applies.
|
|
400
|
+
- **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.
|
|
401
|
+
- **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.
|
|
402
|
+
- **One story per lane, across every session.** A lane runs one story at a time, whichever session started it (`code-kit lanes`).
|
|
403
|
+
|
|
404
|
+
Spec: `docs/specs/23-the-team.md`.
|
|
405
|
+
|
|
391
406
|
## Teams (preview)
|
|
392
407
|
|
|
393
408
|
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:
|
|
@@ -450,8 +465,15 @@ code-kit report "<title>" --what "…" [--expected …] [--command …] [--refus
|
|
|
450
465
|
code-kit report [--json] | report send|discard <id> # the drafts; sending files it on code-kit's GitHub with your gh, which only you do
|
|
451
466
|
code-kit stops [--session id] [--json] # finish checks that refused an agent's last stop and still fail
|
|
452
467
|
code-kit sent-back <branch> [--reason "…"] # record a review's send-back: status shows the story as sent back until the branch moves on
|
|
453
|
-
code-kit
|
|
454
|
-
code-kit
|
|
468
|
+
code-kit decisions [--json] [--all] # what waits on you in this session, and a count in each other one; --all lists every session's
|
|
469
|
+
code-kit who # which session this is, whether it leads the project, and its task
|
|
470
|
+
code-kit sessions [--json] # the sessions working the project, which one leads, and each one's task
|
|
471
|
+
code-kit sessions lead # make this session the lead (the person's own act, as Lead from here)
|
|
472
|
+
code-kit task "<what>" --touches "<globs>" # a working session's ad hoc task, leasing the paths it changes; task done ends it, task take <session> moves a stale one here
|
|
473
|
+
code-kit lanes [--json] # what each lane is running now, one story each across every session
|
|
474
|
+
code-kit lanes release <lane> # free a lane whose agent stopped without finishing
|
|
475
|
+
code-kit settings [--json] # the harness settings in force, with their defaults, and who decides each approval
|
|
476
|
+
code-kit settings set <key> <value> --reason "…" # change one, as the person (approvals.<name> lead|person among them): written to the config and logged as a kit approval
|
|
455
477
|
code-kit queue [--json] # the merge queue: branches whose review passed, in order
|
|
456
478
|
code-kit queue add|drop <branch> # the lead queues a branch at the commit its review passed, or takes it out
|
|
457
479
|
code-kit queue rules # the lead puts the approved rules onto a base that has none yet (a project set up before 0.8.0)
|
|
@@ -511,11 +533,11 @@ code-kit approve <name>... --reason "…" [--lane name] [--delegated [--story ST
|
|
|
511
533
|
| `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). |
|
|
512
534
|
| `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). |
|
|
513
535
|
| `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). |
|
|
514
|
-
| `approvals.delegate` | no | `{ protected?: [approval names], merge?: 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
|
|
536
|
+
| `approvals.delegate` | no | `false`, or `{ protected?: [approval names], merge?: 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 `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 registry; 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). |
|
|
515
537
|
| `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 |
|
|
516
538
|
| `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, approvals, token use and the rules; 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. |
|
|
517
539
|
| `branches.protected` | no | Default `["main", "master"]` |
|
|
518
|
-
| `harness` | no | What the mod's harness does in the session: `autonomy` (`autonomous`, `propose` or `off`; default `autonomous`), `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; default the session's), `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`) 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`.
|
|
540
|
+
| `harness` | no | What the mod's harness does in the session: `autonomy` (`autonomous`, `propose` or `off`; default `autonomous`), `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; 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), `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`) 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`. |
|
|
519
541
|
|
|
520
542
|
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.
|
|
521
543
|
|
|
@@ -532,7 +554,7 @@ echo "Date formatting for ST-12" > .claude/approvals/web/dep-dayjs #
|
|
|
532
554
|
- **Scope:** an approval in a lane's folder serves that lane only; one directly in `.claude/approvals/` serves every agent. The refusal a lane gets names its own folder.
|
|
533
555
|
- **Dependencies:** each new package needs its own approval, `dep-<package>` (`/` becomes `+`, so `@scope/pkg` is `dep-@scope+pkg`). It allows the install, and the changes the install makes to manifests and lockfiles that no other lane owns. When the lane commits a manifest or lockfile outside its own paths, the commit hook logs it as a `dependency` approval, with the packages and reasons, and `code-kit verify` accepts it.
|
|
534
556
|
- **Worktrees:** approvals live in the main checkout, so a lane working in its own worktree sees the ones given at the lead's terminal.
|
|
535
|
-
- **Tests:** a commit that weakens a test needs `tests
|
|
557
|
+
- **Tests:** a commit that weakens a test needs `tests`, used up by the commit, which logs it with what was weakened. On a lane's branch the lead approves it after reviewing the change, where tests are delegated (the default): `code-kit approve tests --lane web --delegated --story ST-9 --reason "the keeps-order case tested the old sort"`. On the lead's own branches, and where tests aren't delegated, it's the person's: `echo "The keeps-order test is wrong until ST-9" > .claude/approvals/web/tests`.
|
|
536
558
|
- **Lifetime:** 60 minutes; a dependency approval (`dep-…`) lasts until the lane commits the install it allows, at most 7 days, since a story may resume hours later.
|
|
537
559
|
- **Agents can't write them.** An edit to an approval or the log is refused, and so is any agent shell command that names them. Like every shell rule, that's a match on the command's text.
|
|
538
560
|
|
|
@@ -558,7 +580,7 @@ Every refusal that an approval would allow is recorded as a request in `.claude/
|
|
|
558
580
|
|
|
559
581
|
### Who decides what
|
|
560
582
|
|
|
561
|
-
You set the guardrails and decide what crosses them
|
|
583
|
+
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 "…"`.
|
|
562
584
|
|
|
563
585
|
```json
|
|
564
586
|
"approvals": { "delegate": { "protected": ["schema", "truth"], "dependencies": {} } }
|
|
@@ -574,7 +596,8 @@ code-kit approve pillow --lane api --delegated --story ST-138 --reason "MED-5 ne
|
|
|
574
596
|
- **Dependencies:** approved for a story, with `--story`: the lead approves a package only when the story's requirements need it, nothing the project already depends on does the job, and it fits the principles and the lane's layer. An npm package must also pass the registry rules: its licence must be in `licences`; it must have at least `minWeeklyDownloads` downloads last week and a release within `maxMonthsSinceRelease` months; and installing it must run no scripts, unless `allowInstallScripts` allows them: `true` for any, or a list of the kinds allowed, such as `["binary"]` for packages that only download a prebuilt binary for the platform (esbuild, sharp). The kinds are `binary`, `build` (compiles native code with node-gyp) and `other` (runs the package's own code). A package from another ecosystem (pip, uv, Poetry, cargo, go, bundler) is the lead's judgement alone.
|
|
575
597
|
- **All or nothing:** if any name is outside the rules, nothing is approved, and the command says which rule each one broke.
|
|
576
598
|
- **The record:** the approval reads `(approved by the lead within the delegated rules: <rule>)` after the reason. The approval log keeps it when the change is committed.
|
|
577
|
-
- **Who:** only the lead.
|
|
599
|
+
- **Who:** only the lead. With `"approvals": { "delegate": false }`, `--delegated` is refused, and every approval is yours.
|
|
600
|
+
- **Weakened tests:** with `"tests": true` (the default), the lead approves a weakened test on a lane's branch for the story it reviewed, with `--lane` and `--story`; on its own branches it's yours.
|
|
578
601
|
- **Merges:** with `"merge": true`, the lead merges a reviewed branch into a protected branch with `code-kit merge <branch> --delegated`.
|
|
579
602
|
- It runs `code-kit verify` on the branch first, checks included, and merges only if it passes. The checks run where the branch is checked out; in a temporary worktree without the project's install, checks that need one fail rather than being skipped.
|
|
580
603
|
- The merge commit says it was verified and delegated.
|