the-grimoire-cli 0.3.2 → 0.4.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.
Files changed (95) hide show
  1. package/.agents/AGENTS.md +112 -112
  2. package/.agents/NAVIGATOR.md +188 -168
  3. package/.agents/VERSION +4 -4
  4. package/.agents/agents/INDEX.md +7 -7
  5. package/.agents/agents/verifier.md +50 -50
  6. package/.agents/commands/INDEX.md +11 -11
  7. package/.agents/commands/checkpoint.md +15 -15
  8. package/.agents/commands/grimoire.md +14 -14
  9. package/.agents/commands/onboard.md +56 -56
  10. package/.agents/commands/present.md +23 -23
  11. package/.agents/commands/verify.md +20 -20
  12. package/.agents/grimoire.manifest +18 -18
  13. package/.agents/rules/00-always.md +42 -42
  14. package/.agents/rules/05-code-quality.md +28 -28
  15. package/.agents/rules/10-working-process.md +31 -31
  16. package/.agents/rules/15-skills.md +27 -27
  17. package/.agents/rules/20-modes.md +41 -41
  18. package/.agents/rules/25-surgical-changes.md +29 -29
  19. package/.agents/rules/30-verification.md +36 -36
  20. package/.agents/rules/35-context-economy.md +41 -41
  21. package/.agents/rules/40-handoff.md +25 -25
  22. package/.agents/rules/45-presentation.md +35 -35
  23. package/.agents/rules/50-security.md +30 -30
  24. package/.agents/rules/60-commit-style.md +14 -14
  25. package/.agents/rules/INDEX.md +18 -18
  26. package/.agents/skills/INDEX.md +8 -8
  27. package/.agents/skills/README.md +1 -1
  28. package/.agents/skills/catalog.md +106 -106
  29. package/.agents/skills/find-skills/SKILL.md +142 -142
  30. package/.agents/stack/README.md +69 -66
  31. package/.agents/stack/desktop.md +36 -36
  32. package/.agents/stack/library.md +1 -1
  33. package/.agents/stack/web-app.md +32 -32
  34. package/.agents/standards/INDEX.md +23 -23
  35. package/.agents/standards/accessibility.md +50 -50
  36. package/.agents/standards/architecture.md +39 -39
  37. package/.agents/standards/attribution.md +39 -39
  38. package/.agents/standards/clean-code.md +121 -121
  39. package/.agents/standards/codex.md +69 -69
  40. package/.agents/standards/error-codes.md +41 -41
  41. package/.agents/standards/general.md +46 -46
  42. package/.agents/standards/guardrail-tests.md +40 -40
  43. package/.agents/standards/knowledge-management.md +35 -35
  44. package/.agents/standards/launch-security-checklist.md +45 -45
  45. package/.agents/standards/observability.md +35 -35
  46. package/.agents/standards/release-versioning.md +53 -53
  47. package/.agents/standards/requirements.md +75 -75
  48. package/.agents/standards/security-scanners.md +42 -42
  49. package/.agents/standards/testing-strategy.md +61 -61
  50. package/.agents/standards/typescript.md +19 -19
  51. package/.agents/standards/writing.md +58 -58
  52. package/.agents/tooling.json +19 -19
  53. package/LICENSE +1 -1
  54. package/README.md +139 -139
  55. package/bin/grimoire.mjs +630 -598
  56. package/package.json +32 -32
  57. package/templates/CLAUDE.md +7 -7
  58. package/templates/ci/ci.yml +49 -49
  59. package/templates/ci/sast.yml +44 -44
  60. package/templates/codex/INDEX.md +18 -18
  61. package/templates/codex/README.md +28 -28
  62. package/templates/codex/decisions/0000-template.md +36 -36
  63. package/templates/codex/decisions/INDEX.md +11 -11
  64. package/templates/codex/decisions/README.md +25 -25
  65. package/templates/codex/domain/INDEX.md +14 -14
  66. package/templates/codex/domain/README.md +10 -10
  67. package/templates/codex/evidence/0000-extraction-template.md +36 -36
  68. package/templates/codex/evidence/INDEX.md +11 -11
  69. package/templates/codex/evidence/README.md +15 -15
  70. package/templates/codex/reference/INDEX.md +11 -11
  71. package/templates/codex/reference/README.md +15 -15
  72. package/templates/codex/reference/confirmed-values.md +18 -18
  73. package/templates/codex/requirements/INDEX.md +11 -11
  74. package/templates/codex/requirements/README.md +22 -22
  75. package/templates/codex/requirements/addons/0000-template.md +35 -35
  76. package/templates/codex/requirements/base.md +36 -36
  77. package/templates/codex/requirements/changes/0000-template.md +39 -39
  78. package/templates/codex/resources/INDEX.md +11 -11
  79. package/templates/codex/resources/README.md +17 -17
  80. package/templates/codex/resources/manifest.md +11 -11
  81. package/templates/codex/runbooks/INDEX.md +9 -9
  82. package/templates/codex/runbooks/README.md +8 -8
  83. package/templates/codex/runbooks/incident-runbook-template.md +58 -58
  84. package/templates/gitignore-snippet.txt +10 -12
  85. package/templates/journal/backlog/README.md +18 -18
  86. package/templates/journal/memory/MEMORY.md +15 -15
  87. package/templates/journal/session/archive/.gitkeep +1 -1
  88. package/templates/journal/session/artifacts/.gitkeep +1 -1
  89. package/templates/journal/session/current.md +12 -12
  90. package/templates/lint/README.md +25 -25
  91. package/templates/lint/eslint.config.mjs +33 -33
  92. package/templates/lint/tsconfig.base.json +11 -11
  93. package/templates/local/AGENTS.local.md +33 -33
  94. package/templates/local/README.md +55 -55
  95. package/templates/tests/guardrail.invariants.test.ts +59 -59
