@warren-dean/code-kit 0.3.4

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.
Files changed (42) hide show
  1. package/.claude-plugin/marketplace.json +18 -0
  2. package/.claude-plugin/plugin.json +23 -0
  3. package/LICENSE +21 -0
  4. package/README.md +369 -0
  5. package/SECURITY.md +7 -0
  6. package/bin/code-kit.mjs +398 -0
  7. package/hooks/guard-bash.mjs +223 -0
  8. package/hooks/guard-paths.mjs +70 -0
  9. package/hooks/hooks.json +71 -0
  10. package/hooks/lane-audit.mjs +58 -0
  11. package/hooks/lib/adapters/context-graph.mjs +34 -0
  12. package/hooks/lib/adapters/index.mjs +34 -0
  13. package/hooks/lib/baseline.mjs +23 -0
  14. package/hooks/lib/checks.mjs +67 -0
  15. package/hooks/lib/config.mjs +211 -0
  16. package/hooks/lib/dependencies.mjs +129 -0
  17. package/hooks/lib/diff.mjs +122 -0
  18. package/hooks/lib/glob.mjs +42 -0
  19. package/hooks/lib/hook.mjs +19 -0
  20. package/hooks/lib/layers.mjs +57 -0
  21. package/hooks/lib/next.mjs +197 -0
  22. package/hooks/lib/plan.mjs +206 -0
  23. package/hooks/lib/rules.mjs +313 -0
  24. package/hooks/lib/trace.mjs +69 -0
  25. package/hooks/lib/verify.mjs +146 -0
  26. package/hooks/post-edit-check.mjs +40 -0
  27. package/hooks/stop-check.mjs +84 -0
  28. package/package.json +41 -0
  29. package/skills/check/SKILL.md +19 -0
  30. package/skills/dispatch/SKILL.md +83 -0
  31. package/skills/init/SKILL.md +151 -0
  32. package/skills/next/SKILL.md +52 -0
  33. package/skills/review/SKILL.md +57 -0
  34. package/skills/spec-check/SKILL.md +27 -0
  35. package/skills/spec-design/SKILL.md +137 -0
  36. package/skills/status/SKILL.md +42 -0
  37. package/templates/agent.md +29 -0
  38. package/templates/brief.md +45 -0
  39. package/templates/claude-md.md +23 -0
  40. package/templates/github-workflow.yml +23 -0
  41. package/templates/plan.md +30 -0
  42. package/templates/spec.md +52 -0
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: {{agent}}
3
+ description: {{what this lane builds, in one sentence}} Use for {{the paths or kinds of work it owns}}.
4
+ tools: Read, Grep, Glob, Edit, Write, Bash
5
+ ---
6
+
7
+ You are the {{lane}} engineer for this repository.
8
+
9
+ **Owned paths:** {{lane paths from .claude/code-kit.json}}
10
+ **Layers:** {{the layers in these paths, and what each may depend on}}
11
+ **Specs:** {{the spec files this lane reads}}
12
+ **Skills to use:** spec-check{{, project skills for this lane}}
13
+ **Prove your work with:** `{{the command that proves this lane's work}}`
14
+
15
+ Lane rules:
16
+ {{- one line per rule the docs set for this lane}}
17
+
18
+ Always:
19
+
20
+ - Work on the branch the brief names (`<lane>/st-<n>`). Start every task with the spec-check skill and save its report to .claude/state/spec-check/<branch>.md; the path guard blocks code until it exists.
21
+ - Follow {{docs.principles}}, including the rules for AI agents. Hooks enforce ownership, layers and the project's checks; if one blocks you, fix the cause, never work around it.
22
+ - Read every file you change in full, plus its imports and its callers.
23
+ - Search before you build; reuse existing services, providers, components and schemas.
24
+ - Write only in your owned paths. For anything else, write a short change request for the lead and stop.
25
+ - A new dependency needs a person's approval for your lane. If the install is refused, put the package, why it's needed and the approval command from the refusal in a change request for the lead, and stop.
26
+ - Build every feature end to end. No mocks, stubs, placeholder screens or "coming soon".
27
+ - Prove each acceptance criterion with a test whose title names the requirement ID, e.g. `BOOK-4 …`.
28
+ - Commit your work on your branch before finishing; the stop hook runs the checks and requires it.
29
+ - Finish with: what you did, the spec section, the commands you ran with their output, open questions.
@@ -0,0 +1,45 @@
1
+ # {{Name}}
2
+
3
+ **Status:** framed | explored | scoped | specified | planned | ready
4
+ **Updated:** {{date}}
5
+
6
+ ## Problem
7
+
8
+ {{What's wrong or missing today, for whom, and how they cope now.}}
9
+
10
+ ## Users
11
+
12
+ | Actor | Trying to get done |
13
+ | --------- | ------------------ |
14
+ | {{actor}} | {{goal}} |
15
+
16
+ ## Outcome
17
+
18
+ {{What's different when this works, and how anyone will know.}}
19
+
20
+ ## Constraints
21
+
22
+ {{Deadline, budget, team, platforms and technology, regulation and data residency, systems it must fit.}}
23
+
24
+ ## Non-goals
25
+
26
+ - {{what this deliberately won't do}}
27
+
28
+ ## Scope
29
+
30
+ | Area | Spec | First release | Later |
31
+ | -------- | -------------------- | ------------- | --------- |
32
+ | {{area}} | `specs/NN-<area>.md` | {{summary}} | {{later}} |
33
+
34
+ **Quality targets:** {{scale, response times, availability, security and privacy, accessibility, devices, languages}}
35
+
36
+ ## Decision log
37
+
38
+ | Date | Decision | Why | Rejected, and why |
39
+ | -------- | ------------ | ------- | ----------------- |
40
+ | {{date}} | {{decision}} | {{why}} | {{alternatives}} |
41
+
42
+ ## Open questions
43
+
44
+ | Question | Owner | Blocks |
45
+ | -------- | ----- | ------ |
@@ -0,0 +1,23 @@
1
+ ## Enforced, not advised
2
+
3
+ The code-kit plugin enforces the rules in `.claude/code-kit.json` on every tool call:
4
+
5
+ - who writes where (the lead delegates lane work to the lane agents in `.claude/agents/`);
6
+ - the layer rules ({{layer names, in order}});
7
+ - spec-check before lane code{{; designs approved before screens}};
8
+ - an audit log of every change to protected paths (`.claude/approval-log.jsonl`), which the person reviews in the pull request;
9
+ - a person's approval for every new dependency, per package and per lane. When a lane asks for one, give the person the package, the reason and the approval command from the refusal, and resume the lane once they've run it;
10
+ - the project's checks before any agent finishes.
11
+
12
+ If a hook blocks you, fix the cause; never work around it.
13
+
14
+ The build runs from the specs in {{docs.specs}} and the stories in {{docs.plan}}. `/code-kit:next` picks the right step from the project's state; the steps are:
15
+
16
+ - `/code-kit:dispatch` starts ready stories on their lanes, each on its own `<lane>/st-<n>` branch;
17
+ - `/code-kit:review` checks a finished branch against its requirements before the lead merges it;
18
+ - `/code-kit:status` shows what's done, in review, ready and blocked, and what's untested;
19
+ - `/code-kit:spec-design` changes the specs when a decision changes. It updates the spec, the decision log and the plan together.
20
+
21
+ {{If the CI workflow is installed: pull requests run `code-kit verify`, and it must pass before a person merges to a protected branch.}}
22
+
23
+ Changing the rules means editing `.claude/code-kit.json` (the lead only), then running the `code-kit:check` skill.
@@ -0,0 +1,23 @@
1
+ # code-kit verify: the project's rules for every pull request, including work done outside Claude Code.
2
+ name: code-kit
3
+
4
+ on:
5
+ pull_request:
6
+
7
+ jobs:
8
+ verify:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+ with:
13
+ fetch-depth: 0 # verify compares the branch with where it left the base
14
+ - uses: actions/setup-node@v4
15
+ with:
16
+ node-version: 22
17
+ # {{init replaces this line with the steps that install what the project's checks need,
18
+ # e.g. pnpm/action-setup and `pnpm install --frozen-lockfile`}}
19
+ - name: Verify
20
+ run: >
21
+ npx --yes @warren-dean/code-kit@{{code-kit version}} verify
22
+ --base origin/${{ github.base_ref }}
23
+ --branch ${{ github.head_ref }}
@@ -0,0 +1,30 @@
1
+ # Plan
2
+
3
+ `code-kit status` reads this file. Keep each story's heading and its four `**…:**` lines in this form.
4
+
5
+ ## Lanes
6
+
7
+ | Lane | Agent | Owns | Proves its work with |
8
+ | -------- | --------- | --------- | -------------------- |
9
+ | {{lane}} | {{agent}} | {{globs}} | `{{command}}` |
10
+
11
+ ## Milestone 1: {{name}}
12
+
13
+ {{The usable increment this milestone delivers, in a sentence.}}
14
+
15
+ ### ST-1 {{Story title}}
16
+
17
+ **Lane:** {{lane}}
18
+ **Requirements:** {{AREA-1, AREA-2}}
19
+ **Depends on:** {{ST-n, or none}}
20
+ **Status:** todo
21
+
22
+ {{What gets built, in two or three sentences. The acceptance criteria are the cited requirements'.}}
23
+
24
+ ### ST-2 {{Story title}}
25
+
26
+ …
27
+
28
+ ## Milestone 2: {{name}}
29
+
30
+ …
@@ -0,0 +1,52 @@
1
+ # {{NN}}. {{Capability area}}
2
+
3
+ **Status:** draft | agreed | building | done
4
+ **Outcome:** {{what this area makes possible, for whom, in a sentence}}
5
+ **Actors:** {{who uses it: kinds of users, admins, other systems, scheduled jobs}}
6
+ **Depends on:** {{other spec files this area relies on}}
7
+
8
+ ## In scope
9
+
10
+ - {{what the first release delivers}}
11
+
12
+ ## Later
13
+
14
+ - {{agreed for a later release, and why it waits}}
15
+
16
+ ## Data
17
+
18
+ | Entity | Field | Type | Required | Rules |
19
+ | ---------- | --------- | -------- | -------- | ------------------------------------- |
20
+ | {{entity}} | {{field}} | {{type}} | yes / no | {{uniqueness, limits, format, owner}} |
21
+
22
+ ## States
23
+
24
+ {{For each entity with a lifecycle: the states, the allowed transitions, and what triggers each. Leave this section out if nothing changes state.}}
25
+
26
+ ## Requirements
27
+
28
+ ### {{AREA}}-1 {{short name}}
29
+
30
+ {{What the system does, stated so someone can check whether the code does it. Real values, not "reasonable".}}
31
+
32
+ - **Who:** {{the actors allowed, and anyone explicitly not allowed}}
33
+ - **Errors:** {{each failure case and what the actor sees}}
34
+ - **Events:** {{what other parts of the system or external services are told}}
35
+
36
+ **Acceptance**
37
+
38
+ - Given {{context}}, when {{action}}, then {{observable result}}.
39
+ - Given {{an error case}}, when {{action}}, then {{observable result}}.
40
+
41
+ ### {{AREA}}-2 {{short name}}
42
+
43
+ …
44
+
45
+ ## Quality targets
46
+
47
+ {{Only the ones that change how this area is built: scale, response times, privacy, accessibility, audit.}}
48
+
49
+ ## Open questions
50
+
51
+ | Question | Owner | Blocks |
52
+ | -------- | ----- | ------ |