@warren-dean/code-kit 0.10.0 → 0.11.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 +18 -0
- package/README.md +33 -31
- package/bin/code-kit.mjs +99 -3
- package/hooks/guard-bash.mjs +8 -0
- package/hooks/lib/rules.mjs +214 -4
- package/hooks/lib/team.mjs +62 -7
- package/hooks/mod/decisions.mjs +5 -1
- package/hooks/mod/loop.mjs +49 -0
- package/hooks/mod/panes.mjs +42 -49
- package/hooks/mod/register.mjs +122 -14
- package/hooks/mod/register.test.ts +283 -15
- package/hooks/mod/teamview.mjs +469 -74
- package/hooks/mod/view.mjs +59 -11
- package/package.json +1 -1
- package/skills/dispatch/SKILL.md +1 -1
- package/skills/init/SKILL.md +2 -1
- package/skills/review/SKILL.md +1 -1
- package/skills/team-init/SKILL.md +59 -0
|
@@ -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.11.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.11.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,24 @@
|
|
|
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.11.1 (2026-10-12)
|
|
6
|
+
|
|
7
|
+
The loop and the lead stop talking past each other, and approvals ask only what still needs you.
|
|
8
|
+
|
|
9
|
+
- **The loop never asks for a story an agent is still on.** `code-kit next` reads only branches, so the loop kept asking the lead to review stories their lane agents were still building, or already being reviewed, and to dispatch stories started a moment ago. It now leaves out every story a running agent's task names ("ST-10 capture pipeline", "Review domain/st-78"), and when nothing's left it waits, saying for what, until an agent finishes.
|
|
10
|
+
- **Approvals are counted as decisions.** "contract for the platform lane: 5 files" is one approval, not five; approving it covers them all.
|
|
11
|
+
- **Only requests that still wait are shown.** A request closes once an approval is given after it, even if that approval has since lapsed or was used up, and once its file has been committed by someone who could. A read-only agent, such as the reviewer running a code generator, is never approved to write: it's told to put the file back, and you aren't asked.
|
|
12
|
+
- **The history of approvals.** `/approvals` and `code-kit requests` list every approval given, newest first: when, what for, which lane, who gave it (you, or the lead within your delegated rules), the reason, and the files and branches it covered, merged or not.
|
|
13
|
+
|
|
14
|
+
## 0.11.0 (2026-10-12)
|
|
15
|
+
|
|
16
|
+
Teams get their own pane and their own setup, and a hosted team provider can stand down to GitHub.
|
|
17
|
+
|
|
18
|
+
- **`/team` opens the Team pane.** It replaces the Lanes pane's Team tab. Its header names the tech lead, you, and what coordinates the team (GitHub, or a hosted provider, and whether it's live). Its tabs: People (who's at work on what), Since you looked, Claims (Keep and Release on yours; Release and Reassign for the tech lead), Intents (Agree and Drop for the tech lead), Drift (with a provider that checks for it) and Setup (the team's config and what GitHub still needs). A Team button in the band opens it on the tab its line is about.
|
|
19
|
+
- **Set up a team only when there is one.** `/code-kit:team-init` asks for the tech lead, each lane's owners, when a claim goes stale and where intents go, shows the team section, and writes it once you agree; it also changes a team or takes it out. `/code-kit:init` asks once whether other developers work in the repository and runs it only if they do. Behind it, `code-kit team init` (`--write` to write, `--off` for one developer again) says what GitHub still needs: gh signed in, the repository reachable, and the intents' discussion category. A lane agent can't write it.
|
|
20
|
+
- **A hosted provider can fall back to GitHub.** With `team.provider: { command, fallback: "github" }`, whatever the provider can't reach goes through GitHub's claim refs instead, and the band says GitHub is standing in. A live provider's state refreshes the band and the pane as it changes, and its presence and drift findings show in the pane, with drift on your own work in the band.
|
|
21
|
+
- **Two band lines with the same button no longer clash.** Each button and row keeps its own key.
|
|
22
|
+
|
|
5
23
|
## 0.10.0 (2026-10-12)
|
|
6
24
|
|
|
7
25
|
An older setup is brought up to date before new work starts, and a security reviewer checks the changes that need one.
|
package/README.md
CHANGED
|
@@ -279,7 +279,7 @@ With Claude Code 2.1.287 or later, code-kit's mod shows the project in the sessi
|
|
|
279
279
|
|
|
280
280
|
- **The band** sits above the prompt. While the build is moving (the lead mid-turn, an agent at work, the loop started) it opens with the mission: **goal**, the milestone being built and how many of its stories are done; **now**, what the lead is doing and the loop's state, with **Pause** or **Resume**; **next**, the step the loop takes next; and **agents**, a line per agent at work with its current tool and how long since. With Context Graph installed, a line says when a lane edited files without understanding them, and only then. Beneath, labelled **you**, what only you can decide, each with the story it's for ("for ST-4 Booking form (BOOK-1)"), and **d** ("Why, and what each choice does") opens it as a card in the Decisions tab; usage and the plan's pause are labelled **note**. In a team (`team` in the config), it also names what of the team needs you, and only that: your stale claim (Keep or Release), a claim of yours changing the same files as someone else's, an intent touching what you own or lease (every intent, with Agree and Drop, for the tech lead), and a pull request in a lane you own. While the loop runs, a lane's finished work is the lead's to review and merge, so it never waits here; with the loop off, Review and Merge are offered to you. With nothing happening and nothing waiting, the band is gone. It shows:
|
|
281
281
|
- an agent's call held for you: installing a new package, writing or committing a protected file, or a lane changing the kit. 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. Under `autonomy: autonomous`, a call within `approvals.delegate` is approved as delegated without asking. Nothing is held under `claude -p` or the SDK, where nobody can answer;
|
|
282
|
-
- the lead loop, under `harness.autonomy`. `/code-kit:init` asks you how hands-off you want it. Until you've chosen, the loop's 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. Once the lead has finished a turn, the loop keeps the build moving: with the lead idle and nothing typed in the prompt, it asks `code-kit next` and prompts the lead to dispatch the ready stories, review a finished one, or build its own, never the same step twice while nothing has changed. A step the lead was prompted with twice in a row and that is still next goes to you instead, in the band: "Merge lead/st-1: still next after 2 prompts. Ask the lead again?" with **Go**. **Pause** and **Resume** stop and start it. Under `propose`, each step waits in the band for **Go**; under `off`, the loop does nothing. 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 then the band flags the lane. When every story is done, the band says so and the loop stops. 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. A branch the lead's review passes joins the merge queue (`code-kit 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. There's no first merge 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. A merged lane's worktree is removed when it holds nothing uncommitted. A head that conflicts or fails verify goes back to its lane. The pane lists the queue, and lanes whose branch waits in it read `queued`;
|
|
282
|
+
- the lead loop, under `harness.autonomy`. `/code-kit:init` asks you how hands-off you want it. Until you've chosen, the loop's 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. Once the lead has finished a turn, the loop keeps the build moving: with the lead idle and nothing typed in the prompt, it asks `code-kit next` and prompts the lead to dispatch the ready stories, review a finished one, or build its own, never 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"). A step the lead was prompted with twice in a row and that is still next goes to you instead, in the band: "Merge lead/st-1: still next after 2 prompts. Ask the lead again?" with **Go**. **Pause** and **Resume** stop and start it. Under `propose`, each step waits in the band for **Go**; under `off`, the loop does nothing. 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 then the band flags the lane. When every story is done, the band says so and the loop stops. 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. A branch the lead's review passes joins the merge queue (`code-kit 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. There's no first merge 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. A merged lane's worktree is removed when it holds nothing uncommitted. A head that conflicts or fails verify goes back to its lane. The pane lists the queue, and lanes whose branch waits in it read `queued`;
|
|
283
283
|
- approvals agents have asked for: **Approve…** opens a confirmation with a reason prefilled from the request, which you keep or rewrite;
|
|
284
284
|
- stories finished and waiting for review: **Review** asks the lead to run `/code-kit:review` on the branch, and **Merge** runs `verify`, checks included, then merges if it passes;
|
|
285
285
|
- a finish check failing in this session: **Lanes** opens the pane;
|
|
@@ -288,10 +288,10 @@ With Claude Code 2.1.287 or later, code-kit's mod shows the project in the sessi
|
|
|
288
288
|
|
|
289
289
|
Each button has a digit: type it in an empty prompt to press it.
|
|
290
290
|
|
|
291
|
-
- **`/lanes`** opens the Lanes pane. Its first line counts the stories by state (building, in review, queued, sent back, blocked, ready, merged), with the loop's state and the plan's 5-hour use; press a count to show only those lanes. Beneath it, whatever needs you (held calls, approvals, reviews, merges, stalled lanes, outliers) is pinned with its key. Tabs on **1** to **
|
|
291
|
+
- **`/lanes`** opens the Lanes pane. Its first line counts the stories by state (building, in review, queued, sent back, blocked, ready, merged), with the loop's state and the plan's 5-hour use; press a count to show only those lanes. Beneath it, whatever needs you (held calls, approvals, reviews, merges, stalled lanes, outliers) is pinned with its key. Tabs on **1** to **7**: **Lanes** opens on the loop as a card: its mode, the steps it took, the one running and the next. Then each lane on fixed columns: its name, state and story, its agent's current or last tool call with the time since beneath (amber once quiet, red when stalled), and its tokens; the lead reads orchestrating while its turn runs. A selected lane shows its stories as cards (state, requirements, what each waits on or its branch), then its agent and the paths it owns. **Decisions**, each decision that needs you as a 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; **Journal**, the build from your request to now in plain sentences, by day: the request and the decisions in the brief, the specification, each story handed out, sent back and merged, each approval and who gave it, each milestone finished, and the loop's steps this session, yours in yellow. Each lane has its own small pixel character, tinted in the lane's colour, whose pose shows its state: working (animated while its agent works), waiting on you, quiet, stalled, done or resting; the lead's wears a crown. Under each lane, its story's timeline on a shared time axis: building, then in review, with send-backs (↩), approvals (◆) and the merge (✓) marked where they fell; **Code map**, the whole project's folders by layer when no story is at work, or a story's files in a column per layer with the imports between them: a file fills with a lane's colour while that lane reads or edits it, and says whether its why (its Context Graph card) is written, out of date or not written yet; **j**/**k** select a file to see its card and what it imports and what imports it, and **o** opens it in Context Graph (box-drawing text in the terminal, an SVG on Desktop); **Trail**, every requirement in the specs as a cell by spec, its glyph and colour saying whether it's done and tested, done but untested, in progress, todo, without a story or removed, with a legend counting each. **h**/**l** and **j**/**k** move between cells and specs (or pick one from the list), showing the requirement's stories, their branches, the code they changed and the tests that name it; beneath the cells, the spec's trail drawn as a flow, each requirement to its stories, code and tests, with a missing link dashed in red; **Queue**, the merge queue; and **Usage**. **j** and **k** move between lanes, and the selected lane's acts are on **a** (approve), **r** (review), **s** (send back, with your reason), **m** (merge), **n** (nudge its agent) and **x** (stop it); **p** pauses or resumes the loop, and **f** filters the lanes by name, agent or story. **Enter** (or **o**) opens the selected lane's story: its requirements beside its spec-check report, the reviewer's findings by severity (each a way into the diff), `verify`'s problems, its usage and loop steps, and its diff against the base, file by file, with the acts its state allows. **b** or Escape goes back to the lanes. Inline (when the terminal can't dock it beside the transcript), it shows the counts, what needs you and a line per lane. It stays current within 2 seconds of a commit, a branch change, a plan edit or an agent starting or stopping. `/lanes` again, or Escape, closes it.
|
|
292
292
|
- **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.
|
|
293
293
|
- **`/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, and the use at which background agents pause. 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`.
|
|
294
|
-
- **`/approvals`** lists the
|
|
294
|
+
- **`/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. **`/verify-branch`** runs `code-kit verify` on this branch. Neither calls the model.
|
|
295
295
|
|
|
296
296
|
Approving from the band records `(approved in the code-kit pane)` with your reason, and a merge from it says it was merged by the person from the pane. A settings change is logged as made in the pane. These happen only on your press: the hooks refuse `approve --via pane`, `merge --person` and `settings set` from every agent. Outside a project with `.claude/code-kit.json`, the mod draws nothing. Mods don't draw in the VS Code extension's chat panel, the Agent SDK or `claude -p`.
|
|
297
297
|
|
|
@@ -311,11 +311,12 @@ Once init has switched the rules on, the lead runs the build in a loop:
|
|
|
311
311
|
|
|
312
312
|
## Teams (preview)
|
|
313
313
|
|
|
314
|
-
For several people in one repository, each with their own agents.
|
|
314
|
+
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:
|
|
315
315
|
|
|
316
316
|
- **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.
|
|
317
317
|
- **The tech lead's paths.** Only the tech lead's sessions change the plan, specs and contracts. Anyone else raises an **intent** (`code-kit intend`), a discussion in the repository's Intents category, before any code. The tech lead agrees, drops or marks it a duplicate; an agreed one becomes a numbered decision record (`code-kit intend record`) through a pull request, where every agent reads it.
|
|
318
|
-
- **Since you last looked.** `code-kit team since` says, by person, what was pushed, opened, merged, reviewed, claimed and intended. The Team
|
|
318
|
+
- **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.
|
|
319
|
+
- **`/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.
|
|
319
320
|
- **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.
|
|
320
321
|
- **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.
|
|
321
322
|
|
|
@@ -357,7 +358,7 @@ code-kit status [--base ref] [--json] # stories and requirements against the sp
|
|
|
357
358
|
code-kit next [--base ref] [--json] # the step to take now, from the project's state
|
|
358
359
|
code-kit trace <path>... [--json] # what a file is for: requirements, lane, layer rules
|
|
359
360
|
code-kit merge <branch> --delegated|--person [--into branch] # merge a branch that passes verify: the lead where approvals.delegate.merge is on, or the person
|
|
360
|
-
code-kit requests [--json] # approval requests
|
|
361
|
+
code-kit requests [--json] # approval requests still waiting, the approvals in force, and every approval given
|
|
361
362
|
code-kit stops [--session id] [--json] # finish checks that refused an agent's last stop and still fail
|
|
362
363
|
code-kit sent-back <branch> [--reason "…"] # record a review's send-back: status shows the story as sent back until the branch moves on
|
|
363
364
|
code-kit settings [--json] # the harness settings in force, with their defaults
|
|
@@ -373,6 +374,7 @@ code-kit timeline [--json] # when each story'
|
|
|
373
374
|
code-kit journal [--json] # the build's lineage: the request, its decisions, the spec, each story handed out, sent back and merged, each approval and who gave it
|
|
374
375
|
code-kit team [--json] [--fresh] # the team (preview): tech lead, owners, claims, intents and open pull requests (spec 16)
|
|
375
376
|
code-kit team since [--json] [--peek] # what everyone pushed, opened, merged, reviewed, claimed and intended since you last looked
|
|
377
|
+
code-kit team init --tech-lead <handle> [--owner <lane>=<handles>] [--stale-days n] [--intents category] [--write] | team init --off [--write] # show, then write, the team's setup; or make the project one developer's again
|
|
376
378
|
code-kit team claim <story> [--lease globs] | team release <story> # claim a story for yourself, leasing what it changes; release it (yours, or any as the tech lead)
|
|
377
379
|
code-kit team keep <story> | team reassign <story> <handle> # keep your stale claim (its clock starts again); the tech lead hands a claim to someone else
|
|
378
380
|
code-kit team codeowners [--write] # .github/CODEOWNERS from the config: the tech lead for their paths, each lane's owners for its paths
|
|
@@ -393,31 +395,31 @@ code-kit approve <name>... --reason "…" [--lane name] [--delegated | --via pan
|
|
|
393
395
|
|
|
394
396
|
`.claude/code-kit.json`. Globs use `*` (one segment), `**` (any depth), `**/` (zero or more folders), `?` and `{a,b}`. Patterns under `shell` are regular expressions.
|
|
395
397
|
|
|
396
|
-
| Field | Required | What it is
|
|
397
|
-
| ------------------------------ | ----------------- |
|
|
398
|
-
| `version` | yes | `1`
|
|
399
|
-
| `docs.specs` | no | Folder of specs. With it, a lane needs a spec-check report before writing code on a branch
|
|
400
|
-
| `docs.principles`, `docs.plan` | no | The engineering principles and the implementation plan
|
|
401
|
-
| `docs.decisions` | no | Where agreed intents are recorded as numbered decision records (`code-kit intend record`); default `docs/decisions`
|
|
402
|
-
| `lead.paths` | yes | What the main session writes. `.claude/**` is always added.
|
|
403
|
-
| `lead.outside` | no | Paths outside the repository the lead may write, e.g. `../shared-lib/**`. Claude's memory and scratchpad are always included.
|
|
404
|
-
| `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.
|
|
405
|
-
| `lanes.<name>` | yes (may be `{}`) | `{ agent, paths, exclude?, owners? }`: the agent name maps a subagent to its lane; `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.
|
|
406
|
-
| `protected[]` | no | `{ glob, approval, why }`: logged on every commit. Anyone but the lead needs a person's approval (see [Approvals](#approvals)). `.claude/**` is always protected as `kit`.
|
|
407
|
-
| `designGate` | no | `{ register, screens: [{ glob, not? }], howTo }`: screen files wait until the register (`{ "screens": [{ "file": … }] }`) lists them. Init sets it for every lane that owns screens; `/code-kit:design` adds approved designs
|
|
408
|
-
| `layers[]` | no | `{ name, paths, mayImport, denyPackages? }`: the first layer whose paths match a file owns it. A layer may always import itself.
|
|
409
|
-
| `importAliases` | no | `{ "@app/domain": "packages/domain/src" }`: resolves non-relative imports to repository paths
|
|
410
|
-
| `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, so a heredoc or quoted text that mentions it isn't refused
|
|
411
|
-
| `shell.restricted[]` | no | `{ pattern, lanes, why }`: only the lead and these lanes
|
|
412
|
-
| `postEdit[]` | no | `{ files, exclude?, run }`: after each edit of a matching file. `{file}` is the file. Exit 127 (tool not installed) is skipped.
|
|
413
|
-
| `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).
|
|
414
|
-
| `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).
|
|
415
|
-
| `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).
|
|
416
|
-
| `approvals.delegate` | no | `{ protected?: [approval names], merge?: true, dependencies?: { licences?, minWeeklyDownloads?, maxMonthsSinceRelease?, allowInstallScripts?: true \| false \| [kinds] } }`: approvals the lead may grant on its own, with `code-kit approve --delegated`, and with `merge`, merges into a protected branch with `code-kit merge --delegated`. Dependencies are checked against the npm 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).
|
|
417
|
-
| `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
|
|
418
|
-
| `team` | no | Preview. For several people in one repository: `{ techLead, staleDays?, intents?, board?, provider? }`. `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) or `{ command }` for another team provider. See docs/specs/16-teams.md. |
|
|
419
|
-
| `branches.protected` | no | Default `["main", "master"]`
|
|
420
|
-
| `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` (default the session's), and `background.pauseAtPercent` (default 80). Change them with `/harness` or `code-kit settings set`.
|
|
398
|
+
| Field | Required | What it is |
|
|
399
|
+
| ------------------------------ | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
400
|
+
| `version` | yes | `1` |
|
|
401
|
+
| `docs.specs` | no | Folder of specs. With it, a lane needs a spec-check report before writing code on a branch |
|
|
402
|
+
| `docs.principles`, `docs.plan` | no | The engineering principles and the implementation plan |
|
|
403
|
+
| `docs.decisions` | no | Where agreed intents are recorded as numbered decision records (`code-kit intend record`); default `docs/decisions` |
|
|
404
|
+
| `lead.paths` | yes | What the main session writes. `.claude/**` is always added. |
|
|
405
|
+
| `lead.outside` | no | Paths outside the repository the lead may write, e.g. `../shared-lib/**`. Claude's memory and scratchpad are always included. |
|
|
406
|
+
| `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. |
|
|
407
|
+
| `lanes.<name>` | yes (may be `{}`) | `{ agent, paths, exclude?, owners? }`: the agent name maps a subagent to its lane; `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. |
|
|
408
|
+
| `protected[]` | no | `{ glob, approval, why }`: logged on every commit. Anyone but the lead needs a person's approval (see [Approvals](#approvals)). `.claude/**` is always protected as `kit`. |
|
|
409
|
+
| `designGate` | no | `{ register, screens: [{ glob, not? }], howTo }`: screen files wait until the register (`{ "screens": [{ "file": … }] }`) lists them. Init sets it for every lane that owns screens; `/code-kit:design` adds approved designs |
|
|
410
|
+
| `layers[]` | no | `{ name, paths, mayImport, denyPackages? }`: the first layer whose paths match a file owns it. A layer may always import itself. |
|
|
411
|
+
| `importAliases` | no | `{ "@app/domain": "packages/domain/src" }`: resolves non-relative imports to repository paths |
|
|
412
|
+
| `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, so a heredoc or quoted text that mentions it isn't refused |
|
|
413
|
+
| `shell.restricted[]` | no | `{ pattern, lanes, why }`: only the lead and these lanes |
|
|
414
|
+
| `postEdit[]` | no | `{ files, exclude?, run }`: after each edit of a matching file. `{file}` is the file. Exit 127 (tool not installed) is skipped. |
|
|
415
|
+
| `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). |
|
|
416
|
+
| `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). |
|
|
417
|
+
| `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). |
|
|
418
|
+
| `approvals.delegate` | no | `{ protected?: [approval names], merge?: true, dependencies?: { licences?, minWeeklyDownloads?, maxMonthsSinceRelease?, allowInstallScripts?: true \| false \| [kinds] } }`: approvals the lead may grant on its own, with `code-kit approve --delegated`, and with `merge`, merges into a protected branch with `code-kit merge --delegated`. Dependencies are checked against the npm 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). |
|
|
419
|
+
| `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 |
|
|
420
|
+
| `team` | no | Preview. For several people in one repository: `{ techLead, staleDays?, intents?, board?, provider? }`. `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) or `{ command, fallback? }` for another team provider, such as the code-kit teams hub; with `fallback: "github"`, claims go through GitHub whenever that provider can't be reached. See docs/specs/16-teams.md. |
|
|
421
|
+
| `branches.protected` | no | Default `["main", "master"]` |
|
|
422
|
+
| `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` (default the session's), and `background.pauseAtPercent` (default 80). Change them with `/harness` or `code-kit settings set`. |
|
|
421
423
|
|
|
422
424
|
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.
|
|
423
425
|
|
package/bin/code-kit.mjs
CHANGED
|
@@ -80,6 +80,7 @@ import {
|
|
|
80
80
|
approvalLifetime,
|
|
81
81
|
currentBranch,
|
|
82
82
|
PANE,
|
|
83
|
+
approvalHistory,
|
|
83
84
|
approvalsInForce,
|
|
84
85
|
delegatedMark,
|
|
85
86
|
grantApprovals,
|
|
@@ -120,7 +121,21 @@ const minutesGiven = option('--minutes');
|
|
|
120
121
|
const answerGiven = option('--answer');
|
|
121
122
|
const leaseGiven = option('--lease');
|
|
122
123
|
const touchesGiven = option('--touches');
|
|
123
|
-
const
|
|
124
|
+
const techLeadGiven = option('--tech-lead');
|
|
125
|
+
const staleDaysGiven = option('--stale-days');
|
|
126
|
+
const intentsGiven = option('--intents');
|
|
127
|
+
const ownersGiven = [];
|
|
128
|
+
for (let o = option('--owner'); o !== undefined; o = option('--owner')) ownersGiven.push(o);
|
|
129
|
+
const FLAGS = [
|
|
130
|
+
'--write',
|
|
131
|
+
'--no-checks',
|
|
132
|
+
'--json',
|
|
133
|
+
'--delegated',
|
|
134
|
+
'--person',
|
|
135
|
+
'--fresh',
|
|
136
|
+
'--peek',
|
|
137
|
+
'--off',
|
|
138
|
+
];
|
|
124
139
|
const flag = (name) => args.includes(name);
|
|
125
140
|
const writeBaseline = flag('--write');
|
|
126
141
|
const [command, ...rest] = args.filter((a) => !FLAGS.includes(a));
|
|
@@ -898,7 +913,9 @@ function requests() {
|
|
|
898
913
|
load();
|
|
899
914
|
const open = openRequests(resolve('.'));
|
|
900
915
|
const granted = approvalsInForce(resolve('.'));
|
|
901
|
-
|
|
916
|
+
// CARD-6: every approval given, newest first.
|
|
917
|
+
const history = approvalHistory(resolve('.')).slice(0, 100);
|
|
918
|
+
if (flag('--json')) return out(JSON.stringify({ open, inForce: granted, history }, null, 2));
|
|
902
919
|
out(open.length ? `${open.length} approval request(s) open:` : 'No approval requests open.');
|
|
903
920
|
for (const r of open)
|
|
904
921
|
out(
|
|
@@ -909,6 +926,11 @@ function requests() {
|
|
|
909
926
|
out(
|
|
910
927
|
` ${a.name} for ${a.lane ? `the ${a.lane} lane` : 'any agent'}, ${a.minutesLeft} min left: ${a.reason}`,
|
|
911
928
|
);
|
|
929
|
+
out(history.length ? `\nApprovals given (newest first):` : '\nNo approvals given yet.');
|
|
930
|
+
for (const h of history.slice(0, 30))
|
|
931
|
+
out(
|
|
932
|
+
` ${h.at.slice(0, 16).replace('T', ' ')} ${h.name} for ${h.lane ? `the ${h.lane} lane` : 'any agent'}, by ${h.by}${h.files.length ? ` · ${h.files.length} file${h.files.length === 1 ? '' : 's'}${h.branches.length ? ` on ${h.branches.join(', ')}` : ''}` : ''}: ${h.reason}`,
|
|
933
|
+
);
|
|
912
934
|
}
|
|
913
935
|
|
|
914
936
|
/**
|
|
@@ -1310,6 +1332,7 @@ function ago(iso) {
|
|
|
1310
1332
|
*/
|
|
1311
1333
|
function teamCommand() {
|
|
1312
1334
|
const { raw } = load();
|
|
1335
|
+
if (rest[0] === 'init') return teamInit(raw);
|
|
1313
1336
|
const team = teamOf(raw);
|
|
1314
1337
|
if (!team)
|
|
1315
1338
|
die(
|
|
@@ -1431,7 +1454,7 @@ function teamCommand() {
|
|
|
1431
1454
|
}
|
|
1432
1455
|
if (sub !== undefined)
|
|
1433
1456
|
die(
|
|
1434
|
-
'code-kit team [--json] [--fresh] | team since [--json] [--peek] | team claim|keep|release <story> | team reassign <story> <handle>',
|
|
1457
|
+
'code-kit team [--json] [--fresh] | team init … | team since [--json] [--peek] | team claim|keep|release <story> | team reassign <story> <handle>',
|
|
1435
1458
|
);
|
|
1436
1459
|
const state = provider.state({ fresh: flag('--fresh') });
|
|
1437
1460
|
if (flag('--json')) return out(JSON.stringify(state, null, 2));
|
|
@@ -1462,6 +1485,78 @@ function teamCommand() {
|
|
|
1462
1485
|
out(` #${p.number} ${p.title} (${p.by}, ${p.branch}${p.draft ? ', draft' : ''})`);
|
|
1463
1486
|
}
|
|
1464
1487
|
|
|
1488
|
+
/**
|
|
1489
|
+
* TEAM-13: `team init` sets the project up as a team's, or (`--off`) as one developer's again. Without
|
|
1490
|
+
* `--write` it shows the team section it would write; with it, it writes the config and says what the
|
|
1491
|
+
* team still needs on GitHub (gh signed in, origin reachable, the intents' discussion category).
|
|
1492
|
+
*/
|
|
1493
|
+
function teamInit(raw) {
|
|
1494
|
+
const usage =
|
|
1495
|
+
'code-kit team init --tech-lead <GitHub handle> [--owner <lane>=<handle>,<handle>]… [--stale-days <n>] [--intents <category>] [--write] [--json] | team init --off [--write]';
|
|
1496
|
+
const changed = structuredClone(raw);
|
|
1497
|
+
if (flag('--off')) {
|
|
1498
|
+
delete changed.team;
|
|
1499
|
+
for (const lane of Object.values(changed.lanes ?? {})) delete lane.owners;
|
|
1500
|
+
} else {
|
|
1501
|
+
const techLead = techLeadGiven ?? raw.team?.techLead;
|
|
1502
|
+
if (!techLead) die(usage);
|
|
1503
|
+
changed.team = { ...(raw.team ?? {}), techLead };
|
|
1504
|
+
if (staleDaysGiven !== undefined) changed.team.staleDays = Number(staleDaysGiven);
|
|
1505
|
+
if (intentsGiven !== undefined) changed.team.intents = intentsGiven;
|
|
1506
|
+
for (const given of ownersGiven) {
|
|
1507
|
+
const [lane, people = ''] = given.split('=');
|
|
1508
|
+
if (!changed.lanes?.[lane])
|
|
1509
|
+
die(
|
|
1510
|
+
`There's no lane "${lane}" in the config. The lanes are: ${Object.keys(changed.lanes ?? {}).join(', ') || 'none'}.`,
|
|
1511
|
+
);
|
|
1512
|
+
const handles = people
|
|
1513
|
+
.split(',')
|
|
1514
|
+
.map((h) => h.trim().replace(/^@/, ''))
|
|
1515
|
+
.filter(Boolean);
|
|
1516
|
+
if (handles.length) changed.lanes[lane].owners = handles;
|
|
1517
|
+
else delete changed.lanes[lane].owners;
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
const problems = validate(changed);
|
|
1521
|
+
if (problems.length) die(`Nothing changed: ${problems.join('; ')}`);
|
|
1522
|
+
const team = teamOf(changed);
|
|
1523
|
+
const section = team
|
|
1524
|
+
? {
|
|
1525
|
+
team: changed.team,
|
|
1526
|
+
owners: team.owners,
|
|
1527
|
+
}
|
|
1528
|
+
: null;
|
|
1529
|
+
if (!flag('--write')) {
|
|
1530
|
+
if (flag('--json')) return out(JSON.stringify({ written: false, ...section }, null, 2));
|
|
1531
|
+
if (!team)
|
|
1532
|
+
return out(
|
|
1533
|
+
'This would take the team out of the config: one developer, no claims or owners. Run again with --write to do it.',
|
|
1534
|
+
);
|
|
1535
|
+
out(JSON.stringify({ team: changed.team }, null, 2));
|
|
1536
|
+
for (const [lane, owners] of Object.entries(team.owners))
|
|
1537
|
+
out(`lanes.${lane}.owners: ${owners.join(', ')}`);
|
|
1538
|
+
return out('Nothing is written yet: run again with --write.');
|
|
1539
|
+
}
|
|
1540
|
+
writeFileSync(resolve(file), `${JSON.stringify(changed, null, 2)}\n`);
|
|
1541
|
+
if (!team)
|
|
1542
|
+
return out(
|
|
1543
|
+
`Took the team out of ${file}: claims, owners and intents no longer apply. Commit it on a branch.`,
|
|
1544
|
+
);
|
|
1545
|
+
// What GitHub says now: the provider's own look at the repository.
|
|
1546
|
+
const state = teamProvider(resolve('.'), team).state({ fresh: true });
|
|
1547
|
+
const setup = state.setup ?? [];
|
|
1548
|
+
if (flag('--json'))
|
|
1549
|
+
return out(JSON.stringify({ written: true, ...section, me: state.me ?? null, setup }, null, 2));
|
|
1550
|
+
out(
|
|
1551
|
+
`Wrote the team to ${file}: ${team.techLead} is the tech lead; a claim is stale after ${team.staleDays} working day${team.staleDays === 1 ? '' : 's'} without a push; intents go in "${team.intents}".`,
|
|
1552
|
+
);
|
|
1553
|
+
for (const [lane, owners] of Object.entries(team.owners))
|
|
1554
|
+
out(`Lane ${lane}: ${owners.join(', ')}`);
|
|
1555
|
+
out(setup.length ? 'Still to set up:' : 'GitHub is ready for the team.');
|
|
1556
|
+
for (const s of setup) out(` ${s}`);
|
|
1557
|
+
out(`Commit ${file} on a branch; each teammate then needs code-kit and gh signed in.`);
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1465
1560
|
/**
|
|
1466
1561
|
* TEAM-5: `intend "<what and why>" [--touches globs]` raises an intent before any code, so the team sees
|
|
1467
1562
|
* a change of direction first; `intend agree|drop|duplicate <id> [--reason "…"]` is the tech lead's answer.
|
|
@@ -1586,6 +1681,7 @@ function usage() {
|
|
|
1586
1681
|
' | map <story>|project [--json] | trail [--json] | journal [--json]\n' +
|
|
1587
1682
|
' | story <id> [--json] | timeline [--json]\n' +
|
|
1588
1683
|
' | team [--json] [--fresh] | team since [--json] [--peek]\n' +
|
|
1684
|
+
' | team init --tech-lead <handle> [--owner <lane>=<handles>] [--write] | team init --off [--write]\n' +
|
|
1589
1685
|
' | team claim <story> [--lease globs] | team keep|release <story>\n' +
|
|
1590
1686
|
' | team reassign <story> <handle> | team codeowners [--write] | team board\n' +
|
|
1591
1687
|
' | intend "<what and why>" [--touches globs] | intend agree|drop|duplicate <id> [--reason "…"] | intend record <id>',
|
package/hooks/guard-bash.mjs
CHANGED
|
@@ -178,6 +178,14 @@ if (runs(cmd, new RegExp(String.raw`^${CODE_KIT}\s+intend\s+(agree|drop|duplicat
|
|
|
178
178
|
block(
|
|
179
179
|
`Blocked: agreeing or dropping an intent is the tech lead's own decision, from their terminal or the code-kit pane. Tell them what you'd recommend and why, and stop.\nCommand: ${cmd}`,
|
|
180
180
|
);
|
|
181
|
+
// TEAM-13: setting the team up, or taking it out, rewrites the config: the lead's, once the person agrees.
|
|
182
|
+
if (
|
|
183
|
+
runs(cmd, new RegExp(String.raw`^${CODE_KIT}\s+team\s+init\b.*\s--write\b`)) &&
|
|
184
|
+
actor.kind !== 'lead'
|
|
185
|
+
)
|
|
186
|
+
block(
|
|
187
|
+
`Blocked: the team's setup is the lead's to write, once the person agrees (/code-kit:team-init). Tell the lead what you'd change, and stop.\nCommand: ${cmd}`,
|
|
188
|
+
);
|
|
181
189
|
// The harness settings are the person's to change, from the pane or their terminal.
|
|
182
190
|
if (runs(cmd, new RegExp(String.raw`^${CODE_KIT}\s+settings\s+set\b`)))
|
|
183
191
|
block(
|