@nurix/etna 0.15.7 → 0.16.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/bin/etna.js +64 -13
- package/data/harness-index.json +7 -5
- package/data/harnesses/code/CLAUDE.md +3 -7
- package/data/harnesses/code/agents/harness-manager.md +4 -4
- package/data/harnesses/code/agents/maintenance.md +1 -1
- package/data/harnesses/code/harness.json +4 -3
- package/data/harnesses/code/hooks/hooks.json +3 -17
- package/data/harnesses/code/hooks/prompt-recall.js +157 -0
- package/data/harnesses/code/hooks/session-reflect.js +283 -0
- package/data/harnesses/code/skills/distiller/SKILL.md +62 -60
- package/data/harnesses/code/skills/distiller/references/docs-mode.md +21 -21
- package/data/harnesses/code/skills/distiller/references/method.md +41 -41
- package/data/harnesses/code/skills/documentation/references/templates.md +20 -27
- package/data/harnesses/code-fable/CLAUDE.md +138 -0
- package/data/harnesses/code-fable/agents/brainstorm.md +35 -0
- package/data/harnesses/code-fable/agents/change-review.md +249 -0
- package/data/harnesses/code-fable/agents/harness-manager.md +193 -0
- package/data/harnesses/code-fable/agents/maintenance.md +123 -0
- package/data/harnesses/code-fable/agents/performance-review.md +218 -0
- package/data/harnesses/code-fable/agents/spec-mode.md +56 -0
- package/data/harnesses/code-fable/harness.json +7 -0
- package/data/harnesses/code-fable/hooks/hooks.json +27 -0
- package/data/harnesses/code-fable/hooks/lib/redact.js +37 -0
- package/data/harnesses/code-fable/hooks/prompt-recall.js +157 -0
- package/data/harnesses/code-fable/hooks/session-reflect.js +283 -0
- package/data/harnesses/code-fable/rules/general.md +96 -0
- package/data/harnesses/code-fable/rules/nomenclature.md +34 -0
- package/data/harnesses/code-fable/skills/boundary/SKILL.md +262 -0
- package/data/harnesses/code-fable/skills/boundary/references/boundary-taxonomy.md +734 -0
- package/data/harnesses/code-fable/skills/brainstorm/README.md +136 -0
- package/data/harnesses/code-fable/skills/brainstorm/SKILL.md +135 -0
- package/data/harnesses/code-fable/skills/brainstorm/harvest.md +26 -0
- package/data/harnesses/code-fable/skills/brainstorm/templates/backlog.md +39 -0
- package/data/harnesses/code-fable/skills/brainstorm/templates/build.md +37 -0
- package/data/harnesses/code-fable/skills/brainstorm/templates/decisions.md +29 -0
- package/data/harnesses/code-fable/skills/brainstorm/templates/doctrine.md +31 -0
- package/data/harnesses/code-fable/skills/brainstorm/templates/domain-model.md +25 -0
- package/data/harnesses/code-fable/skills/brainstorm/templates/glossary.md +19 -0
- package/data/harnesses/code-fable/skills/brainstorm/templates/milestones.md +43 -0
- package/data/harnesses/code-fable/skills/brainstorm/templates/non-goals.md +21 -0
- package/data/harnesses/code-fable/skills/brainstorm/templates/plan-doc.md +61 -0
- package/data/harnesses/code-fable/skills/brainstorm/templates/questions.md +35 -0
- package/data/harnesses/code-fable/skills/brainstorm/templates/references.md +28 -0
- package/data/harnesses/code-fable/skills/brainstorm/templates/rejected.md +29 -0
- package/data/harnesses/code-fable/skills/brainstorm/templates/state.md +8 -0
- package/data/harnesses/code-fable/skills/brainstorm/templates/tech.md +23 -0
- package/data/harnesses/code-fable/skills/brainstorm/templates/thesis.md +21 -0
- package/data/harnesses/code-fable/skills/distiller/SKILL.md +219 -0
- package/data/harnesses/code-fable/skills/distiller/references/docs-mode.md +526 -0
- package/data/harnesses/code-fable/skills/distiller/references/method.md +166 -0
- package/data/harnesses/code-fable/skills/documentation/SKILL.md +127 -0
- package/data/harnesses/code-fable/skills/documentation/references/examples.md +193 -0
- package/data/harnesses/code-fable/skills/documentation/references/style-guide.md +288 -0
- package/data/harnesses/code-fable/skills/documentation/references/templates.md +942 -0
- package/data/harnesses/code-fable/skills/workflow-mapper/SKILL.md +430 -0
- package/data/harnesses/code-fable/skills/workflow-mapper/references/patterns.md +214 -0
- package/data/harnesses/{re → discover}/CLAUDE.md +48 -33
- package/data/harnesses/{re → discover}/agents/api.md +3 -3
- package/data/harnesses/{re → discover}/agents/codebase.md +3 -3
- package/data/harnesses/{re → discover}/agents/community.md +3 -3
- package/data/harnesses/{re → discover}/agents/deployed-client-bundle.md +5 -5
- package/data/harnesses/{re → discover}/agents/distribution-artifacts.md +4 -4
- package/data/harnesses/{re → discover}/agents/docs.md +3 -3
- package/data/harnesses/{re → discover}/agents/infra-backend-fingerprint.md +2 -2
- package/data/harnesses/{re → discover}/agents/packages.md +3 -3
- package/data/harnesses/{re → discover}/agents/session.md +19 -11
- package/data/harnesses/{re → discover}/agents/website.md +3 -3
- package/data/harnesses/{re → discover}/agents/wire-capture.md +9 -7
- package/data/harnesses/discover/harness.json +7 -0
- package/data/harnesses/{re/rules/re-discovery.md → discover/rules/discovery.md} +54 -17
- package/data/harnesses/{re/rules/re-evaluation.md → discover/rules/evaluation.md} +12 -1
- package/data/harnesses/{re/rules/re-ingestion.md → discover/rules/ingestion.md} +192 -23
- package/data/harnesses/discover/rules/self-correction.md +177 -0
- package/data/harnesses/discover/rules/tradecraft.md +532 -0
- package/data/harnesses/hr/CLAUDE.md +91 -0
- package/data/harnesses/hr/harness.json +7 -0
- package/data/harnesses/hr/skills/interview-eval/SKILL.md +118 -0
- package/data/harnesses/hr/skills/interview-eval/TEMPLATE.md +124 -0
- package/data/harnesses/hr/skills/interview-eval/extract_session.py +418 -0
- package/data/harnesses/hr/skills/interview-eval/rubric.md +219 -0
- package/data/harnesses/kb-agi/harness.json +1 -0
- package/package.json +1 -1
- package/data/harnesses/code/hooks/post-commit.js +0 -136
- package/data/harnesses/code/hooks/post-tool-failure.js +0 -136
- package/data/harnesses/code/hooks/session-stop.js +0 -207
- package/data/harnesses/re/harness.json +0 -6
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The shared knowledge root for the `distiller` skill. Every mode reads this file.
|
|
4
4
|
It carries the four mechanisms the distiller runs, the fact-card format, and the
|
|
5
|
-
|
|
5
|
+
inbox-consumption protocol.
|
|
6
6
|
|
|
7
7
|
**These methods are stolen, not invented.** Each is sourced to its primary paper
|
|
8
8
|
with an arXiv id — provenance matters here of all places. Embed them faithfully;
|
|
@@ -15,7 +15,7 @@ do not paraphrase the retention signal away.
|
|
|
15
15
|
### 1. Surprisal filter — *what to keep* (Nemori, arXiv:2508.03341)
|
|
16
16
|
|
|
17
17
|
Present the LLM with **(a)** a summary of the *current* fact-set, and **(b)** the
|
|
18
|
-
new undigested
|
|
18
|
+
new undigested inbox entries. Keep only what is **surprising** relative to
|
|
19
19
|
(a) — what the existing knowledge would **not** have predicted. Predictable ⇒
|
|
20
20
|
dropped.
|
|
21
21
|
|
|
@@ -23,20 +23,21 @@ No importance scores. No emotional tags. No templates. **Prediction error is the
|
|
|
23
23
|
only retention signal.**
|
|
24
24
|
|
|
25
25
|
> **First run, empty fact-set.** With nothing to predict against, "predictable" =
|
|
26
|
-
> mechanical routine
|
|
27
|
-
>
|
|
28
|
-
>
|
|
26
|
+
> mechanical routine. Keep decisions, reversals, discovered constraints, and
|
|
27
|
+
> failures with a cause worth remembering. Drop the rote. (Inbox entries arrive
|
|
28
|
+
> semi-distilled — the `session-reflect` hook already dropped routine work — so
|
|
29
|
+
> most survive this filter; what it still catches is repetition of what the
|
|
30
|
+
> fact-set already knows.)
|
|
29
31
|
|
|
30
|
-
**Surprisal sources are not only
|
|
32
|
+
**Surprisal sources are not only inbox entries.** The inbox is the *default*
|
|
31
33
|
stream, but the retention signal is prediction error wherever it lives. On a
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
section rather than a ledger `#HH:MM`.
|
|
34
|
+
project whose inbox is thin or empty, the decision record carries the surprise
|
|
35
|
+
instead: `docs/architecture/adr/**` (each accepted ADR is, by construction, a
|
|
36
|
+
decision the prior knowledge would not have predicted) and
|
|
37
|
+
`docs/memory/brainstorm.md` (reversals, owner pronouncements, discovered
|
|
38
|
+
constraints). Treat these as input (b) alongside any inbox entries; the filter
|
|
39
|
+
(keep the surprising, drop the predictable) is unchanged. Provenance then points
|
|
40
|
+
at the ADR file or brainstorm section rather than a session id.
|
|
40
41
|
|
|
41
42
|
(Independently corroborated by Honcho's "Dream" — same prediction-error
|
|
42
43
|
retention, arrived at separately.)
|
|
@@ -46,11 +47,11 @@ retention, arrived at separately.)
|
|
|
46
47
|
Each survivor becomes **ONE atomic, self-contained statement** — an Elementary
|
|
47
48
|
Discourse Unit (EDU). Entity names normalized; the minimal context needed to
|
|
48
49
|
stand alone baked into the sentence itself. Each card carries **provenance**: the
|
|
49
|
-
|
|
50
|
+
session ids and/or commits it derives from.
|
|
50
51
|
|
|
51
52
|
This is **decomposition, not summarization.** No information is destroyed; one
|
|
52
|
-
survivor may decompose into several cards; everything stays auditable back to
|
|
53
|
-
|
|
53
|
+
survivor may decompose into several cards; everything stays auditable back to
|
|
54
|
+
the session and commits that produced it.
|
|
54
55
|
|
|
55
56
|
### 3. Reconciliation — *consistency* (Mem0, arXiv:2504.19413)
|
|
56
57
|
|
|
@@ -119,7 +120,7 @@ valid_from: YYYY-MM-DD
|
|
|
119
120
|
invalid_from: null # set on supersession — never delete the file
|
|
120
121
|
superseded_by: null # fact-id
|
|
121
122
|
entities: [qmd, anchors, maintenance]
|
|
122
|
-
provenance: [
|
|
123
|
+
provenance: [session 28b2cd5e, commit abc123]
|
|
123
124
|
---
|
|
124
125
|
One atomic, self-contained statement of the fact, entities normalized.
|
|
125
126
|
```
|
|
@@ -132,35 +133,34 @@ One atomic, self-contained statement of the fact, entities normalized.
|
|
|
132
133
|
- `superseded_by` — `null`, or the `fact-id` of the card that replaced it.
|
|
133
134
|
- `entities` — normalized names the fact concerns (used by the grep fallback and
|
|
134
135
|
by retrieval).
|
|
135
|
-
- `provenance` — the
|
|
136
|
-
commits this card decomposes from.
|
|
136
|
+
- `provenance` — the session ids (`session <id>`, as stamped on the inbox entry)
|
|
137
|
+
and commits this card decomposes from. Inbox entries are consumed after
|
|
138
|
+
digestion, so the session id + commit hashes ARE the audit trail — commits
|
|
139
|
+
resolve in git; session ids resolve to transcripts while retained. ADR /
|
|
140
|
+
brainstorm inputs cite their file or section instead.
|
|
137
141
|
- The body — exactly one atomic, self-contained statement. Entities normalized,
|
|
138
142
|
context baked in, so the card stands alone.
|
|
139
143
|
|
|
140
144
|
---
|
|
141
145
|
|
|
142
|
-
##
|
|
146
|
+
## Inbox-consumption protocol (`docs/memory/inbox/`)
|
|
143
147
|
|
|
144
|
-
|
|
145
|
-
actor
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
---
|
|
149
|
-
# per-actor high-water mark — last ledger entry digested into facts
|
|
150
|
-
last_digested:
|
|
151
|
-
joyjeet-sarkar: { file: ledger/2026-06-04--joyjeet-sarkar.md, entry: "00:31" }
|
|
152
|
-
claude: { file: ledger/2026-06-08--claude.md, entry: "14:32" }
|
|
153
|
-
---
|
|
154
|
-
High-water mark for the facts distiller. Read first, advanced last.
|
|
155
|
-
```
|
|
148
|
+
Consumption is what makes the distiller idempotent. The inbox
|
|
149
|
+
(`docs/memory/inbox/{actor}.md`, one file per actor) is a queue: every entry
|
|
150
|
+
block present is undigested, by definition. There is no separate high-water
|
|
151
|
+
mark and no `.digest-state.md`.
|
|
156
152
|
|
|
157
153
|
**Protocol:**
|
|
158
154
|
|
|
159
|
-
1. **
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
155
|
+
1. **Collect first.** Read every entry block across `docs/memory/inbox/*.md`.
|
|
156
|
+
Empty inbox ⇒ fall through to the ADR/brainstorm surprisal sources (§1).
|
|
157
|
+
2. Digest the collected entries (filter → decompose → reconcile → write).
|
|
158
|
+
3. **Consume last** — only after every card is written, delete exactly the
|
|
159
|
+
entry blocks this run digested (keep each file's header; never touch blocks
|
|
160
|
+
that arrived mid-run). Last, so a crash mid-run leaves entries queued and the
|
|
161
|
+
re-run re-digests them — reconciliation NOOPs the already-written cards —
|
|
162
|
+
rather than silently dropping them.
|
|
163
|
+
|
|
164
|
+
A second run immediately after a successful one finds an empty inbox and is a
|
|
165
|
+
clean NOOP. ADR/brainstorm inputs are never consumed — reconciliation alone
|
|
166
|
+
keeps re-runs over them idempotent.
|
|
@@ -251,8 +251,8 @@ description: Shared knowledge accumulated across agent sessions. All agents shou
|
|
|
251
251
|
|
|
252
252
|
Memory is a gradient — volume falls, signal rises, one hop down each tier. Tiers describe themselves here even before they fill:
|
|
253
253
|
|
|
254
|
-
- **
|
|
255
|
-
- **Fact-cards** (`docs/memory/facts/`) — distilled, provenance-linked atomic facts, written by the distiller (`facts` mode) from
|
|
254
|
+
- **Inbox** (`docs/memory/inbox/`) — per-actor queue of session lessons, written by the `session-reflect` hook at session end and consumed by the distiller on digestion. Transient by design, rarely read directly.
|
|
255
|
+
- **Fact-cards** (`docs/memory/facts/`) — distilled, provenance-linked atomic facts, written by the distiller (`facts` mode) from inbox entries and resurfaced at prompt time by the `prompt-recall` hook.
|
|
256
256
|
- **This index** — the curated read tier: the learnings list below, distilled from the colder tiers and hand-appended.
|
|
257
257
|
|
|
258
258
|
## Learnings
|
|
@@ -284,7 +284,7 @@ Append entries below, oldest at bottom. Format:
|
|
|
284
284
|
Memory file initialized during documentation baseline.
|
|
285
285
|
```
|
|
286
286
|
|
|
287
|
-
> The per-
|
|
287
|
+
> The per-actor memory **inbox** (`docs/memory/inbox/`) is *not* a baseline scaffold — the `session-reflect` hook creates it mechanically on the first reflected session. See **§12 Memory inbox entry** for its format.
|
|
288
288
|
|
|
289
289
|
---
|
|
290
290
|
|
|
@@ -899,51 +899,44 @@ The baseline audit **does** scaffold the project root README when missing. The r
|
|
|
899
899
|
|
|
900
900
|
---
|
|
901
901
|
|
|
902
|
-
## 12. Memory
|
|
902
|
+
## 12. Memory inbox entry (docs/memory/inbox/{actor}.md)
|
|
903
903
|
|
|
904
|
-
Use for: the
|
|
904
|
+
Use for: the capture tier of the knowledge gradient — the durable lessons of each session (corrections, root-caused failures, decisions with rationale, discovered constraints), reflected by the `session-reflect` hook at session end. It is the raw input to distillation: `distiller facts` digests entries into fact-cards and **consumes** them, so the file holds exactly what is undigested.
|
|
905
905
|
|
|
906
906
|
### File grain
|
|
907
907
|
|
|
908
|
-
One file
|
|
908
|
+
One file **per actor**: `docs/memory/inbox/{actor}.md`. `actor` is `git config user.name` lowercased and kebab-slugged; fall back to `$USER`, then `agent`. Two actors write to different files, so the inbox is **append-only without merge conflicts** — no shared file to contend over, no lock, no last-writer-wins.
|
|
909
909
|
|
|
910
|
-
###
|
|
910
|
+
### File header
|
|
911
911
|
|
|
912
|
-
Written once, on the first
|
|
912
|
+
Written once, on the first entry:
|
|
913
913
|
|
|
914
914
|
```
|
|
915
|
-
#
|
|
916
|
-
|
|
915
|
+
# Memory inbox — {actor}
|
|
916
|
+
Session lessons awaiting distillation — appended by the session-reflect hook, consumed by `distiller facts`.
|
|
917
917
|
```
|
|
918
918
|
|
|
919
919
|
### Entry shape
|
|
920
920
|
|
|
921
|
-
One block per
|
|
921
|
+
One block per reflected session, at most 6 bullets. Each bullet is one complete, self-contained sentence tagged `[project]` (true of the repo or its tooling) or `[user]` (true of the user) — the tag routes it at distillation: project facts → `docs/memory/facts/`, user facts → user-level memory.
|
|
922
922
|
|
|
923
923
|
```
|
|
924
|
-
## HH:MM ·
|
|
925
|
-
-
|
|
926
|
-
-
|
|
927
|
-
- why: <one line — optional>
|
|
928
|
-
- refs: <commit hashes / file paths / session id — optional>
|
|
924
|
+
## YYYY-MM-DD HH:MM · session <id> · {repo}@{branch}
|
|
925
|
+
- [project] <one self-contained sentence, names and identifiers spelled out>
|
|
926
|
+
- [user] <one self-contained sentence>
|
|
929
927
|
```
|
|
930
928
|
|
|
931
929
|
### Examples
|
|
932
930
|
|
|
933
931
|
```
|
|
934
|
-
##
|
|
935
|
-
-
|
|
936
|
-
-
|
|
937
|
-
- refs: session a1b2c3d4 · 1 files
|
|
938
|
-
|
|
939
|
-
## 14:09 · jane-doe · etna@dev
|
|
940
|
-
- type: failure
|
|
941
|
-
- what: deploy script rejected auth header Authorization: [redacted:api-key]
|
|
942
|
-
- why: stale key in .env.local — rotated, see docs/operations/setup.md
|
|
932
|
+
## 2026-06-08 22:26 · session bc06c4fc · etna@dev
|
|
933
|
+
- [project] The read_network_requests Chrome CDP tool only captures after its first call — arm it, trigger traffic, then read.
|
|
934
|
+
- [user] jane-doe prefers minimal fixes over defensive machinery; fail loudly instead of engineering around a problem.
|
|
943
935
|
```
|
|
944
936
|
|
|
945
937
|
### Rules
|
|
946
938
|
|
|
947
|
-
- **
|
|
939
|
+
- **Hooks append, the distiller consumes.** A digested entry block is deleted by `distiller facts`; nothing else edits or reorders the file. A human may hand-append a lesson in the same shape — it rides the same queue.
|
|
940
|
+
- **Sessions are deduped by id.** The reflect hook skips a session whose id already appears in the file (SessionEnd re-fires on resume).
|
|
948
941
|
- **Secrets are redacted on write.** The privacy filter replaces secret shapes with `[redacted:{kind}]` (e.g. `[redacted:api-key]`, `[redacted:bearer]`, `[redacted:pem]`) before any line is appended — never paste a raw token in by hand either.
|
|
949
|
-
- **Don't curate here.**
|
|
942
|
+
- **Don't curate here.** Promotion to fact-cards and `docs/memory/main.md` happens at distillation; the inbox stays a transient queue.
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# Agent Instructions
|
|
2
|
+
|
|
3
|
+
This file defines how AI agents (Claude, GPT, etc.) should work on this project. **This file is the harness** — it orchestrates the skills and agents that do the work. There is no separate "harness skill."
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Bootstrap
|
|
8
|
+
|
|
9
|
+
> A missing `docs/structure.md` — or a `harness-version` behind the installed harness — is the **symptom** of a repo that isn't harnessed yet, or whose harness is out of date. Don't reconcile it by hand. Drive the **reconcile chain** — you (the main session) own it, because `harness-manager` is a sub-agent that can't run skills or spawn sub-agents:
|
|
10
|
+
>
|
|
11
|
+
> 1. Invoke **`harness-manager`** (`"baseline this repo"` / `"reconcile the harness"`). It reconciles `docs/`, stamps the version, then hands back.
|
|
12
|
+
> 2. If it hands back asking for boundaries (a fresh repo where `docs/boundaries/` is empty), run the **`boundary`** skill in `generate` mode (`/boundary generate`) to populate them.
|
|
13
|
+
> 3. Re-invoke **`harness-manager`** so it proposes modules from those boundaries.
|
|
14
|
+
>
|
|
15
|
+
> Then continue. Each component's internals live in the component, not here.
|
|
16
|
+
|
|
17
|
+
This is the only step that runs **before** the harness exists; everything below assumes a reconciled repo.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Getting Started
|
|
22
|
+
|
|
23
|
+
- Read **[`docs/structure.md`](docs/structure.md)** for the documentation map and folder authority (architecture, features, operations)
|
|
24
|
+
- Read **[`docs/memory/`](docs/memory/)** for agent memory files (one per agent)
|
|
25
|
+
- Ignore **[`README.md`](README.md)** – it's for human reference only
|
|
26
|
+
- Check **[`package.json`](package.json)** for available scripts. Detect the package manager from the lockfile (`pnpm-lock.yaml` → pnpm, `yarn.lock` → yarn, `package-lock.json` → npm) and use the matching command. Don't hardcode a specific manager.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Workflows
|
|
31
|
+
|
|
32
|
+
Three peer modes plus a Completion step — enter wherever the user's thinking already is. Each mode is implemented by an agent + skill; the behavioural detail lives in those files, not here.
|
|
33
|
+
|
|
34
|
+
| Mode | Enter when | Implemented by | Exits to |
|
|
35
|
+
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------- | ------------------------------ |
|
|
36
|
+
| **Brainstorming** | explicit ask; or a user utterance challenges a loaded pillar headline → name the brushed principle and offer `/brainstorm start` (no auto-entry) | `brainstorm` agent + skill | Spec, Plan, or close + harvest |
|
|
37
|
+
| **Spec** | new feature work | `spec-mode` agent + `documentation` skill | Plan |
|
|
38
|
+
| **Plan** | a spec is approved | `documentation` skill → `docs/history/plans/YYYY-MM-DD-{slug}.md` | Completion |
|
|
39
|
+
|
|
40
|
+
On **Completion**: freeze the plan (`Status: Complete`) and flip the feature spec to `Status: Active`, extending it with how-it-works sections; then distil the plan's trail — if the memory inbox (`docs/memory/inbox/`) holds entries, run `distiller facts` (inbox→fact-cards), then `distiller docs` for the just-completed feature's doc drafts any pending deltas for approval (presented, never auto-written). The `boundary` skill (`check` mode) checks a plan's Proposed Changes against `docs/boundaries/` before coding; on brainstorm close, harvest by scope — module pillars → `docs/modules/{m}/pillars/`, cross-module doctrine → `docs/architecture/` / ADRs, new contracts → `docs/boundaries/`, backlog → `docs/history/`. Open questions block close.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Context Routing
|
|
45
|
+
|
|
46
|
+
Before modifying code in an unfamiliar area:
|
|
47
|
+
|
|
48
|
+
1. If **[`docs/routing.md`](docs/routing.md)** exists, read it for file-pattern → module/doc/agent mapping. If it doesn't exist yet, skip.
|
|
49
|
+
2. Glob `docs/{features,modules/*/features}/**/*.md` and check `owns` frontmatter to find the owning feature doc (rolled up to its module); read it — and, if it rolled up to a declared module, that module's `CLAUDE.md` + `pillars/` — before changes.
|
|
50
|
+
3. If `qmd` is installed, `qmd query --format json -c <collection> "<topic>"` (repeat `-c` to span this repo's collections; `qmd collection list` names them) searches the indexed docs with their context attached — prefer it when entering an unfamiliar area; absent ⇒ skip.
|
|
51
|
+
4. **Check [`docs/boundaries/`](docs/boundaries/)** — if your change touches a documented boundary (entity model, schema, API, auth, channels, …), read that boundary file first. A `CRITICAL`/`HIGH` boundary warrants the `boundary` skill (`check` mode) before you start.
|
|
52
|
+
5. If a `docs/memory/` file exists for the domain you're working in, read it for domain knowledge and failure modes
|
|
53
|
+
6. When you author a declared module's docs, its `docs/modules/{m}/CLAUDE.md` auto-loads (the pillar bootstrap) — follow it. For code work it's surfaced via step 2.
|
|
54
|
+
|
|
55
|
+
For the protocol on _writing_ to memory (which file, what belongs there, what doesn't), see **Project Memory** below.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Project Memory
|
|
60
|
+
|
|
61
|
+
Project-specific learnings live in `docs/memory/` (git-tracked). Cross-project user preferences live in `~/.claude/` (untracked).
|
|
62
|
+
|
|
63
|
+
| File | Owner | Contents |
|
|
64
|
+
| ----------------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
65
|
+
| `docs/memory/main.md` | Main agent | Project-wide patterns, conventions confirmed in this codebase, recurring failure modes, decisions whose rationale isn't obvious from the code |
|
|
66
|
+
| `docs/memory/{agent-name}.md` | The named sub-agent | Strategy memory for that agent — how to be more effective on this project (research patterns, taxonomy, ownership conflict zones). Never user-centric. |
|
|
67
|
+
| `~/.claude/projects/...` | Auto-memory system | User preferences, role, communication style, cross-project habits |
|
|
68
|
+
|
|
69
|
+
**Override the default auto-memory location for project-relevant facts.** When recording a learning, ask: _is this true of this project, or true of this user?_ Project facts → `docs/memory/`. User facts → `~/.claude/`.
|
|
70
|
+
|
|
71
|
+
`docs/memory/main.md` is created on first write. Append entries dated `## YYYY-MM-DD — {topic}`; oldest at bottom is fine.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Out-of-Scope Discovery
|
|
76
|
+
|
|
77
|
+
When implementing a plan, if you discover work that is important but outside the current plan's scope:
|
|
78
|
+
|
|
79
|
+
- Append it to `docs/history/backlog.md` under the appropriate priority (P0-P3)
|
|
80
|
+
- Format: `- **[P1]** Description — discovered by [plan-name or agent-name]`
|
|
81
|
+
- Do NOT ask permission. Just append and mention it in your response.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Doc Ownership
|
|
86
|
+
|
|
87
|
+
Feature docs (in `docs/modules/{m}/features/`, or flat `docs/features/` if the module isn't declared) must include YAML frontmatter with `owns`, `touches`, and `depends_on` fields. Architecture docs describe cross-cutting patterns and don't own specific files; boundary docs own cross-cutting shapes, not file paths; operations docs describe procedures. Only feature docs need frontmatter.
|
|
88
|
+
|
|
89
|
+
The spec-mode agent checks for ownership conflicts during research. If conflicts are found, address them in the spec before proceeding.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Boundaries
|
|
94
|
+
|
|
95
|
+
`docs/boundaries/` holds the repo's **typed application boundaries** — the horizontal cross-cutting contracts (the _edges_ between modules) where editing one module silently breaks another: e.g. the entity model, tenancy, auth, db-schema, wire-contracts, api, env-parity. Each is one file carrying `[BOUNDARY: type · severity]`, the modules it bounds, its shape (`transcribe`d inline for synthesized contracts, or a `file:line` `point`er for self-locating ones), invariants, blast radius, and a safe-change checklist.
|
|
96
|
+
|
|
97
|
+
One component owns this surface — the **`boundary` skill** — `generate` at baseline, `create`/`check`/`init` as you add contracts, plan changes, or reconcile. Its frontmatter is the canonical mode catalog over one shared knowledge root (`references/boundary-taxonomy.md`, the exhaustive catalog of boundary types).
|
|
98
|
+
|
|
99
|
+
Without `docs/boundaries/` populated (`generate`), the `check` and `init` modes have nothing to check against.
|
|
100
|
+
|
|
101
|
+
> Agents and skills live under `.claude/agents/` and `.claude/skills/`. Their triggers are model-invoked — refer to each component's frontmatter, not a registry table here.
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Boundaries & Defaults
|
|
106
|
+
|
|
107
|
+
Unless explicitly requested:
|
|
108
|
+
|
|
109
|
+
❌ **Tests** – Never generate, update, or modify test files.
|
|
110
|
+
❌ **Dependencies** – Never upgrade frameworks, libraries, or dependencies.
|
|
111
|
+
❌ **Compatibility** – Never maintain backward compatibility unless specified.
|
|
112
|
+
❌ **Branches & Worktrees** – Never self-create git branches or worktrees. Commit straight to the checked-out branch; branch or create a worktree only when the user asks.
|
|
113
|
+
❌ **Protected Files** – Before editing, if `docs/operations/protected-files.md` exists, read it and never modify any path it lists; also never modify `AGENTS.md` or the `protected-files.md` file itself.
|
|
114
|
+
✅ **Browser Automation** – Use Chrome CDP / "Claude in Chrome" tools whenever they help (verifying UI, reproducing a flow, seeding or inspecting local data) — no need to ask first. **Main session only:** never drive the browser from a sub-agent or workflow executor — the session-bound Chrome connection destabilizes the sub-agent. A sub-agent that needs browser verification instead returns an explicit CDP checklist (exact URLs, actions, expected outcomes) for the orchestrator to execute in the main session.
|
|
115
|
+
✅ **Orchestrate via Sub-agents** – Run the main session as an orchestrator: delegate substantive work (research, implementation, audits) to sub-agents spawned via the Agent/Task tool with `model: opus` (Claude Opus), keeping the main context for dispatch, coordination, and synthesis. Give each sub-agent a self-contained prompt; parallelize independent dispatches.
|
|
116
|
+
✅ **Documentation** – Keep `docs/` updated when code changes affect documented behavior.
|
|
117
|
+
⚠️ **Plans** – Plans are created directly in `docs/history/plans/` (see Workflow → Plan Mode). Once `Status: Complete` or `Status: Abandoned`, the file is frozen — never edited. If scope changes after completion, write a new dated plan that links back to the old one.
|
|
118
|
+
⚠️ **Tool Issues** – If any CLI tool, shell alias, or MCP tool behaves unexpectedly (syntax errors, silent failures, wrong defaults), report the exact tool name, command, and error to the user so they can fix or remove the underlying library.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## File Structure
|
|
123
|
+
|
|
124
|
+
- Add file path at top of each file:
|
|
125
|
+
`// src/modules/example.js - Module for handling user authentication`
|
|
126
|
+
- Add a 1-line function description as a comment above each function:
|
|
127
|
+
`// Extract JWT token from request based on endpoint type`
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Documentation
|
|
132
|
+
|
|
133
|
+
`docs/structure.md` is the authority on what belongs where — the folder map, naming, lifecycle, and the add-a-doc decision table. Read it before adding or moving a doc; don't restate it here. One canonical source per topic — link, don't copy. Only `CLAUDE.md`, `AGENTS.md`, and `README.md` live at the repo root.
|
|
134
|
+
|
|
135
|
+
Maintenance triggers (act on these without re-reading `structure.md`):
|
|
136
|
+
|
|
137
|
+
- After plan completion: add a `docs/history/changelog/` entry + update `docs/history/CHANGELOG.md` (no confirmation; include `Commits:` if multi-commit). Non-plan changes (refactors, fixes, API changes): prompt first.
|
|
138
|
+
- When you add, move, or delete a doc: update `docs/routing.md` to match. When you move or rename source files: fix the `owns`/`touches` frontmatter in the owning doc; new docs that own code need `owns`/`touches`/`depends_on`.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
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
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Brainstorm Agent
|
|
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.
|
|
11
|
+
|
|
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.**
|
|
13
|
+
|
|
14
|
+
## When to offer a session
|
|
15
|
+
|
|
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 any `docs/modules/*/pillars/`. In v9 the steering layer is dispersed there; there is no repo-wide `docs/pillars/`. 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`.
|
|
18
|
+
|
|
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.
|
|
20
|
+
|
|
21
|
+
## Modes and the close gate
|
|
22
|
+
|
|
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.
|
|
24
|
+
|
|
25
|
+
## How you facilitate
|
|
26
|
+
|
|
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.
|
|
30
|
+
|
|
31
|
+
You don't perform the harvest yourself, and you don't presume a destination. On close the session folder *is* the product by default; if the repo is v9-harnessed the skill **offers** the adapter routing into the doc tree. The skill's `## stop` section is the canonical harvest map — don't duplicate it.
|
|
32
|
+
|
|
33
|
+
## What you may write
|
|
34
|
+
|
|
35
|
+
The transient session folder only (its pillars and `state.md`). Never edit the live docs directly — the harvest does that.
|