@kiwidata/grimoire 0.1.5 → 0.1.6

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 (53) hide show
  1. package/.claude-plugin/plugin.json +2 -2
  2. package/AGENTS.md +21 -25
  3. package/LICENSE +36 -0
  4. package/README.md +7 -3
  5. package/dist/cli/index.js +2 -41
  6. package/dist/cli/index.js.map +1 -1
  7. package/dist/cli/program.d.ts +4 -0
  8. package/dist/cli/program.d.ts.map +1 -0
  9. package/dist/cli/program.js +45 -0
  10. package/dist/cli/program.js.map +1 -0
  11. package/dist/commands/configure.d.ts.map +1 -1
  12. package/dist/commands/configure.js +2 -1
  13. package/dist/commands/configure.js.map +1 -1
  14. package/dist/core/check.d.ts.map +1 -1
  15. package/dist/core/check.js +4 -11
  16. package/dist/core/check.js.map +1 -1
  17. package/dist/core/ci.d.ts.map +1 -1
  18. package/dist/core/ci.js +2 -2
  19. package/dist/core/ci.js.map +1 -1
  20. package/dist/core/docs.d.ts.map +1 -1
  21. package/dist/core/docs.js +3 -10
  22. package/dist/core/docs.js.map +1 -1
  23. package/dist/core/health.d.ts.map +1 -1
  24. package/dist/core/health.js +3 -5
  25. package/dist/core/health.js.map +1 -1
  26. package/dist/core/hooks.d.ts.map +1 -1
  27. package/dist/core/hooks.js +6 -14
  28. package/dist/core/hooks.js.map +1 -1
  29. package/dist/core/list.d.ts.map +1 -1
  30. package/dist/core/list.js +4 -7
  31. package/dist/core/list.js.map +1 -1
  32. package/dist/core/pr.d.ts.map +1 -1
  33. package/dist/core/pr.js +0 -8
  34. package/dist/core/pr.js.map +1 -1
  35. package/dist/core/status.d.ts.map +1 -1
  36. package/dist/core/status.js +3 -3
  37. package/dist/core/status.js.map +1 -1
  38. package/dist/core/update.d.ts.map +1 -1
  39. package/dist/core/update.js +1 -10
  40. package/dist/core/update.js.map +1 -1
  41. package/package.json +19 -2
  42. package/skills/grimoire-apply/SKILL.md +7 -0
  43. package/skills/grimoire-audit/SKILL.md +4 -1
  44. package/skills/grimoire-bug/SKILL.md +7 -3
  45. package/skills/grimoire-draft/SKILL.md +4 -0
  46. package/skills/grimoire-plan/SKILL.md +4 -28
  47. package/skills/grimoire-pr-review/SKILL.md +1 -0
  48. package/skills/grimoire-refactor/SKILL.md +1 -1
  49. package/skills/grimoire-review/SKILL.md +1 -1
  50. package/skills/grimoire-verify/SKILL.md +12 -0
  51. package/skills/references/artifact-map.md +44 -0
  52. package/skills/references/review-personas.md +9 -3
  53. package/skills/references/test-baseline.md +55 -0
@@ -1 +1 @@
1
- {"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/core/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AACtE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,WAAW,GACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC1D,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAWjD,MAAM,CAAC,KAAK,UAAU,aAAa,CACj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,EAAE,kBAAkB,EAAE;SACxC,CAAC,CAAC;QACH,IAAI,CAAC,GAAG,CAAC,EAAE;YAAE,OAAO,IAAI,CAAC;QACzB,MAAM,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAyB,CAAC;QACxD,OAAO,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC;IAC9B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;YAAS,CAAC;QACT,YAAY,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;AACH,CAAC;AAGD,KAAK,UAAU,kBAAkB;IAC/B,IAAI,OAAO,CAAC,GAAG,CAAC,wBAAwB;QAAE,OAAO;IACjD,MAAM,GAAG,GAAG,MAAM,eAAe,EAAE,CAAC;IACpC,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO;QAAE,OAAO;IACvC,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAClD,IAAI,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC;QAAE,OAAO;IACrD,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,MAAM,CACV,uBAAuB,GAAG,CAAC,OAAO,MAAM,MAAM,mBAAmB,GAAG,CAAC,IAAI,WAAW,CACrF,CACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiwidata/grimoire",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Gherkin + MADR spec-driven development for AI coding assistants",
5
5
  "type": "module",
6
6
  "bin": {
@@ -16,7 +16,12 @@
16
16
  "build": "tsc",
17
17
  "dev": "tsc --watch",
18
18
  "test": "vitest",
19
+ "test:bdd": "npm run build && NODE_OPTIONS=\"--import tsx\" cucumber-js",
19
20
  "lint": "eslint src/",
21
+ "docs:gen": "tsx scripts/gen-cli-docs.ts",
22
+ "docs:dev": "npm run docs:gen && vitepress dev docs",
23
+ "docs:build": "npm run docs:gen && vitepress build docs",
24
+ "docs:preview": "vitepress preview docs",
20
25
  "clean": "rm -rf dist/",
21
26
  "prepublishOnly": "npm run clean && npm run build"
22
27
  },
@@ -27,7 +32,8 @@
27
32
  "templates/",
28
33
  "skills/",
29
34
  "AGENTS.md",
30
- "README.md"
35
+ "README.md",
36
+ "LICENSE"
31
37
  ],
