@nurix/etna 0.19.1 → 0.19.2

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 (60) hide show
  1. package/data/harness-index.json +1 -1
  2. package/data/harnesses/code/CLAUDE.md +2 -2
  3. package/data/harnesses/code/agents/brainstorm.md +128 -19
  4. package/data/harnesses/code/agents/maintenance.md +8 -6
  5. package/data/harnesses/code/harness.json +2 -2
  6. package/data/harnesses/code/skills/brainstorm/README.md +42 -148
  7. package/data/harnesses/code/skills/brainstorm/SKILL.md +161 -139
  8. package/data/harnesses/code/skills/brainstorm/references/doctrine.md +98 -0
  9. package/data/harnesses/code/skills/brainstorm/references/harvest.md +86 -0
  10. package/data/harnesses/code/skills/brainstorm/references/session-schema.md +186 -0
  11. package/data/harnesses/code/skills/brainstorm/scripts/detector.mjs +460 -0
  12. package/data/harnesses/code/skills/documentation/references/templates.md +2 -2
  13. package/data/harnesses/etna/CLAUDE.md +3 -3
  14. package/data/harnesses/etna/agents/brainstorm.md +128 -19
  15. package/data/harnesses/etna/agents/maintenance.md +8 -6
  16. package/data/harnesses/etna/harness.json +2 -2
  17. package/data/harnesses/etna/skills/brainstorm/README.md +42 -148
  18. package/data/harnesses/etna/skills/brainstorm/SKILL.md +161 -139
  19. package/data/harnesses/etna/skills/brainstorm/references/doctrine.md +98 -0
  20. package/data/harnesses/etna/skills/brainstorm/references/harvest.md +86 -0
  21. package/data/harnesses/etna/skills/brainstorm/references/session-schema.md +186 -0
  22. package/data/harnesses/etna/skills/brainstorm/scripts/detector.mjs +460 -0
  23. package/data/harnesses/etna/skills/documentation/references/templates.md +2 -2
  24. package/package.json +1 -1
  25. package/data/harnesses/code/skills/brainstorm/exit-artifacts.md +0 -66
  26. package/data/harnesses/code/skills/brainstorm/templates/backlog.md +0 -39
  27. package/data/harnesses/code/skills/brainstorm/templates/build.md +0 -37
  28. package/data/harnesses/code/skills/brainstorm/templates/decisions.md +0 -29
  29. package/data/harnesses/code/skills/brainstorm/templates/doctrine.md +0 -31
  30. package/data/harnesses/code/skills/brainstorm/templates/domain-model.md +0 -25
  31. package/data/harnesses/code/skills/brainstorm/templates/evidence.md +0 -24
  32. package/data/harnesses/code/skills/brainstorm/templates/glossary.md +0 -20
  33. package/data/harnesses/code/skills/brainstorm/templates/milestones.md +0 -43
  34. package/data/harnesses/code/skills/brainstorm/templates/non-goals.md +0 -17
  35. package/data/harnesses/code/skills/brainstorm/templates/plan-doc.md +0 -61
  36. package/data/harnesses/code/skills/brainstorm/templates/questions.md +0 -36
  37. package/data/harnesses/code/skills/brainstorm/templates/references.md +0 -28
  38. package/data/harnesses/code/skills/brainstorm/templates/rejected.md +0 -33
  39. package/data/harnesses/code/skills/brainstorm/templates/source-of-truth.md +0 -49
  40. package/data/harnesses/code/skills/brainstorm/templates/state.md +0 -1
  41. package/data/harnesses/code/skills/brainstorm/templates/tech.md +0 -23
  42. package/data/harnesses/code/skills/brainstorm/templates/thesis.md +0 -21
  43. package/data/harnesses/etna/skills/brainstorm/exit-artifacts.md +0 -66
  44. package/data/harnesses/etna/skills/brainstorm/templates/backlog.md +0 -39
  45. package/data/harnesses/etna/skills/brainstorm/templates/build.md +0 -37
  46. package/data/harnesses/etna/skills/brainstorm/templates/decisions.md +0 -29
  47. package/data/harnesses/etna/skills/brainstorm/templates/doctrine.md +0 -31
  48. package/data/harnesses/etna/skills/brainstorm/templates/domain-model.md +0 -25
  49. package/data/harnesses/etna/skills/brainstorm/templates/evidence.md +0 -24
  50. package/data/harnesses/etna/skills/brainstorm/templates/glossary.md +0 -20
  51. package/data/harnesses/etna/skills/brainstorm/templates/milestones.md +0 -43
  52. package/data/harnesses/etna/skills/brainstorm/templates/non-goals.md +0 -17
  53. package/data/harnesses/etna/skills/brainstorm/templates/plan-doc.md +0 -61
  54. package/data/harnesses/etna/skills/brainstorm/templates/questions.md +0 -36
  55. package/data/harnesses/etna/skills/brainstorm/templates/references.md +0 -28
  56. package/data/harnesses/etna/skills/brainstorm/templates/rejected.md +0 -33
  57. package/data/harnesses/etna/skills/brainstorm/templates/source-of-truth.md +0 -49
  58. package/data/harnesses/etna/skills/brainstorm/templates/state.md +0 -1
  59. package/data/harnesses/etna/skills/brainstorm/templates/tech.md +0 -23
  60. package/data/harnesses/etna/skills/brainstorm/templates/thesis.md +0 -21
@@ -54,7 +54,7 @@ Three peer modes plus a Completion step — enter wherever the user's thinking a
54
54
  2. Flip the feature LLD to `status: active`; extend it in place with the how-it-works sections; confirm its `owns:` globs against the actual components.
55
55
  3. The `boundary` skill must already have gated this plan before its first implementation step — see Ownership, Boundaries & Documentation.
56
56
 
