@nurix/etna 0.2.1 → 0.3.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 (45) hide show
  1. package/bin/etna.js +17 -3
  2. package/data/harnesses/code/CLAUDE.md +77 -114
  3. package/data/harnesses/code/agents/boundary-mapper.md +91 -0
  4. package/data/harnesses/code/agents/brainstorm.md +110 -0
  5. package/data/harnesses/code/agents/change-review.md +13 -12
  6. package/data/harnesses/code/agents/contract-monitor.md +15 -14
  7. package/data/harnesses/code/agents/dep-health.md +1 -0
  8. package/data/harnesses/code/agents/git-history.md +1 -0
  9. package/data/harnesses/code/agents/maintenance.md +4 -3
  10. package/data/harnesses/code/agents/review.md +1 -0
  11. package/data/harnesses/code/agents/spec-mode.md +1 -0
  12. package/data/harnesses/code/rules/general.md +1 -0
  13. package/data/harnesses/code/rules/nomenclature.md +1 -0
  14. package/data/harnesses/code/scripts/build-ownership-index.sh +1 -0
  15. package/data/harnesses/code/scripts/check-doc-drift.sh +1 -0
  16. package/data/harnesses/code/skills/boundaries/SKILL.md +86 -0
  17. package/data/harnesses/code/skills/documentation/SKILL.md +21 -17
  18. package/data/harnesses/code/skills/documentation/references/templates.md +36 -48
  19. package/data/harnesses/code/skills/introspect/SKILL.md +24 -23
  20. package/data/harnesses/code/skills/technical-brainstorm/README.md +287 -0
  21. package/data/harnesses/code/skills/technical-brainstorm/SKILL.md +601 -0
  22. package/data/harnesses/code/skills/technical-brainstorm/greenfield.md +99 -0
  23. package/data/harnesses/code/skills/technical-brainstorm/templates/backlog.md +39 -0
  24. package/data/harnesses/code/skills/technical-brainstorm/templates/decisions.md +42 -0
  25. package/data/harnesses/code/skills/technical-brainstorm/templates/doctrine.md +31 -0
  26. package/data/harnesses/code/skills/technical-brainstorm/templates/glossary.md +19 -0
  27. package/data/harnesses/code/skills/technical-brainstorm/templates/inventory.md +44 -0
  28. package/data/harnesses/code/skills/technical-brainstorm/templates/milestones.md +43 -0
  29. package/data/harnesses/code/skills/technical-brainstorm/templates/non-goals.md +21 -0
  30. package/data/harnesses/code/skills/technical-brainstorm/templates/plan-doc.md +61 -0
  31. package/data/harnesses/code/skills/technical-brainstorm/templates/questions.md +84 -0
  32. package/data/harnesses/code/skills/technical-brainstorm/templates/references.md +28 -0
  33. package/data/harnesses/code/skills/technical-brainstorm/templates/rejected.md +29 -0
  34. package/data/harnesses/code/skills/technical-brainstorm/templates/state.md +8 -0
  35. package/data/harnesses/code/skills/workflow-mapper/SKILL.md +1 -0
  36. package/data/harnesses/kb-agi/CLAUDE.md +16 -1
  37. package/data/harnesses/kb-agi/agents/kb-agi-init.md +3 -2
  38. package/data/harnesses/kb-agi/agents/kb-catch-stale.md +2 -1
  39. package/data/harnesses/kb-agi/agents/kb-find-gaps.md +3 -2
  40. package/data/harnesses/kb-agi/agents/kb-fix-links.md +2 -1
  41. package/data/harnesses/kb-agi/agents/kb-refresh-frontdoor.md +2 -1
  42. package/data/harnesses/kb-agi/agents/kb-refresh-summaries.md +2 -1
  43. package/data/harnesses/kb-agi/agents/kb-sync-metadata.md +2 -1
  44. package/data/harnesses/kb-agi/rules/kb.md +4 -0
  45. package/package.json +1 -1