32
38
  "keywords": [
33
39
  "gherkin",
@@ -42,6 +48,14 @@
42
48
  ],
43
49
  "author": "Kiwi Data",
44
50
  "license": "MIT",
51
+ "repository": {
52
+ "type": "git",
53
+ "url": "git+https://github.com/KiwiData-AI/grimoire.git"
54
+ },
55
+ "homepage": "https://github.com/KiwiData-AI/grimoire#readme",
56
+ "bugs": {
57
+ "url": "https://github.com/KiwiData-AI/grimoire/issues"
58
+ },
45
59
  "engines": {
46
60
  "node": ">=20.0.0"
47
61
  },
@@ -56,13 +70,16 @@
56
70
  "yaml": "^2.8.0"
57
71
  },
58
72
  "devDependencies": {
73
+ "@cucumber/cucumber": "^13.0.0",
59
74
  "@types/node": "^22.0.0",
60
75
  "@typescript-eslint/eslint-plugin": "^8.58.1",
61
76
  "@typescript-eslint/parser": "^8.58.1",
62
77
  "@vitest/coverage-v8": "^3.2.4",
63
78
  "eslint": "^9.0.0",
64
79
  "jscpd": "^4.0.9",
80
+ "tsx": "^4.22.4",
65
81
  "typescript": "^5.7.0",
82
+ "vitepress": "^1.6.4",
66
83
  "vitest": "^3.0.0"
67
84
  }
68
85
  }
@@ -201,6 +201,11 @@ Where `<type>` is `feat`, `fix`, `refactor`, or `chore` based on the change. If
201
201
 
202
202
  The branch links the git history to the change via the `Change: <change-id>` commit trailer. The branch IS the isolation and `git diff` IS the staging — there is no separate promote step.
203
203
 