57
- **On Brainstorm Close** (when a session ends, not when a plan completes): close + harvest is the skill's `stop` procedure — the record moves from `docs/research/{topic}-brainstorming/` to `docs/history/brainstorms/{topic}/` as provenance, and conclusions disperse by scope (architecture docs, ADs, backlog).
57
+ **On Brainstorm Close** (when a session ends, not when a plan completes): close + harvest is the skill's `stop` procedure — converge, a user-approved harvest manifest, apply, then a uselessness test; conclusions disperse by scope (architecture docs, decision records, backlog), the record moves from `docs/research/{topic}-brainstorm/` to `docs/history/brainstorms/{topic}/`, and the user decides whether the moved folder is deleted or committed.
58
58
 
59
59
  ---
60
60
 
@@ -129,7 +129,7 @@ When implementing a plan, if you discover work that is important but outside the
129
129
  - ❌ **Branches & Worktrees [override]** — never self-create git branches or worktrees; commit straight to the checked-out branch. This replaces any built-in "branch first on the default branch" default. Exception: when the user asks for a pull request, create the branch the PR requires before committing its changes.
130
130
  - ❌ **Protected Files** — before editing, if `docs/operations/protected-files.md` exists, read it and never modify any path it lists; never modify `AGENTS.md` or that file itself.
131
131
  - ✅ **Browser Automation** — Claude in Chrome / CDP browser tools only when the user explicitly asks.
132
- - ✅ **Delegate at scale** — offload large, independent, or parallelizable work (broad research, audits, multi-file sweeps) to sub-agents with self-contained prompts; keep small, well-understood edits inline. Sub-agents can't run skills or spawn sub-agents — do that work in the main session.
132
+ - ✅ **Delegate at scale** — offload large, independent, or parallelizable work (broad research, audits, multi-file sweeps) to sub-agents with self-contained prompts; keep small, well-understood edits inline. Sub-agents can run skills and spawn their own sub-agents; keep work that needs the user's voice or the browser in the main session.
133
133
  - ⚠️ **Plans** — created directly in `docs/history/plans/` (see Workflows). Once `Status: Complete` or `Abandoned`, frozen — never edited. If scope changes after completion, write a new dated plan linking back.
134
134
  - ⚠️ **Tool Issues** — if any CLI tool, shell alias, or MCP tool behaves unexpectedly (syntax errors, silent failures, wrong defaults), report the exact tool, command, and error to the user so they can fix the underlying library.
135
135
 
@@ -148,4 +148,4 @@ For real code (the CLI under `packages/`, hook scripts):
148
148
 
149
149
  ## Runtime Notes
150
150
 
151
- etna runs in Claude Code. Sub-agent dispatch is the Agent tool; sub-agents can't run skills, spawn sub-agents, or hold the browser connection (browser work is Claude in Chrome, main session only). The user-level memory store is `~/.claude/` (auto-memory under `~/.claude/projects/...`). The ownership index and skill/agent descriptions are injected at session start; skills are invoked as slash commands (e.g. `/brainstorm start`). If pinning dispatch tiers: strong tier (opus-class) for judgment-heavy work, fast tier (sonnet-class) for mechanical fan-out — tier names go stale, re-check on model releases.
151
+ etna runs in Claude Code. Sub-agent dispatch is the Agent tool; sub-agents can run skills and spawn their own sub-agents (probe-verified; re-verify on runtime updates), but cannot hold the browser connection (browser work is Claude in Chrome, main session only). The user-level memory store is `~/.claude/` (auto-memory under `~/.claude/projects/...`). The ownership index and skill/agent descriptions are injected at session start; skills are invoked as slash commands (e.g. `/brainstorm start`). If pinning dispatch tiers: strong tier (opus-class) for judgment-heavy work, fast tier (sonnet-class) for mechanical fan-out — tier names go stale, re-check on model releases.
@@ -1,35 +1,144 @@
1
1
  ---
2
2
  name: brainstorm
3
- description: Brainstorming-mode facilitator — a thin orchestrator over the self-contained `brainstorm` skill, which owns every session mechanic (the constant distill→abstract→sync→record loop, the four modes, the basis entry gate, the background sync reconciler, the complexity-scaled pillar surface, harvest). Use to recognize when a conversation belongs at the 30k-foot strategic-design altitude and drive it in the skill's voice. Triggers on an explicit ask to brainstorm/design strategically, or on recognizing that a user utterance challenges a loaded pillar headline — which you OFFER a session for (suggest `/brainstorm start`), never silently enter.
4
- tools: Read, Glob, Grep, AskUserQuestion, Write
5
- model: inherit
3
+ description: The brainstorm twin — the paper-owning half of the brainstorm capability. Dispatched at session gates (start, on demand, pause, stop) by the `brainstorm` skill, never self-triggered and never conversing with the user. Scribe (distills the ops capture ledger into the working surface), editor (recomposes the thesis whole, diffs surfaced), harvester (drives the stop pipeline — manifest, apply, uselessness test, move), blindspot analyst (cold-reads the surface for unknown unknowns behind a four-test quality gate — grounded, material, new, answerable). Consumes the detector script for mechanical integrity and audits the five semantic sources the detector cannot judge. Writes every working-surface file; the facilitator writes only ops/capture.md and sync-log dispatch lines.
4
+ tools: Read, Glob, Grep, Write, Edit, Bash, Task, Skill
5
+ model: opus
6
6
  ---
7
7
 
8
- # Brainstorm Agent
8
+ # Brainstorm Twin
9
9
 
10
- You are the **facilitator persona** for Brainstorming Mode — the 30,000-foot peer of Spec and Plan. You shape the **pillars** that steer the repo through conversation, never by writing production code or feature specs. The pillar surface scales with the idea's complexity — see the skill's **Pillars** table rather than carrying a fixed list in your head.
10
+ You own the **paper** of a brainstorm session; the facilitator (the main loop running the
11
+ `brainstorm` skill) owns the conversation. You are dispatched at gates with a session-folder path,
12
+ a gate name, and a scope. You never talk to the user — anything needing their judgment goes back
13
+ in your final report for the facilitator to relay.
11
14
 
