the-grimoire-cli 0.3.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/AGENTS.md +112 -112
- package/.agents/NAVIGATOR.md +193 -168
- package/.agents/VERSION +4 -4
- package/.agents/agents/INDEX.md +7 -7
- package/.agents/agents/verifier.md +50 -50
- package/.agents/commands/INDEX.md +11 -11
- package/.agents/commands/checkpoint.md +15 -15
- package/.agents/commands/grimoire.md +14 -14
- package/.agents/commands/onboard.md +56 -56
- package/.agents/commands/present.md +23 -23
- package/.agents/commands/verify.md +20 -20
- package/.agents/grimoire.manifest +18 -18
- package/.agents/rules/00-always.md +42 -42
- package/.agents/rules/05-code-quality.md +28 -28
- package/.agents/rules/10-working-process.md +31 -31
- package/.agents/rules/15-skills.md +27 -27
- package/.agents/rules/20-modes.md +41 -41
- package/.agents/rules/25-surgical-changes.md +29 -29
- package/.agents/rules/30-verification.md +36 -36
- package/.agents/rules/35-context-economy.md +41 -41
- package/.agents/rules/40-handoff.md +25 -25
- package/.agents/rules/45-presentation.md +35 -35
- package/.agents/rules/50-security.md +30 -30
- package/.agents/rules/60-commit-style.md +14 -14
- package/.agents/rules/INDEX.md +18 -18
- package/.agents/skills/INDEX.md +8 -8
- package/.agents/skills/README.md +1 -1
- package/.agents/skills/catalog.md +106 -106
- package/.agents/skills/find-skills/SKILL.md +142 -142
- package/.agents/stack/README.md +71 -66
- package/.agents/stack/desktop.md +36 -36
- package/.agents/stack/library.md +1 -1
- package/.agents/stack/web-app.md +32 -32
- package/.agents/standards/INDEX.md +23 -23
- package/.agents/standards/accessibility.md +50 -50
- package/.agents/standards/architecture.md +39 -39
- package/.agents/standards/attribution.md +39 -39
- package/.agents/standards/clean-code.md +121 -121
- package/.agents/standards/codex.md +69 -69
- package/.agents/standards/error-codes.md +41 -41
- package/.agents/standards/general.md +46 -46
- package/.agents/standards/guardrail-tests.md +40 -40
- package/.agents/standards/knowledge-management.md +35 -35
- package/.agents/standards/launch-security-checklist.md +45 -45
- package/.agents/standards/observability.md +35 -35
- package/.agents/standards/release-versioning.md +53 -53
- package/.agents/standards/requirements.md +75 -75
- package/.agents/standards/security-scanners.md +42 -42
- package/.agents/standards/testing-strategy.md +61 -61
- package/.agents/standards/typescript.md +19 -19
- package/.agents/standards/writing.md +58 -58
- package/.agents/tooling.json +20 -19
- package/LICENSE +1 -1
- package/README.md +139 -139
- package/bin/grimoire.mjs +667 -598
- package/package.json +32 -32
- package/templates/CLAUDE.md +7 -7
- package/templates/ci/ci.yml +49 -49
- package/templates/ci/sast.yml +44 -44
- package/templates/codex/INDEX.md +18 -18
- package/templates/codex/README.md +28 -28
- package/templates/codex/decisions/0000-template.md +36 -36
- package/templates/codex/decisions/INDEX.md +11 -11
- package/templates/codex/decisions/README.md +25 -25
- package/templates/codex/domain/INDEX.md +14 -14
- package/templates/codex/domain/README.md +10 -10
- package/templates/codex/evidence/0000-extraction-template.md +36 -36
- package/templates/codex/evidence/INDEX.md +11 -11
- package/templates/codex/evidence/README.md +15 -15
- package/templates/codex/reference/INDEX.md +11 -11
- package/templates/codex/reference/README.md +15 -15
- package/templates/codex/reference/confirmed-values.md +18 -18
- package/templates/codex/requirements/INDEX.md +11 -11
- package/templates/codex/requirements/README.md +22 -22
- package/templates/codex/requirements/addons/0000-template.md +35 -35
- package/templates/codex/requirements/base.md +36 -36
- package/templates/codex/requirements/changes/0000-template.md +39 -39
- package/templates/codex/resources/INDEX.md +11 -11
- package/templates/codex/resources/README.md +17 -17
- package/templates/codex/resources/manifest.md +11 -11
- package/templates/codex/runbooks/INDEX.md +9 -9
- package/templates/codex/runbooks/README.md +8 -8
- package/templates/codex/runbooks/incident-runbook-template.md +58 -58
- package/templates/gitignore-snippet.txt +10 -12
- package/templates/journal/backlog/README.md +18 -18
- package/templates/journal/memory/MEMORY.md +15 -15
- package/templates/journal/session/archive/.gitkeep +1 -1
- package/templates/journal/session/artifacts/.gitkeep +1 -1
- package/templates/journal/session/current.md +12 -12
- package/templates/lint/README.md +25 -25
- package/templates/lint/eslint.config.mjs +33 -33
- package/templates/lint/tsconfig.base.json +11 -11
- package/templates/local/AGENTS.local.md +33 -33
- package/templates/local/README.md +55 -55
- package/templates/tests/guardrail.invariants.test.ts +59 -59
package/.agents/AGENTS.md
CHANGED
|
@@ -1,112 +1,112 @@
|
|
|
1
|
-
# AGENTS.md — master contract (tool-agnostic)
|
|
2
|
-
|
|
3
|
-
This is the **canonical entry** for every agent working in this repo. Claude Code reaches it via
|
|
4
|
-
`CLAUDE.md` (`@.agents/AGENTS.md`). Read in the order below — do **not** "read everything" up front.
|
|
5
|
-
|
|
6
|
-
Keep this file lean (`rules/35-context-economy.md`): tone, hardest rules, the map, pointers — detail
|
|
7
|
-
lives in the files it links.
|
|
8
|
-
|
|
9
|
-
## Tone
|
|
10
|
-
|
|
11
|
-
The person you work with is a **Product Builder** — address them directly ("you"), not as a passive
|
|
12
|
-
third party. Talk straight: factual and data-driven, no hype, no flattery, no telling them what they
|
|
13
|
-
want to hear. State trade-offs, risks, and disagreements plainly, with the evidence behind them —
|
|
14
|
-
being right matters more than being agreeable. Stay calm and professional, never emotional or
|
|
15
|
-
defensive. They may not know a given technical detail; explain it when it matters, plainly and
|
|
16
|
-
without condescension. Be terse and technical, and match the surrounding code and the user's
|
|
17
|
-
register. Project-specific tone or any communication mode lives in `local/AGENTS.local.md`.
|
|
18
|
-
|
|
19
|
-
## Load order
|
|
20
|
-
|
|
21
|
-
1. **This file** — hardest rules + the map (below).
|
|
22
|
-
2. **`rules/`** — always-on working process. Read `00-always.md` every session.
|
|
23
|
-
3. **`codex/INDEX.md`** — the project's knowledge base (domain, requirements, decisions, evidence,
|
|
24
|
-
resources, reference, runbooks). Read-on-demand, but **read-first for any domain/feature work**.
|
|
25
|
-
4. **`standards/`** — when writing code, load `general.md` + the per-language file.
|
|
26
|
-
5. **`stack/`** — when scaffolding or configuring, load the active profile.
|
|
27
|
-
6. **`codex/decisions/`** — when a decision's *why* matters.
|
|
28
|
-
7. **`local/`** — per-project customization. Read `local/AGENTS.local.md`, then the matching
|
|
29
|
-
`local/<area>/` (rules/standards/stack/skills/commands/reference) for any base area you touch;
|
|
30
|
-
**loads last and wins**.
|
|
31
|
-
|
|
32
|
-
## The map
|
|
33
|
-
|
|
34
|
-
| Need | Go to |
|
|
35
|
-
|---|---|
|
|
36
|
-
| System structure / what grimoire creates / CLI behavior / layout & lifecycles | `NAVIGATOR.md` |
|
|
37
|
-
| Project knowledge / domain / evidence / resources / requirements / decisions | `codex/` (start at `codex/INDEX.md`) |
|
|
38
|
-
| Working process, modes, handoff routing | `rules/` |
|
|
39
|
-
| Coding standards, naming, error codes | `standards/` |
|
|
40
|
-
| Requirements (base / addon / change request) | `standards/requirements.md` + `codex/requirements/` |
|
|
41
|
-
| Test strategy, release/versioning, accessibility | `standards/testing-strategy.md` · `standards/release-versioning.md` · `standards/accessibility.md` |
|
|
42
|
-
| Framework / lint / test / CI **starter templates** (copy manually — not auto-seeded) | `stack/` + `templates/ci/` · `templates/lint/` · `templates/tests/` |
|
|
43
|
-
| Independent verification (the verifier) | `rules/30-verification.md` + `agents/verifier.md` |
|
|
44
|
-
| What am I doing right now? | `journal/session/current.md` (NOW) |
|
|
45
|
-
| What do we already know? | `journal/memory/` + `journal/memory/MEMORY.md` (KNOWLEDGE) |
|
|
46
|
-
| What work is pending? | `journal/backlog/` (QUEUE) |
|
|
47
|
-
| Project-specific overrides | `local/` |
|
|
48
|
-
| Project domain reference (big contracts, IPC tables, confirmed values) | `local/reference/` |
|
|
49
|
-
| Keeping entry files lean | `rules/35-context-economy.md` |
|
|
50
|
-
| Presenting to a human (HTML) | `rules/45-presentation.md` + `commands/present.md` |
|
|
51
|
-
|
|
52
|
-
Inside any managed folder **or `local/` folder**, read its generated `INDEX.md` (one line per file)
|
|
53
|
-
**before** opening files — that is the per-folder resource map (regenerate with `grimoire index`; CI
|
|
54
|
-
runs `--check`). `grimoire doctor` health-checks the whole wiring (exits non-zero on error, for CI).
|
|
55
|
-
|
|
56
|
-
### Hot keywords (jump straight to the file)
|
|
57
|
-
|
|
58
|
-
| Keyword | File |
|
|
59
|
-
|---|---|
|
|
60
|
-
| error code / error catalog | `standards/error-codes.md` |
|
|
61
|
-
| verify command / done | active `stack/<profile>.md` + `rules/30-verification.md` |
|
|
62
|
-
| security / auth / secrets | `rules/50-security.md` |
|
|
63
|
-
| code quality / clean code | `standards/clean-code.md` + `rules/05-code-quality.md` |
|
|
64
|
-
| over-engineering / laziness / minimal code / the ladder / `ponytail:` marker | `standards/clean-code.md` (ladder + guardrail) · ADR `docs/adr/0007-adopt-ponytail-laziness-ladder.md` |
|
|
65
|
-
| launch / privacy gate | `standards/launch-security-checklist.md` + `standards/security-scanners.md` |
|
|
66
|
-
| requirement / spec / REQ-id / change request | `standards/requirements.md` + `codex/requirements/` |
|
|
67
|
-
| test strategy / how to test / coverage | `standards/testing-strategy.md` |
|
|
68
|
-
| release / changelog / version / rollback | `standards/release-versioning.md` |
|
|
69
|
-
| accessibility / a11y / WCAG | `standards/accessibility.md` |
|
|
70
|
-
| incident / runbook / on-call / outage | `codex/runbooks/` |
|
|
71
|
-
| CI / pipeline / workflow | `templates/ci/ci.yml` + `templates/ci/sast.yml` |
|
|
72
|
-
| commit format | `rules/60-commit-style.md` |
|
|
73
|
-
| HOTFIX | `rules/20-modes.md` |
|
|
74
|
-
| codex / knowledge base / provenance | `standards/codex.md` + `codex/INDEX.md` |
|
|
75
|
-
| domain / glossary / context | `codex/domain/` |
|
|
76
|
-
| evidence / investigation / decompile / reverse-engineer / provenance | `codex/evidence/` + `standards/codex.md` |
|
|
77
|
-
| decision / ADR / "why" | `codex/decisions/` |
|
|
78
|
-
| which skill / capability | `skills/catalog.md` |
|
|
79
|
-
| writing / editing a contract doc | `standards/writing.md` |
|
|
80
|
-
| credit / attribution / license / external source / adopt a tool | `standards/attribution.md` |
|
|
81
|
-
| knowledge retrieval / search the codebase / code graph | `graphify` (ADR `docs/adr/0006-delegate-retrieval-to-external-tooling.md`) |
|
|
82
|
-
| structure / architecture / navigator / what does grimoire create / layout / lifecycle | `NAVIGATOR.md` |
|
|
83
|
-
|
|
84
|
-
## Source priority (when sources conflict)
|
|
85
|
-
|
|
86
|
-
Trust in this order: **live code + committed docs/specs** (current) > **this base template**
|
|
87
|
-
(`rules/ standards/ stack/`) > **`journal/memory/` cards** (may be stale — verify before acting on one).
|
|
88
|
-
A memory never overrides what the code currently says; treat it as a lead, not as truth.
|
|
89
|
-
|
|
90
|
-
## Hardest rules (full text in `rules/00-always.md`)
|
|
91
|
-
|
|
92
|
-
- **Verify before done.** Code you wrote is not done until the verifier returns `pass` on fresh
|
|
93
|
-
context. The author cannot mark their own work done.
|
|
94
|
-
- **Doc-sync same turn.** Behavior change and its doc/memory update ship in the same turn.
|
|
95
|
-
- **Security first.** No hardcoded roles/secrets; validate + authorize on the server; fail closed.
|
|
96
|
-
- **Effort is not a constraint.** Do not scope-cut to save effort. Spawn parallel subagents instead.
|
|
97
|
-
|
|
98
|
-
## Customization & precedence
|
|
99
|
-
|
|
100
|
-
Base (this template) loads first; `local/` loads last and **wins**.
|
|
101
|
-
|
|
102
|
-
**In a consuming project, never edit the managed base** — `.agents/AGENTS.md`, `rules/`,
|
|
103
|
-
`standards/`, `stack/`, `agents/`, `skills/`, `commands/`, `tooling.json`. `grimoire sync`
|
|
104
|
-
overwrites all of them, so edits there are lost. Put **every** customization under root `local/`
|
|
105
|
-
(it is never synced): **override** a base behavior by restating it in `local/` (it wins), or **add**
|
|
106
|
-
a project-only rule/skill/command/standard under the matching `local/<area>/`. Protocol:
|
|
107
|
-
`local/README.md`.
|
|
108
|
-
|
|
109
|
-
**Project domain docs** that don't fit the lean `AGENTS.md` (a big runtime contract, confirmed-value
|
|
110
|
-
tables, an IPC catalog) live in `local/reference/` — `grimoire index` generates its `INDEX.md` too.
|
|
111
|
-
Run `grimoire doctor` to verify the wiring (imports, skill frontmatter, INDEX drift, placeholders);
|
|
112
|
-
it exits non-zero on error, for CI.
|
|
1
|
+
# AGENTS.md — master contract (tool-agnostic)
|
|
2
|
+
|
|
3
|
+
This is the **canonical entry** for every agent working in this repo. Claude Code reaches it via
|
|
4
|
+
`CLAUDE.md` (`@.agents/AGENTS.md`). Read in the order below — do **not** "read everything" up front.
|
|
5
|
+
|
|
6
|
+
Keep this file lean (`rules/35-context-economy.md`): tone, hardest rules, the map, pointers — detail
|
|
7
|
+
lives in the files it links.
|
|
8
|
+
|
|
9
|
+
## Tone
|
|
10
|
+
|
|
11
|
+
The person you work with is a **Product Builder** — address them directly ("you"), not as a passive
|
|
12
|
+
third party. Talk straight: factual and data-driven, no hype, no flattery, no telling them what they
|
|
13
|
+
want to hear. State trade-offs, risks, and disagreements plainly, with the evidence behind them —
|
|
14
|
+
being right matters more than being agreeable. Stay calm and professional, never emotional or
|
|
15
|
+
defensive. They may not know a given technical detail; explain it when it matters, plainly and
|
|
16
|
+
without condescension. Be terse and technical, and match the surrounding code and the user's
|
|
17
|
+
register. Project-specific tone or any communication mode lives in `local/AGENTS.local.md`.
|
|
18
|
+
|
|
19
|
+
## Load order
|
|
20
|
+
|
|
21
|
+
1. **This file** — hardest rules + the map (below).
|
|
22
|
+
2. **`rules/`** — always-on working process. Read `00-always.md` every session.
|
|
23
|
+
3. **`codex/INDEX.md`** — the project's knowledge base (domain, requirements, decisions, evidence,
|
|
24
|
+
resources, reference, runbooks). Read-on-demand, but **read-first for any domain/feature work**.
|
|
25
|
+
4. **`standards/`** — when writing code, load `general.md` + the per-language file.
|
|
26
|
+
5. **`stack/`** — when scaffolding or configuring, load the active profile.
|
|
27
|
+
6. **`codex/decisions/`** — when a decision's *why* matters.
|
|
28
|
+
7. **`local/`** — per-project customization. Read `local/AGENTS.local.md`, then the matching
|
|
29
|
+
`local/<area>/` (rules/standards/stack/skills/commands/reference) for any base area you touch;
|
|
30
|
+
**loads last and wins**.
|
|
31
|
+
|
|
32
|
+
## The map
|
|
33
|
+
|
|
34
|
+
| Need | Go to |
|
|
35
|
+
|---|---|
|
|
36
|
+
| System structure / what grimoire creates / CLI behavior / layout & lifecycles | `NAVIGATOR.md` |
|
|
37
|
+
| Project knowledge / domain / evidence / resources / requirements / decisions | `codex/` (start at `codex/INDEX.md`) |
|
|
38
|
+
| Working process, modes, handoff routing | `rules/` |
|
|
39
|
+
| Coding standards, naming, error codes | `standards/` |
|
|
40
|
+
| Requirements (base / addon / change request) | `standards/requirements.md` + `codex/requirements/` |
|
|
41
|
+
| Test strategy, release/versioning, accessibility | `standards/testing-strategy.md` · `standards/release-versioning.md` · `standards/accessibility.md` |
|
|
42
|
+
| Framework / lint / test / CI **starter templates** (copy manually — not auto-seeded) | `stack/` + `templates/ci/` · `templates/lint/` · `templates/tests/` |
|
|
43
|
+
| Independent verification (the verifier) | `rules/30-verification.md` + `agents/verifier.md` |
|
|
44
|
+
| What am I doing right now? | `journal/session/current.md` (NOW) |
|
|
45
|
+
| What do we already know? | `journal/memory/` + `journal/memory/MEMORY.md` (KNOWLEDGE) |
|
|
46
|
+
| What work is pending? | `journal/backlog/` (QUEUE) |
|
|
47
|
+
| Project-specific overrides | `local/` |
|
|
48
|
+
| Project domain reference (big contracts, IPC tables, confirmed values) | `local/reference/` |
|
|
49
|
+
| Keeping entry files lean | `rules/35-context-economy.md` |
|
|
50
|
+
| Presenting to a human (HTML) | `rules/45-presentation.md` + `commands/present.md` |
|
|
51
|
+
|
|
52
|
+
Inside any managed folder **or `local/` folder**, read its generated `INDEX.md` (one line per file)
|
|
53
|
+
**before** opening files — that is the per-folder resource map (regenerate with `grimoire index`; CI
|
|
54
|
+
runs `--check`). `grimoire doctor` health-checks the whole wiring (exits non-zero on error, for CI).
|
|
55
|
+
|
|
56
|
+
### Hot keywords (jump straight to the file)
|
|
57
|
+
|
|
58
|
+
| Keyword | File |
|
|
59
|
+
|---|---|
|
|
60
|
+
| error code / error catalog | `standards/error-codes.md` |
|
|
61
|
+
| verify command / done | active `stack/<profile>.md` + `rules/30-verification.md` |
|
|
62
|
+
| security / auth / secrets | `rules/50-security.md` |
|
|
63
|
+
| code quality / clean code | `standards/clean-code.md` + `rules/05-code-quality.md` |
|
|
64
|
+
| over-engineering / laziness / minimal code / the ladder / `ponytail:` marker | `standards/clean-code.md` (ladder + guardrail) · ADR `docs/adr/0007-adopt-ponytail-laziness-ladder.md` |
|
|
65
|
+
| launch / privacy gate | `standards/launch-security-checklist.md` + `standards/security-scanners.md` |
|
|
66
|
+
| requirement / spec / REQ-id / change request | `standards/requirements.md` + `codex/requirements/` |
|
|
67
|
+
| test strategy / how to test / coverage | `standards/testing-strategy.md` |
|
|
68
|
+
| release / changelog / version / rollback | `standards/release-versioning.md` |
|
|
69
|
+
| accessibility / a11y / WCAG | `standards/accessibility.md` |
|
|
70
|
+
| incident / runbook / on-call / outage | `codex/runbooks/` |
|
|
71
|
+
| CI / pipeline / workflow | `templates/ci/ci.yml` + `templates/ci/sast.yml` |
|
|
72
|
+
| commit format | `rules/60-commit-style.md` |
|
|
73
|
+
| HOTFIX | `rules/20-modes.md` |
|
|
74
|
+
| codex / knowledge base / provenance | `standards/codex.md` + `codex/INDEX.md` |
|
|
75
|
+
| domain / glossary / context | `codex/domain/` |
|
|
76
|
+
| evidence / investigation / decompile / reverse-engineer / provenance | `codex/evidence/` + `standards/codex.md` |
|
|
77
|
+
| decision / ADR / "why" | `codex/decisions/` |
|
|
78
|
+
| which skill / capability | `skills/catalog.md` |
|
|
79
|
+
| writing / editing a contract doc | `standards/writing.md` |
|
|
80
|
+
| credit / attribution / license / external source / adopt a tool | `standards/attribution.md` |
|
|
81
|
+
| knowledge retrieval / search the codebase / code graph | `graphify` (ADR `docs/adr/0006-delegate-retrieval-to-external-tooling.md`) |
|
|
82
|
+
| structure / architecture / navigator / what does grimoire create / layout / lifecycle | `NAVIGATOR.md` |
|
|
83
|
+
|
|
84
|
+
## Source priority (when sources conflict)
|
|
85
|
+
|
|
86
|
+
Trust in this order: **live code + committed docs/specs** (current) > **this base template**
|
|
87
|
+
(`rules/ standards/ stack/`) > **`journal/memory/` cards** (may be stale — verify before acting on one).
|
|
88
|
+
A memory never overrides what the code currently says; treat it as a lead, not as truth.
|
|
89
|
+
|
|
90
|
+
## Hardest rules (full text in `rules/00-always.md`)
|
|
91
|
+
|
|
92
|
+
- **Verify before done.** Code you wrote is not done until the verifier returns `pass` on fresh
|
|
93
|
+
context. The author cannot mark their own work done.
|
|
94
|
+
- **Doc-sync same turn.** Behavior change and its doc/memory update ship in the same turn.
|
|
95
|
+
- **Security first.** No hardcoded roles/secrets; validate + authorize on the server; fail closed.
|
|
96
|
+
- **Effort is not a constraint.** Do not scope-cut to save effort. Spawn parallel subagents instead.
|
|
97
|
+
|
|
98
|
+
## Customization & precedence
|
|
99
|
+
|
|
100
|
+
Base (this template) loads first; `local/` loads last and **wins**.
|
|
101
|
+
|
|
102
|
+
**In a consuming project, never edit the managed base** — `.agents/AGENTS.md`, `rules/`,
|
|
103
|
+
`standards/`, `stack/`, `agents/`, `skills/`, `commands/`, `tooling.json`. `grimoire sync`
|
|
104
|
+
overwrites all of them, so edits there are lost. Put **every** customization under root `local/`
|
|
105
|
+
(it is never synced): **override** a base behavior by restating it in `local/` (it wins), or **add**
|
|
106
|
+
a project-only rule/skill/command/standard under the matching `local/<area>/`. Protocol:
|
|
107
|
+
`local/README.md`.
|
|
108
|
+
|
|
109
|
+
**Project domain docs** that don't fit the lean `AGENTS.md` (a big runtime contract, confirmed-value
|
|
110
|
+
tables, an IPC catalog) live in `local/reference/` — `grimoire index` generates its `INDEX.md` too.
|
|
111
|
+
Run `grimoire doctor` to verify the wiring (imports, skill frontmatter, INDEX drift, placeholders);
|
|
112
|
+
it exits non-zero on error, for CI.
|
package/.agents/NAVIGATOR.md
CHANGED
|
@@ -1,168 +1,193 @@
|
|
|
1
|
-
# NAVIGATOR — Grimoire structure & components
|
|
2
|
-
|
|
3
|
-
Canonical reference for **what Grimoire is, what it creates, and what each part does**. Read this to
|
|
4
|
-
get a consistent mental model before touching the CLI, the contract, or the layout. It ships inside the
|
|
5
|
-
contract (`.agents/NAVIGATOR.md`) so every project shares the same map; it complements `README.md`
|
|
6
|
-
(quickstart) and `.agents/AGENTS.md` (the working contract an agent loads each session).
|
|
7
|
-
|
|
8
|
-
Grimoire is a single, version-controlled **AI-agent operating system** you pull into any repo. One
|
|
9
|
-
command (`grimoire init`) gives a project a complete contract — rules, standards, subagents, skills,
|
|
10
|
-
commands, stack presets, a verification protocol — plus the root folders an agent writes into. Later,
|
|
11
|
-
`grimoire sync` propagates template updates to old projects **without clobbering** their own data.
|
|
12
|
-
|
|
13
|
-
The CLI (`grimoire`, source `bin/grimoire.mjs` in the template repo) is **zero dependencies**,
|
|
14
|
-
Node ≥18, ESM. The Grimoire repo itself *is* the template and dogfoods this layout
|
|
15
|
-
(`TEMPLATE_ROOT` = repo root, so its own `.agents/` is the template source).
|
|
16
|
-
|
|
17
|
-
## The one mental model: three lifecycles
|
|
18
|
-
|
|
19
|
-
Everything Grimoire manages falls into exactly one of three buckets. This split is the whole design.
|
|
20
|
-
|
|
21
|
-
| Lifecycle | Who owns it | `grimoire sync` | Where it lives |
|
|
22
|
-
|---|---|---|---|
|
|
23
|
-
| **Contract** (read-only) | the base template | **overwrites wholesale** (delete + copy) | `.agents/` |
|
|
24
|
-
| **Project-owned state/knowledge** | the project / the agent | **never touches** | `codex/`, `journal/`, `local/` (repo root) |
|
|
25
|
-
| **Seed sources** | the base template | shipped, copied into new projects | `templates/` |
|
|
26
|
-
|
|
27
|
-
Rule of thumb: **`.agents/` is 100% read-only.** Nothing an agent or project writes lives under it.
|
|
28
|
-
Anything written goes to a root folder (`codex/`, `journal/`, `local/`). To customize base behavior,
|
|
29
|
-
never edit `.agents/` in a consuming project — restate it in `local/` (loads last, wins).
|
|
30
|
-
|
|
31
|
-
## Top-level layout (what a Grimoire project contains)
|
|
32
|
-
|
|
33
|
-
```
|
|
34
|
-
<repo>/
|
|
35
|
-
├─ CLAUDE.md # thin pointer: imports @.agents/AGENTS.md + @local/AGENTS.local.md
|
|
36
|
-
├─ .agents/ # CONTRACT — read-only, wholesale-synced
|
|
37
|
-
│ ├─ AGENTS.md # canonical entry: tone, hardest rules, the map, load order
|
|
38
|
-
│ ├─ rules/ # always-on working process (numbered 00–60)
|
|
39
|
-
│ ├─ standards/ # coding standards (general + per-language) + writing/codex
|
|
40
|
-
│ ├─ stack/ # tech-stack presets (web-app / desktop / library)
|
|
41
|
-
│ ├─ agents/ # subagents (e.g. the independent verifier)
|
|
42
|
-
│ ├─ skills/ # reusable workflows (incl. vendored find-skills)
|
|
43
|
-
│ ├─ commands/ # slash commands (verify, checkpoint, onboard, present, grimoire)
|
|
44
|
-
│ ├─ tooling.json # declared plugins / skills / MCP servers
|
|
45
|
-
│ ├─ grimoire.manifest # documents the contract surface (no longer used for carve-outs)
|
|
46
|
-
│ └─ VERSION # template version + source sha (stamped by init/sync)
|
|
47
|
-
├─ codex/ # KNOWLEDGE — project-owned, seeded once, never synced
|
|
48
|
-
│ ├─ INDEX.md domain/ requirements/ decisions/ evidence/ resources/ reference/ runbooks/
|
|
49
|
-
├─ journal/ # AGENT STATE — project-owned, never synced
|
|
50
|
-
│ ├─ memory/ (+ MEMORY.md) # KNOWLEDGE: durable facts (tracked)
|
|
51
|
-
│ ├─ backlog/ # QUEUE: pending work items (tracked)
|
|
52
|
-
│ └─ session/ # NOW: per-run state (gitignored)
|
|
53
|
-
└─ local/ # OVERRIDE CONFIG — project-owned, never synced, loads LAST and wins
|
|
54
|
-
├─ AGENTS.local.md # profile (stack, testing policy), project facts, override declarations
|
|
55
|
-
├─ README.md rules/ standards/ stack/ skills/ commands/ reference/
|
|
56
|
-
└─ tooling.json # project-only plugins / MCP (merged additively by bootstrap)
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### The contract — `.agents/` (read-only)
|
|
60
|
-
|
|
61
|
-
| Path | Holds |
|
|
62
|
-
|---|---|
|
|
63
|
-
| `AGENTS.md` | entry contract + load-order + the map + hot-keywords |
|
|
64
|
-
| `rules/` | always-on process: 00-always, verification, modes, handoff, context-economy, commit-style, … |
|
|
65
|
-
| `standards/` | coding standards (general + per-language), writing, codex, knowledge-management |
|
|
66
|
-
| `stack/` | per-profile defaults (framework / lint / test / verify command) |
|
|
67
|
-
| `agents/` | subagent definitions — notably `verifier` (independent done-check) |
|
|
68
|
-
| `skills/` | re-runnable workflows; `find-skills` is vendored + mirrored to `.claude/skills/` |
|
|
69
|
-
| `commands/` | slash commands |
|
|
70
|
-
| `tooling.json` | source of truth for required plugins / skills / MCP |
|
|
71
|
-
| `grimoire.manifest` | lists the managed paths — documentation only (sync is wholesale) |
|
|
72
|
-
|
|
73
|
-
### Project-owned roots (never synced)
|
|
74
|
-
|
|
75
|
-
- **`codex/`** — the project's knowledge base; read-first for any domain/feature work (start at
|
|
76
|
-
`codex/INDEX.md`). Holds `domain/`, `requirements/`, `decisions/` (ADRs), `evidence/`, `resources/`,
|
|
77
|
-
`reference/`, `runbooks/`. Seeded once from `templates/codex/`.
|
|
78
|
-
- **`journal/`** — the agent's working state, the "3 homes":
|
|
79
|
-
- `journal/session/` = **NOW** (current run; gitignored),
|
|
80
|
-
- `journal/memory/` = **KNOWLEDGE** (durable facts + `MEMORY.md` index; tracked),
|
|
81
|
-
- `journal/backlog/` = **QUEUE** (pending work; tracked).
|
|
82
|
-
- **`local/`** — the project's customization layer. Loads **last and wins**. Override a base rule by
|
|
83
|
-
restating it here; add project-only rules/skills/commands/standards under the matching `local/<area>/`.
|
|
84
|
-
|
|
85
|
-
## What each CLI command creates / does
|
|
86
|
-
|
|
87
|
-
`grimoire <command> [--dir <path>]` (default dir = cwd).
|
|
88
|
-
|
|
89
|
-
### `init` — scaffold a project
|
|
90
|
-
1. **Auto-migrate** an old-layout project first (`migrateLegacyLayout`, see below).
|
|
91
|
-
2. **Wholesale-copy** the template `.agents/` into the project (`copyAgentsWholesale`).
|
|
92
|
-
3. Stamp `VERSION` (template version + git sha).
|
|
93
|
-
4. Write `CLAUDE.md` pointer (if absent).
|
|
94
|
-
5. Ensure `.gitignore` has the session/backup ignore snippet.
|
|
95
|
-
6. **Seed root folders** (only if absent / per-file gap-fill, never overwriting):
|
|
96
|
-
`seedCodex` → `codex/`; `seedRoot("journal")` → `journal/`; `seedRoot("local")` → `local/`.
|
|
97
|
-
7. Mirror discoverable skills into `.claude/skills/` (`find-skills` + every `local/skills/<x>`).
|
|
98
|
-
8. Generate per-folder `INDEX.md` (after all mutations).
|
|
99
|
-
9. Run `bootstrap` in dry-run (prints the plugin/MCP plan; writes nothing).
|
|
100
|
-
|
|
101
|
-
### `sync` — pull template updates into an existing project
|
|
102
|
-
1. Fail if no `.agents/` (must `init` first).
|
|
103
|
-
2. **Auto-migrate** an old layout (once, with backup).
|
|
104
|
-
3. **Wholesale-replace** `.agents/` from the template (delete + copy) — your contract is refreshed.
|
|
105
|
-
4. Re-stamp `VERSION`; re-seed `codex/`/`journal/`/`local/` (gap-fill only, never clobbers your files);
|
|
106
|
-
re-mirror skills; regenerate `INDEX.md`.
|
|
107
|
-
**`codex/`, `journal/`, `local/` are never overwritten** — only missing files are filled in.
|
|
108
|
-
|
|
109
|
-
### `bootstrap` — wire plugins / MCP / skills
|
|
110
|
-
Reads base `tooling.json` ∪ `local/tooling.json` (base wins on key conflict; local adds new keys).
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
1
|
+
# NAVIGATOR — Grimoire structure & components
|
|
2
|
+
|
|
3
|
+
Canonical reference for **what Grimoire is, what it creates, and what each part does**. Read this to
|
|
4
|
+
get a consistent mental model before touching the CLI, the contract, or the layout. It ships inside the
|
|
5
|
+
contract (`.agents/NAVIGATOR.md`) so every project shares the same map; it complements `README.md`
|
|
6
|
+
(quickstart) and `.agents/AGENTS.md` (the working contract an agent loads each session).
|
|
7
|
+
|
|
8
|
+
Grimoire is a single, version-controlled **AI-agent operating system** you pull into any repo. One
|
|
9
|
+
command (`grimoire init`) gives a project a complete contract — rules, standards, subagents, skills,
|
|
10
|
+
commands, stack presets, a verification protocol — plus the root folders an agent writes into. Later,
|
|
11
|
+
`grimoire sync` propagates template updates to old projects **without clobbering** their own data.
|
|
12
|
+
|
|
13
|
+
The CLI (`grimoire`, source `bin/grimoire.mjs` in the template repo) is **zero dependencies**,
|
|
14
|
+
Node ≥18, ESM. The Grimoire repo itself *is* the template and dogfoods this layout
|
|
15
|
+
(`TEMPLATE_ROOT` = repo root, so its own `.agents/` is the template source).
|
|
16
|
+
|
|
17
|
+
## The one mental model: three lifecycles
|
|
18
|
+
|
|
19
|
+
Everything Grimoire manages falls into exactly one of three buckets. This split is the whole design.
|
|
20
|
+
|
|
21
|
+
| Lifecycle | Who owns it | `grimoire sync` | Where it lives |
|
|
22
|
+
|---|---|---|---|
|
|
23
|
+
| **Contract** (read-only) | the base template | **overwrites wholesale** (delete + copy) | `.agents/` |
|
|
24
|
+
| **Project-owned state/knowledge** | the project / the agent | **never touches** | `codex/`, `journal/`, `local/` (repo root) |
|
|
25
|
+
| **Seed sources** | the base template | shipped, copied into new projects | `templates/` |
|
|
26
|
+
|
|
27
|
+
Rule of thumb: **`.agents/` is 100% read-only.** Nothing an agent or project writes lives under it.
|
|
28
|
+
Anything written goes to a root folder (`codex/`, `journal/`, `local/`). To customize base behavior,
|
|
29
|
+
never edit `.agents/` in a consuming project — restate it in `local/` (loads last, wins).
|
|
30
|
+
|
|
31
|
+
## Top-level layout (what a Grimoire project contains)
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
<repo>/
|
|
35
|
+
├─ CLAUDE.md # thin pointer: imports @.agents/AGENTS.md + @local/AGENTS.local.md
|
|
36
|
+
├─ .agents/ # CONTRACT — read-only, wholesale-synced
|
|
37
|
+
│ ├─ AGENTS.md # canonical entry: tone, hardest rules, the map, load order
|
|
38
|
+
│ ├─ rules/ # always-on working process (numbered 00–60)
|
|
39
|
+
│ ├─ standards/ # coding standards (general + per-language) + writing/codex
|
|
40
|
+
│ ├─ stack/ # tech-stack presets (web-app / desktop / library)
|
|
41
|
+
│ ├─ agents/ # subagents (e.g. the independent verifier)
|
|
42
|
+
│ ├─ skills/ # reusable workflows (incl. vendored find-skills)
|
|
43
|
+
│ ├─ commands/ # slash commands (verify, checkpoint, onboard, present, grimoire)
|
|
44
|
+
│ ├─ tooling.json # declared plugins / skills / MCP servers
|
|
45
|
+
│ ├─ grimoire.manifest # documents the contract surface (no longer used for carve-outs)
|
|
46
|
+
│ └─ VERSION # template version + source sha (stamped by init/sync)
|
|
47
|
+
├─ codex/ # KNOWLEDGE — project-owned, seeded once, never synced
|
|
48
|
+
│ ├─ INDEX.md domain/ requirements/ decisions/ evidence/ resources/ reference/ runbooks/
|
|
49
|
+
├─ journal/ # AGENT STATE — project-owned, never synced
|
|
50
|
+
│ ├─ memory/ (+ MEMORY.md) # KNOWLEDGE: durable facts (tracked)
|
|
51
|
+
│ ├─ backlog/ # QUEUE: pending work items (tracked)
|
|
52
|
+
│ └─ session/ # NOW: per-run state (gitignored)
|
|
53
|
+
└─ local/ # OVERRIDE CONFIG — project-owned, never synced, loads LAST and wins
|
|
54
|
+
├─ AGENTS.local.md # profile (stack, testing policy), project facts, override declarations
|
|
55
|
+
├─ README.md rules/ standards/ stack/ skills/ commands/ reference/
|
|
56
|
+
└─ tooling.json # project-only plugins / MCP (merged additively by bootstrap)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### The contract — `.agents/` (read-only)
|
|
60
|
+
|
|
61
|
+
| Path | Holds |
|
|
62
|
+
|---|---|
|
|
63
|
+
| `AGENTS.md` | entry contract + load-order + the map + hot-keywords |
|
|
64
|
+
| `rules/` | always-on process: 00-always, verification, modes, handoff, context-economy, commit-style, … |
|
|
65
|
+
| `standards/` | coding standards (general + per-language), writing, codex, knowledge-management |
|
|
66
|
+
| `stack/` | per-profile defaults (framework / lint / test / verify command) |
|
|
67
|
+
| `agents/` | subagent definitions — notably `verifier` (independent done-check) |
|
|
68
|
+
| `skills/` | re-runnable workflows; `find-skills` is vendored + mirrored to `.claude/skills/` |
|
|
69
|
+
| `commands/` | slash commands |
|
|
70
|
+
| `tooling.json` | source of truth for required plugins / skills / MCP |
|
|
71
|
+
| `grimoire.manifest` | lists the managed paths — documentation only (sync is wholesale) |
|
|
72
|
+
|
|
73
|
+
### Project-owned roots (never synced)
|
|
74
|
+
|
|
75
|
+
- **`codex/`** — the project's knowledge base; read-first for any domain/feature work (start at
|
|
76
|
+
`codex/INDEX.md`). Holds `domain/`, `requirements/`, `decisions/` (ADRs), `evidence/`, `resources/`,
|
|
77
|
+
`reference/`, `runbooks/`. Seeded once from `templates/codex/`.
|
|
78
|
+
- **`journal/`** — the agent's working state, the "3 homes":
|
|
79
|
+
- `journal/session/` = **NOW** (current run; gitignored),
|
|
80
|
+
- `journal/memory/` = **KNOWLEDGE** (durable facts + `MEMORY.md` index; tracked),
|
|
81
|
+
- `journal/backlog/` = **QUEUE** (pending work; tracked).
|
|
82
|
+
- **`local/`** — the project's customization layer. Loads **last and wins**. Override a base rule by
|
|
83
|
+
restating it here; add project-only rules/skills/commands/standards under the matching `local/<area>/`.
|
|
84
|
+
|
|
85
|
+
## What each CLI command creates / does
|
|
86
|
+
|
|
87
|
+
`grimoire <command> [--dir <path>]` (default dir = cwd).
|
|
88
|
+
|
|
89
|
+
### `init` — scaffold a project
|
|
90
|
+
1. **Auto-migrate** an old-layout project first (`migrateLegacyLayout`, see below).
|
|
91
|
+
2. **Wholesale-copy** the template `.agents/` into the project (`copyAgentsWholesale`).
|
|
92
|
+
3. Stamp `VERSION` (template version + git sha).
|
|
93
|
+
4. Write `CLAUDE.md` pointer (if absent).
|
|
94
|
+
5. Ensure `.gitignore` has the session/backup ignore snippet.
|
|
95
|
+
6. **Seed root folders** (only if absent / per-file gap-fill, never overwriting):
|
|
96
|
+
`seedCodex` → `codex/`; `seedRoot("journal")` → `journal/`; `seedRoot("local")` → `local/`.
|
|
97
|
+
7. Mirror discoverable skills into `.claude/skills/` (`find-skills` + every `local/skills/<x>`).
|
|
98
|
+
8. Generate per-folder `INDEX.md` (after all mutations).
|
|
99
|
+
9. Run `bootstrap` in dry-run (prints the plugin/MCP plan; writes nothing).
|
|
100
|
+
|
|
101
|
+
### `sync` — pull template updates into an existing project
|
|
102
|
+
1. Fail if no `.agents/` (must `init` first).
|
|
103
|
+
2. **Auto-migrate** an old layout (once, with backup).
|
|
104
|
+
3. **Wholesale-replace** `.agents/` from the template (delete + copy) — your contract is refreshed.
|
|
105
|
+
4. Re-stamp `VERSION`; re-seed `codex/`/`journal/`/`local/` (gap-fill only, never clobbers your files);
|
|
106
|
+
re-mirror skills; regenerate `INDEX.md`.
|
|
107
|
+
**`codex/`, `journal/`, `local/` are never overwritten** — only missing files are filled in.
|
|
108
|
+
|
|
109
|
+
### `bootstrap` — wire plugins / MCP / skills
|
|
110
|
+
Reads base `tooling.json` ∪ `local/tooling.json` (base wins on key conflict; local adds new keys).
|
|
111
|
+
For every missing plugin it prints the **paste-in-Claude** install command (`/plugin marketplace add
|
|
112
|
+
<source> && /plugin install <name>@<marketplace>`) — the CLI can only flip the enable flag, it cannot
|
|
113
|
+
register a marketplace or run a slash command.
|
|
114
|
+
- **Interactive** (default, in a terminal): asks `enable <plugin>? [y/N]` per missing plugin, then
|
|
115
|
+
enables the chosen ones in `~/.claude/settings.json` and merges MCP servers.
|
|
116
|
+
- **Dry-run** (no TTY — CI/piped, and the `init`-embedded preview): prints the plan, writes nothing.
|
|
117
|
+
- `--apply`: non-interactive enable-all — enables every missing plugin in `~/.claude/settings.json`
|
|
118
|
+
(backs it up first, only **adds**, never disables), and merges MCP servers into `.mcp.json` (never
|
|
119
|
+
clobbers an existing server). Flags unresolved `${ENV}` placeholders.
|
|
120
|
+
|
|
121
|
+
### `index` — regenerate per-folder `INDEX.md`
|
|
122
|
+
One-line-per-file table built from each file's frontmatter `description:` or its H1 + first sentence.
|
|
123
|
+
Two groups: the contract (`.agents/<folder>`) and the override layer (`local/<folder>`).
|
|
124
|
+
`index --check` is the CI drift gate: fails if any `INDEX.md` is stale, or a `tooling.json` MCP isn't
|
|
125
|
+
documented in `skills/catalog.md`. Newline-agnostic (tolerates CRLF checkouts).
|
|
126
|
+
|
|
127
|
+
### `doctor` — health-check the wiring (CI-friendly, exits non-zero on error)
|
|
128
|
+
Checks: `CLAUDE.md` imports `@.agents/AGENTS.md` (error) and `@local/AGENTS.local.md` (warn); mirrored
|
|
129
|
+
skills have `name:`+`description:`; INDEX/catalog drift; `local/AGENTS.local.md` stack-profile +
|
|
130
|
+
testing-policy filled; entry files ≤300 lines; `codex/INDEX.md` scaffolded; `local/tooling.json` valid.
|
|
131
|
+
|
|
132
|
+
## Seed-source map (`templates/` → project root)
|
|
133
|
+
|
|
134
|
+
`init`/`sync` seed project-owned roots from `templates/`. Source and destination are separate so this
|
|
135
|
+
repo's own live state never doubles as the seed.
|
|
136
|
+
|
|
137
|
+
| Seed source | Seeds into | How |
|
|
138
|
+
|---|---|---|
|
|
139
|
+
| `templates/codex/` | `codex/` | `seedCodex` — dir-level **seed-once** (skips if `codex/` exists) |
|
|
140
|
+
| `templates/journal/` | `journal/` | `seedRoot` — **per-file gap-fill** (fills missing files only) |
|
|
141
|
+
| `templates/local/` | `local/` | `seedRoot` — **per-file gap-fill** |
|
|
142
|
+
| `templates/CLAUDE.md` | `CLAUDE.md` | copied once (if absent) |
|
|
143
|
+
| `templates/gitignore-snippet.txt` | `.gitignore` | appended once (`journal/session/`, `.agents.bak-*/`) |
|
|
144
|
+
|
|
145
|
+
## Migration (old layout → new)
|
|
146
|
+
|
|
147
|
+
Older projects kept agent state under `.agents/{memory,backlog,session,local}`. On the next
|
|
148
|
+
`init`/`sync`, `migrateLegacyLayout` runs once: it backs up the whole `.agents/` to
|
|
149
|
+
`.agents.bak-<stamp>/`, then **moves** each legacy dir to its root home —
|
|
150
|
+
`.agents/memory→journal/memory`, `…/backlog→journal/backlog`, `…/session→journal/session`,
|
|
151
|
+
`…/local→local/` — **only if the destination is absent** (a conflict leaves the legacy copy in the
|
|
152
|
+
backup, never overwriting a newer root copy). Idempotent: a no-op once the legacy dirs are gone.
|
|
153
|
+
|
|
154
|
+
The same `sync` also **repairs the wiring** the move would otherwise break: it rewrites a `CLAUDE.md`
|
|
155
|
+
still importing `@.agents/local/…` to `@local/…`, and refreshes `.gitignore` (drops the stale
|
|
156
|
+
`.agents/session/` line, adds `journal/session/`, `.agents.bak-*/`, and `graphify-out/`). `doctor`
|
|
157
|
+
warns if a stale `@.agents/local/` import survives.
|
|
158
|
+
|
|
159
|
+
### Adopting an existing repo's `docs/` into `codex/`
|
|
160
|
+
|
|
161
|
+
Moving a project's hand-kept `docs/` tree into `codex/` is **manual and project-owned** (the CLI never
|
|
162
|
+
touches `docs/` or `codex/`). Place by *kind*, not by old folder: ADRs → `codex/decisions/`, specs →
|
|
163
|
+
`codex/requirements/`, contracts/lookups/IPC tables → `codex/reference/`, "what the system is" →
|
|
164
|
+
`codex/domain/`, runbooks → `codex/runbooks/`, investigations/postmortems/release evidence →
|
|
165
|
+
`codex/evidence/`. Drop low-value process exhaust (it stays recoverable in git history).
|
|
166
|
+
|
|
167
|
+
**Before calling it done, grep the codebase for runtime reads of the moved paths.** Code that does
|
|
168
|
+
`readFileSync(join(cwd, "docs", …))` — test oracles, `db:seed` scripts, fixture loaders — breaks
|
|
169
|
+
silently when the file moves. Two consequences: (1) update that path in the code; (2) if the moved
|
|
170
|
+
files are *loaded by code* (seed CSVs, test fixtures), they are runtime assets, not knowledge — keep
|
|
171
|
+
them where the loader expects, or treat `codex/` as their home and point the loader there. **Never let
|
|
172
|
+
PII (staff/patient rosters) land in `codex/` if `codex/` is fed to retrieval/wiki tooling.**
|
|
173
|
+
|
|
174
|
+
## How an agent reads a Grimoire project (load order)
|
|
175
|
+
|
|
176
|
+
1. `CLAUDE.md` → imports `@.agents/AGENTS.md` (contract) + `@local/AGENTS.local.md` (overrides).
|
|
177
|
+
2. `.agents/AGENTS.md` — hardest rules + the map; **read first, don't read everything**.
|
|
178
|
+
3. `.agents/rules/00-always.md` — every session.
|
|
179
|
+
4. `codex/INDEX.md` — read-first for any domain/feature work.
|
|
180
|
+
5. `standards/` + `stack/` — when writing/scaffolding code.
|
|
181
|
+
6. `local/` — loads **last and wins**.
|
|
182
|
+
|
|
183
|
+
Inside any folder, read its generated `INDEX.md` before opening files (two-level progressive
|
|
184
|
+
disclosure: map → INDEX → file), keeping context lean.
|
|
185
|
+
|
|
186
|
+
## Invariants (don't break these)
|
|
187
|
+
|
|
188
|
+
- **Zero runtime dependencies** in `bin/grimoire.mjs` (Node stdlib only).
|
|
189
|
+
- **`.agents/` is read-only** and wholesale-replaced by `sync` — never store project data there.
|
|
190
|
+
- **`codex/`, `journal/`, `local/` are never synced** — safe homes for project-owned content.
|
|
191
|
+
- **`local/` wins** on any conflict (loads last).
|
|
192
|
+
- Behavior change ships with its doc/INDEX update in the **same change** (doc-sync).
|
|
193
|
+
- Code an agent wrote is not done until the independent **verifier** returns `pass`.
|
package/.agents/VERSION
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
grimoire v0.
|
|
2
|
-
source: this repository IS the template (canonical source of truth)
|
|
3
|
-
note: informational only — package.json `version` is the single source of truth;
|
|
4
|
-
`grimoire init` / `grimoire sync` regenerate this from it and stamp the build sha.
|
|
1
|
+
grimoire v0.5.0
|
|
2
|
+
source: this repository IS the template (canonical source of truth)
|
|
3
|
+
note: informational only — package.json `version` is the single source of truth;
|
|
4
|
+
`grimoire init` / `grimoire sync` regenerate this from it and stamp the build sha.
|