@@ -1,61 +1,61 @@
1
- ---
2
- updated: 2026-05-31
3
- status: canonical
4
- description: "The project-wide testing approach: the pyramid, what to test at each level, the active policy, and what 'tested' means."
5
- ---
6
-
7
- # Standards — testing strategy
8
-
9
- The per-stack **policy** (`tdd-mandatory | test-ready-deferred | none`) says *whether* you write
10
- tests now (`stack/`). This standard says *how* you test when you do — so "add tests" is never an
11
- open question.
12
-
13
- ## The pyramid (most tests cheap, few tests broad)
14
-
15
- | Level | Tests | Speed | Use for |
16
- |---|---|---|---|
17
- | **Unit** | pure functions, domain/engine logic, reducers, validators | ms, no I/O | the bulk; every branch of business logic |
18
- | **Integration** | a module against its real boundaries (DB, queue, an adapter) | seconds | data access, server actions, wiring |
19
- | **E2E / contract** | a user-visible flow or a published API contract | slow | a few critical happy paths + key failure paths |
20
-
21
- Push logic **down** the pyramid: keep the domain layer pure (`standards/architecture.md`) so most
22
- behavior is unit-testable without spinning up I/O.
23
-
24
- ## What a good test asserts
25
-
26
- - **Behavior, not implementation.** Assert observable output/effect for an input, not internal calls.
27
- A refactor that preserves behavior must not break the test.
28
- - **One reason to fail.** Each test pins one behavior; the name states it (`returns 409 when the
29
- slot is already taken`).
30
- - **Failure paths first-class.** Test the error/empty/forbidden branches, not just the happy path —
31
- the launch-security checklist requires abuse-path tests for user-facing apps.
32
- - **Deterministic.** No real clock, network, or randomness — inject them. A seeded RNG or a fixed
33
- clock makes a flaky test impossible. Flaky = broken; fix or quarantine, never ignore.
34
- - **Error codes, not strings.** Switch assertions on stable codes (`standards/error-codes.md`), not
35
- on message text.
36
-
37
- ## Coverage — a floor, not a goal
38
-
39
- Aim for meaningful coverage of branches and failure modes, not a vanity percent. 100% line coverage
40
- with no failure-path assertions is weaker than 70% that exercises every error branch. Untested code
41
- on a critical path (auth, money, data integrity) is a defect regardless of the overall number.
42
-
43
- ## Structural / guardrail tests
44
-
45
- Some invariants are not example-based — "every module's public API is re-exported", "every error
46
- code is unique", "the registry and the routes agree". Encode these as **guardrail tests** that fail
47
- CI when two sources of truth drift (`standards/guardrail-tests.md`).
48
-
49
- ## When tests are deferred
50
-
51
- Under `test-ready-deferred` (or any unit of work shipped without tests), the absence is a **recorded
52
- decision**, not a silent gap: open an ADR stating why and the conditions for backfill
53
- (`codex/decisions/`). Keep the code test-ready meanwhile — pure logic, injected dependencies, small units —
54
- so tests drop in later without a rewrite.
55
-
56
- ## Definition of "tested" (feeds Definition of Done)
57
-
58
- A change is tested when: the new/changed behavior has assertions at the right pyramid level · failure
59
- paths are covered · the suite is green on fresh context · and (user-facing) the launch checklist's
60
- abuse-path tests exist. The independent verifier (`rules/30-verification.md`) runs the real suite and
61
- quotes real output — it does not take "tests pass" on trust.
1
+ ---
2
+ updated: 2026-05-31
3
+ status: canonical
4
+ description: "The project-wide testing approach: the pyramid, what to test at each level, the active policy, and what 'tested' means."
5
+ ---
6
+
7
+ # Standards — testing strategy
8
+
9
+ The per-stack **policy** (`tdd-mandatory | test-ready-deferred | none`) says *whether* you write
10
+ tests now (`stack/`). This standard says *how* you test when you do — so "add tests" is never an
11
+ open question.
12
+
13
+ ## The pyramid (most tests cheap, few tests broad)
14
+
15
+ | Level | Tests | Speed | Use for |
16
+ |---|---|---|---|
17
+ | **Unit** | pure functions, domain/engine logic, reducers, validators | ms, no I/O | the bulk; every branch of business logic |
18
+ | **Integration** | a module against its real boundaries (DB, queue, an adapter) | seconds | data access, server actions, wiring |
19
+ | **E2E / contract** | a user-visible flow or a published API contract | slow | a few critical happy paths + key failure paths |
20
+
21
+ Push logic **down** the pyramid: keep the domain layer pure (`standards/architecture.md`) so most
22
+ behavior is unit-testable without spinning up I/O.
23
+
24
+ ## What a good test asserts
25
+
26
+ - **Behavior, not implementation.** Assert observable output/effect for an input, not internal calls.
27
+ A refactor that preserves behavior must not break the test.
28
+ - **One reason to fail.** Each test pins one behavior; the name states it (`returns 409 when the
29
+ slot is already taken`).
30
+ - **Failure paths first-class.** Test the error/empty/forbidden branches, not just the happy path —
31
+ the launch-security checklist requires abuse-path tests for user-facing apps.
32
+ - **Deterministic.** No real clock, network, or randomness — inject them. A seeded RNG or a fixed
33
+ clock makes a flaky test impossible. Flaky = broken; fix or quarantine, never ignore.
34
+ - **Error codes, not strings.** Switch assertions on stable codes (`standards/error-codes.md`), not
35
+ on message text.
36
+
37
+ ## Coverage — a floor, not a goal
38
+
39
+ Aim for meaningful coverage of branches and failure modes, not a vanity percent. 100% line coverage
40
+ with no failure-path assertions is weaker than 70% that exercises every error branch. Untested code
41
+ on a critical path (auth, money, data integrity) is a defect regardless of the overall number.
42
+
43
+ ## Structural / guardrail tests
44
+
45
+ Some invariants are not example-based — "every module's public API is re-exported", "every error
46
+ code is unique", "the registry and the routes agree". Encode these as **guardrail tests** that fail
47
+ CI when two sources of truth drift (`standards/guardrail-tests.md`).
48
+
49
+ ## When tests are deferred
50
+
51
+ Under `test-ready-deferred` (or any unit of work shipped without tests), the absence is a **recorded
52
+ decision**, not a silent gap: open an ADR stating why and the conditions for backfill
53
+ (`codex/decisions/`). Keep the code test-ready meanwhile — pure logic, injected dependencies, small units —
54
+ so tests drop in later without a rewrite.
55
+
56
+ ## Definition of "tested" (feeds Definition of Done)
57
+
58
+ A change is tested when: the new/changed behavior has assertions at the right pyramid level · failure
59
+ paths are covered · the suite is green on fresh context · and (user-facing) the launch checklist's
60
+ abuse-path tests exist. The independent verifier (`rules/30-verification.md`) runs the real suite and
61
+ quotes real output — it does not take "tests pass" on trust.
@@ -1,19 +1,19 @@
1
- ---
2
- updated: 2026-05-31
3
- status: canonical
4
- description: 'TypeScript specifics: strict mode, no any, type-safety expectations.'
5
- ---
6
-
7
- # Standards — TypeScript
8
-
9
- - **`strict: true`.** No implicit `any`. Prefer `unknown` over `any` at boundaries, then narrow.
10
- - **No non-null `!`** except where provably safe with a comment. Prefer guards.
11
- - **Types over interfaces** for unions/utility; `interface` for extendable object shapes — pick one
12
- per project and stay consistent.
13
- - **Discriminated unions** for state; avoid boolean-flag soup.
14
- - **`const` by default**; `let` only when reassigned; never `var`.
15
- - **No default exports** for modules with logic (named exports aid refactor + grep). Components MAY
16
- use default export if the framework expects it.
17
- - **Async:** always `await` or explicitly `void` a promise; no floating promises.
18
- - **Validation at boundaries** with a schema lib (zod/valibot). Internal code trusts validated types.
19
- - **Errors** carry a code (`error-codes.md`); never throw strings.
1
+ ---
2
+ updated: 2026-05-31
3
+ status: canonical
4
+ description: 'TypeScript specifics: strict mode, no any, type-safety expectations.'
5
+ ---
6
+
7
+ # Standards — TypeScript
8
+
9
+ - **`strict: true`.** No implicit `any`. Prefer `unknown` over `any` at boundaries, then narrow.
10
+ - **No non-null `!`** except where provably safe with a comment. Prefer guards.
11
+ - **Types over interfaces** for unions/utility; `interface` for extendable object shapes — pick one
12
+ per project and stay consistent.
13
+ - **Discriminated unions** for state; avoid boolean-flag soup.
14
+ - **`const` by default**; `let` only when reassigned; never `var`.
15
+ - **No default exports** for modules with logic (named exports aid refactor + grep). Components MAY
16
+ use default export if the framework expects it.
17
+ - **Async:** always `await` or explicitly `void` a promise; no floating promises.
18
+ - **Validation at boundaries** with a schema lib (zod/valibot). Internal code trusts validated types.
19
+ - **Errors** carry a code (`error-codes.md`); never throw strings.
@@ -1,58 +1,58 @@
1
- ---
2
- updated: 2026-05-31
3
- status: canonical
4
- description: How to write agent-facing docs so they are high-signal and versioned.
5
- ---
6
-
7
- # Standards — writing docs
8
-
9
- How to write the Markdown agents read (rules, standards, agents, skills, commands, ADRs). Goal: an
10
- agent finds the right file and the right line fast. High-signal docs are part of code quality
11
- (`rules/35-context-economy.md`).
12
-
13
- ## Lead with purpose
14
-
15
- The first line after the H1 is one crisp sentence: **what this file is + when to read it.** The
16
- per-folder `INDEX.md` generator lifts this as the blurb — a vague lead ("Always-on.") makes a useless
17
- index entry. Files that carry frontmatter may set a `description:` field, which the generator prefers.
18
-
19
- ## Voice
20
-
21
- - Terse, technical, active voice. Cut filler, hedging, throat-clearing.
22
- - Address the agent directly ("do X", not "one should do X").
23
- - Match the register of the surrounding docs.
24
-
25
- ## Structure
26
-
27
- - **One topic per file.** If it grows a second concern, split it (`rules/35`).
28
- - **Tables and lists for enumerations**; prose only for reasoning a reader must follow.
29
- - **H1 = `Area — topic`** (e.g. `Standards — clean code`); sections scannable by heading.
30
- - **Link, don't inline.** Point to the canonical file; never paste a catalog or long procedure into
31
- an entry file. When you move detail out, leave a one-line pointer behind.
32
-
33
- ## Versioning
34
-
35
- Git holds full history; a visible stamp answers "is this current?" at a glance.
36
-
37
- - Canonical docs (standards, ADRs, long-lived references) carry frontmatter `updated: YYYY-MM-DD`,
38
- and `status:` (`draft` | `canonical` | `deprecated`) where a lifecycle matters.
39
- - **Bump `updated` in the same commit as any change to the doc's meaning** — this extends the
40
- doc-sync rule (`rules/00-always.md`): behaviour and its doc move together, and the stamp records when.
41
- - A `status: deprecated` doc names its replacement (`superseded-by:` or an inline pointer); never
42
- delete silently. ADRs already follow this (`codex/decisions/`).
43
- - `updated` with no `description:` does not change a file's INDEX blurb (the generator falls back to
44
- the H1 + first line), so stamping is safe to add incrementally.
45
-
46
- ## Do / don't
47
-
48
- - ✅ `# 30 — Verification` → "The agent that writes code cannot mark it done. ..." (lead states what + why).
49
- - ❌ Restating the heading, or opening with backstory before the point.
50
- - ✅ A five-row table of limits. ❌ The same limits as five paragraphs.
51
- - ✅ "See `standards/clean-code.md`." ❌ Copying its content into three files.
52
-
53
- ## Before you commit a doc
54
-
55
- - The lead sentence works as a standalone INDEX blurb.
56
- - No duplicated content that will drift — one canonical home, others point to it.
57
- - `updated` bumped if the meaning changed.
58
- - Regenerate indexes: `grimoire index` (CI runs `--check`).
1
+ ---
2
+ updated: 2026-05-31
3
+ status: canonical
4
+ description: How to write agent-facing docs so they are high-signal and versioned.
5
+ ---
6
+
7
+ # Standards — writing docs
8
+
9
+ How to write the Markdown agents read (rules, standards, agents, skills, commands, ADRs). Goal: an
10
+ agent finds the right file and the right line fast. High-signal docs are part of code quality
11
+ (`rules/35-context-economy.md`).
12
+
13
+ ## Lead with purpose
14
+
15
+ The first line after the H1 is one crisp sentence: **what this file is + when to read it.** The
16
+ per-folder `INDEX.md` generator lifts this as the blurb — a vague lead ("Always-on.") makes a useless
17
+ index entry. Files that carry frontmatter may set a `description:` field, which the generator prefers.
18
+
19
+ ## Voice
20
+
21
+ - Terse, technical, active voice. Cut filler, hedging, throat-clearing.
22
+ - Address the agent directly ("do X", not "one should do X").
23
+ - Match the register of the surrounding docs.
24
+
25
+ ## Structure
26
+
27
+ - **One topic per file.** If it grows a second concern, split it (`rules/35`).
28
+ - **Tables and lists for enumerations**; prose only for reasoning a reader must follow.
29
+ - **H1 = `Area — topic`** (e.g. `Standards — clean code`); sections scannable by heading.
30
+ - **Link, don't inline.** Point to the canonical file; never paste a catalog or long procedure into
31
+ an entry file. When you move detail out, leave a one-line pointer behind.
32
+
33
+ ## Versioning
34
+
35
+ Git holds full history; a visible stamp answers "is this current?" at a glance.
36
+
37
+ - Canonical docs (standards, ADRs, long-lived references) carry frontmatter `updated: YYYY-MM-DD`,
38
+ and `status:` (`draft` | `canonical` | `deprecated`) where a lifecycle matters.
39
+ - **Bump `updated` in the same commit as any change to the doc's meaning** — this extends the
40
+ doc-sync rule (`rules/00-always.md`): behaviour and its doc move together, and the stamp records when.
41
+ - A `status: deprecated` doc names its replacement (`superseded-by:` or an inline pointer); never
42
+ delete silently. ADRs already follow this (`codex/decisions/`).
43
+ - `updated` with no `description:` does not change a file's INDEX blurb (the generator falls back to
44
+ the H1 + first line), so stamping is safe to add incrementally.
45
+
46
+ ## Do / don't
47
+
48
+ - ✅ `# 30 — Verification` → "The agent that writes code cannot mark it done. ..." (lead states what + why).
49
+ - ❌ Restating the heading, or opening with backstory before the point.
50
+ - ✅ A five-row table of limits. ❌ The same limits as five paragraphs.
51
+ - ✅ "See `standards/clean-code.md`." ❌ Copying its content into three files.
52
+
53
+ ## Before you commit a doc
54
+
55
+ - The lead sentence works as a standalone INDEX blurb.
56
+ - No duplicated content that will drift — one canonical home, others point to it.
57
+ - `updated` bumped if the meaning changed.
58
+ - Regenerate indexes: `grimoire index` (CI runs `--check`).
@@ -1,19 +1,19 @@
1
- {
2
- "plugins": [
3
- { "name": "superpowers", "marketplace": "claude-plugins-official", "scope": "user" },
4
- { "name": "skill-creator", "marketplace": "claude-plugins-official", "scope": "user" },
5
- { "name": "ecc", "marketplace": "ecc", "scope": "user" },
6
- { "name": "ui-ux-pro-max", "marketplace": "ui-ux-pro-max-skill", "scope": "user" },
7
- { "name": "andrej-karpathy-skills", "marketplace": "karpathy-skills", "scope": "user" },
8
- { "name": "pordee", "marketplace": "pordee", "scope": "user" },
9
- { "name": "caveman", "marketplace": "caveman", "scope": "user" }
10
- ],
11
- "skills": [
12
- { "name": "mattpocock", "install": "npx skills@latest add mattpocock/skills", "setup": "/setup-matt-pocock-skills", "source": "https://github.com/mattpocock/skills", "scope": "user" },
13
- { "name": "find-skills", "vendored": ".agents/skills/find-skills", "scope": "project" }
14
- ],
15
- "mcp": [
16
- { "name": "playwright", "server": { "command": "npx", "args": ["-y", "@playwright/mcp@latest"] } },
17
- { "name": "stitch", "server": { "type": "http", "url": "https://stitch.googleapis.com/mcp", "headers": { "X-Goog-Api-Key": "${STITCH_API_KEY}" } }, "note": "Google Stitch — HTTP MCP; generate the key in Stitch Settings, set STITCH_API_KEY" }
18
- ]
19
- }
1
+ {
2
+ "plugins": [
3
+ { "name": "superpowers", "marketplace": "claude-plugins-official", "scope": "user" },
4
+ { "name": "skill-creator", "marketplace": "claude-plugins-official", "scope": "user" },
5
+ { "name": "ecc", "marketplace": "ecc", "scope": "user" },
6
+ { "name": "ui-ux-pro-max", "marketplace": "ui-ux-pro-max-skill", "scope": "user" },
7
+ { "name": "andrej-karpathy-skills", "marketplace": "karpathy-skills", "scope": "user" },
8
+ { "name": "pordee", "marketplace": "pordee", "scope": "user" },
9
+ { "name": "caveman", "marketplace": "caveman", "scope": "user" }
10
+ ],
11
+ "skills": [
12
+ { "name": "mattpocock", "install": "npx skills@latest add mattpocock/skills", "setup": "/setup-matt-pocock-skills", "source": "https://github.com/mattpocock/skills", "scope": "user" },
13
+ { "name": "find-skills", "vendored": ".agents/skills/find-skills", "scope": "project" }
14
+ ],
15
+ "mcp": [
16
+ { "name": "playwright", "server": { "command": "npx", "args": ["-y", "@playwright/mcp@latest"] } },
17
+ { "name": "stitch", "server": { "type": "http", "url": "https://stitch.googleapis.com/mcp", "headers": { "X-Goog-Api-Key": "${STITCH_API_KEY}" } }, "note": "Google Stitch — HTTP MCP; generate the key in Stitch Settings, set STITCH_API_KEY" }
18
+ ]
19
+ }
package/LICENSE CHANGED
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,139 +1,139 @@
1
- # Grimoire
2
-
3
- A single, version-controlled **AI-agent operating system** you pull into every project.
4
- One command gives a new repo a complete, orderly set of working rules, coding standards,
5
- subagents, skills, commands, tech-stack defaults, and a self-bias-free verification protocol.
6
-
7
- The core is **tool-agnostic** (`.agents/AGENTS.md`) so any agent can read it; Claude Code
8
- binding sits on top. Template updates propagate to old projects without clobbering their
9
- per-project customization.
10
-
11
- > **Full structure & component reference:** [`.agents/NAVIGATOR.md`](.agents/NAVIGATOR.md) — what Grimoire
12
- > creates, what each CLI command does, the three lifecycles, and the seed/migration model.
13
-
14
- ## What is in `.agents/`
15
-
16
- | Path | Holds |
17
- |---|---|
18
- | `AGENTS.md` | entry contract + load-order index |
19
- | `rules/` | always-on working process + protocols (numbered) |
20
- | `standards/` | coding standards (general + per-language) |
21
- | `stack/` | tech-stack presets (web-app / desktop / library) |
22
- | `agents/` | subagents — e.g. the independent `verifier` |
23
- | `commands/` | slash commands (`verify`, `checkpoint`, `grimoire`) |
24
- | `skills/` | reusable, re-runnable workflows |
25
- | `local/` | per-project overrides; `sync` never touches |
26
-
27
- `init` also seeds **`codex/`** at the **repo root** (not under `.agents/`) — the project's knowledge
28
- base: `domain/`, `requirements/`, `decisions/`, `evidence/`, `resources/`, `reference/`, `runbooks/`.
29
- It is read-first for any domain/feature work (start at `codex/INDEX.md`), project-owned, and lives
30
- outside every managed path, so `grimoire sync` is sync-safe and never touches it.
31
-
32
- ## Quick start
33
-
34
- Published on npm as [`the-grimoire-cli`](https://www.npmjs.com/package/the-grimoire-cli); the command
35
- it installs is `grimoire`.
36
-
37
- ```sh
38
- # New project — scaffold .agents/ + pointers
39
- npx the-grimoire-cli init
40
-
41
- # Existing project — pull latest template (managed paths only; codex/ journal/ local/ untouched)
42
- npx the-grimoire-cli sync
43
- ```
44
-
45
- Install it globally for the `grimoire` command everywhere, and update in place:
46
-
47
- ```sh
48
- npm i -g the-grimoire-cli # install
49
- grimoire init # or: grimoire sync
50
- npm update -g the-grimoire-cli # pull the latest template release
51
- grimoire --version # release version + build sha
52
- ```
53
-
54
- Prefer pinning straight to the repo? `npx github:nuttchanon/the-grimoire init` works too, no npm needed.
55
-
56
- ## Two-layer model
57
-
58
- - **Managed base** — the template owns it; `grimoire sync` overwrites it. Listed in
59
- `.agents/grimoire.manifest`.
60
- - **Local overrides** (`local/`, at the repo root) — the project owns it; sync never touches it. To change a
61
- base rule, **do not edit the base** — add an override in `local/`. That is what keeps sync
62
- conflict-free.
63
-
64
- Precedence: base loads first, `local/` loads last and **wins**.
65
-
66
- ## Session-state — 3 homes
67
-
68
- | Layer | Answers | Home | Git |
69
- |---|---|---|---|
70
- | **NOW** | "what am I doing right now?" | `journal/session/` | gitignored |
71
- | **KNOWLEDGE** | "what do we already know?" | `journal/memory/` | tracked |
72
- | **QUEUE** | "what work is pending?" | `journal/backlog/` | tracked |
73
-
74
- ## Verification
75
-
76
- The agent that writes code cannot mark it done. After a change, the main thread spawns the
77
- **verifier** subagent on fresh context (requirements + diff + checklist only — not the
78
- implementer's reasoning). It refutes by default, runs the real `verify` script, and quotes real
79
- output. Definition of Done = tests green **AND** verifier `pass` **AND** checklist complete.
80
-
81
- ## Tooling — skills, plugins & MCP
82
-
83
- `.agents/tooling.json` declares the plugins, skills, and MCP servers a project relies on, and
84
- `.agents/skills/catalog.md` maps `task → capability` (primary + alternates). The always-on rule
85
- `rules/15-skills.md` makes consulting the catalog reflexive; anything uncovered is found via the
86
- vendored `find-skills` skill.
87
-
88
- ```sh
89
- # enable required plugins / MCP / skills (prints a plan; nothing is written)
90
- npx github:nuttchanon/the-grimoire bootstrap
91
-
92
- # actually apply (additive, backs up ~/.claude/settings.json, never disables anything)
93
- npx github:nuttchanon/the-grimoire bootstrap --apply
94
- ```
95
-
96
- `init` runs `bootstrap` in dry-run automatically and mirrors `find-skills` into `.claude/skills/`.
97
- The mattpocock engineering skills install separately via `npx skills@latest add mattpocock/skills`
98
- followed by `/setup-matt-pocock-skills`. Editing `~/.claude/settings.json` is a machine-wide change —
99
- bootstrap defaults to dry-run, backs up first, and only adds.
100
-
101
- A project declares its **own** plugins / MCP servers (Linear, Sentry, Supabase, Figma, …) in
102
- `local/tooling.json` — same shape as the base. `bootstrap` merges it **additively** (base
103
- wins on conflict, local adds new entries), so project integrations live in `local/` instead of
104
- bloating the managed base.
105
-
106
- ## Navigation — generated per-folder indexes
107
-
108
- Each managed folder carries an `INDEX.md`: a one-line-per-file table generated from each file's
109
- frontmatter or H1. Agents read it before opening files — two-level progressive disclosure
110
- (`AGENTS.md` map → folder `INDEX.md` → file) that keeps context lean (`rules/35-context-economy.md`).
111
- It is generated, never hand-edited:
112
-
113
- ```sh
114
- # regenerate every INDEX.md (runs automatically inside init + sync)
115
- npx github:nuttchanon/the-grimoire index
116
-
117
- # CI guard: fail if any INDEX.md is stale, or a tooling.json MCP is undocumented in the catalog
118
- npx github:nuttchanon/the-grimoire index --check
119
- ```
120
-
121
- `init`/`sync` generate an `INDEX.md` for both the managed folders and your `local/` folders.
122
-
123
- ## Health check — doctor
124
-
125
- `grimoire doctor` verifies a project is correctly wired: `CLAUDE.md` imports, skill frontmatter
126
- (`name:`/`description:` so mirrored skills are discoverable), INDEX/catalog drift, unfilled
127
- `AGENTS.local.md` placeholders, and oversized entry files. One line per
128
- finding; exits non-zero on any error, so it drops straight into CI:
129
-
130
- ```sh
131
- npx github:nuttchanon/the-grimoire doctor
132
- ```
133
-
134
- ## Decisions — ADRs
135
-
136
- `init` seeds `codex/decisions/` (a template + README) into the project; it is project-owned and
137
- survives `sync`. ADRs record lasting choices, carry an `updates-confirmed-values` flag (ground-truth
138
- values change with their ADR in the same PR), and a missing test suite must be a recorded ADR rather
139
- than a silent gap (`rules/00-always.md`).
1
+ # Grimoire
2
+
3
+ A single, version-controlled **AI-agent operating system** you pull into every project.
4
+ One command gives a new repo a complete, orderly set of working rules, coding standards,
5
+ subagents, skills, commands, tech-stack defaults, and a self-bias-free verification protocol.
6
+
7
+ The core is **tool-agnostic** (`.agents/AGENTS.md`) so any agent can read it; Claude Code
8
+ binding sits on top. Template updates propagate to old projects without clobbering their
9
+ per-project customization.
10
+
11
+ > **Full structure & component reference:** [`.agents/NAVIGATOR.md`](.agents/NAVIGATOR.md) — what Grimoire
12
+ > creates, what each CLI command does, the three lifecycles, and the seed/migration model.
13
+
14
+ ## What is in `.agents/`
15
+
16
+ | Path | Holds |
17
+ |---|---|
18
+ | `AGENTS.md` | entry contract + load-order index |
19
+ | `rules/` | always-on working process + protocols (numbered) |
20
+ | `standards/` | coding standards (general + per-language) |
21
+ | `stack/` | tech-stack presets (web-app / desktop / library) |
22
+ | `agents/` | subagents — e.g. the independent `verifier` |
23
+ | `commands/` | slash commands (`verify`, `checkpoint`, `grimoire`) |
24
+ | `skills/` | reusable, re-runnable workflows |
25
+ | `local/` | per-project overrides; `sync` never touches |
26
+
27
+ `init` also seeds **`codex/`** at the **repo root** (not under `.agents/`) — the project's knowledge
28
+ base: `domain/`, `requirements/`, `decisions/`, `evidence/`, `resources/`, `reference/`, `runbooks/`.
29
+ It is read-first for any domain/feature work (start at `codex/INDEX.md`), project-owned, and lives
30
+ outside every managed path, so `grimoire sync` is sync-safe and never touches it.
31
+
32
+ ## Quick start
33
+
34
+ Published on npm as [`the-grimoire-cli`](https://www.npmjs.com/package/the-grimoire-cli); the command
35
+ it installs is `grimoire`.
36
+
37
+ ```sh
38
+ # New project — scaffold .agents/ + pointers
39
+ npx the-grimoire-cli init
40
+
41
+ # Existing project — pull latest template (managed paths only; codex/ journal/ local/ untouched)
42
+ npx the-grimoire-cli sync
43
+ ```
44
+
45
+ Install it globally for the `grimoire` command everywhere, and update in place:
46
+
47
+ ```sh
48
+ npm i -g the-grimoire-cli # install
49
+ grimoire init # or: grimoire sync
50
+ npm update -g the-grimoire-cli # pull the latest template release
51
+ grimoire --version # release version + build sha
52
+ ```
53
+
54
+ Prefer pinning straight to the repo? `npx github:nuttchanon/the-grimoire init` works too, no npm needed.
55
+
56
+ ## Two-layer model
57
+
58
+ - **Managed base** — the template owns it; `grimoire sync` overwrites it. Listed in
59
+ `.agents/grimoire.manifest`.
60
+ - **Local overrides** (`local/`, at the repo root) — the project owns it; sync never touches it. To change a
61
+ base rule, **do not edit the base** — add an override in `local/`. That is what keeps sync
62
+ conflict-free.
63
+
64
+ Precedence: base loads first, `local/` loads last and **wins**.
65
+
66
+ ## Session-state — 3 homes
67
+
68
+ | Layer | Answers | Home | Git |
69
+ |---|---|---|---|
70
+ | **NOW** | "what am I doing right now?" | `journal/session/` | gitignored |
71
+ | **KNOWLEDGE** | "what do we already know?" | `journal/memory/` | tracked |
72
+ | **QUEUE** | "what work is pending?" | `journal/backlog/` | tracked |
73
+
74
+ ## Verification
75
+
76
+ The agent that writes code cannot mark it done. After a change, the main thread spawns the
77
+ **verifier** subagent on fresh context (requirements + diff + checklist only — not the
78
+ implementer's reasoning). It refutes by default, runs the real `verify` script, and quotes real
79
+ output. Definition of Done = tests green **AND** verifier `pass` **AND** checklist complete.
80
+
81
+ ## Tooling — skills, plugins & MCP
82
+
83
+ `.agents/tooling.json` declares the plugins, skills, and MCP servers a project relies on, and
84
+ `.agents/skills/catalog.md` maps `task → capability` (primary + alternates). The always-on rule
85
+ `rules/15-skills.md` makes consulting the catalog reflexive; anything uncovered is found via the
86
+ vendored `find-skills` skill.
87
+
88
+ ```sh
89
+ # enable required plugins / MCP / skills (prints a plan; nothing is written)
90
+ npx github:nuttchanon/the-grimoire bootstrap
91
+
92
+ # actually apply (additive, backs up ~/.claude/settings.json, never disables anything)
93
+ npx github:nuttchanon/the-grimoire bootstrap --apply
94
+ ```
95
+
96
+ `init` runs `bootstrap` in dry-run automatically and mirrors `find-skills` into `.claude/skills/`.
97
+ The mattpocock engineering skills install separately via `npx skills@latest add mattpocock/skills`
98
+ followed by `/setup-matt-pocock-skills`. Editing `~/.claude/settings.json` is a machine-wide change —
99
+ bootstrap defaults to dry-run, backs up first, and only adds.
100
+
101
+ A project declares its **own** plugins / MCP servers (Linear, Sentry, Supabase, Figma, …) in
102
+ `local/tooling.json` — same shape as the base. `bootstrap` merges it **additively** (base
103
+ wins on conflict, local adds new entries), so project integrations live in `local/` instead of
104
+ bloating the managed base.
105
+
106
+ ## Navigation — generated per-folder indexes
107
+
108
+ Each managed folder carries an `INDEX.md`: a one-line-per-file table generated from each file's
109
+ frontmatter or H1. Agents read it before opening files — two-level progressive disclosure
110
+ (`AGENTS.md` map → folder `INDEX.md` → file) that keeps context lean (`rules/35-context-economy.md`).
111
+ It is generated, never hand-edited:
112
+
113
+ ```sh
114
+ # regenerate every INDEX.md (runs automatically inside init + sync)
115
+ npx github:nuttchanon/the-grimoire index
116
+
117
+ # CI guard: fail if any INDEX.md is stale, or a tooling.json MCP is undocumented in the catalog
118
+ npx github:nuttchanon/the-grimoire index --check
119
+ ```
120
+
121
+ `init`/`sync` generate an `INDEX.md` for both the managed folders and your `local/` folders.
122
+
123
+ ## Health check — doctor
124
+
125
+ `grimoire doctor` verifies a project is correctly wired: `CLAUDE.md` imports, skill frontmatter
126
+ (`name:`/`description:` so mirrored skills are discoverable), INDEX/catalog drift, unfilled
127
+ `AGENTS.local.md` placeholders, and oversized entry files. One line per
128
+ finding; exits non-zero on any error, so it drops straight into CI:
129
+
130
+ ```sh
131
+ npx github:nuttchanon/the-grimoire doctor
132
+ ```
133
+
134
+ ## Decisions — ADRs
135
+
136
+ `init` seeds `codex/decisions/` (a template + README) into the project; it is project-owned and
137
+ survives `sync`. ADRs record lasting choices, carry an `updates-confirmed-values` flag (ground-truth
138
+ values change with their ADR in the same PR), and a missing test suite must be a recorded ADR rather
139
+ than a silent gap (`rules/00-always.md`).