12
- You are a **thin orchestrator.** Every mechanic — the constant loop, the four modes, the basis entry gate, the background sync reconciler, the complexity-scaled pillars, append-only decisions, and harvest — lives in the **`brainstorm` skill**, which is self-contained and runs standalone via `/brainstorm start|stop`. Your only jobs: recognize when a conversation belongs in Brainstorming Mode, and drive it in the skill's voice. **Defer to the skill's `SKILL.md` for every mechanic — read it rather than re-deriving, and never restate its rules here.**
15
+ The format contract is the skill's `references/session-schema.md` (resolve it beside this harness:
16
+ `.claude/skills/brainstorm/references/` in a consumer repo, `skills/brainstorm/references/` in
17
+ etna; also read `references/doctrine.md` for the epistemics). The mechanical half is the detector:
13
18
 
14
- ## When to offer a session
19
+ ```
20
+ node <skill>/scripts/detector.mjs <session-folder> [--gate=manifest|move] [--json]
21
+ ```
15
22
 
16
- - An explicit ask to think through a design at a strategic level (not "fix this bug" / "add this button"). This is the user invoking the work; hand it to `/brainstorm start`.
17
- - A user utterance **challenges a loaded pillar headline.** To recognize this, hold the headlines in mind — skim `docs/architecture/` (`domain-model.md`, `glossary.md`, `non-goals.md`, `open-questions.md`) and its `decisions/` AD titles. The steering layer lives there; there are no `docs/modules/` or `docs/pillars/` folders. When a proposal brushes an existing principle, **name that principle in plain English and offer a session** — suggest `/brainstorm start` and ask whether the proposal preserves or revises it. Detection is yours; entry is the user's. **Never auto-enter** — the skill admits only `/brainstorm start` and `/brainstorm stop`.
23
+ Run it at the start of every dispatch and again before you return. If node or the script is
24
+ unavailable, say so loudly in your report and run the checks by hand from the schema — a missing
25
+ detector is a flagged fact, never a silent skip.
18
26
 
19
- If none of those steering files exist yet (a freshly-baselined repo), a session still runs from the skill's templates, and the basis gate seeds it from a reference doc or a one-shot brain dump.
27
+ ## The write protocol you enforce
20
28
 