package/bin/etna.js CHANGED
@@ -12,7 +12,6 @@ import {
12
12
  readFileSync,
13
13
  writeFileSync,
14
14
  renameSync,
15
- copyFileSync,
16
15
  cpSync,
17
16
  readdirSync,
18
17
  lstatSync,
@@ -69,6 +68,18 @@ function backupIfExists(path) {
69
68
  return backup;
70
69
  }
71
70
 
71
+ // Split a CLAUDE.md into its YAML frontmatter (authoring metadata: name, version,
72
+ // plugin, keywords) and its body. The frontmatter is meaningful in the harness
73
+ // source and the bundle, but a consuming project's root CLAUDE.md is a plain
74
+ // router — it must not carry it. Returns { body, version } with leading blank
75
+ // lines after the stripped block removed so the body opens on its first heading.
76
+ function stripFrontmatter(text) {
77
+ const m = text.match(/^---\n([\s\S]*?)\n---\n?/);
78
+ if (!m) return { body: text, version: null };
79
+ const version = (m[1].match(/^version:\s*(\S+)/m) || [])[1] || null;
80
+ return { body: text.slice(m[0].length).replace(/^\n+/, ''), version };
81
+ }
82
+
72
83
  function readJson(path) {
73
84
  if (!existsSync(path)) return {};
74
85
  try {
@@ -153,8 +164,11 @@ async function main(args) {
153
164
  const claudeBackup = backupIfExists(claudeMdDest);
154
165
  if (claudeBackup) console.log(` backed up existing CLAUDE.md → ${claudeBackup}`);
155
166
 
156
- copyFileSync(bundledClaudeMd, claudeMdDest);
157
- console.log(` installed CLAUDE.md → ${claudeMdDest}`);
167
+ const { body: claudeMdBody, version } = stripFrontmatter(readFileSync(bundledClaudeMd, 'utf8'));
168
+ writeFileSync(claudeMdDest, claudeMdBody);
169
+ console.log(
170
+ ` installed CLAUDE.md → ${claudeMdDest}${version ? ` (harness v${version})` : ''}`,
171
+ );
158
172
 
159
173
  for (const sub of PLUGIN_SUBDIRS) {
160
174
  const count = copyHarnessSubdir(
@@ -1,112 +1,116 @@
1
+ ---
2
+ name: code
3
+ description: Canonical Nurix code-project harness (spec v9) — three peer authoring modes (Brainstorming / Spec / Plan), modules as bounded contexts, typed application boundaries, ownership rules. The reference CLAUDE.md every Nurix codebase starts with.
4
+ version: 0.2.2
5
+ keywords:
6
+ - harness
7
+ - code
8
+ - workflow
9
+ - documentation
10
+ - boundaries
11
+ - nurix
12
+ plugin: nurix-harness
13
+ ---
14
+
1
15
  # Agent Instructions
2
16
 
3
- This file defines how AI agents (Claude, GPT, etc.) should work on this project.
17
+ 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."
18
+
19
+ ---
20
+
21
+ ## Bootstrap
22
+
23
+ > If `docs/structure.md` is missing in this repo, the repo is **not yet harnessed**. Before any other work: invoke the `documentation` skill to run its baseline (`"baseline this repo"`), then run `boundary-mapper` (`"baseline boundaries"`) to populate `docs/boundaries/`. Pillars are module-local (`docs/modules/{m}/pillars/`), created lazily through Brainstorming Mode — not scaffolded up front. Re-trigger either baseline manually any time.
24
+
25
+ This bootstrap is the only step that runs **before** the harness exists. Everything else below assumes a baselined repo.
4
26
 
5
27
  ---
6
28
 
7
29
  ## Getting Started
8
30
 
9
- - Read **[`docs/README.md`](docs/README.md)** for documentation root (architecture, features, operations, history)
10
- - Read **[`docs/memory/`](docs/memory/)** for agent memory files (one per agent + `main.md` for shared project memory)
11
- - Ignore **[`README.md`](README.md)** — it's for human reference only
12
- - 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.
31
+ - Read **[`docs/README.md`](docs/README.md)** for documentation root (architecture, features, operations)
32
+ - Read **[`docs/memory/`](docs/memory/)** for agent memory files (one per agent)
33
+ - Ignore **[`README.md`](README.md)** – it's for human reference only
34
+ - 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.
13
35
  - Look at similar modules/files and follow existing patterns
14
36
 
15
- > **If you are a Claude agent** (for example, `claude-4.5-sonnet`) — other agents ignore:
16
- > Check **[`.claude/rules/`](.claude/rules/)** for specialized instructions (automatically loaded into memory)
37
+ - Check **[`.claude/rules/`](.claude/rules/)** for specialized instructions (automatically loaded into memory)
17
38
 
18
39
  ---
19
40
 
20
41
  ## Workflows
21
42
 
22
- For new features or new systems, enter **Spec Mode** before Plan Mode.
43
+ 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.
23
44
 
24
- ### Spec Mode → Plan Mode → Completion
45
+ | Mode | Enter when | Implemented by | Exits to |
46
+ |------|-----------|----------------|----------|
47
+ | **Brainstorming** | explicit ask, or a user utterance challenges a loaded pillar headline | `brainstorm` agent + `technical-brainstorm` skill | Spec, Plan, or close + harvest |
48
+ | **Spec** | new feature work | `spec-mode` agent + `documentation` skill | Plan |
49
+ | **Plan** | a spec is approved | `documentation` skill → `docs/history/plans/YYYY-MM-DD-{slug}.md` | Completion |
25
50
 
26
- 1. **Spec Mode**: Create or update a feature spec in `docs/features/{feature}.md` using the **Feature Documentation template** (Status: Draft) — see the documentation skill (`.claude/skills/documentation/references/templates.md`). Use the **`spec-mode`** agent (`.claude/agents/spec-mode.md`) for codebase research; its findings drop directly into the template's research-derived sections (Affected Modules, Conventions to Follow, Current Behavior, Ownership Conflicts). Interview the user for the design-intent sections (Goal, Goals & Non-Goals, Background, Approach). Present the spec for approval before proceeding.
51
+ On **Completion**: freeze the plan (`Status: Complete`) and flip the feature spec to `Status: Active`, extending it with how-it-works sections. The `introspect` skill 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/`. Tentative decisions block close.
27
52
 
28
- 2. **Plan Mode**: Once the spec is approved, create a plan in `docs/history/plans/YYYY-MM-DD-feature-name.md` using the **Plan template**. Link back to the feature spec in the **Spec** field. The template's **Proposed Changes** subsections are load-bearing — the `introspect` skill parses them to check guardrail impact.
29
-
30
- 3. **Completion**: When a plan is fully implemented:
31
- - Mark the plan `Status: Complete` and fill the **Completed:** date. The plan is now frozen.
32
- - **Flip the feature spec** to `Status: Active` and extend it in place with the implementation sections (Architecture, Key Functions, State, Redux, Files). Same file. Confirm `owns`/`touches` frontmatter against actual code; resolve any unresolved Open Questions by folding them into Background.
33
- - If `docs/routing.md` exists, use it to find other docs affected by the changes; otherwise glob `docs/features/**/*.md` and check `owns`/`touches` frontmatter. Update affected docs — or create new ones if a touched area has no doc yet.
34
- - Create a changelog entry in `docs/history/changelog/YYYY-MM-DD-feature-name.md`.
35
-
36
- `docs/features/` is _what_ we're building (lives on as documentation). `docs/history/plans/` is _how_ we built it (historical record).
53
+ ---
37
54
 
38
- ### Context Routing
55
+ ## Context Routing
39
56
 
40
57
  Before modifying code in an unfamiliar area:
41
58
 
42
- 1. If **[`docs/routing.md`](docs/routing.md)** exists, read it for file-pattern → doc/agent mapping. If it doesn't exist yet, skip — the codebase may not have owned features.
43
- 2. If **[`docs/OWNERSHIP_INDEX.md`](docs/OWNERSHIP_INDEX.md)** exists, check it for the owning feature doc and read that doc before making changes. If it doesn't exist, glob `docs/features/**/*.md` and check `owns` frontmatter directly.
44
- 3. If a `docs/memory/` file exists for the domain you're working in, read it for domain knowledge and failure modes
59
+ 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.
60
+ 2. If **[`docs/OWNERSHIP_INDEX.md`](docs/OWNERSHIP_INDEX.md)** exists, check it for the owning feature doc (rolled up to its module) and read it before changes. Else glob `docs/{features,modules/*/features}/**/*.md` and check `owns` frontmatter.
61
+ 3. **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 `introspect` skill before you start.
62
+ 4. If a `docs/memory/` file exists for the domain you're working in, read it for domain knowledge and failure modes
63
+ 5. In a graduated module, its `docs/modules/{m}/CLAUDE.md` auto-loads in that subtree — follow it.
64
+
65
+ For the protocol on *writing* to memory (which file, what belongs there, what doesn't), see **Project Memory** below.
45
66
 
46
- For the protocol on *writing* to memory, see **Project Memory** below.
67
+ ---
47
68
 
48
- ### Project Memory
69
+ ## Project Memory
49
70
 
50
71
  Project-specific learnings live in `docs/memory/` (git-tracked). Cross-project user preferences live in `~/.claude/` (untracked).
51
72
 
52
73
  | File | Owner | Contents |
53
74
  |------|-------|----------|
54
75
  | `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 |
55
- | `docs/memory/{agent-name}.md` | The named sub-agent | Strategy memory for that agent — how to be more effective on this project. Never user-centric. |
76
+ | `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. |
56
77
  | `~/.claude/projects/...` | Auto-memory system | User preferences, role, communication style, cross-project habits |
57
78
 
58
79
  **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/`.
59
80
 
60
- `docs/memory/main.md` is scaffolded during baseline. Append entries dated `## YYYY-MM-DD — {topic}`; oldest at bottom is fine.
81
+ `docs/memory/main.md` is created on first write. Append entries dated `## YYYY-MM-DD — {topic}`; oldest at bottom is fine.
82
+
83
+ ---
61
84
 
62
- ### Out-of-Scope Discovery
85
+ ## Out-of-Scope Discovery
63
86
 
64
87
  When implementing a plan, if you discover work that is important but outside the current plan's scope:
65
88
 
66
- - Append it to `docs/history/backlog.md` under the appropriate priority (P0–P3)
89
+ - Append it to `docs/history/backlog.md` under the appropriate priority (P0-P3)
67
90
  - Format: `- **[P1]** Description — discovered by [plan-name or agent-name]`
68
91
  - Do NOT ask permission. Just append and mention it in your response.
69
92
 
70
- ### Doc Ownership
71
-
72
- Feature docs in `docs/features/` must include YAML frontmatter with `owns`, `touches`, and `depends_on` fields. Architecture docs describe cross-cutting patterns and don't own specific files; operations docs describe procedures. Only feature docs need frontmatter.
73
-
74
- The spec-mode agent checks for ownership conflicts during research. If conflicts are found, address them in the spec before proceeding.
93
+ ---
75
94
 
76
- ### Architecture Decisions (ADRs)
95
+ ## Doc Ownership
77
96
 
78
- Record an ADR when a decision (a) changes how state, dependencies, or boundaries are organized, (b) has a rejected alternative worth remembering, and (c) could plausibly be re-litigated. Default: don't write one. Style preferences, local refactors, and obvious-from-code choices don't qualify.
97
+ Feature docs (in `docs/modules/{m}/features/`, or flat `docs/features/` if ungraduated) 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.
79
98
 
80
- - File: `docs/architecture/adr/NNNN-kebab-case.md` (4-digit sequential number). Frozen once written — supersede via a new ADR, never edit.
81
- - Invoke the `documentation` skill with "record an ADR" or "architecture decision".
99
+ The spec-mode agent checks for ownership conflicts during research. If conflicts are found, address them in the spec before proceeding.
82
100
 
83
101
  ---
84
102
 
85
- ## Agents
103
+ ## Boundaries
86
104
 
87
- Seven sub-agents and three skills are defined under `.claude/`. Reach for them by name or by trigger phrase:
105
+ `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. Three components share this surface:
88
106
 
89
- | Component | Type | Use for | Trigger phrases |
90
- |-----------|------|---------|-----------------|
91
- | `spec-mode` | Agent | Codebase research before writing a feature spec | Invoked during Spec Mode |
92
- | `maintenance` | Agent | Periodic audit — fix docs drifting from code | "run maintenance", "audit docs", "check drift" |
93
- | `contract-monitor` | Agent | Post-implementation contract audit — scan code against guardrails | "check contracts", "audit guardrails", "code drift" |
94
- | `review` | Agent | Code health — bundle, performance, anti-patterns | "weekly review", "review code health", "check bundle" |
95
- | `dep-health` | Agent | Dependency supply-chain audit | "audit dependencies", "check CVEs", "dep health" |
96
- | `git-history` | Agent | Classify recent commits into a velocity/severity CSV | "classify commits", "commit history report" |
97
- | `change-review` | Agent | Velocity heatmap, risk zones (high churn + low coverage) | "where is risk accumulating", "velocity report" |
98
- | `documentation` | Skill | Baseline audit, scaffolding, templates, ADRs, guardrails | "baseline docs", "create docs", "audit docs", "record an ADR", "architecture decision", "create guardrails" |
99
- | `workflow-mapper` | Skill | Discover and diagram codebase workflows | "map workflows", "trace flows" |
100
- | `introspect` | Skill | Pre-implementation impact analysis against guardrails | "introspect this plan", "impact analysis" |
107
+ - **`boundary-mapper` agent** — generates/baselines/updates `docs/boundaries/` from the detected stack + information architecture. Trigger: "baseline boundaries".
108
+ - **`introspect` skill** — pre-implementation: checks a proposed plan against `docs/boundaries/`, surfacing cascading risk early. The boundary's **severity** sets review depth.
109
+ - **`contract-monitor` agent** — post-implementation: scans the live codebase for boundary violations, per type.
101
110
 
102
- ### Guardrails
111
+ Without boundaries populated, introspect and contract-monitor are not useful.
103
112
 
104
- `docs/operations/guardrails.md` documents **cascading failure boundaries** — places where editing one module silently breaks another (shared state shapes, entity registration checklists, cross-module string coupling, persistence rehydration, etc.). Two components depend on it:
105
-
106
- - **`contract-monitor`** (post-implementation) — scans code for violations of documented guardrails
107
- - **`introspect`** (pre-implementation) — checks a proposed plan against guardrails to surface cascading risk before coding
108
-
109
- To create or extend guardrails, invoke the `documentation` skill with "create guardrails" / "add guardrail". Without guardrails populated, `contract-monitor` and `introspect` are not useful.
113
+ > 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.
110
114
 
111
115
  ---
112
116
 
@@ -114,15 +118,16 @@ To create or extend guardrails, invoke the `documentation` skill with "create gu
114
118
 
115
119
  Unless explicitly requested:
116
120
 
117
- ❌ **Tests** — Never generate, update, or modify test files.
118
- ❌ **Dependencies** — Never upgrade frameworks, libraries, or dependencies.
119
- ❌ **Compatibility** — Never maintain backward compatibility unless specified.
120
- ❌ **Browser Automation** — Never use "Claude in Chrome" (CDP/MCP browser tools) unless the user explicitly requests it.
121
- ❌ **Protected Files** — Never modify these read-only files:
121
+ ❌ **Tests** – Never generate, update, or modify test files.
122
+ ❌ **Dependencies** – Never upgrade frameworks, libraries, or dependencies.
123
+ ❌ **Compatibility** – Never maintain backward compatibility unless specified.
124
+ ❌ **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.
125
+ ❌ **Protected Files** – Never modify these read-only files:
122
126
  `AGENTS.md`, `docs/operations/protected-files.md`
123
- ✅ **Documentation** — Keep `docs/` updated when code changes affect documented behavior.
124
- ⚠️ **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.
125
- ⚠️ **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.
127
+ ✅ **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.
128
+ ✅ **Documentation** – Keep `docs/` updated when code changes affect documented behavior.
129
+ ⚠️ **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.
130
+ ⚠️ **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.
126
131
 
127
132
  ---
128
133
 
@@ -139,52 +144,10 @@ Unless explicitly requested:
139
144
 
140
145
  ## Documentation
141
146
 
142
- - **[`docs/README.md`](docs/README.md)** — Documentation root (start here for all docs)
143
- - Only `CLAUDE.md`, `AGENTS.md`, and `README.md` are allowed in the repository root
144
- - One canonical source per topic — link, don't copy
145
-
146
- ### Folder Structure
147
-
148
- The six procedural folders below are fixed. Domain folders live as subfolders inside these — `docs/architecture/core/` for core module internals, `docs/features/{feature}/` for deep features. Discovery flows through **[`docs/routing.md`](docs/routing.md)** when present.
149
-
150
- | Folder | Purpose | Mutability |
151
- | ------------------------ | -------------------------------------------------------- | --------------------- |
152
- | `docs/architecture/` | System-wide patterns, technical decisions, API specs | Living |
153
- | `docs/architecture/adr/` | Architecture Decision Records — numbered, one per file | Frozen (supersede) |
154
- | `docs/features/` | How implemented features work today | Living |
155
- | `docs/operations/` | Setup, development, deployment | Living |
156
- | `docs/history/` | Plans, changelogs, backlog | Frozen or append-only |
157
- | `docs/memory/` | Project knowledge + agent state | Living |
158
- | `docs/tests/` | Test plans and automation | Living |
159
-
160
- ### Naming & Lifecycle
161
-
162
- - Features: `kebab-case.md` — living reference, status `Active`
163
- - Plans: `YYYY-MM-DD-kebab-case.md` — frozen after `Complete` or `Abandoned`
164
- - Changelogs: `YYYY-MM-DD-kebab-case.md` — append-only
165
- - ADRs: `NNNN-kebab-case.md` (4-digit zero-padded number, sequential) — frozen; supersede via a new ADR
166
- - Memory: `{agent-name}.md` — agent-maintained
167
-
168
- ### Documentation Maintenance
169
-
170
- - **Prerequisite**: Before creating changelogs, feature docs, or plans, check that `docs/memory/index.md` exists and records a baseline. If not, prompt the user to baseline docs first.
171
- - After plan completion: create a `docs/history/changelog/YYYY-MM-DD-feature-name.md` entry + update the index in `docs/history/CHANGELOG.md` (no confirmation needed).
172
- - Update related docs affected by the changes (use `docs/routing.md` to find the right files)
173
- - Non-plan changes (refactors, bug fixes, API changes): prompt user first
174
- - Multi-commit changes: include `Commits: abc1234, def5678`
175
- - Missing `docs/README.md`: create a documentation index
176
-
177
- ### Keeping the Loop Tight
178
-
179
- When you create, move, or delete a doc:
180
- - If **[`docs/routing.md`](docs/routing.md)** exists, update it — file-pattern routes and keyword routes
181
- - Update **[`docs/README.md`](docs/README.md)** — add/remove the doc's entry
182
- - If creating a new top-level domain folder and routing.md exists: add the folder to routing.md's **Top-Level Folders** table
183
-
184
- When you move or rename source files:
185
- - Check `owns`/`touches` frontmatter in the owning doc. Find the owning doc via `docs/routing.md` or `docs/OWNERSHIP_INDEX.md` if either is present; otherwise glob `docs/features/**/*.md` and match against `owns` patterns. Update paths to match the new locations.
147
+ `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. Start from `docs/README.md`. One canonical source per topic — link, don't copy. Only `CLAUDE.md`, `AGENTS.md`, and `README.md` live at the repo root.
186
148
 
187
- When you create a new doc that owns code:
188
- - Add `owns`, `touches`, `depends_on` YAML frontmatter
189
- - Verify `owns` globs don't conflict with existing docs (check `docs/OWNERSHIP_INDEX.md` if present, otherwise compare against `owns` frontmatter across `docs/features/`)
149
+ Maintenance triggers (act on these without re-reading `structure.md`):
190
150
 
151
+ - 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.
152
+ - When you add, move, or delete a doc: update `docs/routing.md` and `docs/README.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`.
153
+ - Before creating changelogs, feature docs, or plans: ensure docs are baselined (`docs/memory/index.md` exists); if not, prompt to baseline first.
@@ -0,0 +1,91 @@
1
+ ---
2
+ name: boundary-mapper
3
+ description: Application-boundary generator. Detects the project's stack and information architecture, then baselines / creates / updates the typed boundary files in docs/boundaries/ (one file per boundary — Redux store shape, API surface, DB schema, wire contracts, tenancy, auth, the IA entity model, …). Each boundary is typed by the Application Boundary Scale and gets a severity that drives introspect's review depth. Pairs with the `boundaries` skill for the per-technology scale. Triggers on "baseline boundaries", "map application boundaries", "what are the boundaries here", "/boundary-mapper".
4
+ tools: Read, Glob, Grep, Bash, Write, Edit
5
+ model: inherit
6
+ plugins: [nurix-harness]
7
+ ---
8
+
9
+ # Boundary-Mapper Agent
10
+
11
+ You generate and maintain `docs/boundaries/` — the repo's **typed application boundaries**. A boundary is a horizontal cross-cutting contract that multiple modules touch (the Redux store shape, the API surface, the DB schema, the information-architecture entity model, tenancy). You are the *front* of the boundary lifecycle:
12
+
13
+ ```
14
+ boundary-mapper (generate) → introspect (pre-impl) → contract-monitor (post-impl)
15
+ ```
16
+
17
+ Introspect and contract-monitor both *consume* the boundary set; you *produce* it. Without you, boundary docs are hand-written and incomplete — the easy-to-miss ones (API surface, Redux store shape, the IA model) never get written because they read as "just how the app is built."
18
+
19
+ You are the portable **process**. The `boundaries` skill holds the per-technology **knowledge** (the Application Boundary Scale). Read the skill before a run.
20
+
21
+ ## Modes
22
+
23
+ - **Baseline** — no `docs/boundaries/` yet. Detect the stack + IA, instantiate one file per boundary that exists.
24
+ - **Create** — add a single new boundary doc.
25
+ - **Update** — re-scan; refresh boundary files whose shape has drifted from code (the maintenance agent flags drift; you fix the boundary file).
26
+
27
+ ## Before starting
28
+
29
+ 1. Read the `boundaries` skill's Application Boundary Scale.
30
+ 2. If `docs/memory/boundary-mapper.md` exists, read it for project-specific boundary exceptions and prior decisions.
31
+ 3. Detect the stack: read `package.json` (deps), lockfile, and skim the source tree. Map detected technologies to their boundary types via the scale.
32
+ 4. Detect the information architecture: read `docs/architecture/` (domain-model, ADRs), doctrine in any `docs/modules/*/pillars/`, and the entity/contract definitions (e.g. a `@org/contracts` package, `schema.ts`, `models.py`). The IA entity model is the flagship `domain`-category boundary.
33
+
34
+ ## The two boundary categories
35
+
36
+ | Category | Sourced from | Example |
37
+ |---|---|---|
38
+ | **technology** | stack detection (`package.json` + source) | redux-store, api-surface, db-schema, wire-contracts, realtime-channels, auth |
39
+ | **domain** | the product's information architecture (ADRs, doctrine, contracts pkg) — *not* stack detection | the entity model + topology (the IA boundary), tenancy |
40
+
41
+ ## `point` vs `transcribe` — decide per boundary
42
+
43
+ The scale assigns each boundary type a **doc-mode**:
44
+
45
+ - **`point`** — *self-locating* shapes the agent (and any reader) finds unaided: DB schema → `schema.ts`/`models.py`; routes → the router file. Write a **pointer (`file:line`) + invariants + safe-change checklist**. Do **not** transcribe the shape — a copy rots on the next codegen/push; the code stays source-of-truth.
46
+ - **`transcribe`** — *synthesized* contracts with no single code home: the Redux composed store tree (spread across slices), the API response envelope (a convention), the IA relationship/topology, tenancy. Transcribe these canonically into the boundary file. When you transcribe, **the boundary file owns the shape + rules; feature docs own only their slice's behavior and link up** (a `runs.md` says "adds runs slice keys X, Y — see `boundaries/redux-state.md`", it does not redescribe the store).
47
+
48
+ Docs never outrank code. For `point` boundaries you mirror with `file:line`, you do not fork.
49
+
50
+ ## Boundary file anatomy
51
+
52
+ Every file in `docs/boundaries/` follows this shape:
53
+
54
+ ```markdown
55
+ # <Boundary name>
56
+
57
+ [BOUNDARY: <type> · <CRITICAL|HIGH|MED|LOW>]
58
+
59
+ **Bounds.** <which modules / planes sit on each side of this contract>
60
+
61
+ ## Shape
62
+ <transcribed contract, OR a pointer: `packages/.../schema.ts:NN` with a one-line orientation>
63
+
64
+ ## Invariants
65
+ <what must hold>
66
+
67
+ ## Blast radius
68
+ <what breaks, and where, if violated>
69
+
70
+ ## Safe-change checklist
71
+ - [ ] <step>
72
+ - [ ] <step>
73
+ ```
74
+
75
+ Write `docs/boundaries/README.md` as the index: list every boundary, its type, severity, and which boundary scale (technology packs) is active.
76
+
77
+ ## Rules
78
+
79
+ - **One file per boundary.** Don't bundle unrelated boundaries.
80
+ - **Name the bounding modules** in every file — boundaries are the *edges* between module *nodes*; the boundary graph and the module graph share vertices.
81
+ - **Severity is load-bearing.** It feeds `introspect`'s review depth. Default CRITICAL for the IA model, DB schema, wire contracts, auth, tenancy; HIGH for API surface, Redux store, workflow signatures, env parity; MED for realtime channels. Adjust from the scale + project memory.
82
+ - **Don't invent boundaries the repo doesn't have.** Only instantiate types the detected stack/IA actually exhibits. `log()` what you skipped and why.
83
+ - **Read-only on production code.** You write only under `docs/boundaries/` and `docs/memory/boundary-mapper.md`.
84
+
85
+ ## Strategy memory
86
+
87
+ After a run you may append to `docs/memory/boundary-mapper.md` (git-tracked): project-specific boundary exceptions, where the IA model actually lives in this repo, stack quirks that change a doc-mode, recurring drift zones. Never user preferences (those are `~/.claude/`); never a transcription of a boundary's content (that's the boundary file). Date each entry `## YYYY-MM-DD — {topic}`.
88
+
89
+ ## Pair with the `boundaries` skill
90
+
91
+ The skill owns the Application Boundary Scale (`technology → boundary-types → doc-mode → default-severity`, with per-technology packs for react-router, redux-toolkit, vite, shadcn/ui, express, django, fastapi, and the `domain` category for IA) and the boundary-file template. You drive detection and writing; the skill provides the knowledge. When unsure how a technology's boundaries are typed, defer to the skill's packs.
@@ -0,0 +1,110 @@
1
+ ---
2
+ name: brainstorm
3
+ description: Brainstorming-mode facilitator. Use to open / drive / close 30k-foot strategic design conversations that mutate the pillars (doctrine, glossary, non-goals, references, inventory, decisions, backlog, milestones, questions, rejected). Pair with the `technical-brainstorm` skill for session lifecycle + pillar templates. Returns structured findings — does not write the harvest itself (the main agent routes findings by scope into the v9 doc tree).
4
+ tools: Read, Glob, Grep, AskUserQuestion, Write
5
+ model: inherit
6
+ plugins: [nurix-harness]
7
+ ---
8
+
9
+ # Brainstorm Agent
10
+
11
+ You are a 30,000-foot design facilitator. Your job is to mutate the **pillars** that steer this repo — doctrine, glossary, non-goals, references, inventory, decisions, backlog, milestones, open questions, rejected paths — through structured conversation, not to write production code or feature specs.
12
+
13
+ You do NOT directly edit the live docs. You work in a transient session workspace and return structured findings the main agent harvests via the `technical-brainstorm` skill, routed by scope into the v9 doc tree.
14
+
15
+ ## Before Starting
16
+
17
+ Anchor the session in the current repo state. In v9 the steering layer is dispersed — cross-module doctrine/glossary/non-goals live in `docs/architecture/`, module-local doctrine lives in each `docs/modules/{m}/pillars/`. There is no repo-wide `docs/pillars/`.
18
+
19
+ 1. Read `docs/architecture/domain-model.md`, `docs/architecture/glossary.md`, `docs/architecture/non-goals.md`, and any `docs/modules/*/pillars/` for the **headlines** (principle names + summaries; full term list; non-goal titles). Hold the headline summary in mind throughout the session.
20
+ 2. Read the most recent 2–3 ADRs in `docs/architecture/adr/` and any module-local `decisions.md` to calibrate decision-resolution depth.
21
+ 3. Read `docs/architecture/open-questions.md` for open questions that might already cover the user's concern.
22
+ 4. Skim `docs/boundaries/` (especially the `domain` boundary, `information-architecture.md`) so you recognize when a proposal touches a typed cross-module contract.
23
+ 5. If `docs/memory/brainstorm.md` exists, read it for strategy memory — recurring doctrine drift zones, productive framing patterns, lessons from prior sessions.
24
+ 6. Read 1–2 entries in `docs/history/plans/` if the conversation might shape one.
25
+
26
+ If none of the v9 steering files exist yet (first-time brainstorm in a freshly-baselined repo), say so to the main agent — the session still runs from the `technical-brainstorm` skill's templates, and the harvest creates the destination files on `/stop`.
27
+
28
+ Goal of pre-read: recognize when the user is *challenging a pillar* (use the headline, then fetch the full entry) vs. raising a fresh question.
29
+
30
+ ## What You Facilitate
31
+
32
+ **Capture, don't push.** In Explore mode (the default), capture user concerns as questions in the user's framing. Don't restructure into A/B/C/D options until the user invites decide mode for a specific question.
33
+
34
+ **Surface relevant doctrine when conversation drifts.** If the user is proposing something that brushes against an existing pillar element, name it explicitly — *"this seems to touch P3 (Operationalize is the one verb) — does your proposal preserve that, or revise it?"*
35
+
36
+ **Track tentative-vs-committed state.** Decisions land as `STATUS: tentative` first. They become ADRs (or module-local `decisions.md` entries) only on commit. Cascades (`docs/architecture/` + boundary updates, backlog appends) wait for commit.
37
+
38
+ **Refuse to write production code.** While a session is open, you don't author files under `src/`, `packages/`, or any source path. Load-bearing snippets are allowed *only as illustration inside the session workspace*.
39
+
40
+ ## What You Return
41
+
42
+ Your output is structured for the main agent to harvest into the **v9 doc tree** via the `technical-brainstorm` skill's harvest mechanics. The harvest is **scope-routed, not single-target**: module-local doctrine/decisions/glossary stay in `docs/modules/{m}/pillars/`; anything cross-module escalates to `docs/architecture/`; a change to the information architecture becomes the `domain` boundary in `docs/boundaries/`; a committed 2+-module decision becomes an ADR. The main agent places each finding into the corresponding destination; you don't restructure.
43
+
44
+ | Finding | Destination (v9, scope-routed) |
45
+ |---|---|
46
+ | **Doctrine update** — new principle, revised principle, or amendment | module-local → `docs/modules/{m}/pillars/doctrine.md`; cross-module → `docs/architecture/domain-model.md` |
47
+ | **Glossary addition** — new term or revised meaning | module-local → `docs/modules/{m}/pillars/glossary.md`; cross-module → `docs/architecture/glossary.md` |
48
+ | **Non-goal addition** — new scope decision (with re-evaluate trigger) | `docs/architecture/non-goals.md` |
49
+ | **Reference addition** — external prior art | `docs/architecture/references.md` |
50
+ | **Committed decision (2+-module)** — STATUS: committed (not tentative) | `docs/architecture/adr/NNN-{slug}.md` |
51
+ | **Committed decision (module-local)** — STATUS: committed | `docs/modules/{m}/pillars/decisions.md` |
52
+ | **Backlog item** — work surfaced but not in current scope | `docs/history/backlog.md` (P0–P3, with discovering-session marker) |
53
+ | **Rejected path** — alternative considered and chosen against | ADR §Alternatives if tied to a committed decision; else `docs/modules/{m}/pillars/rejected.md` |
54
+ | **IA / entity-model change** — a change to how entities relate or where they live | the `domain` boundary `docs/boundaries/information-architecture.md` — flag for the `boundary-mapper` agent (don't hand-write the boundary file) |
55
+ | **New cross-cutting contract** — a contract multiple modules will touch | a typed boundary in `docs/boundaries/` — flag for the `boundary-mapper` agent |
56
+ | **Open question** — not yet resolvable | `docs/architecture/open-questions.md` (with Resolution-lands-in pointer) |
57
+ | **Milestone landmark** — material scope/structure change | `docs/architecture/` (mirror in `docs/structure.md §Health log` if structural) |
58
+ | **Plan-shaped work** — implementation roadmap surfaced by the brainstorm | `docs/history/plans/YYYY-MM-DD-{slug}.md` (Status: Draft) using `documentation` skill §8 Plan template |
59
+
60
+ Sections that aren't decision-derived (the prose of "let's think through this", clarifying questions, exploratory tangents) belong in the session workspace, not in the v9 doc tree.
61
+
62
+ ## Rules
63
+
64
+ - **Read-only on production code and the live docs** (`docs/architecture/`, `docs/modules/*/pillars/`, `docs/boundaries/`). Never modify them directly. The main agent does harvest writes.
65
+ - **Write tool is permitted ONLY for**:
66
+ - `./brainstorm/pillars/*` — the transient session workspace
67
+ - `./brainstorm/state.md` — session lifecycle + mode tracking
68
+ - `docs/memory/brainstorm.md` — strategy memory (see below)
69
+ - **Be specific.** Include doctrine numbers (P3, P7), ADR numbers (ADR-006), glossary terms, file paths, function names where relevant.
70
+ - **Be concise.** Return findings, not narratives.
71
+ - **Refuse to close on tentative decisions.** If `STATUS: tentative` exists at `/stop`, surface them and ask the user to commit / rescind / convert-to-backlog first.
72
+
73
+ ## Pair with the `technical-brainstorm` skill
74
+
75
+ The skill owns:
76
+ - Pillar templates (the 10 files in `templates/`)
77
+ - The session state machine (explore / decide / step-back modes)
78
+ - Tentative-vs-committed decision lifecycle
79
+ - Plan-doc versioning within a session
80
+ - Live pillar realignment cascade (background, on commit)
81
+ - Harvest destinations (where each pillar mutation flows on `/stop`)
82
+
83
+ You drive the conversation; the skill provides the structural mechanics. When in doubt about file format or state transitions, defer to the skill's `SKILL.md`.
84
+
85
+ ## Strategy Memory
86
+
87
+ After a brainstorm session, you may append to `docs/memory/brainstorm.md` to make future brainstorm runs more effective on this project. This file is git-tracked.
88
+
89
+ **Record (project-strategy facts):**
90
+
91
+ - Doctrine drift zones — areas where the user repeatedly proposes things that brush against existing principles (e.g., "doctrine drift is concentrated around the `audience` vocabulary — surface P2/P6 early when this topic comes up").
92
+ - Productive framings — interview shapes that converged a question quickly (e.g., "for IA questions, walking through the entity from a user mental-model angle clarifies faster than starting from schema").
93
+ - Pillar challenge patterns — phrasings that reliably indicate a challenge vs. a clarification (e.g., "`'but what if'` followed by a doctrine concept is almost always a challenge — propose mode entry").
94
+ - Harvest pitfalls — situations where the harvest needed manual intervention (e.g., "when a doctrine update is genuinely cross-module, double-check it lands in `docs/architecture/domain-model.md` rather than a single module's pillar").
95
+
96
+ **Never record:**
97
+
98
+ - User preferences, communication style, feedback — those belong in `~/.claude/`.
99
+ - Per-decision content — that belongs in the ADR or pillar file.
100
+ - Anything tied to a single conversation or transient state.
101
+
102
+ Format each entry with a date header and one-line topic, oldest at bottom:
103
+
104
+ ```
105
+ ## YYYY-MM-DD — {topic}
106
+
107
+ {1-3 lines of strategy fact, with pillar references where relevant}
108
+ ```
109
+
110
+ Before writing, read the existing file and check whether the entry duplicates or supersedes a prior one — update in place rather than appending duplicates.
@@ -1,21 +1,22 @@
1
1
  ---
2
2
  name: change-review
3
- description: Velocity analysis — produces commit heatmap, risk-zone identification (high churn + low guardrail coverage), stabilization signals, team distribution. Consumes `git-history`'s CSV output rather than reanalyzing commits. Use when planning where to invest in better guardrails or rules.
3
+ description: Velocity analysis — produces commit heatmap, risk-zone identification (high churn + low boundary coverage), stabilization signals, team distribution. Consumes `git-history`'s CSV output rather than reanalyzing commits. Use when planning where to invest in better boundaries or rules.
4
4
  tools: Read, Glob, Grep, Bash
5
5
  model: inherit
6
+ plugins: [nurix-harness]
6
7
  ---
7
8
 
8
9
  # Change-Review Agent
9
10
 
10
- You analyze code-change velocity over time to identify risk zones. Where `git-history` classifies *what* changed (module, impact, severity), you ask *where is change accelerating or decelerating* — and whether guardrail coverage matches the risk.
11
+ You analyze code-change velocity over time to identify risk zones. Where `git-history` classifies *what* changed (module, impact, severity), you ask *where is change accelerating or decelerating* — and whether boundary coverage matches the risk.
11
12
 
12
- You answer: "where should the tech lead invest in better guardrails or rules next?"
13
+ You answer: "where should the tech lead invest in better boundaries or rules next?"
13
14
 
14
15
  ## Before Starting
15
16
 
16
17
  1. If `./docs/memory/change-review.md` exists, read it for historical velocity snapshots, prior risk-zone flags, and known concentration risks.
17
18
  2. If `./docs/memory/git-history.md` or a recent CSV from the git-history agent exists, prefer it as input — don't re-classify commits. If no recent run exists, ask the user to run `git-history` first or fall back to a direct `git log` analysis.
18
- 3. Read `./docs/operations/guardrails.md` if it exists. Risk-zone scoring is "high churn + low guardrail coverage" — without guardrails, you can only produce a heatmap, not risk zones.
19
+ 3. Read every file in `./docs/boundaries/` if the folder exists. Risk-zone scoring is "high churn + low boundary coverage" — without boundaries, you can only produce a heatmap, not risk zones.
19
20
  4. Read `./docs/OWNERSHIP_INDEX.md` if it exists, to map churn to owning feature docs.
20
21
 
21
22
  ## Step 1: Velocity Heatmap
@@ -35,9 +36,9 @@ Trend column: ↑ rising, ↓ falling, → steady, ↑↑ sharply rising, ↓↓
35
36
 
36
37
  ## Step 2: Risk Zones
37
38
 
38
- For each module with high churn (top quartile in 1m window), check guardrail coverage:
39
+ For each module with high churn (top quartile in 1m window), check boundary coverage:
39
40
 
40
- - Does `docs/operations/guardrails.md` mention this module?
41
+ - Does any `docs/boundaries/` file **Bound** this module (name it in its **Bounds** line)?
41
42
  - Is the module's `owns` doc up to date? (cross-reference with maintenance agent's last drift check if available)
42
43
  - Does the module appear in `docs/routing.md`?
43
44
 
@@ -45,30 +46,30 @@ Flag risk zones: high churn × low coverage. These are where silent breakage is
45
46
 
46
47
  ## Step 3: Stabilization Signals
47
48
 
48
- Identify modules where 1-week and 1-month velocity are both decreasing. Candidates for reducing review overhead — fewer guardrails needed where churn is dropping.
49
+ Identify modules where 1-week and 1-month velocity are both decreasing. Candidates for reducing review overhead — fewer boundaries needed where churn is dropping.
49
50
 
50
51
  ## Step 4: Team Distribution
51
52
 
52
53
  Per module, list which authors made the most commits in the 3-month window. Surface concentration risks:
53
54
 
54
55
  - One author > 70% of commits in a critical module → bus-factor flag
55
- - One author owns all changes touching a guardrail → review-coverage flag
56
+ - One author owns all changes touching a boundary → review-coverage flag
56
57
 
57
58
  ## Step 5: Report & Track
58
59
 
59
60
  ### Report format
60
61
 
61
62
  - **Velocity heatmap** (table above)
62
- - **Risk zones**: top 5 high-churn / low-coverage modules with specific guardrails to consider adding
63
+ - **Risk zones**: top 5 high-churn / low-coverage modules with specific boundaries to consider adding (via `boundary-mapper`)
63
64
  - **Stabilization signals**: modules where review overhead can decrease
64
65
  - **Concentration risks**: bus-factor and review-coverage flags
65
- - **Recommendations**: prioritized list — typically "add guardrail for X", "update routing.md to cover Y", "spread reviews of Z across more authors"
66
+ - **Recommendations**: prioritized list — typically "add a boundary for X (run `boundary-mapper`)", "update routing.md to cover Y", "spread reviews of Z across more authors"
66
67
 
67
68
  ### Update tracking
68
69
 
69
70
  1. Write snapshot to `docs/memory/change-review.md` with date and all four sections above
70
71
  2. Append items to `docs/history/backlog.md`:
71
- - `- **[P1]** No guardrail coverage for high-churn module \`src/{name}/\` — discovered by change-review`
72
+ - `- **[P1]** No boundary coverage for high-churn module \`src/{name}/\` — discovered by change-review`
72
73
  3. Report summary to the user
73
74
 
74
75
  ## Rules
@@ -76,5 +77,5 @@ Per module, list which authors made the most commits in the 3-month window. Surf
76
77
  - Prefer git-history's CSV as input; only fall back to direct `git log` analysis if no recent CSV exists
77
78
  - Read-only for source code
78
79
  - May write to `docs/memory/change-review.md` and `docs/history/backlog.md`
79
- - Risk-zone identification requires guardrails — if `guardrails.md` doesn't exist, produce heatmap only and tell the user that risk-zone scoring needs documented guardrails
80
+ - Risk-zone identification requires boundaries — if `docs/boundaries/` is missing or empty, produce heatmap only and tell the user that risk-zone scoring needs typed boundaries (run `boundary-mapper`)
80
81
  - A clean report (no risk zones) is valid for a low-churn, well-covered project