204
+ ### 3b. Capture Test Baseline
205
+ Before writing the first test, run the configured suites once to record the starting state, then **present any pre-existing failures to the user and get acceptance before proceeding**. This is the run you'd do anyway to understand where you're starting — just save the result. Write it to `.grimoire/changes/<change-id>/baseline.md` so `grimoire-verify` can tell a regression you introduced from a failure that was already red. Skippable when no test command is configured or the user opts out (record the skip — don't leave it silent). Full protocol: `../references/test-baseline.md`.
206
+
207
+ The point: a failure is "pre-existing" only if it's in `baseline.md`. This replaces end-of-run "that's a pre-existing failure" surprises with a start-of-run acceptance the user signed off on.
208
+
204
209
  > **No promote.** Feature files, decisions, and constraints were drafted directly into their live locations (`features/`, `.grimoire/decisions/`, `.grimoire/docs/constraints.md`) on this branch. BDD runners already discover the scenarios from `features/`. Do not copy anything out of `.grimoire/changes/` — that folder holds only `manifest.md` and `tasks.md`.
205
210
 
206
211
  ### 4. Load Context
@@ -274,6 +279,7 @@ When all implementation tasks are complete:
274
279
  - If existing scenarios break, you've introduced a regression — fix it before proceeding
275
280
  - Check ADR confirmation criteria if applicable
276
281
  - Run the project's full test suite (`config.tools.unit_test`) if configured — grimoire tests don't replace existing tests
282
+ - **Diff against the baseline** (`baseline.md` from step 3b): a failure already in the baseline is pre-existing and accepted; a failure NOT in the baseline is a regression you introduced — fix it before finalize. If the baseline was skipped, say so and list all failures for the user rather than claiming "existing tests pass."
277
283
 
278
284
  **The verify step is not optional. Do not proceed to finalize with failing tests.**
279
285
 
@@ -320,6 +326,7 @@ Present a brief summary:
320
326
  - `../references/pattern-guard.md` — run before each task: (1) classify code type, (1b) reuse discovery — two `search_graph` calls (semantic_query by concept + name_pattern by likely name) to find existing code to call instead of writing new code, (2) find 3–5 peers, extract modal pattern across four seams (error handling, dependency, abstraction depth, return shape), write a pattern brief. Apply the brief while writing. Run hallucination check after writing (verify called functions exist in graph). Skip if graph not indexed.
321
327
  - `../references/code-quality.md` — anti-slop rules to apply *while writing*: reuse before write, trust callers, names reveal intent, branching budget, function size, no premature abstraction, zero comments by default (only non-obvious *why*, never *what*). Includes a seven-point quality gate to run before marking each task `[x]`.
322
328
  - `../references/testing-contracts.md` — verify-before-using rules (imports, packages, APIs), mocking strategy (HTTP boundary not client), fixture management, contract tests, and step definition quality checks.
329
+ - `../references/test-baseline.md` — capture which tests were already failing at change start, save to `baseline.md`, get user acceptance; verify diffs against it so only new failures count as regressions.
323
330
 
324
331
  ## Important
325
332
  - **Tests are not optional.** Every task produces both production code and passing step definitions. No exceptions.
@@ -59,7 +59,10 @@ Scan for implicit architecture decisions:
59
59
  - **Deployment** — Docker, K8s, serverless? CI/CD pipeline?
60
60
  - **Data model** — multi-tenant? event-sourced? CQRS?
61
61
 
62
- For each pattern found, check if a corresponding ADR exists. If not, note it as undocumented.
62
+ For each pattern found, check if a corresponding ADR exists. If not, apply the **novelty gate** before proposing one:
63
+
64
+ - **Only propose an ADR for a novel decision** — one with a real, project-specific trade-off between viable alternatives. An industry-default pick on this stack (the standard test runner, CLI parser, git wrapper, linter; the ecosystem-forced module convention) is **not** novel. Test: *would a competent engineer on this stack pick differently, and need the reasoning to understand the choice?* If no, do not backfill an ADR for it.
65
+ - **Do NOT mint one ADR per default tooling pick.** That is the most common audit-backfill failure — it floods the register with "we used the standard tool" records. Collect the obvious tooling/convention defaults into a single `Tooling and convention baseline` ADR (one row each: choice → why), and reserve sequential ADRs for genuine trade-offs (e.g. "Huey instead of Celery", "regex over tree-sitter").
63
66
 
64
67
  ### 3.5. Conventions Drift Detection
65
68
  Read each file in `.grimoire/docs/conventions/`. For each file:
@@ -45,6 +45,9 @@ If the user's report is vague, ask one clarifying question. Don't start fixing u
45
45
 
46
46
  **Scenario is wrong** → Rare, but possible. The spec itself describes incorrect behavior. Flag this to the user — it may need a grimoire draft to update the feature properly.
47
47
 
48
+ ### 2b. Capture Test Baseline
49
+ Before you write the reproduction test, run the configured suites once and note which tests are **already** failing. A bug fix has no change folder, so record this inline — in the repro test's note and the eventual commit — and present pre-existing failures to the user. This is what lets step 4/7's "no regressions" mean something: a failure already red here is not yours. Capture this *before* the repro test exists, so the repro's intended red isn't mistaken for a pre-existing failure. Skippable if no test command is configured (say so). Full protocol: `../references/test-baseline.md`.
50
+
48
51
  ### 3. Write a Reproduction Test
49
52
  Before touching any production code:
50
53
 
@@ -126,7 +129,7 @@ Then:
126
129
  1. Make the smallest change that fixes the failing test
127
130
  2. **Hallucination check:** Before running tests, verify every external function/method the fix calls actually exists: `search_graph(name_pattern="<name>")` for each new call. If not found: locate the correct function or stop and flag to user. (Full instructions in `../references/pattern-guard.md` Step 6. Skip if graph not indexed.)
128
131
  3. Run the reproduction test — it should pass
129
- 4. Run ALL existing tests — no regressions
132
+ 4. Run ALL existing tests — no *new* failures vs the step 2b baseline. A test already failing in the baseline is pre-existing and accepted; a test failing now that wasn't then is a regression you introduced — fix it.
130
133
  5. If the fix is more than a few lines, pause and consider whether the approach is the simplest one
131
134
  6. **Code quality check:** Walk the seven-point checklist in `../references/code-quality.md` against every file you changed. Any fail → fix and re-run tests.
132
135
 
@@ -134,8 +137,8 @@ Then:
134
137
 
135
138
  ### 7. Verify
136
139
  - Reproduction test passes (`config.tools.bdd_test`)
137
- - All existing feature scenarios pass (`config.tools.bdd_test`)
138
- - All existing unit/integration tests pass (`config.tools.unit_test`)
140
+ - No *new* failures vs the step 2b baseline — pre-existing failures stay pre-existing; anything newly red is the fix's fault
141
+ - All existing unit/integration tests pass (`config.tools.unit_test`), baseline-failures aside
139
142
  - If a new scenario was added in step 2, it passes with the fix
140
143
 
141
144
  ### 8. Tester Verification Checklist
@@ -186,6 +189,7 @@ Report to the user:
186
189
  **Before writing the fix**, read both:
187
190
  - `../references/code-quality.md` — anti-slop rules to apply *while writing*: reuse before write, trust callers, names reveal intent, branching budget, function size, no premature abstraction, comments only for non-obvious why. Includes a seven-point quality gate to run before declaring the fix done.
188
191
  - `../references/pattern-guard.md` Step 6 only — after writing the fix, verify every new external function call exists in the graph via `search_graph`. Skip the full pattern brief (over-constrains bug fixes). Skip entirely if graph not indexed.
192
+ - `../references/test-baseline.md` — capture which tests were already failing before the fix (step 2b), so "no regressions" means "no *new* failures," not "zero failures."
189
193
 
190
194
  ## Important
191
195
  - **Reproduce before you fix.** No exceptions. If you can't reproduce it, you don't understand it, and your fix is a guess.
@@ -124,6 +124,7 @@ Never silently fill in an open question. Either ask, defer to a non-goal, or rec
124
124
  Present a Requirements Summary (template in the reference) and wait for user confirmation before proceeding.
125
125
 
126
126
  ### 5. Check Existing State
127
+ See `../references/artifact-map.md` for what each artifact is and the reading discipline.
127
128
  - Read `features/` to understand the current behavioral baseline
128
129
  - Read `.grimoire/decisions/` to understand existing architecture decisions
129
130
  - Read `.grimoire/docs/context.yml` (if it exists) to understand the deployment environment, related services, and infrastructure — this tells you what's available (caches, queues, sibling services) and what constraints apply (deployment target, environments)
@@ -212,6 +213,9 @@ Anything that failed the feature admission test because it's an invariant rather
212
213
  - If the constraint stems from a decision, link the MADR; don't restate the decision (DRY).
213
214
 
214
215
  **For architecture decisions:**
216
+
217
+ - **Novelty gate — record only novel decisions.** A MADR is for a decision with a real, project-specific trade-off between viable alternatives. It is NOT for industry-default tooling picks (the standard test runner, CLI parser, git wrapper, linter) or for conventions the ecosystem forces (ESM `.js` import suffix, where the framework expects files). If the honest "Considered Options" would be "the obvious default vs. things nobody would pick here", do not write an ADR. Before writing one, ask: *would a competent engineer on this stack make a different choice, and would they need our reasoning to understand ours?* If no, skip it.
218
+ - **Obvious tooling/conventions go in the baseline record, not their own ADR.** When you do need to write down a default pick (e.g. a new dev dependency), add a row to the existing `Tooling and convention baseline` ADR (one line: choice → why) rather than minting a new sequential record. Reserve sequential ADRs for genuine trade-offs.
215
219
  - Write the MADR record directly into the live `.grimoire/decisions/` with the next sequential number (`NNNN-title.md`)
216
220
  - Use the template from `.grimoire/decisions/template.md` or the AGENTS.md format
217
221
  - Include considered options, decision drivers, and consequences
@@ -63,14 +63,11 @@ These are gates, not aspirations — a task that adds a duplicate home or a rein
63
63
 
64
64
  ### 2. Read All Artifacts
65
65
 
66
- **Grimoire docs first, codebase second.** The `.grimoire/docs/` directory is a pre-computed map of the codebase — it tells you where code lives, what utilities exist, what patterns to follow, and what the data layer looks like. Read these *instead of* exploring the raw codebase. Only read specific source files when the docs don't have what you need.
66
+ Read the change's artifacts following `../references/artifact-map.md` — it defines what each file is, the grimoire-docs-first / graph-for-structure discipline, and the staleness gate. Plan-specific reading on top of that:
67
67
 
68
- **Always read:**
69
- - `manifest.md` for the change summary, **including complexity level, Assumptions, Pre-Mortem, and Prior Art sections**
70
- - All `.feature` files for this change (edited live in `features/` on the branch)
71
- - All decision records for this change (edited live in `.grimoire/decisions/`), **including Cost of Ownership sections**
72
- - `.grimoire/docs/constraints.md` — any constraints (security/NFR/observability) this change adds or touches. These produce `unit-invariant` tasks, not scenarios.
73
- - The current baseline (`features/`, `.grimoire/decisions/`) via `git diff main` to see exactly what this change adds vs. what already existed
68
+ - `.grimoire/docs/constraints.md` — any constraints (security/NFR/observability) this change touches. These produce `unit-invariant` tasks, not scenarios.
69
+ - The current baseline (`features/`, `.grimoire/decisions/`) via `git diff main` exactly what this change adds vs. what already existed.
70
+ - Existing duplication in areas you're touching — `search_graph` for similar functions, or `grimoire health` (its `duplicates` metric) so tasks consolidate rather than clone.
74
71
 
75
72
  **Validate the build-vs-buy decision:**
76
73
  - Check that `manifest.md` has a **Prior Art** section documenting what existing solutions were researched. If it's missing or empty, **stop and tell the user** — planning without a build-vs-buy analysis produces plans that ignore cheaper alternatives.
@@ -78,27 +75,6 @@ These are gates, not aspirations — a task that adds a duplicate home or a rein
78
75
  - If the decision was to **build custom**, verify the manifest documents (1) what existing tools were considered, (2) the specific requirements they don't meet, and (3) what design patterns are being borrowed from prior art.
79
76
  - If the decision was **hybrid** (adopt for part, build for part), ensure the boundary between adopted and custom code is clear in the tasks.
80
77
 
81
- **Read from grimoire docs (these replace codebase exploration):**
82
- - **`.grimoire/docs/<area>.md`** for each area the change touches — these contain Purpose, Boundaries, Conventions (naming/structure), and "Where New Code Goes" guidance. For key files, exact symbols, reusable utilities (function names, file paths, line numbers), and call graphs, **query the graph** — `search_graph` / `get_code_snippet` / `get_architecture`. Area docs give you intent and placement; the graph gives you the live structure to write exact file paths and reuse existing code.
83
- - **`.grimoire/docs/data/schema.yml`** — the full data model: every table/collection, field types, relationships, indexes, and external API contracts with `source:` pointers to ORM code. Read this instead of reading individual model files.
84
- - **`.grimoire/docs/context.yml`** — the project's deployment environment, related services, infrastructure dependencies, CI/CD pipelines, and observability setup. Read this to understand deployment constraints (e.g., Lambda means no long-running processes, Kubernetes means you may need health check endpoints), cross-service boundaries (e.g., auth is handled by a sibling service, not this project), and infrastructure available at runtime (e.g., Redis is available for caching, RabbitMQ for async tasks).
85
- - Existing duplication in areas you're touching — query codebase-memory-mcp (`search_graph` for similar functions) or run `grimoire health` (its config-driven `duplicates` metric) so tasks consolidate rather than add more clones.
86
-
87
- **Read proposed data changes:**
88
- - **`data.yml`** if present — proposed schema changes need migration and model tasks
89
-
90
- **Staleness gate:** For each area doc loaded, check its `last_updated` date against `git log -1 --format=%ci <directory>`. If any doc is older than the most recent commit to its directory, it's stale — the file paths, utility names, and patterns it describes may no longer be accurate.
91
-
92
- - **Level 1-2:** Warn ("Area doc for `<area>` is behind recent commits — its boundaries/conventions may be wrong; rely on the graph for structure") and proceed. Note inferred paths with `<!-- inferred: area doc may be stale -->`.
93
- - **Level 3-4:** Treat as a blocker. Do not generate tasks until the user refreshes stale docs via `grimoire-discover` targeted refresh. Planning with stale docs at this complexity produces wrong file paths and misses recent utilities — the cost of re-planning outweighs the cost of refreshing first.
94
-
95
- **Read specific source files only when:**
96
- - Area docs don't exist yet (tell the user to run `/grimoire:discover` first — planning without area docs produces worse tasks)
97
- - Area docs exist but you need to verify a specific implementation detail (e.g., exact function signature, exact import path)
98
- - You need to read existing step definitions to understand the test setup
99
-
100
- **Do NOT read the entire codebase** for "context." The plan skill's job is to produce tasks with specific file paths and specific assertions. Area docs + data schema give you this. Reading dozens of source files wastes context window and doesn't produce better plans.
101
-
102
78
  ### 3. Check Specification Completeness
103
79
 
104
80
  Before generating tasks, evaluate whether the specifications are detailed enough to plan against. Underspecified requirements produce vague tasks, which produce wrong code.
@@ -71,6 +71,7 @@ If present:
71
71
  If no `Change:` trailer exists, that's itself a finding for a grimoire-managed repo: flag as **suggestion** ("commits missing audit trailer — `grimoire trace` won't find this PR") unless the project clearly doesn't use grimoire.
72
72
 
73
73
  ### 4. Gather Project Context
74
+ See `../references/artifact-map.md` for what each artifact is and the grimoire-docs-first / staleness discipline.
74
75
  - `.grimoire/config.yaml` — language, tools, `commit_style`, `comment_style`, `project.compliance`, `dep_audit`
75
76
  - `.grimoire/docs/context.yml` — deployment environment, related services
76
77
  - `.grimoire/docs/data/schema.yml` — current data baseline
@@ -209,7 +209,7 @@ For each item the user approves to fix:
209
209
  4. Hand off to `/grimoire:plan` for task generation, then `/grimoire:apply` for implementation
210
210
 
211
211
  **Refactoring-specific guidance for the plan/apply stages:**
212
- - **All existing tests must keep passing.** A refactoring that breaks tests is not a refactoring.
212
+ - **Capture a baseline first, then keep it.** Apply records which tests were already failing at change start (`baseline.md`, see `../references/test-baseline.md`). For a refactor this is the whole safety net: "passing" means *no new failures vs the baseline*, not "zero failures." A test red before you started is pre-existing and accepted; a test you turn red is the refactor breaking behavior — and that means it's not a refactoring. Diff against the baseline after each incremental move.
213
213
  - **Prefer incremental moves over big-bang rewrites.** Move one function at a time, run tests after each move.
214
214
  - **Add tests before refactoring if test debt is part of the item.** You need a safety net before restructuring.
215
215
  - **Update imports incrementally.** When moving code to a new module, re-export from the old location first, then update consumers, then remove the re-export.
@@ -42,7 +42,7 @@ This step is optional. The user can skip it by saying "skip review" or "go strai
42
42
  - If only one, confirm it
43
43
 
44
44
  ### 2. Gather Context
45
- Read all artifacts for the change:
45
+ Read all artifacts for the change — see `../references/artifact-map.md` for what each is and the grimoire-docs-first / staleness discipline:
46
46
  - `manifest.md` — change summary, scope, **and Prior Art section** (build-vs-buy rationale)
47
47
  - All `.feature` files — behavioral specifications
48
48
  - All decision records — architectural choices
@@ -41,6 +41,7 @@ Two modes:
41
41
  ### 2. Load Artifacts
42
42
  For change verification:
43
43
  - Read `manifest.md`, proposed `.feature` files, decision records, `tasks.md`
44
+ - Read `baseline.md` if present (the test state captured at change start) — it's how you tell a regression from a failure that was already red
44
45
 
45
46
  For baseline verification:
46
47
  - Read all `features/**/*.feature` and `.grimoire/decisions/*.md`
@@ -76,6 +77,17 @@ Flag issues:
76
77
  - Decision's Confirmation criteria not verifiable → WARNING
77
78
  - Decision consequences not addressed → WARNING
78
79
 
80
+ ### 3.C2 Regression vs Baseline
81
+
82
+ Run the configured suites (`config.tools.unit_test`, `config.tools.bdd_test`) and classify each failure against `baseline.md`:
83
+
84
+ - Failing now **and** in the baseline → **pre-existing**, already accepted by the user at change start. Not a regression. Do not blame the change.
85
+ - Failing now, **not** in the baseline → **regression** introduced by this change → CRITICAL. Must be fixed before the change finalizes.
86
+ - Passing now, failing in the baseline → incidentally fixed; note it, don't require it.
87
+ - **No `baseline.md` / baseline skipped** → you cannot classify. List all failures and say plainly they're untriaged. Do NOT assert "existing tests pass" or call anything "pre-existing" without a baseline to back it.
88
+
89
+ The rule: a failure is "pre-existing" only if it's in `baseline.md`. Otherwise it's the change's. Full protocol: `../references/test-baseline.md`.
90
+
79
91
  ### 3.D Test Quality Intelligence
80
92
 
81
93
  Go beyond "does a step definition exist?" to "would this test catch a real bug?"
@@ -0,0 +1,44 @@
1
+ # Artifact Map & Reading Discipline
2
+
3
+ Loaded by skills that read a change's specs before acting (`grimoire-plan`, `grimoire-draft`, `grimoire-design`, `grimoire-review`, `grimoire-pr-review`). This is the single home for **what each grimoire artifact is** and **how to read them**. Skills link here instead of restating it; they keep only the reading focus specific to their job.
4
+
5
+ ---
6
+
7
+ ## The artifacts
8
+
9
+ Per-change (under `.grimoire/changes/<change-id>/`):
10
+
11
+ - **`manifest.md`** — change summary, complexity level, and the Why. Level 3-4 also carry Assumptions, Pre-Mortem, and **Prior Art** (the build-vs-buy rationale).
12
+ - **`features/*.feature`** — behavioral specifications. Edited live in `features/` on the branch.
13
+ - **decision records** — architectural choices for this change, edited live in `.grimoire/decisions/`, including Cost of Ownership sections.
14
+ - **`tasks.md`** — the implementation plan (present once planned).
15
+ - **`data.yml`** — proposed schema changes (present only when the change touches the data model).
16
+
17
+ Project-wide (under `.grimoire/`):
18
+
19
+ - **`config.yaml`** — language, tools, conventions, `comment_style`, `commit_style`, `compliance`, `dep_audit`.
20
+ - **`docs/<area>.md`** — per-area Purpose, Boundaries, Conventions, and "Where New Code Goes". Intent and placement, not live structure.
21
+ - **`docs/data/schema.yml`** — the full data model: tables/collections, field types, relationships, indexes, external API contracts with `source:` pointers. Read this instead of individual model files.
22
+ - **`docs/context.yml`** — deployment environment, related services, infrastructure dependencies, CI/CD, observability. Tells you runtime constraints (Lambda → no long-running processes), cross-service boundaries (auth lives in a sibling service), and what's available (Redis, RabbitMQ).
23
+ - **`brand/tokens.json`**, **`brand/voice.md`** — design grounding (see `brand-tokens-format.md`).
24
+
25
+ ---
26
+
27
+ ## Reading discipline
28
+
29
+ **Grimoire docs first, codebase second.** `.grimoire/docs/` is a pre-computed map — where code lives, what utilities exist, what patterns to follow, what the data layer looks like. Read it *instead of* exploring raw source. Read specific source files only when the docs don't have what you need.
30
+
31
+ **Graph for live structure.** Area docs give intent and placement; they do not carry exact symbols. For function names, file paths, line numbers, reusable utilities, and call graphs, query the graph — `search_graph` / `get_code_snippet` / `get_architecture`. Combine the two: area doc says *where new code goes*, the graph says *what's already there to reuse*.
32
+
33
+ **Do NOT read the entire codebase for "context."** Area docs + data schema + the graph already give you specific paths and assertions. Reading dozens of source files wastes context and does not produce better output. Read specific source only to verify a detail the docs can't answer (exact signature, exact import path, existing step-definition setup).
34
+
35
+ ---
36
+
37
+ ## Staleness gate
38
+
39
+ For each area doc you load, compare its `last_updated` against `git log -1 --format=%ci <directory>`. If the doc is older than the most recent commit to its directory, it's stale — its paths, utility names, and patterns may be wrong.
40
+
41
+ - **Level 1-2:** warn (`Area doc for <area> is behind recent commits — rely on the graph for structure`) and proceed. Mark inferred paths with `<!-- inferred: area doc may be stale -->`.
42
+ - **Level 3-4:** blocker. Do not proceed until the user refreshes via `grimoire-discover` targeted refresh. Acting on stale docs at this complexity produces wrong paths and misses recent utilities — re-doing the work costs more than refreshing first.
43
+
44
+ If area docs don't exist at all, tell the user to run `/grimoire:discover` first.
@@ -227,12 +227,18 @@ Every security finding gets OWASP 2021 + CWE tags. See CWE quick-reference in `.
227
227
 
228
228
  Skip if change is purely internal.
229
229
 
230
+ **Coverage-gap routing (apply before recommending any new artifact).** A coverage gap does NOT default to "write a `.feature`." Route each gap to its one home using the feature-file admission test in `../grimoire-draft/SKILL.md` (§ jurisdiction table + the four admission gates):
231
+ - A `.feature` scenario is warranted **only** for an actor-observable behavior that passes all four gates (external actor, observable outcome, domain language, survives reimplementation).
232
+ - An invariant — observability/logging guarantee, perf budget, security control, compliance rule — is a **constraint**. Recommend it be recorded/verified in `.grimoire/docs/constraints.md`, never as a new `.feature`.
233
+ - When a behavior gap belongs in features, the default is **extend an existing feature file** in the same domain — recommend a new file only if no existing file fits, and say which were considered. Don't propose a `.feature` per finding.
234
+ - Test gaps for already-specified behavior are a *missing test*, not a missing feature — recommend the test, not a new spec.
235
+
230
236
  Evaluate:
231
- - **Test presence**: Every new user-facing behavior has a test? Every scenario from linked feature file has step definitions?
237
+ - **Test presence**: Every new user-facing behavior has a test? Every scenario from a linked feature file has step definitions? Missing test = recommend the test; only recommend a new/extended `.feature` if the behavior itself is unspecified *and* passes the admission test.
232
238
  - **Test quality**: Tests asserting outputs, or just that code "ran"? Over-mocked tests = red flag.
233
239
  - **Negative paths**: For each happy path, is there a failure-path test?
234
- - **Edge cases**: Empty states, concurrent users, interruptions, boundary values?
235
- - **Observability**: New feature — how will it be debugged in prod? Structured logs / metrics / error surfaces?
240
+ - **Edge cases**: Empty states, concurrent users, interruptions, boundary values? A missing edge case is a missing test/scenario in the relevant existing feature — not grounds for a new feature file.
241
+ - **Observability**: New feature — how will it be debugged in prod? Structured logs / metrics / error surfaces? Observability is a **constraint**: verify it's asserted in `constraints.md`; do not recommend a `.feature` for it.
236
242
  - **Regression risk** *(PR/pre-commit)*: Which existing tests cover the touched code? Were any tests removed or weakened?
237
243
  - **Accessibility**: New UI — keyboard nav, aria labels, contrast?
238
244
 
@@ -0,0 +1,55 @@
1
+ # Test Baseline Reference
2
+
3
+ Loaded by skills that mutate code (`grimoire-apply`, `grimoire-bug`, `grimoire-refactor`) and the skill that checks for regressions (`grimoire-verify`).
4
+
5
+ ## Why
6
+
7
+ "That's a pre-existing failure" is unfalsifiable if you never recorded what was failing *before* you started. Without a baseline, verify diffs against nothing — a regression you introduced and a failure that was already red look identical, and the user finds out at the end instead of signing off at the start.
8
+
9
+ The fix is cheap: you already run the suite when you pick up a change. **Capture which tests were already failing, save it, and let the user accept it before any code is touched.** Verify then flags only *new* failures as regressions.
10
+
11
+ This is not a new gate. It's saving the result of a run you already do.
12
+
13
+ ## Capture (at the start of a code change)
14
+
15
+ Do this once, before writing the first test or touching production code — as part of the suite run you'd do anyway to understand the starting state.
16
+
17
+ 1. Run the configured suites: `config.tools.unit_test` and `config.tools.bdd_test`. Use what's configured; don't invent commands.
18
+ 2. Record the result to `.grimoire/changes/<change-id>/baseline.md` (ephemeral scaffolding, discarded with the change folder like `tasks.md`). For a bug fix with no change folder, record inline in the commit/test note and present to the user instead.
19
+ 3. Present the pre-existing failures to the user and get explicit acceptance before proceeding.
20
+
21
+ ### baseline.md format
22
+
23
+ ```markdown
24
+ # Test Baseline — <change-id>
25
+
26
+ captured: <date> # the day you ran it; if unavailable, omit
27
+ unit: <pass>/<total> passing command: <config.tools.unit_test>
28
+ bdd: <pass>/<total> passing command: <config.tools.bdd_test>
29
+
30
+ ## Pre-existing failures (accepted by user before change)
31
+ - <test id / name> — <one-line reason if known, else "pre-existing, cause unknown">
32
+ - ...
33
+
34
+ ## Notes
35
+ - <e.g. "unit suite not configured — baseline skipped for unit">
36
+ ```
37
+
38
+ If nothing was failing, say so explicitly: `## Pre-existing failures: none — clean baseline`.
39
+
40
+ ## Skip rules
41
+
42
+ - **No test command configured** for a suite → skip that suite, write `baseline skipped — no <suite> command configured` under Notes. Don't fabricate a command.
43
+ - **User opts out** → write `baseline skipped — user opted out`. Verify must then NOT claim a clean diff; it reports failures as unclassified (could be pre-existing or new).
44
+ - A skipped baseline is recorded, not silent. Verify needs to know it can't trust a diff.
45
+
46
+ ## Diff (at verify)
47
+
48
+ `grimoire-verify` reads `baseline.md` and classifies the current suite result against it:
49
+
50
+ - Test failing now **and** in baseline → **pre-existing** (already accepted; not a regression, don't blame the change).
51
+ - Test failing now, **not** in baseline → **regression** introduced by this change → CRITICAL, must fix before finalize.
52
+ - Test passing now, failing in baseline → incidentally fixed; note it, don't require it.
53
+ - **No baseline / baseline skipped** → state plainly that failures cannot be classified, and list them all for the user to triage. Do not assert "existing tests pass" or "pre-existing failure" without a baseline to back it.
54
+
55
+ The rule that replaces the old unfalsifiable claim: **a failure is "pre-existing" only if it's in `baseline.md`.** Otherwise it's yours.