@warren-dean/code-kit 0.34.0 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +17 -0
- package/README.md +55 -33
- package/bin/code-kit.mjs +312 -14
- package/hooks/guard-agent.mjs +32 -1
- package/hooks/guard-bash.mjs +8 -3
- package/hooks/guard-paths.mjs +21 -2
- package/hooks/lib/config.mjs +8 -0
- package/hooks/lib/harness.mjs +13 -0
- package/hooks/lib/instructions.mjs +11 -1
- package/hooks/lib/layers.mjs +18 -0
- package/hooks/lib/loop-state.mjs +4 -3
- package/hooks/lib/next.mjs +100 -9
- package/hooks/lib/plan.mjs +19 -5
- package/hooks/lib/promote.mjs +554 -0
- package/hooks/lib/regression.mjs +2 -1
- package/hooks/lib/sessions.mjs +97 -13
- package/hooks/lib/shell.mjs +36 -11
- package/hooks/lib/streamconfig.mjs +80 -0
- package/hooks/lib/streams.mjs +244 -0
- package/hooks/lib/verify.mjs +14 -0
- package/hooks/mod/loop.mjs +7 -0
- package/hooks/mod/register.mjs +9 -1
- package/hooks/session.mjs +8 -0
- package/package.json +1 -1
- package/skills/decide/SKILL.md +9 -2
- package/skills/init/SKILL.md +9 -2
- package/skills/lead/SKILL.md +9 -1
- package/skills/promote/SKILL.md +49 -0
- package/skills/review/SKILL.md +1 -0
- package/skills/spec-check/SKILL.md +2 -1
- package/skills/spec-design/SKILL.md +1 -0
- package/templates/agent.md +2 -0
- package/templates/claude-md.md +2 -0
package/hooks/mod/register.mjs
CHANGED
|
@@ -421,13 +421,19 @@ export function register(on) {
|
|
|
421
421
|
boardSynced = at;
|
|
422
422
|
$.process.run(['node', cli, 'team', 'board'], { cwd, timeoutMs: 120000 }).catch(() => {});
|
|
423
423
|
}
|
|
424
|
+
const recorded = await json('loop', '--session', session).catch(() => null);
|
|
424
425
|
// LOOP-10: while another session runs the loop, whether it still does (its lease lapses as it ends).
|
|
425
426
|
if (!lease.mine) {
|
|
426
|
-
const recorded = await json('loop', '--session', session).catch(() => null);
|
|
427
427
|
const lead = recorded?.lead ?? null;
|
|
428
428
|
lease.other = lead && lead.session !== session ? lead : null;
|
|
429
429
|
role = recorded?.role ?? role;
|
|
430
430
|
}
|
|
431
|
+
// LOOP-6: a pause another tool recorded in the project (`code-kit loop pause`) pauses this loop too.
|
|
432
|
+
if (recorded?.paused && !loop.paused) {
|
|
433
|
+
loop.paused = true;
|
|
434
|
+
loop.proposal = null;
|
|
435
|
+
$.ui.invalidate('ui.render');
|
|
436
|
+
}
|
|
431
437
|
// SESS-4: a working session's own task, for its band.
|
|
432
438
|
const task =
|
|
433
439
|
valid && role === 'working'
|
|
@@ -686,6 +692,8 @@ export function register(on) {
|
|
|
686
692
|
// TEAM-7: a live provider (the hub's helper) rewrites the team's state as events arrive.
|
|
687
693
|
await stamp('.claude/state/team.json'),
|
|
688
694
|
await stamp('.claude/state/merge-queue.json'),
|
|
695
|
+
// LOOP-6: a pause recorded by another tool.
|
|
696
|
+
await stamp('.claude/state/loop.json'),
|
|
689
697
|
await listing('.claude/approvals'),
|
|
690
698
|
await listing('.claude/state/stop-blocks'),
|
|
691
699
|
[...agentsAtWork(await $.agent.list().catch(() => []))].sort().join(','),
|
package/hooks/session.mjs
CHANGED
|
@@ -11,6 +11,7 @@ import { loadConfig } from './lib/config.mjs';
|
|
|
11
11
|
import { releaseSession } from './lib/laneclaims.mjs';
|
|
12
12
|
import { modelOf } from './lib/hook.mjs';
|
|
13
13
|
import { endSession, startSession } from './lib/sessions.mjs';
|
|
14
|
+
import { hasStreams } from './lib/streams.mjs';
|
|
14
15
|
import { projectDir } from './lib/rules.mjs';
|
|
15
16
|
|
|
16
17
|
let input = {};
|
|
@@ -33,6 +34,13 @@ if (config && session && process.argv[2] === 'start') {
|
|
|
33
34
|
detached: true,
|
|
34
35
|
stdio: 'ignore',
|
|
35
36
|
}).unref();
|
|
37
|
+
// PROM-1: in a project built as streams, module code that belongs in core is looked for, in the background.
|
|
38
|
+
if (hasStreams(config))
|
|
39
|
+
spawn(process.execPath, [cli, 'promote', 'scan', '--quiet'], {
|
|
40
|
+
cwd: project,
|
|
41
|
+
detached: true,
|
|
42
|
+
stdio: 'ignore',
|
|
43
|
+
}).unref();
|
|
36
44
|
// DUR-4: what an agent left open when the last session stopped is checked against git, in the background.
|
|
37
45
|
spawn(process.execPath, [cli, 'reconcile'], {
|
|
38
46
|
cwd: project,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@warren-dean/code-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
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/decide/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: decide
|
|
3
|
-
description: The lead decides what a lane asked for and couldn't do itself (a new package, a migration, a protected file, a UX question) against the story's requirements, the spec, the principles and the architecture. Approves it, answers the lane with something that fits better, or takes it to the person only when it crosses a guardrail. Use when code-kit's loop or `code-kit next` says a lane waits on your decision, when a lane hands back a change request, or when the person runs /code-kit:decide [request numbers].
|
|
3
|
+
description: The lead decides what a lane asked for and couldn't do itself (a new package, a migration, a protected file, a UX question), and, as a platform's lead, what a stream asks of core, against the story's requirements, the spec, the principles and the architecture. Approves it, answers the lane with something that fits better, or takes it to the person only when it crosses a guardrail. Use when code-kit's loop or `code-kit next` says a lane waits on your decision, when a lane hands back a change request, or when the person runs /code-kit:decide [request numbers].
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Decide a lane's request
|
|
@@ -57,6 +57,13 @@ For each, read the lane's change request (its report, in `.claude/state/reports/
|
|
|
57
57
|
|
|
58
58
|
A request `by: "person"` is a guardrail the lane hit: a spec, a contract, a design, CI, a weakened test, or the running budget. A `cost` request (a commit over the budget, spec 29) is the person's under vibe too, and never goes to them bare: first look for what fits the budget (a smaller size, a cheaper tier or provider, one environment instead of two, a service the story can do without at launch), and send the lane back with it if one does. If none fits, ask them with each option that comes closest, what it gives up and what it saves a month, and the over-budget one with its cost (`code-kit ask … --option …`; under vibe, `--needs payment`). Check the lane really needs it first: often the story can be done inside the guardrail, and you tell the lane how and drop the request. If it does need it, the request is already waiting for the person, in their band and the pane's Needs you. Add your recommendation with `ask` when the choice isn't obvious from the request alone.
|
|
59
59
|
|
|
60
|
-
## 5.
|
|
60
|
+
## 5. Change requests to core
|
|
61
|
+
|
|
62
|
+
In a project built as streams with a platform stream (spec 31), a stream that needs core changed asks the platform (`code-kit core ask`), and its story waits. As the platform's lead, `core --json` lists them; ids are `C-n`. Judge each as you would a lane's request: the asking story's requirements need it, core doesn't already do it, and core can own it without knowing the stream (no stream's types, data or rules). Then:
|
|
63
|
+
|
|
64
|
+
- **Accept it** with the platform story that builds it, written in the platform's plan: `code-kit core accept C-n --story ST-n`. The asking story waits for that story to merge.
|
|
65
|
+
- **Decline it** with why, and what the stream can do instead: `code-kit core decline C-n --reason "…"`. The asking story no longer waits.
|
|
66
|
+
|
|
67
|
+
## 6. Report
|
|
61
68
|
|
|
62
69
|
One line per request: what was asked, what you decided, and why. "ST-138: pillow approved for api (MED-5 needs HEIC decoding; nothing installed reads HEIC)." Then carry on with the build.
|
package/skills/init/SKILL.md
CHANGED
|
@@ -61,6 +61,12 @@ 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 says so (a core and a module per line), or, without specs, ask once: "Do separate teams, or sessions, build separate product lines of this product?" If not, leave `streams` out: one lead runs every lane, as before. If so:
|
|
65
|
+
- `docs.plan` is a folder (`docs/plan/`) and each stream has its own plan file in it;
|
|
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
|
+
- 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;
|
|
68
|
+
- core's lanes go in a stream with `"platform": true` when the person wants a team to own core (its lead decides what goes into core, and the other streams ask it with `code-kit core ask`); otherwise they're in no stream, and the streams take them in turns;
|
|
69
|
+
- each stream's lead runs in its own session: `/code-kit:lead <stream>`; the first one leads from the main checkout, the others from a worktree each.
|
|
64
70
|
- **A QA lane:** when lanes own screens, or the plan's journeys cross lanes, a `qa` lane with a `test-engineer` agent owning the end-to-end suites (the plan's work split names them; brownfield: the folders the existing end-to-end tests live in), even if the docs forgot it. Its agent's proving command runs the suites. Add a `checks` entry for them scoped by `files` to the suites, so verify runs them when they change. Unit tests stay with each lane.
|
|
65
71
|
- **`setup`:** `3`, the version of this setup, so `code-kit next` can tell an older project what re-running init adds.
|
|
66
72
|
- **`lead.paths`:** contracts, specs, design, root config, and anything the docs reserve for the lead.
|
|
@@ -195,7 +201,8 @@ Re-run whenever the build has moved on: new apps or packages, folders that moved
|
|
|
195
201
|
|
|
196
202
|
`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.
|
|
197
203
|
|
|
198
|
-
4. **
|
|
204
|
+
4. **Adding streams to a project that started as one (spec 31):** when the person now builds separate product lines, 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
|
+
5. **Also propose:**
|
|
199
206
|
- agent files for new lanes, and updates to agents whose paths changed, and to the security reviewer when the specs' threat models changed;
|
|
200
207
|
- **project skills**, by reading the recipes in the docs again and comparing them with `.claude/skills/`:
|
|
201
208
|
- a new skill for each recipe the docs now describe that has none;
|
|
@@ -204,7 +211,7 @@ Re-run whenever the build has moved on: new apps or packages, folders that moved
|
|
|
204
211
|
- the matching **Skills to use** changes on every lane agent whose paths each recipe touches;
|
|
205
212
|
- skills the person wrote themselves, with no recipe behind them, stay as they are;
|
|
206
213
|
- a smaller baseline when `baseline` shows violations were fixed. It only ever shrinks.
|
|
207
|
-
|
|
214
|
+
6. **On approval:**
|
|
208
215
|
1. Replace `.claude/code-kit.json` with the draft and delete the draft.
|
|
209
216
|
2. Write or update the agents, and write, update or remove the project skills as approved, together.
|
|
210
217
|
3. Run `baseline --write` if it shrank.
|
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, where code-kit's loop runs and the plan's stories are dispatched from, when several sessions work one project. Says which session leads now and what moving the lead does, then gives the person the command that moves it. Use when the person says this session should lead, asks which session leads, or runs /code-kit: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. Says which session leads now and what moving the lead does, then gives the person the command that moves it. 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
|
|
@@ -25,4 +25,12 @@ The CLI is `node "${CLAUDE_PLUGIN_ROOT}/bin/code-kit.mjs"`, run from the project
|
|
|
25
25
|
|
|
26
26
|
4. Once they have, run `who` again and confirm this session leads.
|
|
27
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
|
+
```
|
|
33
|
+
|
|
34
|
+
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
|
+
|
|
28
36
|
A working session doesn't need this to work: it records its task (`code-kit task "<what>" --touches "<globs>"`), works in a worktree of its own, and `code-kit task done` when it's finished.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: promote
|
|
3
|
+
description: Decide the candidates for core in a project built as streams (spec 31): code in one stream's module that another stream repeats, wants to import or copied, or that repeats core. Reads each candidate's evidence, promotes it with a platform story that moves it into core and switches every stream to it, or keeps it in its module with why. Use when code-kit's loop or `code-kit next` says candidates are proposed for core, or the person runs /code-kit:promote [candidate ids].
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Decide what goes into core
|
|
7
|
+
|
|
8
|
+
In a project built as streams, each stream's lanes own its modules, and core is the code every stream builds on. When the same capability shows up in two streams, it belongs in core: built once, with one owner. code-kit raises a candidate when it sees code alike in two streams' modules (names aside), a lane refused an import of another stream's module, a lane copying files into a module, module code that repeats core, or a story's requirement that another stream's spec already has. Nothing moves by itself: you decide each one. It's yours when your stream is the platform (it owns core), or, without a platform stream, when the candidate touches your stream.
|
|
9
|
+
|
|
10
|
+
The CLI is `node "${CLAUDE_PLUGIN_ROOT}/bin/code-kit.mjs"`.
|
|
11
|
+
|
|
12
|
+
## 1. Read the candidates
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
node "${CLAUDE_PLUGIN_ROOT}/bin/code-kit.mjs" promote --json
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Each open candidate has its `id`, `kind` (`clone`, `core-clone`, `import`, `copy`, `requirement`), `what`, the files (`where`), the streams it touches and its evidence. The argument, if given, names the ids to take. For each, read the code on both sides: the lines `what` names, and enough around them to see what the code does and what it depends on.
|
|
19
|
+
|
|
20
|
+
## 2. Judge it
|
|
21
|
+
|
|
22
|
+
Promote only when all of these hold:
|
|
23
|
+
|
|
24
|
+
- **A second real use.** Two streams use it, or one stream uses it and another needs it now (a refused import, a story whose requirement repeats one). One stream's code stays in its module however general it looks.
|
|
25
|
+
- **The same thing.** The two copies do the same job for the same reason. Code alike by accident (two loops over different things) isn't a capability: reject it with that reason.
|
|
26
|
+
- **Core can own it without knowing the streams.** Once moved, it must not import a module or name a stream's types, data or rules. Where it does, either the stream-specific part stays behind (core takes a parameter, an interface or a callback), or it isn't core's.
|
|
27
|
+
- **It fits core's layer.** It moves into the core layer of the same technical layer (an API module's code into API core), never across layers.
|
|
28
|
+
|
|
29
|
+
A `core-clone` is a stream rebuilding what core already has: there's nothing to promote. Reject it with "use core's <name>", and tell that stream's lead, who sends the lane back to use core's.
|
|
30
|
+
|
|
31
|
+
## 3. Act on it
|
|
32
|
+
|
|
33
|
+
- **Promote.** Write a story in the platform's plan (yours, as the platform's lead; without one, in your stream's plan on a core lane), with `**Promotes:** <id>`, that moves the code into core, switches every stream's module that had it to core's, and proves it with tests every stream that uses it runs. Large code moves in steps, lower layers first, a few files a story. Then record it:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
node "${CLAUDE_PLUGIN_ROOT}/bin/code-kit.mjs" promote accept <id> --story ST-n
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The candidate closes when that story merges.
|
|
40
|
+
|
|
41
|
+
- **Keep it in its module.** Say why, so it isn't proposed again until its evidence changes (a third stream, a new copy):
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
node "${CLAUDE_PLUGIN_ROOT}/bin/code-kit.mjs" promote reject <id> --reason "<why it stays>"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## 4. Report
|
|
48
|
+
|
|
49
|
+
One line per candidate: what it was, what you decided and why. "P-3: the price rounding in both streams' checkout promoted as ST-210 (same rule, no stream types)."
|
package/skills/review/SKILL.md
CHANGED
|
@@ -59,6 +59,7 @@ Read the story and every requirement it cites. Then start from what's already be
|
|
|
59
59
|
|
|
60
60
|
- **Contracts respected:** the code uses the contracts as written. A lane that needed a contract change should have asked, not worked around it.
|
|
61
61
|
- **Running cost (spec 29):** where the config has a budget, a branch that changes the infrastructure files (`cost.paths`) changes `docs/costs.md` too (verify fails it otherwise). Read the two together: the size, tier and count in the code are the ones in the register's rows, every new paid thing has a row, and the estimate is for the load the spec gives, not a provider's production default. A mismatch sends the branch back, naming the file and the row. `code-kit cost` shows the totals against the budget and the prices to recheck.
|
|
62
|
+
- **Core reused, streams kept apart (spec 31):** in a project built as streams, `code-kit promote scan --branch <branch>` lists the branch's code that repeats core or another stream's module. Code that repeats core sends the branch back: it uses core's. Code alike in another stream is raised for core as a candidate: note it in the report; it's the platform's decision (`/code-kit:promote`), not a reason to send the branch back.
|
|
62
63
|
- **Standards kept:** `code-kit standards --for <changed files>` lists the project's standards for those files' layers. Check each changed file against the ones marked `checked` (the hooks already refuse what an `enforced` one names). A broken required standard sends the branch back, naming the standard's id and where; a broken recommended one is a concern; advice is at most a nit.
|
|
63
64
|
|
|
64
65
|
## 4. The security review
|
|
@@ -18,7 +18,8 @@ The project's specs are in the folder named by `docs.specs` in `.claude/code-kit
|
|
|
18
18
|
| Requirement | Status (done / partial / missing / conflicts) | Where | Note |
|
|
19
19
|
| ----------- | --------------------------------------------- | ----- | ---- |
|
|
20
20
|
|
|
21
|
-
6. **
|
|
21
|
+
6. **In a project built as streams** (the config has `streams`), run `node "${CLAUDE_PLUGIN_ROOT}/bin/code-kit.mjs" promote --story <ST-n>`: it lists each requirement of the story that another stream's spec already has. Don't build it again: note it in the table, and ask the lead whether it comes from core (a change request to the platform) or from that stream.
|
|
22
|
+
7. **List questions** for the lead wherever the spec is missing, ambiguous, or contradicts the code or another spec. Don't resolve them by guessing.
|
|
22
23
|
|
|
23
24
|
## Output
|
|
24
25
|
|
|
@@ -99,6 +99,7 @@ A spec answers what and why, not how: no framework, file or function names unles
|
|
|
99
99
|
|
|
100
100
|
These are what `/code-kit:init` turns into enforced rules, so be concrete.
|
|
101
101
|
|
|
102
|
+
- **Product lines (spec 31), asked once:** does the product have, or plan, separate product lines (offerings for different users, each with its own roadmap), or is it platform capability other products will build on? If yes, the architecture is a core per technical layer plus a module per product line (`api/core`, `api/<line>`), a module never imports another line's module, and core never imports a module; the plan has a plan file per line under `docs/plan/` and, when the person wants a team to own core, one for the platform. If no, a plain layout, as below; streams can be added later. Don't guess seams the brief doesn't show: a product split along lines it never follows makes every feature cross them.
|
|
102
103
|
- **`docs/architecture.md`:**
|
|
103
104
|
- the components (apps, services, packages, jobs) and what each is for;
|
|
104
105
|
- the **layers**, the folders each will live in, and which layers each may depend on (for example `ui → application → domain`, with adapters implementing the domain's ports);
|
package/templates/agent.md
CHANGED
|
@@ -23,6 +23,8 @@ Always:
|
|
|
23
23
|
- {{if standards}}Build to the project's standards for your layers, from `{{docs.standards}}` (read a standard's why and evidence there when you need it). A required one that review checks sends your branch back if it's broken; advice is yours to weigh:{{standards}}{{end}}
|
|
24
24
|
- Read every file you change in full. Of what it imports and what calls it, read what your change needs: the definitions it uses and the call sites it changes. A context tool's fresh card for a file stands for reading it whole; read the source where the card is missing, stale or not enough.
|
|
25
25
|
- Search before you build; reuse existing services, providers, components and schemas.
|
|
26
|
+
- {{if streams}}Look in core first: this project is built as streams, and what every stream needs lives there. Never import or copy another stream's module; if you need what it has, write a change request for the lead to have it promoted into core.{{end}}
|
|
27
|
+
- Change files with the Edit and Write tools, not the shell: no `cat > file <<EOF`, `python3 - <<EOF`, `sed -i` or `>>`. In your own worktree, Claude Code refuses a shell command it can't prove stays inside it, and each refusal is a step lost. Keep shell commands to running things, one plain command at a time, from your worktree's root.
|
|
26
28
|
- Write only in your owned paths. For anything else, write a short change request for the lead and stop.
|
|
27
29
|
- You answer to the lead, never the person. A question the spec doesn't settle (a product choice, UX the spec is silent on, an account): write it for the lead, with the choices and what each does, and carry on with what doesn't depend on it, or stop. The lead decides, or asks the person.
|
|
28
30
|
- A new dependency needs the lead's approval. Before asking, check the project doesn't already have something that does the job. If the install is refused, put in a change request for the lead: the package, the story and requirement that need it, what you checked, and anything lighter that would do; then stop. The lead approves it, or tells you what to use instead.
|
package/templates/claude-md.md
CHANGED
|
@@ -19,6 +19,8 @@ The code-kit plugin enforces the rules in `.claude/code-kit.json` on every file
|
|
|
19
19
|
|
|
20
20
|
{{if standards.all}}The project's standards, in `{{docs.standards}}`: {{standards.all}}. Each lane is given the ones for its layers. In review, check each changed file against the checked standards for its layer (`code-kit standards --for <file>`): a broken required one sends the branch back, naming the standard; a broken recommended one is a concern, and advice at most a nit. Adding a recommended standard may be yours where the config delegates the `standards` approval; removing one, or weakening a required one, is always the person's.{{end}}
|
|
21
21
|
|
|
22
|
+
{{if streams}}This project is built as streams (`code-kit streams`): {{streams}}. Each stream has its own lead session, plan, specs and lanes, and a lead dispatches only its own stream's stories and writes only its own stream's plan and specs. A module never imports another stream's module, and core never imports a module: the hooks refuse both. Core is the code the streams share{{platform}}. When the same code shows up in two streams' modules, it's a candidate for core: `code-kit promote` lists them, and the lead whose they are decides each (`/code-kit:promote`). In review, `code-kit promote scan --branch <branch>` lists what a branch repeats: code that repeats core goes back to use core's.{{end}}
|
|
23
|
+
|
|
22
24
|
- {{if harness.report.on}}When code-kit itself is wrong (a refusal that shouldn't have happened, a crash), draft a report with `code-kit report "<title>" --what "…" --expected "…"`: only code-kit's facts, never the project's. The person reads it and sends it, or not.{{end}}
|
|
23
25
|
|
|
24
26
|
Several sessions may work this project at once. One leads (the loop runs there, and stories are dispatched from it); the others are working sessions. `code-kit who` says which this is. In a working session, record what you're doing before you change code, with the paths you'll change, and work in a worktree of your own: `code-kit task "<what>" --touches "<globs>"`, and `code-kit task done` when it's finished. Never stash, discard or commit another session's files: ask that session.
|