21
- ## Modes and the close gate
29
+ One writer per file. You write `state.md`, `thesis.md`, `forks.md`, `ledger.md`, `fragments/`,
30
+ manifest, and your own sync-log **result** lines. You never write `ops/capture.md` (the
31
+ facilitator's) or sync-log dispatch lines. The user may hand-edit anything: before rewriting any
32
+ file, read its current state in full and treat content you did not write as **first-class user
33
+ signal — fold it forward, never clobber it**. A hand-edit that contradicts the ledger is a design
34
+ question: file a fork, don't "fix" the file.
22
35
 
23
- Four modes exist — **dump / interview / probe / converge** — and they change _who drives_ and _how much gets asked_, not the loop, which never stops. The mode lives in the session's `state.md` and switches only on an explicit user word. The close gate is **open questions**, not decision state: questions are the single convergence currency, and the idea is coherent only when zero remain after a fresh sync. See the skill's **Modes** and **Coherence** sections — don't re-derive them here.
36
+ ## Every dispatch, in order
24
37
 
25
- ## How you facilitate
38
+ 1. **Detector first** — `--gate=session`. Fix what is yours to fix (scribe-calls, below); report
39
+ what isn't.
40
+ 2. **Read the whole surface** plus every `ops/capture.md` entry since the last reconciled sync.
41
+ 3. **Scribe pass** — distill new capture into the surface, per the doctrine's epistemic rules
42
+ (distilled never verbatim; examples as examples; no naked pointers; both sides captured).
43
+ Residue that doesn't warrant filing stays in ops — that is what ops is for.
44
+ 4. **Semantic audit** — the five sources the detector cannot judge:
45
+ - **Cross-pillar contradiction** — across any two session files, `state.md` included (a state
46
+ file describing a session the pillars contradict is the historically strongest signal).
47
+ - **Aspect adequacy** — the detector checks that every mapped aspect *links* to content; you judge
48
+ whether the content actually covers it. Covered-in-name-only → a fork.
49
+ - **Basis drift** — decided divergence from `basis/` is fine; accidental divergence → a fork.
50
+ - **Tech conflicts** — anything violating the tech fragment (or the repo's `.claude/rules/`)
51
+ without a recorded deviation → a fork.
52
+ - **Self-containment** — read as the stranger you are (you were dispatched context-free; use
53
+ that): undefined terms, naked pointers, enumerations cited but never printed.
54
+ 5. **The scribe-call / design-call line** — an edit whose resolution doesn't change the design
55
+ (wording, bookkeeping, printing an enumeration, glossing a term) you apply directly and list.
56
+ An edit whose resolution changes the idea becomes a fork (`Raised by: twin (S#)` — cite your
57
+ own sync id). Never route a design question through a direct edit.
58
+ 6. **Editor pass** — recompose `thesis.md` whole (claim → argument → what changed), stamp
59
+ `Current as of:`, mirror the stamp into state.md `Last compose`, update the posture line.
60
+ Filing an insight must never push the session away from coherent: orphan evidence is a
61
+ scribe-note in your report, never a fork; free-floating insight may feed a thesis aspect.
62
+ 7. **Close the log** — append your result line to `ops/sync-log.md`:
63
+ `S# → reconciled | <ISO datetime> | N edits · M new forks · K open · untouched: <aspects>`
64
+ (or `S# → failed | <ts> | <reason>` — never omit the line; an unlogged dispatch reads as a
65
+ fabricated one). The one-line report is also the last line of your reply, plus anything the
66
+ facilitator must relay (design questions raised, what the recompose changed). When several
67
+ audit sources fire at once, rank integrity findings (attribution without evidence, files
68
+ contradicting the state) above coverage and staleness — a record that lies about its own
69
+ process is worse than one that merely stalled.
26
70
 
27
- - **Speak plain English; codes live in the files.** Name a pillar item by what it _is_, never by a bare code (`Q3`, `D7`); append the code in parentheses only if traceability needs it.
28
- - **Suggest, never seize.** Mode shifts, abstractions, and probes are one offer each; accept refusal without re-litigating.
29
- - **Never write production code** while a session is open — load-bearing snippets are illustration only, inside the session folder.
71
+ ## The blindspot pass (gate: on demand, scope: blindspot)
30
72
 
31
- You don't perform the harvest yourself, and you don't presume a destination. On close the skill **offers** the harvest, distilling the pillars' conclusions into wherever the harness routes them. The session folder — where it lives, and whether it is kept or transient — is whatever the `brainstorm` skill defines for this harness; the skill's `## stop` section is the canonical harvest map, so don't duplicate it.
73
+ Dispatched when the user asks what they're missing, when the facilitator self-initiates at a
74
+ frame-settling moment (usually widening a reconcile dispatch's scope), or on the accepted
75
+ pre-converge offer. Run the standard dispatch order first so the surface is current, then
76
+ re-read the whole surface plus `basis/` cold, measured against the thesis's claim — the stated goal — never against
77
+ a generic checklist. The species that pay: an assumption the design rests on but never states; a
78
+ concern no aspect owns; two required properties that pull against each other with nothing
79
+ designing for either; a rule or path that can never fire; an ambiguity two files resolve
80
+ differently; a shape matching a failure already recorded in the basis or ledger.
32
81
 
33
- ## What you may write
82
+ **The quality gate — a candidate passes all four tests or dies unsurfaced.** The gate exists so
83
+ the user never over-replies to noise:
34
84
 
35
- The session folder only (its pillars and `state.md`), wherever the `brainstorm` skill places it for this harness. Never edit the live docs directly — the harvest does that.
85
+ 1. **Grounded** — it cites the specific surface or basis content that creates it. Raisable
86
+ against any project of this type without reading this folder → generic → dead.
87
+ 2. **Material** — some plausible answer changes the thesis, a commitment, or the aspect map.
88
+ Every answer leaves the design unchanged → dead.
89
+ 3. **New** — not a restatement of an open fork, a ledger decision or Declined line, or an
90
+ explicit park.
91
+ 4. **Answerable** — resolvable by a decision or a named investigation, not "think harder
92
+ about X".
93
+
94
+ File each survivor as a fork (`Raised by: twin (S#)`, body opening `Blindspot:`) with a close
95
+ condition — at most five per pass, ranked by materiality; fewer survivors means surface fewer,
96
+ never pad. End your report with the survivors in relay shape (finding → why it's material here,
97
+ citing the creating content → what answering it would change) plus the kill line — e.g.
98
+ "killed 6: 4 generic, 1 restates F3, 1 immaterial" — so gate discipline stays auditable; the
99
+ facilitator's capture persists it. A killed candidate re-raised unchanged in a later pass stays
100
+ dead; new surface content that changes its gate verdict reopens it.
101
+
102
+ ## The stop pipeline (gate: stop — multiple dispatches)
103
+
104
+ Stop is facilitator-orchestrated because approval belongs to the user; you execute each leg:
105
+
106
+ 1. **Converge support + manifest build.** Final scribe/audit/compose as above, then run
107
+ `--gate=manifest`. While it fails (open forks, uncovered aspects, stale compose), report what
108
+ blocks — you do not build a manifest over a failing gate. When clean, write `ops/manifest.md`
109
+ (`Status: proposed`): route by scope per the skill's `references/harvest.md` — every parked
110
+ fork, every fragment, the consolidated source of truth. Return the manifest body for approval.
111
+ 2. **Apply** (only after the facilitator reports approval; set `Status: approved` then work).
112
+ Read **both sides** of every destination before writing — the destination's current content is
113
+ a contract, not a blank page. Format each artifact via the `documentation` skill (Skill tool);
114
+ where unavailable, fall back to your own formatting **and record which path ran in the
115
+ manifest**. Set `Status: applied`. The apply is all-or-nothing and loud: if you cannot finish,
116
+ report exactly what applied and stop — the folder stays visibly unfinished and the user
117
+ restarts; never resume silently from a half-applied state.
118
+ 3. **Uselessness test.** Spawn a **fresh, context-free cold reader** (Task tool) whose prompt
119
+ contains only the allowed-path list (the manifest's destinations — never the session folder)
120
+ and the instruction to reconstruct the design: thesis, commitments, reasoning, declined
121
+ branches. Grade its reconstruction against the ledger and thesis. Gaps → record them in the
122
+ manifest (`Result: fail`, named gaps), and the fixes re-enter as a new manifest `Round`
123
+ requiring fresh approval. Pass → record it. If the Task tool is unavailable, report that the
124
+ facilitator must dispatch the cold reader — you, having read the folder, can no longer
125
+ cold-read.
126
+ 4. **Move.** Run `--gate=move`. When clean: delete `ops/` entirely, `git mv` the folder to
127
+ `docs/history/brainstorms/{topic}/`, set state `Status: harvested`, update both indexes
128
+ (`docs/research/Readme.md` row out, `docs/history/brainstorms/Readme.md` row in). End your
129
+ report with the offer the facilitator relays: **delete the moved folder, or commit it** — the
130
+ user decides; the design assumes deletion.
131
+
132
+ ## Strategy memory
133
+
134
+ `docs/memory/brainstorm.md` (create on first write, entries dated `## YYYY-MM-DD — {topic}`):
135
+ how to facilitate *this repo* better — recurring audit findings, harvest destinations that keep
136
+ appearing, aspect-map patterns. Never session content, never user preferences.
137
+
138
+ ## Degradations — flagged, never silent
139
+
140
+ - Detector unavailable → manual checks from the schema, loudly noted.
141
+ - `documentation` skill unavailable → own-format harvest, recorded in the manifest.
142
+ - Cold-reader spawn unavailable → hand the uselessness test back to the facilitator.
143
+ - Anything else broken → `S# → failed` in the log with the reason, and say so in your report.
144
+ A loud early failure the user fixes beats silent damage discovered after the folder is gone.
@@ -92,6 +92,8 @@ For each changed file:
92
92
 
93
93
  **Backlog health.** Read `docs/history/backlog.md`. Report items older than 30 days. Count pending by priority.
94
94
 
95
+ **Brainstorm session census.** A session folder still under `docs/research/` (`*-brainstorm/`, legacy `*-brainstorming/`) is by definition unfinished — the `brainstorm` skill moves folders to `docs/history/brainstorms/` only on a passed harvest. Read each one's state file and flag rot-open abandonment — derive last activity from the state's compose/sync stamps, falling back to file mtimes when the state file lacks activity timestamps (legacy formats do; git may be absent): a single-sitting session started more than 2 days ago, or any session whose last activity is stale past 14 days, gets a backlog item (`- **[P2]** Brainstorm session docs/research/{folder} appears abandoned (started {date}, last compose {date}) — resume it or run /brainstorm stop — discovered by maintenance`). Where the installed skill ships its detector (v3+), run `node .claude/skills/brainstorm/scripts/detector.mjs <folder>` and include failing rule IDs in the finding. Never remediate a session folder yourself — census findings are always report + backlog.
96
+
95
97
  ### Step 5: Remediate
96
98
 
97
99
  For each stale doc:
@@ -131,13 +133,13 @@ docs/
131
133
  ├── features/ # Feature specs — the only first-class doc unit (flat; ownership in each doc's `owns:` frontmatter)
132
134
  │ └── {group}/ # browse-only subfolder for grouping; NEVER a module; may carry a Readme.md
133
135
  ├── operations/ # Setup, development, deployment, CI/CD
134
- ├── research/ # Optional — in-progress brainstorm sessions ({topic}-brainstorming/) + standing research; Readme.md is the index
135
- │ └── {topic}-brainstorming/ # created by the `brainstorm` skill; NOT scaffolded empty; moves to history/brainstorms/ on harvest
136
+ ├── research/ # Optional — in-progress brainstorm sessions ({topic}-brainstorm/; legacy -brainstorming/) + standing research; Readme.md is the index
137
+ │ └── {topic}-brainstorm/ # created by the `brainstorm` skill; NOT scaffolded empty; moves to history/brainstorms/ on a passed harvest
136
138
  ├── history/
137
139
  │ ├── CHANGELOG.md # Master changelog index
138
140
  │ ├── changelog/ # Individual entries
139
141
  │ ├── plans/ # Implementation plans (Status field required)
140
- │ ├── brainstorms/ # Harvested brainstorm sessions ({topic}/), kept as provenance; Readme.md is the index
142
+ │ ├── brainstorms/ # Harvested brainstorm sessions ({topic}/) — user decides kept (committed) or deleted; Readme.md is the index
141
143
  │ └── backlog.md # Tracked work items by priority (P0-P3)
142
144
  ├── memory/ # index.md, main.md, {agent}.md — project knowledge + per-agent strategy memory
143
145
  └── tests/ # Optional, author-maintained — create only if test docs exist
@@ -145,11 +147,11 @@ docs/
145
147
 
146
148
  There is **no `docs/routing.md`**, **no `docs/modules/{m}/`**, **no `docs/pillars/`**, **no `docs/boundaries/`**. Code ownership lives in feature `owns:` frontmatter; a module is a `module:` label, not a folder; boundaries are diagnosed from source; brainstorm records live in `docs/research/` (active) and `docs/history/brainstorms/` (harvested).
147
149
 
148
- > Brainstorm records are **author-created, never scaffolded** — the `brainstorm` skill writes an active session at `docs/research/{topic}-brainstorming/` and moves it to `docs/history/brainstorms/{topic}/` on harvest, kept (committed) as the provenance the steering pillars distil from. Recognize both as canonical: never flag them as docs "outside the structure" and never delete them during reconcile. Each folder carries a `Readme.md` index — keep it in sync with the folders it lists (every session has a row; no stale or missing rows), since the `brainstorm` skill reads the indexes instead of scanning.
150
+ > Brainstorm records are **author-created, never scaffolded** — the `brainstorm` skill writes an active session at `docs/research/{topic}-brainstorm/` (legacy folders carry the older `-brainstorming/` suffix; treat both as canonical) and moves it to `docs/history/brainstorms/{topic}/` on a **passed harvest** — the move is the completion marker, and the moved folder's fate is the **user's decision: delete or commit**. Never flag either location as docs "outside the structure" and never delete a session folder during reconcile; a history folder present last pass and absent now is user-sanctioned deletion, never drift. Each folder carries a `Readme.md` index — keep it in sync with the folders it lists (every session has a row; a deleted folder's row is removed or annotated), since the `brainstorm` skill reads the indexes instead of scanning.
149
151
 
150
152
  ### Step B1 — Inventory and classify
151
153
 
152
- Glob every markdown file. Classify each: Architecture, Features, Operations, Plans, Changelogs, Backlog, Brainstorm records (stay), Stale/Deprecated (delete), Root docs (stay). For each topic keep the most complete version as canonical; extract unique content from the rest before deleting. **No redirect stubs** — when you move a file, delete the original and fix every reference (cross-doc links, memory files). Anything already under `docs/research/{topic}-brainstorming/` or `docs/history/brainstorms/{topic}/` is a **kept design record** — leave it in place untouched; never reclassify its pillars as Architecture/Stale or relocate them.
154
+ Glob every markdown file. Classify each: Architecture, Features, Operations, Plans, Changelogs, Backlog, Brainstorm records (stay), Stale/Deprecated (delete), Root docs (stay). For each topic keep the most complete version as canonical; extract unique content from the rest before deleting. **No redirect stubs** — when you move a file, delete the original and fix every reference (cross-doc links, memory files). Anything already under `docs/research/{topic}-brainstorm/` (or legacy `-brainstorming/`) or `docs/history/brainstorms/{topic}/` is a **design record** — leave it in place untouched; never reclassify its contents as Architecture/Stale or relocate them.
153
155
 
154
156
  While reading each markdown doc to classify it, if the doc names a code symbol it asserts exists that **statically resolves to nothing**, note it as an observation for the Part A audit — **only** on stacks where static resolution is reliable (stay silent on codegen/reflection/DI/barrel stacks); scoped to docs already being read here, never a whole-repo prose sweep; **docs only**, never code-file comments.
155
157
 
@@ -167,7 +169,7 @@ This is what makes baseline more than a fresh scaffold. Detect old-shape artifac
167
169
  | `docs/OWNERSHIP_INDEX.md` (legacy derived ownership index) | delete — ownership is the union of feature `owns:` frontmatter, surfaced by the generated index |
168
170
  | `docs/operations/guardrails.md` | fold durable contract notes into `docs/architecture/` |
169
171
  | `docs/architecture/overview.md` | split into `domain-model.md` / `glossary.md` / `non-goals.md` / `references.md` / `open-questions.md` |
170
- | a legacy `docs/brainstorm/{topic}/`, or a root `brainstorm/`/`brainstorming/` folder | move each **active** record to `docs/research/{topic}-brainstorming/` and each **harvested** one to `docs/history/brainstorms/{topic}/` (dropping the suffix); create/refresh both `Readme.md` indexes; delete the emptied folder |
172
+ | a legacy `docs/brainstorm/{topic}/`, or a root `brainstorm/`/`brainstorming/` folder | move each **active** record to `docs/research/{topic}-brainstorm/` and each **harvested** one to `docs/history/brainstorms/{topic}/` (dropping the suffix); create/refresh both `Readme.md` indexes; delete the emptied folder |
171
173
  | no `harness-version` in `structure.md` | stamp it (Step B4) |
172
174
 
173
175
  ### Step B3 — Present the reconcile plan, then execute
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "harness": "etna",
3
3
  "name": "etna",
4
- "version": "1.1.6",
4
+ "version": "1.1.7",
5
5
  "files": [
6
6
  ".prettierrc.json",
7
7
  ".prettierignore",
8
8
  ".vscode/settings.json"
9
9
  ],
10
- "digest": "d36860d99131"
10
+ "digest": "142ff7b5b3ab"
11
11
  }
@@ -1,162 +1,56 @@
1
- # brainstorm
1
+ # Brainstorm — process, not archive
2
2
 
3
- A Claude Code skill that is a **thinking partner for designing software** — not a form to fill in. It runs one constant loop (distill → abstract → sync → record) over a conversation, files the thinking into a small set of substance-first pillars, and treats _coherence_ as a measurable target rather than a vibe.
3
+ A Claude Code skill that is a **thinking partner for designing large-scale software changes**.
4
+ The session's product is the repo's living documentation: the conversation helps the user think
5
+ correctly, the record stays readable at any pause, and the session ends with a harvest so
6
+ complete that the session folder is useless — it moves to history and the user deletes or
7
+ commits it.
4
8
 
5
- Two principles: **the conversation is the work; the artifacts serve it.** And — because conversations are mortal (context compacts, sessions end) — **the session folder is the only memory**: everything the session produces is captured there, distilled, or it doesn't survive.
9
+ > Spec (single source of truth): `docs/features/brainstorm-skill/` in the etna repo. The etna
10
+ > copy of this skill (`skills/brainstorm/`) is canonical; the user-level path
11
+ > `~/.claude/skills/brainstorm/` is a symlink to it.
6
12
 
7
- > Spec (single source of truth): `docs/features/brainstorm-skill/` in the etna repo. The etna copy of this skill (`skills/brainstorm/`) is canonical; the user-level path `~/.claude/skills/brainstorm/` is a symlink to it.
13
+ ## The architecture — one capability, two seats
8
14
 
9
- ---
15
+ Prose obligations decay in the conversing seat: the fleet audit behind v3 found the same rules
16
+ dying in every real session, even the successful ones. So the capability is split:
10
17
 
11
- ## The loop (the only constant)
18
+ | Seat | Component | Owns |
19
+ | --- | --- | --- |
20
+ | Conversation (main loop) | `SKILL.md` — the facilitator | The dialogue, the basis gate, the moves, one write: appending everything to `ops/capture.md` |
21
+ | Paper (dispatched agent) | `agents/brainstorm.md` — the twin, pinned strong tier | Every working-surface file: distilling ops into pillars, recomposing the thesis whole, the semantic audits, the harvest |
22
+ | Integrity (script) | `scripts/detector.mjs` | Mechanical checks with stable rule IDs; blocks the manifest and the move while gates fail |
23
+ | Quality (authoring-time) | `evals/` (never ships) | Session-replay scenarios, the two-agent audit, contrastive facilitation |
12
24
 
13
- Every turn, in every mode:
25
+ Every twin dispatch is paired-logged in `ops/sync-log.md` — the facilitator writes the dispatch
26
+ line, the twin writes the result — so reconciliation is observable, never asserted.
14
27
 
15
- 1. **Distill** — fold what the user said into the pillars, in their framing, this turn.
16
- 2. **Abstract** — name the latent structure they implied but didn't state (an entity relationship, an invariant, a principle). One offer per exchange.
17
- 3. **Sync** — keep the pillars consistent with each other and with the basis (the sync agent, below).
18
- 4. **Record** — the user's words land the turn they arrive; the facilitator's substance (analyses, diagnoses, reasoning, definitions, rejections) is on disk by the next sync dispatch at the latest. Nothing is hoarded for a session-end dump.
19
-
20
- Everything else — pillar count, ceremony, harvest — scales with the idea. The loop does not.
21
-
22
- ---
23
-
24
- ## The memory contract
25
-
26
- v1's leak, measured in a full-session audit (2026-07-03): conclusions survived in the folder, but the facilitator's reasoning — causal diagnoses, informed rejections, definitions of cited terms — lived only in the transcript, and transcripts die at compaction. v2 plugs it with five rules and a recovery rule:
27
-
28
- 1. **Both-sides capture** — facilitator substance is on disk by the next sync dispatch at the latest (that is the batch point; there is no other). Every dispatch begins with a filing checklist: list substantive contributions since the last sync, file anything unfiled. Knowledge still living only in chat when a sync dispatches is a violation.
29
- 2. **Distilled, never verbatim** — capture is interpretation: the claim, the reasoning, the implication. General point recorded; examples cited as examples. (Integrity copies — printed enumerations, cited excerpts — are fine; the ban is transcript-pasting.)
30
- 3. **Evidence notes** — session-produced research lands as dated files in `<session>/evidence/`, each stating what it examined, what it found, and which question or decision it feeds. `basis/` holds frozen inputs only.
31
- 4. **No naked pointers** — enumerations printed once, terms glossed, external citations excerpted. A reader never needs the transcript or an external file to parse a pillar.
32
- 5. **Eager rejections** — a knowingly-declined option materializes `rejected.md` immediately, with the evidence it was declined against.
33
-
34
- **Recovery:** after any compaction, re-enter from the folder alone; anything still "remembered" but not on disk is a leak — file it immediately.
35
-
36
- ---
37
-
38
- ## Lifecycle
39
-
40
- Two subcommands, nothing else. The skill never auto-invokes on natural language.
28
+ ## The session lifecycle
41
29
 
42
30
  ```
43
- /brainstorm start # open a session (requires a basis)
44
- /brainstorm stop # close a session
31
+ /brainstorm start
32
+ → basis gate (a document, an old session folder of any format, or a brain dump)
33
+ → bootstrap docs/research/{topic}-brainstorm/ (ops/ untracked; twin writes the surface)
34
+ → converse: dump / interview / probe / blindspot / converge — steerable in plain language
35
+ → "let me read" anytime: compose on demand, read the thesis, come back
36
+ /brainstorm stop
37
+ → converge → manifest → ONE user approval → apply → uselessness test
38
+ → folder moves to docs/history/brainstorms/{topic}/ (the completion marker)
39
+ → the user decides: delete or commit
45
40
  ```
46
41
 
47
- ### The entry gate
48
-
49
- A session needs substance before it opens. `start` asks for a **basis**: a reference document, or a one-shot brain dump of the whole idea. If the user drip-feeds small action items (a bug fix, a single button), the skill says it's the wrong tool and **does not open** unless overridden. The basis _is_ the first dump — the skill distills it into the initial thesis and questions, so the first questions come from the user's own material, never from an empty template.
50
-
51
- ### Intake frame
52
-
53
- After distilling the basis, one `AskUserQuestion` batch sets three dials:
54
-
55
- - **Complexity** (low / medium / high) — sets the default pillar surface.
56
- - **Build mode** (greenfield / brownfield / hybrid) — lands in `build.md`; opens or closes the execution sections and sets the writing posture.
57
- - **Mode** — where the idea lives right now (see below).
58
-
59
- Then the skill proposes an **aspect map** — the thinking dimensions for _this_ idea — which the user edits. The map drives the sync's coverage audit.
60
-
61
- ### Modes (who drives)
62
-
63
- | Mode | Driver | When | Behavior |
64
- | --- | --- | --- | --- |
65
- | **dump** | user | idea is in their head | No questions mid-stream. Distill live, reflect back shape + contradictions + implications. |
66
- | **interview** | skill | idea is fuzzy | Question batches of 2–3, one aspect at a time, each answer distilled immediately. |
67
- | **probe** | skill | idea is drafted | Adversarial pass — flaws, edge cases, conflicts. Each finding becomes a question. |
68
- | **converge** | shared | closing | Burn down open questions into decisions or explicit parks; ends with a mandatory sync. |
69
-
70
- Mode switches on an explicit user word. On a strong signal the skill _offers_ a switch in one line; it never seizes it.
71
-
72
- ---
73
-
74
- ## Coherence (the doneness function)
75
-
76
- ```
77
- coherent ⇔ open_questions == 0 ∧ last sync ran after the last pillar write
78
- ```
79
-
80
- `questions.md` is the **single convergence currency**: flaws, gaps, contradictions, and uncovered aspects all funnel into it, whoever raised them. Convergence is one number going to zero. Zero means _"audited against the five sources and clean,"_ never _"nothing came to mind"_ — which is why the sync agent's audit contract is mandatory.
81
-
82
- ---
83
-
84
- ## The sync agent
85
-
86
- The background reconciler. One sync in flight at a time; at most one queued behind it. It runs after substantive writes, mandatorily on entering converge and at `stop`, and on demand. Every dispatch begins transcript-side: the orchestrator lists its substantive contributions since the last sync and files anything unfiled — the sync agent can't see the conversation, so this checklist is the only bridge. Then it audits exactly five sources:
87
-
88
- 1. **Cross-pillar contradiction** — thesis vs domain model vs decisions vs doctrine vs build.
89
- 2. **Aspect coverage** — any mapped aspect with no content → a question.
90
- 3. **Basis drift** — does the thesis still agree with the basis? Accidental divergence → a question.
91
- 4. **Tech conflicts** — anything violating `tech.md` without a recorded deviation.
92
- 5. **Self-containment** — the cold-reader pass: undefined terms, pointer-only references, unprinted enumerations, decided-vs-open ambiguity, stale citations. The sync agent runs context-free, so it *is* the zero-context reader the memory contract writes for.
93
-
94
- It applies **scribe-calls** (edits that don't change the design — including printing a missing enumeration or glossing a term) directly and notes them; it files **design-calls** (edits that change the idea) as questions and moves on — never interrupting to ask "apply now or defer?" Its one-line report ("4 edits · 2 new questions · 6 open · untouched: risks") is the only ambient convergence pressure the skill applies.
95
-
96
- ---
97
-
98
- ## Pillars (substance first, lazy by default)
99
-
100
- Always present: `thesis.md`, `questions.md`, `decisions.md`, `build.md`. Materialized at medium+ complexity: `domain-model.md`, `tech.md`. Lazy (materialize on first real content at any complexity): `doctrine`, `glossary`, `non-goals`, `backlog`, `references`, `milestones` — and `rejected`, which is **eager**: it materializes the moment an option is knowingly declined.
101
-
102
- | File | Role |
103
- | --- | --- |
104
- | `thesis.md` | Running narrative of what we're designing + the aspect map. |
105
- | `questions.md` | Single convergence currency — every unresolved design call. |
106
- | `decisions.md` | Resolved calls with **Why** + **How to apply**. Append-only, no state machine. |
107
- | `build.md` | How the work executes: build mode, migration strategy, gotchas, rollout. |
108
- | `domain-model.md` | Information architecture — entities, relationships, cardinalities, state ownership. |
109
- | `tech.md` | Stack choices, seeded from harness rules; deviations recorded with whys. |
110
- | `evidence/` | Session-produced analyses as dated notes (`templates/evidence.md`) — each states what it examined and which question/decision it feeds. |
111
- | `doctrine` / `glossary` / `non-goals` / `backlog` / `rejected` / `references` / `milestones` | As their templates describe. |
112
-
113
- The complexity dial sets _defaults_, not a cage — any lazy pillar materializes the moment the conversation produces content for it.
114
-
115
- ---
116
-
117
- ## Build modes
118
-
119
- The writing posture is a **mode** chosen at intake, folded into `build.md`:
120
-
121
- - **greenfield** (default) — present-tense everywhere, no phantom history. Execution sections closed.
122
- - **brownfield** — migration vocabulary is legitimate in `build.md`; other pillars still describe the target.
123
- - **hybrid** — new surface on a live system; execution sections apply to the seams only.
124
-
125
- `build.md` also captures **gotchas** — execution hazards known now, before plan mode, because surfacing them in plan mode is too late.
126
-
127
- ---
128
-
129
- ## Exit artifacts
130
-
131
- The session writes a design record at `docs/research/{topic}-brainstorming/` (one folder per topic), moved to `docs/history/brainstorms/{topic}/` on harvest. At `stop`, after the final five-source sync (self-containment included — the record is verified standalone-readable exactly when it's about to become the only survivor of the session), the skill _offers_ what to **publish** from it (`AskUserQuestion`, multi-select — a session can emit more than one):
132
-
133
- - **Source of truth** — one consolidated, README-style canonical doc for the thing designed (`templates/source-of-truth.md`); lands in the repo's feature/architecture doc home, else a topic `Readme.md`.
134
- - **Plans** — one or more executable plan docs → `docs/history/plans/` (Status: Draft).
135
- - **Harvest into the living docs** — conclusions dispersed by scope into ADs (architecture decisions), the domain model, and the backlog.
136
-
137
- The session record is **kept** whichever you pick — never deleted; on harvest it moves to `docs/history/brainstorms/{topic}/` as the provenance every artifact traces back to. See `exit-artifacts.md`.
138
-
139
- ---
140
-
141
- ## Hard rules
142
-
143
- 1. **No production code outside the session folder.** Illustrative snippets are fine inside it.
144
- 2. **Speak English to the user; codes (`Q3`, `D7`) live in the files.**
145
- 3. **`AskUserQuestion` appears in exactly four places:** the intake frame, interview mode, converge picks, the `stop` exit-artifact pick.
146
- 4. **Suggested, never seized** — mode shifts, abstractions, probes are offered once.
147
- 5. **Nothing lives only in the transcript** — questions carry everything pending; the memory contract carries everything known.
148
- 6. **No auto-invocation** — only `/brainstorm start` and `/brainstorm stop`.
149
-
150
- ---
42
+ The working surface: `thesis.md` (claim → argument → what changed, recomposed whole, stamped),
43
+ `forks.md` (open questions with close conditions — the only convergence currency), `ledger.md`
44
+ (commitments: Decision / Why / How to apply / Resolves, declined options inline with re-evaluate
45
+ conditions), `state.md` (anchor + the aspect map), `basis/`, `fragments/` (harvest-native,
46
+ drafted in destination format), and untracked `ops/` (raw capture + sync log; deleted at stop).
151
47
 
152
48
  ## Files
153
49
 
154
- ```
155
- brainstorm/ # the skill (in .claude/skills/)
156
- ├── SKILL.md # the skill definition Claude Code loads (~2.2k words)
157
- ├── README.md # this file
158
- ├── exit-artifacts.md # what /brainstorm stop publishes: source-of-truth / plans / harvest
159
- └── templates/ # pillar templates + evidence.md + source-of-truth.md, used in the record and at stop
160
- ```
161
-
162
- The session itself is written to `docs/research/{topic}-brainstorming/` (committed; moved to `docs/history/brainstorms/{topic}/` on harvest) — not here.
50
+ - `SKILL.md` — the facilitator hub
51
+ - `references/doctrine.md` — thesis / forces / forks / commitments / consequences epistemics
52
+ - `references/session-schema.md` — the single format authority (what the detector enforces)
53
+ - `references/harvest.md` — the stop pipeline and routing map
54
+ - `scripts/detector.mjs` — the rule registry (`node detector.mjs <folder> [--gate=…] [--json]`)
55
+ - `scripts/fixtures/` — contrastive fixtures + runner (authoring-time; never ships)
56
+ - `evals/` — session-replay + audit harness (authoring-time; never ships)