@warren-dean/code-kit 0.36.0 → 0.36.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 +5 -0
- package/hooks/guard-bash.mjs +1 -1
- package/hooks/hooks.json +11 -0
- package/hooks/lead-prompt.mjs +44 -0
- package/package.json +1 -1
- package/skills/init/SKILL.md +3 -2
- package/skills/lead/SKILL.md +11 -13
|
@@ -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.36.
|
|
12
|
+
"version": "0.36.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.36.
|
|
3
|
+
"version": "0.36.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,11 @@
|
|
|
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.36.1 (2026-11-14)
|
|
6
|
+
|
|
7
|
+
- **`/code-kit:lead` moves the lead itself.** Typing `/code-kit:lead` (or `/code-kit:lead <stream>`) answered with which session leads and a `!` command for you to run, since the hooks refuse moving the lead from an agent. Typing the command is already your choice, so code-kit now records this session as the lead, of the stream you named, as the prompt arrives; the skill confirms it, says what it means, and moves into a worktree when another stream's lead holds the main checkout. A stream that doesn't exist changes nothing, and the answer names the streams.
|
|
8
|
+
- **Re-running init asks about product lines.** `/code-kit:init` asked whether the product has separate product lines only on a project with no specs, or drafted streams when the architecture already laid out a core and modules. A project whose brief or specs name several product lines, with code laid out by technical role, was never asked. init now asks once, naming the lines it found, on a first run and on every re-run while the config has no `streams`.
|
|
9
|
+
|
|
5
10
|
## 0.36.0 (2026-11-14)
|
|
6
11
|
|
|
7
12
|
- **Streams: several product lines in one product.** A product with separate product lines in one repository can now be built by a squad, or a session, per line at once. Declare them as `streams` in the config: each stream has its own lead session (`/code-kit:lead <stream>`), plan file, specs and lanes, and each lead's loop dispatches only its own stream's stories, so two sessions no longer fight over one lead. Layers become a core per technical layer and a module per stream: a module may use core and its own stream's modules, never another stream's, and core uses no module; the hooks refuse both and say to ask for it in core rather than copy it. Core is owned by a platform stream, which the others ask with `code-kit core ask`, or, without one, its lanes are shared and taken in turns. A project without `streams` works as before.
|
package/hooks/guard-bash.mjs
CHANGED
|
@@ -246,7 +246,7 @@ if (
|
|
|
246
246
|
runs(cmd, new RegExp(String.raw`^${CODE_KIT}\s+sessions\s+(lead|beat|stream)\b`))
|
|
247
247
|
)
|
|
248
248
|
block(
|
|
249
|
-
`Blocked: which session leads the project is recorded by code-kit, and choosing it is the person's own act (
|
|
249
|
+
`Blocked: which session leads the project is recorded by code-kit, and choosing it is the person's own act (they type \`/code-kit:lead\`, with the stream in a project built as streams, or use Lead from here in the code-kit band). Carry on with your work.\nCommand: ${cmd}`,
|
|
250
250
|
);
|
|
251
251
|
// TEAM-9: handing someone's claim to someone else is the tech lead's own decision too.
|
|
252
252
|
if (runs(cmd, new RegExp(String.raw`^${CODE_KIT}\s+team\s+reassign\b`)))
|
package/hooks/hooks.json
CHANGED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// UserPromptSubmit (docs/specs/23-the-team.md, SESS-2; docs/specs/31-streams-and-platform.md, STRM-2):
|
|
3
|
+
// the person typing `/code-kit:lead [stream]` is their own choice of lead, so it's recorded as the prompt
|
|
4
|
+
// arrives. The agent can't run `sessions lead` itself (guard-bash refuses it); the skill only confirms.
|
|
5
|
+
import { spawnSync } from 'node:child_process';
|
|
6
|
+
import { readFileSync } from 'node:fs';
|
|
7
|
+
import { fileURLToPath } from 'node:url';
|
|
8
|
+
import { loadConfig } from './lib/config.mjs';
|
|
9
|
+
import { mainCheckoutLead, memberOf, readSession } from './lib/sessions.mjs';
|
|
10
|
+
import { hasStreams } from './lib/streams.mjs';
|
|
11
|
+
import { projectDir } from './lib/rules.mjs';
|
|
12
|
+
|
|
13
|
+
let input = {};
|
|
14
|
+
try {
|
|
15
|
+
input = JSON.parse(readFileSync(0, 'utf8') || '{}');
|
|
16
|
+
} catch {
|
|
17
|
+
// no input: nothing to do
|
|
18
|
+
}
|
|
19
|
+
const asked = String(input.prompt ?? '').match(/^\s*\/(?:code-kit:)?lead(?:\s+(\S+))?\s*$/);
|
|
20
|
+
const session = input.session_id ?? null;
|
|
21
|
+
const project = projectDir();
|
|
22
|
+
const { config } = loadConfig(project);
|
|
23
|
+
if (!asked || !session || !config) process.exit(0);
|
|
24
|
+
|
|
25
|
+
const cli = fileURLToPath(new URL('../bin/code-kit.mjs', import.meta.url));
|
|
26
|
+
const run = spawnSync(
|
|
27
|
+
process.execPath,
|
|
28
|
+
[cli, 'sessions', 'lead', ...(asked[1] ? [asked[1]] : []), '--session', session],
|
|
29
|
+
{ cwd: project, encoding: 'utf8' },
|
|
30
|
+
);
|
|
31
|
+
const said = (run.status === 0 ? run.stdout : run.stderr).trim();
|
|
32
|
+
let note =
|
|
33
|
+
run.status === 0
|
|
34
|
+
? `code-kit: the person ran /code-kit:lead, so code-kit recorded it as they sent it. ${said}`
|
|
35
|
+
: `code-kit: the person ran /code-kit:lead, and code-kit couldn't record it: ${said}`;
|
|
36
|
+
// STRM-2: one lead holds the main checkout; another stream's lead works from a worktree of its own.
|
|
37
|
+
const holder = run.status === 0 && hasStreams(config) ? mainCheckoutLead(project) : null;
|
|
38
|
+
if (holder && holder.id !== session)
|
|
39
|
+
note += ` The ${holder.stream ?? 'project'} lead (${memberOf(holder)}) holds the main checkout, so lead from a worktree of your own on lead/${readSession(project, session)?.stream ?? 'work'} (EnterWorktree), unless this session already works in one.`;
|
|
40
|
+
process.stdout.write(
|
|
41
|
+
JSON.stringify({
|
|
42
|
+
hookSpecificOutput: { hookEventName: 'UserPromptSubmit', additionalContext: note },
|
|
43
|
+
}),
|
|
44
|
+
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@warren-dean/code-kit",
|
|
3
|
-
"version": "0.36.
|
|
3
|
+
"version": "0.36.1",
|
|
4
4
|
"description": "Keeps AI coding agents inside your project's rules: lanes, layer rules, protected paths and proof before finish, enforced by Claude Code hooks and in CI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Warren Langeveldt",
|
package/skills/init/SKILL.md
CHANGED
|
@@ -61,7 +61,7 @@ Write `.claude/code-kit.draft.json`. Follow `${CLAUDE_PLUGIN_ROOT}/README.md`
|
|
|
61
61
|
- `agent`: a kebab-case agent name, for example `api-engineer`;
|
|
62
62
|
- `paths` and `exclude`: every path must have exactly one owner.
|
|
63
63
|
- `label` (optional): what the lane delivers, in a few words ("Screens", "Tests"), when its name doesn't say it.
|
|
64
|
-
- **`streams` (spec 31), only when the product has separate product lines:** the architecture
|
|
64
|
+
- **`streams` (spec 31), only when the product has separate product lines:** when the architecture lays out a core and a module per line, draft them. When the brief, the specs or the plan name more than one product line or offering (for different users, on a shared platform), or there are no specs, ask once: "Do separate teams, or sessions, build separate product lines of this product?", naming the lines you found. If not, leave `streams` out: one lead runs every lane, as before. If so:
|
|
65
65
|
- `docs.plan` is a folder (`docs/plan/`) and each stream has its own plan file in it;
|
|
66
66
|
- `"streams": { "<line>": { "label", "lanes", "plan", "specs" } }`, each lane in exactly one stream: a line's lanes own its modules (`api-<line>`, `web-<line>`);
|
|
67
67
|
- each module's layer gets `"stream": "<line>"`; core's layers have none. The import check then refuses a module importing another line's module, and core importing a module;
|
|
@@ -191,6 +191,7 @@ Re-run whenever the build has moved on: new apps or packages, folders that moved
|
|
|
191
191
|
- the security reviewer (`.claude/agents/security-reviewer.md`), unless the product handles no sign-in, personal data, payments, outside input or secrets; and, as a proposal for the person, a threat model and security requirements for each spec that lacks them (spec-design's section 4);
|
|
192
192
|
- `"adapters": { "<name>": true }` for a companion that's installed but not set up, which is then set up before any code.
|
|
193
193
|
- project standards, when the project has no `docs/standards.md`: suggest them as section 2's Standards describes, moving the engineering rules out of `docs/principles.md`, and protect the file.
|
|
194
|
+
- streams, when the config has no `streams` (whatever its `setup`) and the brief, the specs or the plan name more than one product line: ask the question section 2 gives, naming the lines, and on a yes draft them as section 4 describes.
|
|
194
195
|
- a running budget, when the config has no `cost` (whatever its `setup`): ask the person for it as section 2 describes. Then cost what's already defined in the infrastructure files, or deployed, into `docs/costs.md`, a row per paid thing at its real size, and run `code-kit cost`. When it's over the budget, bring the person options that fit (spec-design's architecture step lists the kinds), each with what it gives up and what it saves a month, and record their choice in the brief's decision log; the stories that bring it within budget go in the plan.
|
|
195
196
|
3. **Show the difference:**
|
|
196
197
|
|
|
@@ -201,7 +202,7 @@ Re-run whenever the build has moved on: new apps or packages, folders that moved
|
|
|
201
202
|
|
|
202
203
|
`diff` lists lanes, layers, checks and rules that were added (`+`), removed (`-`) or changed (`~`), and how many files change owner, route by route. Explain each change in a sentence, with where it came from: the doc section, or the folder in the repository.
|
|
203
204
|
|
|
204
|
-
4. **Adding streams to a project that started as one (spec 31):** when the person now
|
|
205
|
+
4. **Adding streams to a project that started as one (spec 31):** when the person says they now build separate product lines, or answers yes to the question above, draft `streams` as in section 2, splitting each technical lane into a core lane and a lane per line, and each layer into core and a module per line. Where the code isn't split into those folders yet, don't move it in the update: write the move as stories (in the platform's plan, or the lead's own), lower layers first, a few files each, every story switching the code that imports what it moved, and say so in the diff. Until a story moves a file, the file stays with the lane that owns it today.
|
|
205
206
|
5. **Also propose:**
|
|
206
207
|
- agent files for new lanes, and updates to agents whose paths changed, and to the security reviewer when the specs' threat models changed;
|
|
207
208
|
- **project skills**, by reading the recipes in the docs again and comparing them with `.claude/skills/`:
|
package/skills/lead/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: lead
|
|
3
|
-
description: Make this Claude Code session the project's lead session (or, in a project built as streams, one stream's lead), where code-kit's loop runs and the plan's stories are dispatched from, when several sessions work one project.
|
|
3
|
+
description: Make this Claude Code session the project's lead session (or, in a project built as streams, one stream's lead), where code-kit's loop runs and the plan's stories are dispatched from, when several sessions work one project. Running it moves the lead here as the person sends it; the skill confirms it and says what it means. Use when the person says this session should lead, asks which session leads, or runs /code-kit:lead.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Lead from this session
|
|
@@ -9,6 +9,14 @@ Several Claude Code sessions can work one project at once. One is the lead sessi
|
|
|
9
9
|
|
|
10
10
|
The CLI is `node "${CLAUDE_PLUGIN_ROOT}/bin/code-kit.mjs"`, run from the project root.
|
|
11
11
|
|
|
12
|
+
**When the person ran `/code-kit:lead`**, typing it was their choice: code-kit recorded this session as the lead (of the stream they named) as the prompt arrived, and its note in your context says so, or why it couldn't. Don't ask them to run anything. Run `who` to confirm, and tell them in a sentence or two what it means: which stream this session leads, its lanes and plan, and which session leads the rest. When the note says another lead holds the main checkout, move this session into a worktree of its own on the branch the note names (EnterWorktree) before you change anything. If the note says it couldn't (a stream that doesn't exist, say), tell them why and what the streams are.
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
node "${CLAUDE_PLUGIN_ROOT}/bin/code-kit.mjs" who
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
**When the person asked in words** ("lead from this session"), and didn't run the command:
|
|
19
|
+
|
|
12
20
|
1. See who leads now:
|
|
13
21
|
|
|
14
22
|
```bash
|
|
@@ -17,19 +25,9 @@ The CLI is `node "${CLAUDE_PLUGIN_ROOT}/bin/code-kit.mjs"`, run from the project
|
|
|
17
25
|
```
|
|
18
26
|
|
|
19
27
|
2. If this session already leads, say so and stop.
|
|
20
|
-
3. Otherwise, tell
|
|
28
|
+
3. Otherwise, tell them what moving the lead does: this session starts running the loop and dispatching the plan's stories, and the session that led becomes a working session, which stops prompting its lead. Choosing the lead is theirs, and the hooks refuse it from an agent: they run `/code-kit:lead` (with the stream, in a project built as streams), or use **Lead from here** in the code-kit band.
|
|
21
29
|
|
|
22
|
-
|
|
23
|
-
! node "${CLAUDE_PLUGIN_ROOT}/bin/code-kit.mjs" sessions lead
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
4. Once they have, run `who` again and confirm this session leads.
|
|
27
|
-
|
|
28
|
-
**A project built as streams** (`code-kit streams` lists them; spec 31) has a lead per stream, and they lead at once: each runs its own loop, dispatches only its own stream's lanes and stories, and writes only its own stream's plan and specs. The argument names the stream (`/code-kit:lead studio`). Give the person the command with it:
|
|
29
|
-
|
|
30
|
-
```text
|
|
31
|
-
! node "${CLAUDE_PLUGIN_ROOT}/bin/code-kit.mjs" sessions lead <stream>
|
|
32
|
-
```
|
|
30
|
+
**A project built as streams** (`code-kit streams` lists them; spec 31) has a lead per stream, and they lead at once: each runs its own loop, dispatches only its own stream's lanes and stories, and writes only its own stream's plan and specs. The argument names the stream (`/code-kit:lead studio`).
|
|
33
31
|
|
|
34
32
|
Moving one stream's lead leaves the other streams' leads as they are. The first lead works in the main checkout; every other stream's lead works in a worktree of its own (start the session with `claude --worktree`, or move it into one), on `lead/<stream>`, and its plan changes reach the base through the merge queue. A session that leads with no stream named leads every stream that has no lead of its own. A working session joins a stream with `sessions stream <name>`, the person's command too.
|
|
35
33
|
|