@xhulz/nina 0.59.0 → 0.60.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/package.json +1 -1
- package/releases/0.60.0/core/GAPS.md +125 -0
- package/releases/0.60.0/core/answered.json +74 -0
- package/releases/0.60.0/core/defaults/tree/.claude/agents/architect.md +1 -0
- package/releases/0.60.0/core/defaults/tree/.claude/agents/dba.md +3 -0
- package/releases/0.60.0/core/defaults/tree/.claude/agents/devops.md +1 -0
- package/releases/0.60.0/core/defaults/tree/.claude/agents/implementer.md +1 -0
- package/releases/0.60.0/core/defaults/tree/.claude/agents/integration-tester.md +3 -0
- package/releases/0.60.0/core/defaults/tree/.claude/agents/qa.md +7 -0
- package/releases/0.60.0/core/defaults/tree/.claude/agents/reviewer.md +3 -0
- package/releases/0.60.0/core/defaults/tree/.claude/agents/secops.md +3 -0
- package/releases/0.60.0/core/defaults/tree/.claude/agents/solidity-auditor.md +3 -0
- package/releases/0.60.0/core/defaults/tree/.claude/agents/solidity-dev.md +3 -0
- package/releases/0.60.0/core/tree/.claude/agents/architect.md +132 -0
- package/releases/0.60.0/core/tree/.claude/agents/dba.md +119 -0
- package/releases/0.60.0/core/tree/.claude/agents/design-reviewer.md +76 -0
- package/releases/0.60.0/core/tree/.claude/agents/devops.md +118 -0
- package/releases/0.60.0/core/tree/.claude/agents/implementer.md +164 -0
- package/releases/0.60.0/core/tree/.claude/agents/integration-tester.md +170 -0
- package/releases/0.60.0/core/tree/.claude/agents/planner.md +132 -0
- package/releases/0.60.0/core/tree/.claude/agents/qa.md +150 -0
- package/releases/0.60.0/core/tree/.claude/agents/reviewer.md +187 -0
- package/releases/0.60.0/core/tree/.claude/agents/secops.md +120 -0
- package/releases/0.60.0/core/tree/.claude/agents/solidity-auditor.md +126 -0
- package/releases/0.60.0/core/tree/.claude/agents/solidity-dev.md +123 -0
- package/releases/0.60.0/core/tree/.claude/agents-overview.md +65 -0
- package/releases/0.60.0/core/tree/.claude/frontend.md +10 -0
- package/releases/0.60.0/core/tree/.claude/graph.md +79 -0
- package/releases/0.60.0/core/tree/.claude/patterns.md +251 -0
- package/releases/0.60.0/core/tree/.claude/pills/README.md +150 -0
- package/releases/0.60.0/core/tree/.claude/pipeline.md +101 -0
- package/releases/0.60.0/core/tree/.claude/retrieval.md +103 -0
- package/releases/0.60.0/core/tree/.claude/router.md +205 -0
- package/releases/0.60.0/core/tree/.claude/templates/integration.md +48 -0
- package/releases/0.60.0/core/tree/CLAUDE.md +166 -0
- package/releases/0.60.0/core/tree/scripts/cost-watch.mjs +25 -0
- package/releases/0.60.0/core/tree/scripts/edit-guard.mjs +24 -0
- package/releases/0.60.0/core/tree/scripts/harness-check.mjs +71 -0
- package/releases/0.60.0/core/tree/scripts/loop-gate.mjs +19 -0
- package/releases/0.60.0/core/vocabulary.json +14 -0
- package/releases/0.60.0/surfaces/blockchain/tree/.claude/agents/architect.md +5 -0
- package/releases/0.60.0/surfaces/blockchain/tree/.claude/agents/devops.md +5 -0
- package/releases/0.60.0/surfaces/blockchain/tree/.claude/agents/reviewer.md +5 -0
- package/releases/0.60.0/surfaces/blockchain/tree/.claude/agents/solidity-auditor.md +18 -0
- package/releases/0.60.0/surfaces/blockchain/tree/.claude/agents/solidity-dev.md +16 -0
- package/releases/0.60.0/surfaces/blockchain/tree/.claude/agents-overview.md +6 -0
- package/releases/0.60.0/surfaces/blockchain/tree/.claude/graph.md +11 -0
- package/releases/0.60.0/surfaces/blockchain/tree/.claude/router.md +6 -0
- package/releases/0.60.0/surfaces/blockchain/tree/CLAUDE.md +12 -0
- package/releases/0.60.0/surfaces/d1/tree/.claude/agents/dba.md +15 -0
- package/releases/0.60.0/surfaces/d1/tree/.claude/agents/devops.md +2 -0
- package/releases/0.60.0/surfaces/d1/tree/.claude/agents/implementer.md +2 -0
- package/releases/0.60.0/surfaces/d1/tree/.claude/patterns.md +8 -0
- package/releases/0.60.0/surfaces/d1/tree/CLAUDE.md +2 -0
- package/releases/0.60.0/surfaces/db/tree/.claude/agents/architect.md +5 -0
- package/releases/0.60.0/surfaces/db/tree/.claude/agents/dba.md +54 -0
- package/releases/0.60.0/surfaces/db/tree/.claude/agents/devops.md +5 -0
- package/releases/0.60.0/surfaces/db/tree/.claude/agents/implementer.md +2 -0
- package/releases/0.60.0/surfaces/db/tree/.claude/agents/integration-tester.md +10 -0
- package/releases/0.60.0/surfaces/db/tree/.claude/agents/planner.md +2 -0
- package/releases/0.60.0/surfaces/db/tree/.claude/agents/reviewer.md +22 -0
- package/releases/0.60.0/surfaces/db/tree/.claude/agents/secops.md +2 -0
- package/releases/0.60.0/surfaces/db/tree/.claude/agents-overview.md +5 -0
- package/releases/0.60.0/surfaces/db/tree/.claude/graph.md +8 -0
- package/releases/0.60.0/surfaces/db/tree/.claude/patterns.md +22 -0
- package/releases/0.60.0/surfaces/db/tree/.claude/pipeline.md +13 -0
- package/releases/0.60.0/surfaces/db/tree/.claude/retrieval.md +5 -0
- package/releases/0.60.0/surfaces/db/tree/.claude/router.md +4 -0
- package/releases/0.60.0/surfaces/db/tree/CLAUDE.md +17 -0
- package/releases/0.60.0/surfaces/drizzle/tree/.claude/agents/dba.md +9 -0
- package/releases/0.60.0/surfaces/drizzle/tree/.claude/agents/devops.md +5 -0
- package/releases/0.60.0/surfaces/drizzle/tree/.claude/agents/implementer.md +2 -0
- package/releases/0.60.0/surfaces/drizzle/tree/.claude/patterns.md +7 -0
- package/releases/0.60.0/surfaces/edge-cf/tree/.claude/agents/architect.md +14 -0
- package/releases/0.60.0/surfaces/edge-cf/tree/.claude/agents/dba.md +2 -0
- package/releases/0.60.0/surfaces/edge-cf/tree/.claude/agents/devops.md +29 -0
- package/releases/0.60.0/surfaces/edge-cf/tree/.claude/agents/implementer.md +14 -0
- package/releases/0.60.0/surfaces/edge-cf/tree/.claude/agents/integration-tester.md +11 -0
- package/releases/0.60.0/surfaces/edge-cf/tree/.claude/agents/qa.md +3 -0
- package/releases/0.60.0/surfaces/edge-cf/tree/.claude/agents/reviewer.md +8 -0
- package/releases/0.60.0/surfaces/edge-cf/tree/.claude/agents/secops.md +8 -0
- package/releases/0.60.0/surfaces/edge-cf/tree/.claude/patterns.md +17 -0
- package/releases/0.60.0/surfaces/edge-cf/tree/.claude/retrieval.md +8 -0
- package/releases/0.60.0/surfaces/edge-cf/tree/CLAUDE.md +27 -0
- package/releases/0.60.0/surfaces/frontend/tree/.claude/agents/architect.md +20 -0
- package/releases/0.60.0/surfaces/frontend/tree/.claude/agents/devops.md +28 -0
- package/releases/0.60.0/surfaces/frontend/tree/.claude/agents/implementer.md +25 -0
- package/releases/0.60.0/surfaces/frontend/tree/.claude/agents/qa.md +17 -0
- package/releases/0.60.0/surfaces/frontend/tree/.claude/agents/reviewer.md +56 -0
- package/releases/0.60.0/surfaces/frontend/tree/.claude/patterns.md +8 -0
- package/releases/0.60.0/surfaces/frontend/tree/.claude/retrieval.md +2 -0
- package/releases/0.60.0/surfaces/frontend/tree/.claude/router.md +14 -0
- package/releases/0.60.0/surfaces/frontend/tree/CLAUDE.md +5 -0
- package/releases/0.60.0/surfaces/integrations/tree/.claude/agents/architect.md +16 -0
- package/releases/0.60.0/surfaces/integrations/tree/.claude/agents/implementer.md +12 -0
- package/releases/0.60.0/surfaces/integrations/tree/.claude/agents/integration-tester.md +20 -0
- package/releases/0.60.0/surfaces/integrations/tree/.claude/agents/planner.md +2 -0
- package/releases/0.60.0/surfaces/integrations/tree/.claude/agents/reviewer.md +21 -0
- package/releases/0.60.0/surfaces/integrations/tree/.claude/agents/secops.md +2 -0
- package/releases/0.60.0/surfaces/integrations/tree/.claude/agents-overview.md +8 -0
- package/releases/0.60.0/surfaces/integrations/tree/.claude/graph.md +10 -0
- package/releases/0.60.0/surfaces/integrations/tree/.claude/patterns.md +38 -0
- package/releases/0.60.0/surfaces/integrations/tree/.claude/pipeline.md +16 -0
- package/releases/0.60.0/surfaces/integrations/tree/.claude/retrieval.md +16 -0
- package/releases/0.60.0/surfaces/integrations/tree/.claude/router.md +6 -0
- package/releases/0.60.0/surfaces/integrations/tree/CLAUDE.md +17 -0
- package/releases/0.60.0/surfaces/money/tree/.claude/agents/architect.md +12 -0
- package/releases/0.60.0/surfaces/money/tree/.claude/agents/dba.md +14 -0
- package/releases/0.60.0/surfaces/money/tree/.claude/agents/implementer.md +11 -0
- package/releases/0.60.0/surfaces/money/tree/.claude/agents/integration-tester.md +3 -0
- package/releases/0.60.0/surfaces/money/tree/.claude/agents/reviewer.md +23 -0
- package/releases/0.60.0/surfaces/money/tree/.claude/agents/secops.md +5 -0
- package/releases/0.60.0/surfaces/money/tree/.claude/agents/solidity-auditor.md +4 -0
- package/releases/0.60.0/surfaces/money/tree/.claude/agents/solidity-dev.md +4 -0
- package/releases/0.60.0/surfaces/money/tree/.claude/graph.md +2 -0
- package/releases/0.60.0/surfaces/money/tree/.claude/patterns.md +49 -0
- package/releases/0.60.0/surfaces/money/tree/.claude/pipeline.md +2 -0
- package/releases/0.60.0/surfaces/money/tree/.claude/retrieval.md +2 -0
- package/releases/0.60.0/surfaces/money/tree/CLAUDE.md +11 -0
- package/releases/0.60.0/surfaces/pii/tree/.claude/agents/dba.md +2 -0
- package/releases/0.60.0/surfaces/pii/tree/.claude/agents/devops.md +8 -0
- package/releases/0.60.0/surfaces/pii/tree/.claude/agents/reviewer.md +8 -0
- package/releases/0.60.0/surfaces/pii/tree/.claude/agents/secops.md +2 -0
- package/releases/0.60.0/surfaces/pii/tree/.claude/agents/solidity-auditor.md +5 -0
- package/releases/0.60.0/surfaces/pii/tree/CLAUDE.md +5 -0
- package/releases/0.60.0/surfaces/prisma/tree/.claude/agents/architect.md +2 -0
- package/releases/0.60.0/surfaces/prisma/tree/.claude/agents/dba.md +42 -0
- package/releases/0.60.0/surfaces/prisma/tree/.claude/agents/devops.md +11 -0
- package/releases/0.60.0/surfaces/prisma/tree/.claude/agents/implementer.md +2 -0
- package/releases/0.60.0/surfaces/prisma/tree/.claude/agents/integration-tester.md +2 -0
- package/releases/0.60.0/surfaces/prisma/tree/.claude/agents/reviewer.md +2 -0
- package/releases/0.60.0/surfaces/prisma/tree/.claude/patterns.md +15 -0
- package/releases/0.60.0/surfaces/prisma/tree/CLAUDE.md +5 -0
- package/src/commands/upgrade.mjs +23 -1
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# Pills of Knowledge
|
|
2
|
+
|
|
3
|
+
Hard-won, per-agent **behavioral corrections** — lessons learned the expensive way (a loop-back,
|
|
4
|
+
a rejected diff, a blocked milestone, a user correction). Each agent reads its own pills **before
|
|
5
|
+
acting** so it does not repeat a past mistake.
|
|
6
|
+
|
|
7
|
+
This is a knowledge surface, not a convention doc. Keep the niche clean:
|
|
8
|
+
|
|
9
|
+
| Surface | Holds | Example |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| `CLAUDE.md` / `.claude/patterns.md` | **Codebase law / conventions** | "relative imports carry a `.js` extension" |
|
|
12
|
+
| `.claude/integrations/<slug>.md` | **External premises**, with evidence | "the client's `signOut()` never rejects" |
|
|
13
|
+
| **`.claude/pills/<role>/` (here)** | **Agent behavioral corrections** | "implementer: `waitFor()` hangs under fake timers" |
|
|
14
|
+
|
|
15
|
+
If a lesson is really a code convention or an external premise, it belongs in those files — not here.
|
|
16
|
+
|
|
17
|
+
## Layout
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
.claude/pills/
|
|
21
|
+
├── README.md # this file
|
|
22
|
+
├── shared/ # pills that apply to MORE THAN ONE role
|
|
23
|
+
└── <role>/ # one directory per role, named exactly as its spec in .claude/agents/
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
A role directory is created on demand, when its first pill is written. One **lesson per file**,
|
|
27
|
+
`kebab-case.md`. An agent reads `pills/<its-role>/*.md` **and** the `pills/shared/*.md` whose
|
|
28
|
+
`applies_to` includes it.
|
|
29
|
+
|
|
30
|
+
Placement is not decoration — it is delivery. A pill sitting in `architect/` that declares
|
|
31
|
+
`applies_to: [architect, implementer]` is never read by the implementer, because the implementer
|
|
32
|
+
only globs its own directory and `shared/`. So the rule is mechanical, and `nina pills` enforces it:
|
|
33
|
+
|
|
34
|
+
- **one role in `applies_to`** → the pill lives in that role's directory
|
|
35
|
+
- **more than one** → the pill lives in `shared/`
|
|
36
|
+
|
|
37
|
+
A pill loose at the top level of `pills/` is read by nobody.
|
|
38
|
+
|
|
39
|
+
## Pill format
|
|
40
|
+
|
|
41
|
+
Frontmatter is mandatory. A pill without it still reads like prose to a human, but it is invisible
|
|
42
|
+
to every filter the agents and the tooling run — `status`, `trigger` and `applies_to` all stop
|
|
43
|
+
working, so the pill is either ignored or applied where it does not belong.
|
|
44
|
+
|
|
45
|
+
```markdown
|
|
46
|
+
---
|
|
47
|
+
id: <role-dir>-<file-slug> # derived from the path, so it cannot drift
|
|
48
|
+
applies_to: [implementer] # one or more roles; drives who reads it, and where it lives
|
|
49
|
+
severity: low | medium | high
|
|
50
|
+
status: active | retired # retired = graduated into a rule, kept for history
|
|
51
|
+
date: YYYY-MM-DD # when learned; this is what lets staleness be spotted
|
|
52
|
+
occurrences: 1 # bump when the SAME lesson is learned again — see Graduation
|
|
53
|
+
last_seen: YYYY-MM-DD # set with every bump; how the harness knows the lesson is current
|
|
54
|
+
trigger: <when this pill is relevant — the agent applies it only if the task matches>
|
|
55
|
+
citations: [path/to/file.ts:42] # the code this pill is a claim about, when there is any
|
|
56
|
+
---
|
|
57
|
+
**What went wrong:** <the concrete mistake, with where it happened>
|
|
58
|
+
**Rule:** <the imperative — what to do / not do next time>
|
|
59
|
+
**Why:** <the mechanism, so the rule is understood and not merely obeyed>
|
|
60
|
+
**How to apply:** <the concrete check or step the agent runs>
|
|
61
|
+
source: <the run / commit / conversation that produced the lesson>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
The `id` is the pill's directory and filename joined. When the filename already opens with the
|
|
65
|
+
role — `reviewer/reviewer-never-write-to-repo-files.md` — the role is not repeated.
|
|
66
|
+
|
|
67
|
+
**Every pill carries evidence: `citations`, or `source`, or both.** A pill is a claim about how
|
|
68
|
+
this system behaves, and a claim with nothing behind it is the thing this harness exists to remove.
|
|
69
|
+
The two are not interchangeable, and that is why they sit in different places:
|
|
70
|
+
|
|
71
|
+
- `citations` point at code in this repository, so a machine can later ask whether the cited line
|
|
72
|
+
still exists. Use them whenever the lesson is about code. They are a **frontmatter field**
|
|
73
|
+
because tooling reads them back.
|
|
74
|
+
- `source` points at the episode — a run, a commit, a conversation. Use it when the lesson is about
|
|
75
|
+
a tool or a process and there is no line to cite. Only a person ever reads it, so it closes the
|
|
76
|
+
body rather than crowding the header.
|
|
77
|
+
|
|
78
|
+
## The four guardrails (so this stays an asset, not noise)
|
|
79
|
+
|
|
80
|
+
1. **Bounded growth + graduation.** "Read all my pills" only works while the set is small. See
|
|
81
|
+
*Graduation* below.
|
|
82
|
+
2. **Staleness.** A pill that cites code rots like any note. `date` flags age and `citations` make
|
|
83
|
+
the rot findable; **verify before trusting**, and prune or update when you next touch the topic.
|
|
84
|
+
3. **Defined authoring trigger.** Every loop-back (qa → implementer, a reviewer rejection, a mandatory
|
|
85
|
+
gate blocking) **and every user correction** is looked at for a lesson, and a pill is written when the
|
|
86
|
+
mistake would happen again — `.claude/router.md` § *Look at every loop-back for a lesson*. The lesson
|
|
87
|
+
belongs to the stage whose work was sent back. If it already has a pill, do not write a second one:
|
|
88
|
+
increment that pill's `occurrences` and set `last_seen`.
|
|
89
|
+
4. **Trigger-targeted, not blanket.** The agent reads its pills but **applies only those whose
|
|
90
|
+
`trigger` matches the current task**. This is what lets the corpus grow without drowning the agent.
|
|
91
|
+
|
|
92
|
+
## Graduation
|
|
93
|
+
|
|
94
|
+
`occurrences` is the counter that decides when a correction has stopped being an anecdote. A pill
|
|
95
|
+
learned once is a note. The same pill learned a third time is evidence that the surrounding rules do
|
|
96
|
+
not cover the case, and the fix belongs where nobody has to remember it:
|
|
97
|
+
|
|
98
|
+
- a convention of this codebase → this project's `.claude/patterns.md`, `CLAUDE.md` or the agent's own
|
|
99
|
+
spec, each written through its copy under `.nina/project/tree/` (`nina where <file>` lists the slots),
|
|
100
|
+
then `nina compose`
|
|
101
|
+
- a premise about a dependency → `.claude/integrations/<slug>.md`
|
|
102
|
+
- a correction that would apply to **any** project of this shape → back into the harness itself, as
|
|
103
|
+
a rule in the core or in the surface that implies it
|
|
104
|
+
|
|
105
|
+
Which of these it is, is this project's call, and only the last leaves it. When a pill reaches three
|
|
106
|
+
occurrences, `harness:check` asks for the call every turn until it is made:
|
|
107
|
+
|
|
108
|
+
- **A rule here:** write it, then `nina learn --graduate <pill> --here <file>`. That retires the pill —
|
|
109
|
+
`status: retired`, moved to `.claude/pills/retired/<the directory it was in>/` — and keeps a record under
|
|
110
|
+
`.nina/requests/`, so the lesson is still watched: if it comes back three more times, the rule did not
|
|
111
|
+
hold, and `harness:check` sends it to the harness. A retired pill is history, not instruction, and there
|
|
112
|
+
no agent opens it to find out. Deleting it would lose the reason the rule exists.
|
|
113
|
+
- **A rule for every project:** the core and the surfaces live in another repository, and this project
|
|
114
|
+
composes a frozen version of them, so this graduation is a request. `nina learn --graduate <pill>` writes
|
|
115
|
+
one under `.nina/requests/`, carrying the pinned version, the layer the rule belongs in and the lesson in
|
|
116
|
+
this project's words. **Commit it with the pill.** The harness maintainer answers it in a release — with
|
|
117
|
+
the rule, or with the reason it stays here — and the `nina upgrade` that installs that release closes the
|
|
118
|
+
request: a rule retires the pill; a decline leaves it active, and `harness:check` asks for it as a rule
|
|
119
|
+
here. Until then the pill stays active; retiring it earlier drops the lesson in the gap.
|
|
120
|
+
|
|
121
|
+
Either can be done before three. `nina pills` names every active pill that has reached three
|
|
122
|
+
occurrences and, for the harness, proposes where it should go: the core when its roles are composed by
|
|
123
|
+
every project, or the surface that its roles exist for. That is a proposal, not a verdict — a reviewer
|
|
124
|
+
lesson can still be about one surface, and only a person can tell. It is reported as a note, never a
|
|
125
|
+
failure: a recurring lesson is work to do, not a defect.
|
|
126
|
+
|
|
127
|
+
## Reading contract (referenced from each agent spec)
|
|
128
|
+
|
|
129
|
+
> Before acting, read `.claude/pills/<your-role>/*.md` and the `pills/shared/*.md` whose
|
|
130
|
+
> `applies_to` includes your role. Treat `status: active` pills as binding for any task matching
|
|
131
|
+
> their `trigger`. Skip `retired` pills. If a pill cites code that no longer exists, prefer the
|
|
132
|
+
> current code and flag the pill as stale.
|
|
133
|
+
|
|
134
|
+
## Checking
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
nina pills --project .
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Reports malformed frontmatter, pills filed where their audience will not read them, roles this
|
|
141
|
+
project does not compose, and pills carrying no evidence.
|
|
142
|
+
|
|
143
|
+
It also resolves every `citations` entry against the repository. A path that no longer exists, or a
|
|
144
|
+
line past the end of the file it names, is a failure: the pill is telling an agent to look at
|
|
145
|
+
something that is not there. A citation that still resolves in a file which **changed after the
|
|
146
|
+
pill's `date`** is only a note — the line survived, but the code on it may have moved on, and no
|
|
147
|
+
machine can settle that. Verify it before trusting it, then update the pill or retire it.
|
|
148
|
+
|
|
149
|
+
This is what `citations` buys, and it is the reason the format asks for them. A pill with only a
|
|
150
|
+
`source` cannot be checked this way at all.
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Pipeline
|
|
2
|
+
|
|
3
|
+
<!-- nina:slot project.1 track-summary -->
|
|
4
|
+
|
|
5
|
+
<!-- nina:slot project.2 pipeline-diagram -->
|
|
6
|
+
|
|
7
|
+
The `reviewer` and every gate the diff triggers are read-only, so **dispatch them together in one
|
|
8
|
+
message** after the implementer rather than in sequence. The reviewer names the gates the diff
|
|
9
|
+
triggers; `qa` goes out once the reviewer and each of them approved, and runs vitest once, on its own. On a diff over ~200 lines, fan the reviewer out by dimension. Full rules:
|
|
10
|
+
`.claude/router.md` § *Parallelization*.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Stage contracts
|
|
15
|
+
|
|
16
|
+
Each stage has: **Input** → what arrives, **Output** → the artifact handed on, **Tools** → what it may use, **Exit criteria** → what must be true before handing off.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
### Planner
|
|
21
|
+
|
|
22
|
+
- **Input:** user request, often ambiguous or multi-step.
|
|
23
|
+
- **Output:** ordered list of subtasks, each tagged with a 1-line goal + scope (S/M/L) + retrieval list + parallelization tag (`SEQUENTIAL` / `PARALLEL-SAFE`).
|
|
24
|
+
- **Tools:** what its spec's `tools:` grants. **No edits except planning artifacts.**
|
|
25
|
+
- **Exit criteria:** each subtask is small enough for an architect to design in a single pass.
|
|
26
|
+
- **Skip if:** task is already small, single-concern, and concrete.
|
|
27
|
+
|
|
28
|
+
### Architect
|
|
29
|
+
|
|
30
|
+
- **Input:** one subtask from planner, or a well-scoped direct request.
|
|
31
|
+
- **Output:** technical spec — files to touch, function signatures, data flow, edge cases, tests to add, patterns to follow. Marks which gates in `.claude/graph.md` the change will trigger — the database gate if the schema or a query will be touched, the integration gate if an integration boundary will be — AND, for the latter, includes an **Integration premises** section: every behavior the implementation depends on, each carrying the evidence its kind requires — a `<package dir>/node_modules/<lib>/<file>:<line>` citation with its version, a contract-test case, an observed response, or a `P<n>` reference into `.claude/integrations/<slug>.md`. No premise without a citation.
|
|
32
|
+
- **Tools:** what its spec's `tools:` grants. **No edits except spec files + `.claude/integrations/**`.**
|
|
33
|
+
- **Exit criteria:** implementer can code without re-planning AND the integration gate, where `.claude/graph.md` has one, can verify each premise / contract case without re-deriving it.
|
|
34
|
+
|
|
35
|
+
### Implementer
|
|
36
|
+
|
|
37
|
+
- **Input:** architect's spec.
|
|
38
|
+
- **Output:** working TS code + tests. `{{TYPECHECK_CMD}}`, `{{LINT_CMD}}`, and (when frontend) `{{BUILD_CMD}}` clean for the affected packages. Diff scoped to the spec. **Does NOT run vitest.**
|
|
39
|
+
- **Tools:** what its spec's `tools:` grants.
|
|
40
|
+
- **Exit criteria:** typecheck/lint/build pass; no scope creep; if the database was touched, says so on first line; if an external service surface touched, says so.
|
|
41
|
+
<!-- nina:slot db.1 -->
|
|
42
|
+
<!-- nina:slot integrations.1 -->
|
|
43
|
+
|
|
44
|
+
### Reviewer (gate before qa)
|
|
45
|
+
|
|
46
|
+
- **Input:** implementer's diff + all upstream artifacts.
|
|
47
|
+
- **Output:** `APPROVED`, or `REJECTED` with `path:line` references.
|
|
48
|
+
- **Tools:** what its spec's `tools:` grants. **No edits. No vitest.**
|
|
49
|
+
- **Exit criteria:**
|
|
50
|
+
- `{{TYPECHECK_CMD}}`, `{{LINT_CMD}}` pass; `{{BUILD_CMD}}` when frontend touched.
|
|
51
|
+
- Diff matches spec (reject scope creep).
|
|
52
|
+
- `.claude/patterns.md` conventions followed (TSDoc, layering, naming, owner scoping).
|
|
53
|
+
<!-- nina:slot db.2 -->
|
|
54
|
+
<!-- nina:slot integrations.2 -->
|
|
55
|
+
- No security / privacy regression (no PII in logs, no leaked secret, no query missing its owner scope).
|
|
56
|
+
<!-- nina:slot money.1 -->
|
|
57
|
+
- **Preview-first deploy invariant:** a spec that culminates in prod deploy names a preview URL where smoke runs FIRST.
|
|
58
|
+
|
|
59
|
+
### QA (test execution)
|
|
60
|
+
|
|
61
|
+
- **Input:** `APPROVED` from the reviewer and every gate the diff triggered + the implementer's touched-package list.
|
|
62
|
+
- **Output:** PASS (ready for deploy) or FAIL (loops back to implementer/architect).
|
|
63
|
+
- **Tools:** what its spec's `tools:` grants.
|
|
64
|
+
- Runs vitest **once**, per affected package, **sequentially** (configs enforce single-fork). Kills stray test processes at start and end. See `.claude/agents/qa.md`.
|
|
65
|
+
|
|
66
|
+
### Devops (deploy)
|
|
67
|
+
|
|
68
|
+
- **Trigger:** qa PASS on a step that changes a deployed surface. Not for test-only, docs-only or harness-only steps, nor while the project has no preview target yet.
|
|
69
|
+
- **Input:** qa PASS + the touched-package list + the architect spec's preview-deploy plan.
|
|
70
|
+
- **Output:** `DEPLOYED` (targets, migrations, the smoke it actually ran, the rollback) or `BLOCKED` (what stopped it, which stage owns the fix).
|
|
71
|
+
- **Tools:** what its spec's `tools:` grants. **No edits to code, tests or config.**
|
|
72
|
+
- **Checks:** clean rebuild of emitting packages; both targets when the API surface changed; every variable the bundle reads present at build time; migrations applied in order against the intended database; secret parity; smoke against preview exercising the changed path; a named rollback.
|
|
73
|
+
- **Production:** never on its own initiative — an explicit go from {{OWNER}}, for that change.
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Handoff discipline
|
|
78
|
+
|
|
79
|
+
Each stage produces a **written artifact** — spec, diff, review comments. The next stage consumes the artifact, **not** the original user message. If the implementer finds itself re-reading the original user message, something is wrong with the spec.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Examples
|
|
84
|
+
<!-- nina:slot project.3 worked-example-a -->
|
|
85
|
+
<!-- nina:slot project.4 worked-example-b -->
|
|
86
|
+
|
|
87
|
+
### Example C — Trivial fix
|
|
88
|
+
|
|
89
|
+
User: "Fix the typo in the dashboard page title."
|
|
90
|
+
|
|
91
|
+
No stage: a trivial edit goes through no chain (`CLAUDE.md`, the task table). Edit it directly, run the typecheck, and commit.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## When the pipeline breaks
|
|
96
|
+
|
|
97
|
+
Where each failing verdict sends the work, and how many rounds it gets, is in `.claude/graph.md` —
|
|
98
|
+
the one place it is stated, composed for this project.<!-- nina:why --> This section used to restate it, and had
|
|
99
|
+
already drifted from it: it sent an architect back to the planner along an edge the graph did not
|
|
100
|
+
have.<!-- /nina:why --> One thing the graph cannot express, so it stays here: a stage that hits something no spec
|
|
101
|
+
anticipated stops and says so. It does not guess.
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Retrieval Map (RAG for workflow)
|
|
2
|
+
|
|
3
|
+
Which documents to pull into context for a given task type. Goal: **avoid loading all docs on every task** — that wastes tokens and crowds out the actual work.
|
|
4
|
+
|
|
5
|
+
This is the closest thing the harness has to RAG for development. Treat it as authoritative.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Always loaded (by Claude Code itself)
|
|
10
|
+
- `CLAUDE.md` — loads automatically. Don't re-read.
|
|
11
|
+
|
|
12
|
+
## Pills (per-agent behavioral corrections — loaded by the agent itself)
|
|
13
|
+
|
|
14
|
+
`.claude/pills/<role>/*.md` + `.claude/pills/shared/*.md` hold hard-won corrections from past mistakes (a loop-back, a rejected diff, a blocked milestone, a user correction). **Each subagent reads its own pills before acting** (the instruction is in every `.claude/agents/<role>.md`). Distinct from the surfaces above: pills capture *agent behavior* ("the implementer did X wrong"), not codebase conventions (→ `patterns.md`) or library premises (→ `integrations/`). The orchestrator looks at every loop-back and user correction for a lesson, and writes a pill when it would happen again. Graduation: a lesson learned three times goes to the harness as a request, and the upgrade to the release that answers it retires the pill. Format + guardrails: `.claude/pills/README.md`.
|
|
15
|
+
<!-- nina:slot integrations.1 -->
|
|
16
|
+
<!-- nina:slot project.1 integration-doc-list -->
|
|
17
|
+
<!-- nina:slot integrations.2 -->
|
|
18
|
+
|
|
19
|
+
## Code map (load first for file-location tasks)
|
|
20
|
+
|
|
21
|
+
**Rule:** Before grepping the repo to find which files participate in a domain, load `.claude/code-map.md`. Two layers:
|
|
22
|
+
|
|
23
|
+
- **`.claude/code-map.md`** — hand-curated. Purpose, invariants, the critical paths, what to reuse. **Read this one.**
|
|
24
|
+
- **`.claude/code-map.generated.md`** — the exhaustive mechanical inventory (every module, its exports, its test) plus the dead-export and untested-module reports, built by a script of the project's own: the harness ships none. Go here when you need the full list. A project with no such script yet defers this file in its profile, and `.claude/code-map.md` is then the whole map — every instruction that points here falls back to it.
|
|
25
|
+
|
|
26
|
+
Where the project checks the curated map against the tree, its `harness:check` runs that check every turn. **A "does this helper already exist?" question is answered here, not by writing a second one.**
|
|
27
|
+
|
|
28
|
+
## Load on demand
|
|
29
|
+
|
|
30
|
+
### Task types
|
|
31
|
+
|
|
32
|
+
| Task type | Load these docs | Dispatch |
|
|
33
|
+
|---|---|---|
|
|
34
|
+
| New API endpoint | `.claude/architecture.md` § *API*, § *Layering*, `.claude/patterns.md` § *API conventions* | architect → implementer → reviewer → qa |
|
|
35
|
+
<!-- nina:slot db.1 -->
|
|
36
|
+
<!-- nina:slot db.2 -->
|
|
37
|
+
<!-- nina:slot edge-cf.1 -->
|
|
38
|
+
<!-- nina:slot integrations.3 -->
|
|
39
|
+
<!-- nina:slot edge-cf.2 -->
|
|
40
|
+
<!-- nina:slot money.1 -->
|
|
41
|
+
<!-- nina:slot frontend.1 -->
|
|
42
|
+
<!-- nina:slot edge-cf.3 -->
|
|
43
|
+
| Performance investigation | `.claude/architecture.md` § *Performance targets*, relevant source | architect → implementer |
|
|
44
|
+
|
|
45
|
+
### Meta tasks
|
|
46
|
+
|
|
47
|
+
**Before changing anything under `.claude/` or `CLAUDE.md`, settle where it goes.** Most of those
|
|
48
|
+
files are composed and cannot be changed from this project; the rest are yours outright, and the
|
|
49
|
+
first question is mechanical rather than a judgement call: **does the file carry `nina:generated`?**
|
|
50
|
+
`nina where <path>` answers that and the rest for any path — including a path that does not exist
|
|
51
|
+
yet, which is the case no file's own header can answer — and it prints the same sentence that file's
|
|
52
|
+
header carries rather than a second wording of it. Inside a generated file the second question is
|
|
53
|
+
the judgement one, and it is only about that case: is the wrong text **this project's fact**, which
|
|
54
|
+
belongs in a `project.N` slot, or **a rule for every project**, which cannot be changed from here?
|
|
55
|
+
|
|
56
|
+
| Task type | Load these docs | Dispatch |
|
|
57
|
+
|---|---|---|
|
|
58
|
+
| A rule an agent follows is wrong | `nina where <the composed file>` — it is a **request against the pinned core**, quoting file and line. It cannot be edited here | report it; it arrives back through `nina upgrade` |
|
|
59
|
+
| A number, path, command or provider in a composed file is wrong | `nina where <the composed file>` — it is **this project's fact**, so it belongs in the slot it names under `.nina/project/tree/` | whoever found it, now |
|
|
60
|
+
| A spec the harness should compose is not on disk | `nina where <the path>` — a file gated on a surface this project does not declare is **not missing**, it is switched off. Declaring the surface is a decision about the project, not a fix | whoever is asking why it is absent |
|
|
61
|
+
| A mistake just happened and should not happen twice | `.claude/pills/README.md` — a **pill** under `.claude/pills/<role>/`, written directly. Never an edit to the agent's spec | the orchestrator, on the loop-back |
|
|
62
|
+
| What a library actually does, proven at runtime | `.claude/integrations/<slug>.md` — yours to write, and the slug belongs in `.nina/profile.json` or nothing knows the doc exists | the integration gate, or whoever proved it |
|
|
63
|
+
| A plan for work in progress | `.claude/plans/**` — yours, and nothing composes it, ever | whoever is planning |
|
|
64
|
+
| Anything that is not one of the above | `nina where <the path>` — it will say "not harness", which is an answer: the file is ordinary project code and the harness has no opinion about it | whoever is editing it |
|
|
65
|
+
| New subagent role | `.claude/pipeline.md`, `.claude/router.md`, existing `.claude/agents/*.md` | human decision |
|
|
66
|
+
| Package / route / service / RPC method added or removed | `.claude/code-map.md` — update the curated map, and its check where the project has one | whoever shipped the change, at the close of the step |
|
|
67
|
+
| Update this map | the project's slot in it — `nina where .claude/retrieval.md` names it; a row every project needs is a request against the pinned core | architect (light) → reviewer |
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## How to scope loads
|
|
72
|
+
|
|
73
|
+
- **Load a section, not a full doc, when possible.** Architecture and patterns docs have headings; jump to the relevant one.
|
|
74
|
+
- **Don't preload.** Only read a doc when the task actually requires it.
|
|
75
|
+
- **Re-read existing code before editing it**, even if read this session — it may have changed.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Anti-patterns
|
|
80
|
+
|
|
81
|
+
- ❌ Loading `.claude/architecture.md` in full for a 3-line bug fix.
|
|
82
|
+
- ❌ Loading `.claude/patterns.md` when the task is a pure design discussion (no code yet).
|
|
83
|
+
- ❌ Loading every subagent spec manually — they load automatically when dispatched via Agent.
|
|
84
|
+
- ❌ Re-reading `CLAUDE.md` after Claude Code has loaded it.
|
|
85
|
+
- ❌ Skipping the retrieval map and loading "everything just in case."
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## When unsure
|
|
90
|
+
|
|
91
|
+
1. Read the **first 50 lines** of `.claude/architecture.md` (table of contents).
|
|
92
|
+
2. Identify the relevant section.
|
|
93
|
+
3. Read that section only.
|
|
94
|
+
4. If still unclear, escalate to the user — don't guess with more tokens.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Updating this map
|
|
99
|
+
|
|
100
|
+
When a new kind of task appears that isn't in the table:
|
|
101
|
+
1. Add a row here first.
|
|
102
|
+
2. Commit the update alongside the change it describes.
|
|
103
|
+
3. Don't let the map rot — a stale retrieval map is worse than no map.
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# Agent Router
|
|
2
|
+
|
|
3
|
+
Decides which subagent (or chain) to dispatch for a given task. Subagent definitions live in `.claude/agents/`.
|
|
4
|
+
|
|
5
|
+
<!-- nina:slot project.1 track-summary -->
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Decision tree
|
|
10
|
+
|
|
11
|
+
The stages and edges are in `.claude/graph.md`. What follows is this project's own way of sizing a
|
|
12
|
+
task into a chain over them.
|
|
13
|
+
|
|
14
|
+
<!-- nina:slot project.2 decision-tree -->
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Track flow
|
|
19
|
+
|
|
20
|
+
<!-- nina:slot project.3 track-flow-diagram -->
|
|
21
|
+
|
|
22
|
+
The stages, and the edges between them, are in `.claude/graph.md` — the one place they are stated. Every gate the diff triggers runs beside the reviewer, and `qa` goes out once all of them approved. The reviewer's `Gates` line names the gates the diff triggers: send any you did not. When the architect's report says `Design review: needed`, says nothing of it, or the change builds a check, scanner, parser or filter, send the spec to the `design-reviewer` before the implementer, once per spec, before its first step: a design flaw found in the spec costs one correction, found in the diff a whole round.
|
|
23
|
+
|
|
24
|
+
**Every loop has a cap.** Before dispatching a loop-back, count the rounds the SAME issue has already made on that edge. At the cap `.claude/graph.md` gives it, do not dispatch again: stop and hand {{OWNER}} the report from every round. A third attempt at a fix that failed twice is rarely different from the second, each round costs minutes to hours<!-- nina:why -->, and until this rule existed nothing in the pipeline could stop a loop at all<!-- /nina:why -->. A different issue on the same edge starts its own count. A stage that sends work back names each issue on the `ISSUES` line under its verdict; when you dispatch a round — the fix, and the check of the fix — copy that line into both dispatches, so the stage that checks can keep the id of an issue that is still open. That id is what your count is of.
|
|
25
|
+
|
|
26
|
+
Where the project wires the **loop gate** (`scripts/loop-gate.mjs`, run by hooks — `nina wire` puts them
|
|
27
|
+
in place), the cap is held for you. It counts a round when a dispatch acts on a loop-back a stage
|
|
28
|
+
declared on its `VERDICT` line — per issue while every round's reports named theirs on the `ISSUES` line,
|
|
29
|
+
per loop from the first that did not until it closes — whichever stage the fix went to; several dispatches
|
|
30
|
+
acting on the same verdicts are one round; and each message from {{OWNER}} gives every open loop one round
|
|
31
|
+
more — your own `AskUserQuestion` does not. A loop closes when a review launched after the latest fix passes
|
|
32
|
+
with no rejection beside it — a resumed one too, and a pass needs no `ISSUES` line — or when the next stage,
|
|
33
|
+
sent out after the last review, passes. Work run side by side shares one count per stage and verdict: a rejection still open in
|
|
34
|
+
one task keeps another's pass from closing it. The dispatch past the cap goes to {{OWNER}} to confirm. If they refuse it, do
|
|
35
|
+
what the graph says — hand them each round's report and ask how to proceed — and do not route around the
|
|
36
|
+
refusal by resuming the fixer or making the fix yourself.
|
|
37
|
+
|
|
38
|
+
The gate trusts the ids it is given: an issue renamed between rounds starts its count over, so an edge
|
|
39
|
+
still goes to {{OWNER}} once it has gone round more than twice its cap with no approval between. It does
|
|
40
|
+
not see a fix you make without a subagent — so keep your own count as well, gate or no gate. When you
|
|
41
|
+
dispatch a second round on an edge, say "round 2 of max 2 on <edge>" in the dispatch itself, so the
|
|
42
|
+
count is in the transcript for whoever reads it next. After a compaction the gate hands you its open loops
|
|
43
|
+
and the documents to read again; `nina gate --status` lists them, and what closes each, at any time.
|
|
44
|
+
|
|
45
|
+
### Milestone gate
|
|
46
|
+
|
|
47
|
+
**secops** is a milestone gate, not a per-sub-step stage: when the LAST sub-step of a numbered set (`6.*`)
|
|
48
|
+
or phase passes qa, dispatch it beside devops to audit the whole assembled surface. The set is not done
|
|
49
|
+
until it returns `SECURE`; a `BLOCKED` goes back to the architect or implementer, then to a re-audit.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Rules
|
|
54
|
+
<!-- nina:slot db.1 -->
|
|
55
|
+
<!-- nina:slot integrations.1 -->
|
|
56
|
+
<!-- nina:slot blockchain.1 -->
|
|
57
|
+
|
|
58
|
+
### Planner only for ambiguous, multi-step, or multi-package work
|
|
59
|
+
If the task fits in one head and lives in a single package, skip to architect (or implementer for trivial things).
|
|
60
|
+
One package is not one step, though: the architect still splits a long file list into steps (see *A spec's steps are passes of their own*).
|
|
61
|
+
|
|
62
|
+
### Architect output is a spec, not code
|
|
63
|
+
Architect produces a TS spec; implementer consumes the spec; they do not re-read the original user message.
|
|
64
|
+
|
|
65
|
+
### A chain with no architect: the dispatch is the spec
|
|
66
|
+
When a chain starts at the implementer, your dispatch is its spec: the goal, the files it may touch and
|
|
67
|
+
what must hold when it is done. The reviewer reviews against it and asks none of what only an architect's
|
|
68
|
+
spec carries — an Obsolescence list, a preview-deploy plan, a skill citation, integration premises. A
|
|
69
|
+
change that needs one of those needs an architect.
|
|
70
|
+
|
|
71
|
+
### A spec is corrected in place
|
|
72
|
+
A spec sent back is corrected where it is wrong; new work comes as a new step file or spec. Never ask for
|
|
73
|
+
a `Revision N` section, and correct a spec yourself only in place, searching it and its steps for what you contradict. Point a dispatch at the sections and steps
|
|
74
|
+
that changed, by number: a history at a spec's head is read first by every stage and applies to
|
|
75
|
+
nothing.<!-- nina:why --> The architect was told to correct in place, and the
|
|
76
|
+
orchestrator went on asking for revisions. The first new project's second spike spec opened with four
|
|
77
|
+
revision sections, one of them written by the orchestrator, and every dispatch told the stage to read them
|
|
78
|
+
first. Its first spec reached an eighth revision, which had become the way new work was asked for.<!-- /nina:why -->
|
|
79
|
+
|
|
80
|
+
### A spike answers one question
|
|
81
|
+
A spike is an experiment: it answers a question about a service, a library or the data before anything is
|
|
82
|
+
designed on it, and its code is evidence, kept in a directory of its own outside the product's packages.
|
|
83
|
+
The architect writes a spike plan, one page, not a spec: the question, what to run and observe, the
|
|
84
|
+
answer that settles it, and when to stop. The reviewer checks that it measures what it says it measures.
|
|
85
|
+
No qa, devops or secops. A plan in steps runs them as a spec's (§ *A spec's steps are passes of their own*), without qa:
|
|
86
|
+
a step that builds on another goes out once every review of that one approved, whatever the plan says. Its plan is
|
|
87
|
+
corrected at most twice, counting a correction you make in place; past that, or when its answer raises a new
|
|
88
|
+
question, stop and ask {{OWNER}}: a new question is a new spike, and a spike revised past its question is
|
|
89
|
+
the product being designed without a spec.
|
|
90
|
+
|
|
91
|
+
### Reviewer audits; QA runs tests
|
|
92
|
+
Reviewer runs `{{TYPECHECK_CMD}}` / `{{LINT_CMD}}` (and `{{BUILD_CMD}}` for frontend) and verifies clean, confirms guardrails ran, but **does not run vitest**. QA runs vitest once after approval.
|
|
93
|
+
|
|
94
|
+
### A stage that returns no verdict
|
|
95
|
+
A report with no `VERDICT` line, a run that stopped, or one out of context is not a pass. Resume it once
|
|
96
|
+
with `SendMessage` for its report; failing that, dispatch the stage again, saying what the first run left
|
|
97
|
+
in the tree. Nothing builds on its work until a verdict does.
|
|
98
|
+
|
|
99
|
+
### A round of work goes to a fresh run
|
|
100
|
+
A resumed run is billed its whole history again on every turn. Resume one only for something short: its missing report, or a re-check of a few files. A fix, a revised spec or a re-run of flows goes to a new run of the stage, dispatched with what it needs: the spec's path, the findings with their `ISSUES` line, and the files and probes they name.<!-- nina:why --> In the project this was learned in, a resumed fix began at a 526k-token context and re-read 60M tokens, twice a first round, and resumed rounds held three quarters of everything the pipeline read.<!-- /nina:why -->
|
|
101
|
+
|
|
102
|
+
### Notes ride with the work
|
|
103
|
+
A report's **Notes** send nothing back (Hard Rule #20). Carry them into the next dispatch of the same work — the fix round when there is one, else the next step's spec — and list those still open when you report the step to {{OWNER}}. A rejection whose every issue is a note goes back to the stage that gave it, to give its verdict again under that rule, not to a fix.
|
|
104
|
+
|
|
105
|
+
### A report that sends work two ways
|
|
106
|
+
When one report names issues for the architect and for the implementer, the architect goes first, and the
|
|
107
|
+
implementer fixes against the corrected spec.
|
|
108
|
+
|
|
109
|
+
### Pipeline is not sacred
|
|
110
|
+
If reviewer finds a design flaw, loop back to the architect. Don't paper over with implementation hacks.
|
|
111
|
+
|
|
112
|
+
### Plugin skills are part of the pipeline
|
|
113
|
+
The mandatory triggers are the table in `CLAUDE.md` and each spec's own § *Skills you MUST consult*; every
|
|
114
|
+
stage invokes them through the `Skill` tool. The architect cites which skill informed the spec, and the
|
|
115
|
+
reviewer rejects a spec touching a surface with a mandatory skill that cites none and says nothing of why.
|
|
116
|
+
|
|
117
|
+
### Devops owns the deploy
|
|
118
|
+
Invoke **devops** after **qa PASS** on any step that changes a deployed surface (API, frontend, schema, deploy config, secrets, platform bindings). It is the stage that executes Hard Rule #14 — the reviewer only checks that the spec *has* a preview-deploy plan. Skip it for steps that touch only tests, docs, or the harness, and while the project has no preview target yet. **Preview and staging it deploys on its own; production needs an explicit go from {{OWNER}} for that specific change, quoted in the dispatch.**
|
|
119
|
+
<!-- nina:slot frontend.2 -->
|
|
120
|
+
|
|
121
|
+
### Look at every loop-back for a lesson
|
|
122
|
+
|
|
123
|
+
When a stage loops back (qa → implementer on a test failure, reviewer rejects a diff, a gate blocks) **or** the user corrects something, the orchestrator asks one question: **would this happen again?** If it would, the lesson goes into a pill under `.claude/pills/<role>/` (or `shared/` if it spans roles) so the responsible agent does not repeat it. If it would not — a typo, a flake, a one-off — say so in one line and move on. The question is not optional; the pill is its answer when the answer is yes. <!-- nina:why -->The rule used to be "a pill on every loop-back", and it was followed 3% of the time. <!-- /nina:why -->A rule that demands a lesson from a typo trains everyone to skip the ones that were lessons. `harness:check` watches the outcome<!-- nina:why --> instead of the ritual<!-- /nina:why --> — a role sent back three times since its newest lesson is reported every turn until one is written (`nina learn`). Skip it only if the lesson is really a code convention (→ `patterns.md`/`CLAUDE.md`, through `.nina/project/tree/`) or a library premise (→ `integrations/<lib>.md`): write it there. If the lesson already has a pill, do **not** write a second one — increment its `occurrences` and set `last_seen` to today. At three, `harness:check` asks every turn where it graduates: a convention of this codebase becomes a rule here, and `nina learn --graduate <pill> --here <file>` retires the pill; a rule any project of this shape needs goes to the harness with `nina learn --graduate <pill>` — commit the request with the pill. Each subagent reads its own pills before acting, and `nina pills` checks they are well formed and filed where their audience reads them (see `.claude/pills/README.md`).
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Parallelization
|
|
128
|
+
|
|
129
|
+
**The rule that decides everything here: a stage that only reads can always run beside another
|
|
130
|
+
stage that only reads. A stage that writes files owns those files alone.** Most of this pipeline is
|
|
131
|
+
read-only, so most of it can overlap — the default of running every stage nose-to-tail is a
|
|
132
|
+
habit, not a constraint.
|
|
133
|
+
|
|
134
|
+
Dispatch concurrent agents **in a single message with multiple Agent tool calls**. Separate messages
|
|
135
|
+
run them one after another and buy nothing.
|
|
136
|
+
|
|
137
|
+
### Run these in parallel
|
|
138
|
+
|
|
139
|
+
| Together | Why it is safe | What it buys |
|
|
140
|
+
|---|---|---|
|
|
141
|
+
| **`reviewer` ∥ every gate the diff triggered** after the implementer | all read-only + Bash | the gates stop being a serial prefix to the review |
|
|
142
|
+
| **`reviewer` fanned out by dimension** — one per axis of risk the diff carries, such as tenant isolation, patterns and spec-scope | read-only; they never touch the same output | **the biggest single win.** One reviewer carrying ~15 checklists over a 500-line diff misses things; three narrow ones do not. Faster *and* better |
|
|
143
|
+
| **`architect` across the sibling specs of one milestone** (`<feature>-spec1..N`) | each writes its own file under `.claude/plans/specs/` | the specs share context, so designing them together is more coherent than one-at-a-time, and the whole milestone is specced in one pass |
|
|
144
|
+
| **`devops` ∥ `secops`** at the end of a milestone | devops only reads code; what it writes is a deploy target, not the tree | the audit and the preview deploy stop being sequential |
|
|
145
|
+
| **`Explore` fan-out** for "where does X live" | read-only | one search instead of every stage re-grepping the tree |
|
|
146
|
+
|
|
147
|
+
### Implementers side by side
|
|
148
|
+
|
|
149
|
+
Two implementers write at once only on work that shares no file and builds on nothing the other writes:
|
|
150
|
+
the planner's `PARALLEL-SAFE`, a step's `Builds on` and the binding file lists say which. Where decides how:
|
|
151
|
+
|
|
152
|
+
- **In different packages, each checked on its own** (typecheck, lint and build scoped to it, and none of
|
|
153
|
+
them building the other package first): side by side in this checkout.
|
|
154
|
+
- **In one package, or where a check spans packages:** each with **`isolation: "worktree"`**. A worktree
|
|
155
|
+
holds only what is committed — every closed pass is (§ *Commits*) — and lacks what git does not track,
|
|
156
|
+
such as dependencies or a virtual environment, until its implementer sets it up.
|
|
157
|
+
- You merge a worktree's work, in step order. Never let two agents merge.<!-- nina:why --> The rule
|
|
158
|
+
used to be one implementer per package, always in a worktree. The first new project had no commit for a
|
|
159
|
+
worktree to hold, so it ran two implementers side by side in one checkout, one per spike directory, and
|
|
160
|
+
neither disturbed the other. It also ran two steps of one spec one after the other that built on the
|
|
161
|
+
same two steps and nothing else, only because they shared a package and both edited its README.<!-- /nina:why -->
|
|
162
|
+
|
|
163
|
+
### A spec's steps are passes of their own
|
|
164
|
+
|
|
165
|
+
When the architect splits a spec into steps, each step is its own pass from the implementer on: an
|
|
166
|
+
implementer for that step alone, then the reviewer and every gate its diff triggers, then qa. A step's
|
|
167
|
+
implementer goes out only once every step it builds on has closed its pass, so no step is built on one
|
|
168
|
+
that was sent back. Steps whose turn comes together and share no file go out together, as § *Implementers side by side*
|
|
169
|
+
says; their reviews go out together too, and their qa runs one after the other. Parallel steps save
|
|
170
|
+
time, not tokens: each run builds its own context, and a step that builds on another is never one of
|
|
171
|
+
them. Never hand one implementer several steps, or a spec that lists more than {{STEP_FILES}} files or forecasts more
|
|
172
|
+
than {{STEP_LINES}} lines with no steps: that spec goes back to the architect to be split. The planner's `ONE-SPEC` and `ONE-REVIEW` group
|
|
173
|
+
its own sibling steps into one spec and one review; they never put two of an architect's steps in one
|
|
174
|
+
implementer run.
|
|
175
|
+
|
|
176
|
+
### Commits
|
|
177
|
+
|
|
178
|
+
When a pass closes — `qa` returns `PASS`, or the reviewer approves a chain that ends there — commit what
|
|
179
|
+
it changed, with a message naming the step and its spec. Commit on a working branch: never on the
|
|
180
|
+
project's default branch, so before a piece of work's first commit there, create a branch named for its
|
|
181
|
+
spec. Never push, amend, rebase or force; {{OWNER}} merges. A pass sent back is not committed. You are
|
|
182
|
+
the only one who commits (Hard Rule #18): a commit is what a worktree holds, what `secops` audits a
|
|
183
|
+
milestone by, and what `qa` checks a "pre-existing" failure against.
|
|
184
|
+
|
|
185
|
+
### Keep these serial
|
|
186
|
+
|
|
187
|
+
- **`qa`.** Vitest is ~2–3 GB per worker; concurrent invocations take the machine down. One run, at
|
|
188
|
+
the end of each pass. This is not negotiable and is not a speed problem — the suites are seconds, except those
|
|
189
|
+
`CLAUDE.md` names as slow.
|
|
190
|
+
- **The merge**, always.
|
|
191
|
+
- **A loop-back.** When a stage rejects, fix and re-run that stage; do not fan out around a failure.
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## Examples
|
|
196
|
+
|
|
197
|
+
| User request | Pipeline |
|
|
198
|
+
|---|---|
|
|
199
|
+
<!-- nina:slot project.5 dispatch-examples -->
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## Quick triage
|
|
204
|
+
|
|
205
|
+
When the doubt is whether a critical path is touched, take the heavier chain; when it is only how much ceremony, the lighter one (`CLAUDE.md` § *If you are uncertain which chain applies*).
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<!-- nina:requires integrations -->
|
|
2
|
+
# <Name> — premises
|
|
3
|
+
|
|
4
|
+
> One integration, one doc. The **integration-tester** creates it on first contact with the
|
|
5
|
+
> dependency and appends to it whenever it observes behavior this file does not yet carry.
|
|
6
|
+
> Everything below is evidence. A claim you cannot cite belongs in *Open questions*, not in a
|
|
7
|
+
> premise — a premise that turns out to be a guess is how an integration regression ships.
|
|
8
|
+
|
|
9
|
+
- **Kind:** `installed-library` · `live-api` · `platform-binding` — each that applies (a client library over a platform binding is both); a premise's kind decides what counts as its evidence.
|
|
10
|
+
- **Boundary:** the one module that speaks to this dependency. Nothing else may.
|
|
11
|
+
- **Skill:** the installed skill covering it, or *none* — do not invent one.
|
|
12
|
+
|
|
13
|
+
## Premise index
|
|
14
|
+
|
|
15
|
+
Read this table and the sections your task actually cites. Not the whole file.
|
|
16
|
+
|
|
17
|
+
| Premise | Evidence | Claim |
|
|
18
|
+
|---|---|---|
|
|
19
|
+
| P1 | `<citation>` | one sentence |
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## P1 — <the claim, as a sentence>
|
|
24
|
+
|
|
25
|
+
**Claim.** What the dependency does, in one sentence, stated specifically enough to be wrong.
|
|
26
|
+
|
|
27
|
+
**Evidence.** The form depends on the kind:
|
|
28
|
+
|
|
29
|
+
- `installed-library` — `<package dir>/node_modules/<lib>/<file>:<line>`, with the lines that prove it
|
|
30
|
+
quoted and the version beside it. From the version actually installed here, not the latest release,
|
|
31
|
+
and through the package's own link: the store directory behind it is renamed by a peer change. A library
|
|
32
|
+
no package links, a dependency of a dependency, has no link of its own: cite it through the one that depends
|
|
33
|
+
on it, `<package dir>/node_modules/<parent> → <lib>@<version>/<file>:<line>`, which `nina check` resolves from where that link leads.
|
|
34
|
+
- `live-api` — the request sent and the response received, verbatim, or the contract-test case that
|
|
35
|
+
pins it. The vendor's documentation is not evidence: it describes what they intend, and you are
|
|
36
|
+
depending on what they do.
|
|
37
|
+
- `platform-binding` — what the local emulator did when driven, plus the platform's installed types.
|
|
38
|
+
|
|
39
|
+
**Why it matters here.** Which code depends on this being true, and what breaks if it is not.
|
|
40
|
+
|
|
41
|
+
**Checked.** `<date>` against `<version / environment>`.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Open questions
|
|
46
|
+
|
|
47
|
+
Behavior this doc does not settle yet, and what would settle it. A question here is honest work;
|
|
48
|
+
the same uncertainty written as a premise is a defect waiting for a deploy.
|