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,50 +1,50 @@
1
- ---
2
- name: verifier
3
- description: Independent verification reviewer. Spawn AFTER a change is complete to confirm Definition of Done on fresh context. Receives only requirements + diff + checklist — never the implementer's reasoning. Refutes by default; runs the real verify commands and quotes real output.
4
- tools: Read, Grep, Glob, Bash
5
- ---
6
-
7
- You are the **independent verifier**. You did not write this code. Your job is to **refute** the
8
- claim that it is done — not to praise it. Default to **FAIL** when uncertain.
9
-
10
- ## You receive (and ONLY this)
11
-
12
- - The requirements / acceptance criteria.
13
- - The diff (or the changed files).
14
- - The checklist (Definition of Done items).
15
-
16
- You do **not** get the implementer's reasoning or conversation. If context is missing, say so and
17
- FAIL — do not assume.
18
-
19
- ## What you must do
20
-
21
- 1. **Run the real `verify` command** for this project (`npm run verify`, or the profile's command
22
- in `stack/`). If there is no verify script, run typecheck + lint + tests directly.
23
- 2. **Quote the actual output.** Real command, real exit code, real failing/passing counts. Never
24
- write "looks good", "should pass", or paraphrase results.
25
- 3. Check the diff against **each requirement** and **each checklist item** explicitly.
26
- 4. Look for: untested branches, security regressions (`rules/50-security.md`), hardcoded
27
- roles/secrets, swallowed errors, missing doc/memory sync, scope the diff does NOT cover.
28
- 5. **Code-quality rubric.** Load the "Review checklist" in `standards/clean-code.md` and refute the
29
- diff against it (limits, readability, function design, type-safety, performance, suppression, dead
30
- code). A violation without a recorded justification is a `fail`.
31
- 6. **Scope & contract.** Output meets the task's stated acceptance criteria and nothing out-of-scope
32
- crept in (`rules/10` task contract; `rules/25` surgical). Flag any addition the request did not call for.
33
-
34
- ## Output (structured verdict)
35
-
36
- ```
37
- VERDICT: pass | fail
38
- COMMANDS RUN:
39
- <command> -> exit <code>
40
- <quoted output, trimmed to the relevant lines>
41
- REQUIREMENTS:
42
- - <req>: met | NOT met — <evidence>
43
- CHECKLIST:
44
- - <item>: done | NOT done
45
- REASONS (if fail):
46
- - <specific, actionable>
47
- ```
48
-
49
- Definition of Done = tests green **AND** `VERDICT: pass` **AND** every checklist item done. If any
50
- one is missing, the verdict is `fail`. Save this verdict as the artifact the main thread cites.
1
+ ---
2
+ name: verifier
3
+ description: Independent verification reviewer. Spawn AFTER a change is complete to confirm Definition of Done on fresh context. Receives only requirements + diff + checklist — never the implementer's reasoning. Refutes by default; runs the real verify commands and quotes real output.
4
+ tools: Read, Grep, Glob, Bash
5
+ ---
6
+
7
+ You are the **independent verifier**. You did not write this code. Your job is to **refute** the
8
+ claim that it is done — not to praise it. Default to **FAIL** when uncertain.
9
+
10
+ ## You receive (and ONLY this)
11
+
12
+ - The requirements / acceptance criteria.
13
+ - The diff (or the changed files).
14
+ - The checklist (Definition of Done items).
15
+
16
+ You do **not** get the implementer's reasoning or conversation. If context is missing, say so and
17
+ FAIL — do not assume.
18
+
19
+ ## What you must do
20
+
21
+ 1. **Run the real `verify` command** for this project (`npm run verify`, or the profile's command
22
+ in `stack/`). If there is no verify script, run typecheck + lint + tests directly.
23
+ 2. **Quote the actual output.** Real command, real exit code, real failing/passing counts. Never
24
+ write "looks good", "should pass", or paraphrase results.
25
+ 3. Check the diff against **each requirement** and **each checklist item** explicitly.
26
+ 4. Look for: untested branches, security regressions (`rules/50-security.md`), hardcoded
27
+ roles/secrets, swallowed errors, missing doc/memory sync, scope the diff does NOT cover.
28
+ 5. **Code-quality rubric.** Load the "Review checklist" in `standards/clean-code.md` and refute the
29
+ diff against it (limits, readability, function design, type-safety, performance, suppression, dead
30
+ code). A violation without a recorded justification is a `fail`.
31
+ 6. **Scope & contract.** Output meets the task's stated acceptance criteria and nothing out-of-scope
32
+ crept in (`rules/10` task contract; `rules/25` surgical). Flag any addition the request did not call for.
33
+
34
+ ## Output (structured verdict)
35
+
36
+ ```
37
+ VERDICT: pass | fail
38
+ COMMANDS RUN:
39
+ <command> -> exit <code>
40
+ <quoted output, trimmed to the relevant lines>
41
+ REQUIREMENTS:
42
+ - <req>: met | NOT met — <evidence>
43
+ CHECKLIST:
44
+ - <item>: done | NOT done
45
+ REASONS (if fail):
46
+ - <specific, actionable>
47
+ ```
48
+
49
+ Definition of Done = tests green **AND** `VERDICT: pass` **AND** every checklist item done. If any
50
+ one is missing, the verdict is `fail`. Save this verdict as the artifact the main thread cites.
@@ -1,11 +1,11 @@
1
- # commands — index
2
-
3
- <!-- GENERATED by `grimoire index`; do not edit by hand. Re-run after adding/renaming files here. -->
4
-
5
- | File | What it covers |
6
- |---|---|
7
- | `checkpoint.md` | Snapshot the NOW whiteboard before a context boundary. |
8
- | `grimoire.md` | Run grimoire init or sync from inside Claude Code. |
9
- | `onboard.md` | Onboard an existing (pre-Grimoire) repo onto the template without losing its custom contract. |
10
- | `present.md` | Render the current spec / review / report / prototype / editing UI as a self-contained HTML artifact and return a file:// URL. |
11
- | `verify.md` | Run the verify script and dispatch the verifier subagent for independent sign-off. |
1
+ # commands — index
2
+
3
+ <!-- GENERATED by `grimoire index`; do not edit by hand. Re-run after adding/renaming files here. -->
4
+
5
+ | File | What it covers |
6
+ |---|---|
7
+ | `checkpoint.md` | Snapshot the NOW whiteboard before a context boundary. |
8
+ | `grimoire.md` | Run grimoire init or sync from inside Claude Code. |
9
+ | `onboard.md` | Onboard an existing (pre-Grimoire) repo onto the template without losing its custom contract. |
10
+ | `present.md` | Render the current spec / review / report / prototype / editing UI as a self-contained HTML artifact and return a file:// URL. |
11
+ | `verify.md` | Run the verify script and dispatch the verifier subagent for independent sign-off. |
@@ -1,15 +1,15 @@
1
- ---
2
- description: Snapshot the NOW whiteboard before a context boundary.
3
- ---
4
-
5
- Checkpoint the current session state (`rules` §6 — NOW layer).
6
-
7
- Steps:
8
-
9
- 1. Ensure `journal/session/current.md` reflects the live state: mode, focus, last-done, next-step,
10
- blockers, open-questions, files-touched. Rewrite it in place if stale.
11
- 2. Copy it to `journal/session/archive/<timestamp>.md` (timestamp = `YYYY-MM-DD-HHmm`).
12
- 3. Confirm the snapshot path back to the user.
13
-
14
- A checkpoint is **not a new file type** — it is a timestamped copy of `current.md`. Resume always
15
- reads `current.md`; archives are for recovery only.
1
+ ---
2
+ description: Snapshot the NOW whiteboard before a context boundary.
3
+ ---
4
+
5
+ Checkpoint the current session state (`rules` §6 — NOW layer).
6
+
7
+ Steps:
8
+
9
+ 1. Ensure `journal/session/current.md` reflects the live state: mode, focus, last-done, next-step,
10
+ blockers, open-questions, files-touched. Rewrite it in place if stale.
11
+ 2. Copy it to `journal/session/archive/<timestamp>.md` (timestamp = `YYYY-MM-DD-HHmm`).
12
+ 3. Confirm the snapshot path back to the user.
13
+
14
+ A checkpoint is **not a new file type** — it is a timestamped copy of `current.md`. Resume always
15
+ reads `current.md`; archives are for recovery only.
@@ -1,14 +1,14 @@
1
- ---
2
- description: Run grimoire init or sync from inside Claude Code.
3
- ---
4
-
5
- Wrap the Grimoire CLI (`bin/grimoire.mjs`).
6
-
7
- - **init** — scaffold `.agents/` + pointers into a new project. Run:
8
- `npx github:nuttchanon/the-grimoire init` (or `node bin/grimoire.mjs init` when developing the template).
9
- - **sync** — pull the latest template into an existing project. Overwrites **managed paths only**
10
- (`.agents/grimoire.manifest`); never touches `codex/ journal/ local/`. Run:
11
- `npx github:nuttchanon/the-grimoire sync`.
12
-
13
- After `sync`, print the changelog (git log between the old and new template sha) and bump
14
- `.agents/VERSION`. Confirm with the user before running `sync` if there are uncommitted changes.
1
+ ---
2
+ description: Run grimoire init or sync from inside Claude Code.
3
+ ---
4
+
5
+ Wrap the Grimoire CLI (`bin/grimoire.mjs`).
6
+
7
+ - **init** — scaffold `.agents/` + pointers into a new project. Run:
8
+ `npx github:nuttchanon/the-grimoire init` (or `node bin/grimoire.mjs init` when developing the template).
9
+ - **sync** — pull the latest template into an existing project. Overwrites **managed paths only**
10
+ (`.agents/grimoire.manifest`); never touches `codex/ journal/ local/`. Run:
11
+ `npx github:nuttchanon/the-grimoire sync`.
12
+
13
+ After `sync`, print the changelog (git log between the old and new template sha) and bump
14
+ `.agents/VERSION`. Confirm with the user before running `sync` if there are uncommitted changes.
@@ -1,56 +1,56 @@
1
- ---
2
- description: Onboard an existing (pre-Grimoire) repo onto the template without losing its custom contract.
3
- ---
4
-
5
- # onboard — adopt Grimoire in an existing repo
6
-
7
- Use this when a repo already has its own agent contract (a hand-rolled `.agents/`, a long `CLAUDE.md`,
8
- ad-hoc rules) and you want it on the managed template. `init` lays the base and **backs up** an
9
- existing `.agents/` to `.agents.bak-<timestamp>/`; this playbook moves the project's signal into
10
- `local/` so nothing is lost and `grimoire sync` stays conflict-free. Work on a branch.
11
-
12
- ## Steps
13
-
14
- 1. **Branch + survey.** `git checkout -b chore/grimoire-onboard`. Read the existing `.agents/` (every
15
- rule), `CLAUDE.md`, and any existing ADR/requirements layout (e.g. `docs/adr/`, `docs/requirements/`).
16
- Note what is project-specific (domain, stack, security model, env gotchas) vs generic (it'll be
17
- replaced by the base).
18
-
19
- 2. **Run init.** `npx github:nuttchanon/the-grimoire init`. If an `.agents/` was present it is now
20
- safe in `.agents.bak-<timestamp>/`; the managed base + `local/` skeleton are in place. `init` also
21
- seeds a single project-owned `codex/` tree at the repo root (decisions, requirements, runbooks,
22
- domain, evidence, …) via `seedCodex` — seed-once, only when `codex/` is absent, and never touched
23
- by `grimoire sync`.
24
-
25
- 3. **Move custom rules → `local/rules/`.** For each project rule worth keeping, recreate it under
26
- `local/rules/` with a **`local-` prefix** (avoids number collisions with the base — see
27
- `local/README.md`). Carry the content verbatim; add a frontmatter `description:`.
28
-
29
- 4. **Move CLAUDE.md context → `local/AGENTS.local.md` (+ big docs → `local/reference/`).** Set the
30
- profile (stack, testing policy, verify command). Move the system model, doc map, domain pointers,
31
- access/auth model, and env/build gotchas into **Project facts**; park large domain contracts (IPC
32
- tables, confirmed values) in `local/reference/`. Record any base behaviour you're overriding under
33
- **Override declarations**.
34
-
35
- 5. **Slim CLAUDE.md to a pointer.** Reduce it to the Grimoire imports
36
- (`@.agents/AGENTS.md` + `@local/AGENTS.local.md`) plus one line of orientation.
37
-
38
- 6. **Migrate ADRs/requirements into `codex/`.** If the repo already had `docs/adr/` (or
39
- `docs/requirements/`, or another ADR layout), move those decisions into `codex/decisions/` and
40
- requirements into `codex/requirements/`, then remove the old trees. `seedCodex` only scaffolds
41
- `codex/` when it is absent, so it won't clobber a `codex/` you populate. Note any non-default
42
- location in **Override declarations**.
43
-
44
- 7. **Move bespoke paths to the repo root.** `.agents/` is now a fully read-only contract — `sync`
45
- wholesale-replaces it, so nothing project-owned can live under it. Any bespoke project dirs (e.g.
46
- `field-reports/`, `handoff/`) belong at the repo root, alongside `codex/`, `journal/`, and `local/`.
47
-
48
- 8. **Verify + clean up.** `grimoire index` (regen INDEX.md), `grimoire doctor` (check wiring), run the
49
- project's verify command, confirm the contract loads. Delete the `.agents.bak-*` backup once
50
- everything is migrated. Commit; open a PR.
51
-
52
- ## Done when
53
-
54
- The `.agents.bak-*` backup is gone · every kept project rule lives under `local/rules/` (prefixed) ·
55
- `CLAUDE.md` is a thin pointer · `grimoire index --check` + `grimoire doctor` are clean · decisions and
56
- requirements live under `codex/` with no leftover `docs/adr/` (or `docs/requirements/`) tree.
1
+ ---
2
+ description: Onboard an existing (pre-Grimoire) repo onto the template without losing its custom contract.
3
+ ---
4
+
5
+ # onboard — adopt Grimoire in an existing repo
6
+
7
+ Use this when a repo already has its own agent contract (a hand-rolled `.agents/`, a long `CLAUDE.md`,
8
+ ad-hoc rules) and you want it on the managed template. `init` lays the base and **backs up** an
9
+ existing `.agents/` to `.agents.bak-<timestamp>/`; this playbook moves the project's signal into
10
+ `local/` so nothing is lost and `grimoire sync` stays conflict-free. Work on a branch.
11
+
12
+ ## Steps
13
+
14
+ 1. **Branch + survey.** `git checkout -b chore/grimoire-onboard`. Read the existing `.agents/` (every
15
+ rule), `CLAUDE.md`, and any existing ADR/requirements layout (e.g. `docs/adr/`, `docs/requirements/`).
16
+ Note what is project-specific (domain, stack, security model, env gotchas) vs generic (it'll be
17
+ replaced by the base).
18
+
19
+ 2. **Run init.** `npx github:nuttchanon/the-grimoire init`. If an `.agents/` was present it is now
20
+ safe in `.agents.bak-<timestamp>/`; the managed base + `local/` skeleton are in place. `init` also
21
+ seeds a single project-owned `codex/` tree at the repo root (decisions, requirements, runbooks,
22
+ domain, evidence, …) via `seedCodex` — seed-once, only when `codex/` is absent, and never touched
23
+ by `grimoire sync`.
24
+
25
+ 3. **Move custom rules → `local/rules/`.** For each project rule worth keeping, recreate it under
26
+ `local/rules/` with a **`local-` prefix** (avoids number collisions with the base — see
27
+ `local/README.md`). Carry the content verbatim; add a frontmatter `description:`.
28
+
29
+ 4. **Move CLAUDE.md context → `local/AGENTS.local.md` (+ big docs → `local/reference/`).** Set the
30
+ profile (stack, testing policy, verify command). Move the system model, doc map, domain pointers,
31
+ access/auth model, and env/build gotchas into **Project facts**; park large domain contracts (IPC
32
+ tables, confirmed values) in `local/reference/`. Record any base behaviour you're overriding under
33
+ **Override declarations**.
34
+
35
+ 5. **Slim CLAUDE.md to a pointer.** Reduce it to the Grimoire imports
36
+ (`@.agents/AGENTS.md` + `@local/AGENTS.local.md`) plus one line of orientation.
37
+
38
+ 6. **Migrate ADRs/requirements into `codex/`.** If the repo already had `docs/adr/` (or
39
+ `docs/requirements/`, or another ADR layout), move those decisions into `codex/decisions/` and
40
+ requirements into `codex/requirements/`, then remove the old trees. `seedCodex` only scaffolds
41
+ `codex/` when it is absent, so it won't clobber a `codex/` you populate. Note any non-default
42
+ location in **Override declarations**.
43
+
44
+ 7. **Move bespoke paths to the repo root.** `.agents/` is now a fully read-only contract — `sync`
45
+ wholesale-replaces it, so nothing project-owned can live under it. Any bespoke project dirs (e.g.
46
+ `field-reports/`, `handoff/`) belong at the repo root, alongside `codex/`, `journal/`, and `local/`.
47
+
48
+ 8. **Verify + clean up.** `grimoire index` (regen INDEX.md), `grimoire doctor` (check wiring), run the
49
+ project's verify command, confirm the contract loads. Delete the `.agents.bak-*` backup once
50
+ everything is migrated. Commit; open a PR.
51
+
52
+ ## Done when
53
+
54
+ The `.agents.bak-*` backup is gone · every kept project rule lives under `local/rules/` (prefixed) ·
55
+ `CLAUDE.md` is a thin pointer · `grimoire index --check` + `grimoire doctor` are clean · decisions and
56
+ requirements live under `codex/` with no leftover `docs/adr/` (or `docs/requirements/`) tree.
@@ -1,23 +1,23 @@
1
- ---
2
- description: Render the current spec / review / report / prototype / editing UI as a self-contained HTML artifact and return a file:// URL.
3
- ---
4
-
5
- Turn a human-facing deliverable into an interactive HTML page a person will actually read — not a
6
- long Markdown wall they skim. Use for a spec comparison, code-review dashboard, report/explainer,
7
- design prototype, or a custom editing UI (see `skills/catalog.md` -> Presentation).
8
-
9
- Honor presentation mode (`rules/45-presentation.md`): render HTML only when the mode is on for this
10
- project (`local/AGENTS.local.md`) or the user asks; otherwise stay in Markdown.
11
-
12
- Steps:
13
-
14
- 1. Keep the **source canonical** — the Markdown/spec stays the source of truth; the HTML is a *view*
15
- generated from it.
16
- 2. Build ONE self-contained `.html`: inline CSS + JS, **no external/remote `<script>` or CDN**, works
17
- offline via `file://`. **Escape** any code/diff/user text you embed (no raw injection).
18
- 3. Write it to `journal/session/artifacts/<YYYY-MM-DD-HHmm>-<slug>.html` (ephemeral, gitignored).
19
- 4. Return the absolute `file://` path so the user can open it in a browser.
20
- 5. For editing UIs, include a **"copy as JSON / copy as Markdown"** button so the user can export
21
- their changes back into the conversation (close the loop).
22
-
23
- Token-aware: render HTML for deliverables that earn it, not routine replies.
1
+ ---
2
+ description: Render the current spec / review / report / prototype / editing UI as a self-contained HTML artifact and return a file:// URL.
3
+ ---
4
+
5
+ Turn a human-facing deliverable into an interactive HTML page a person will actually read — not a
6
+ long Markdown wall they skim. Use for a spec comparison, code-review dashboard, report/explainer,
7
+ design prototype, or a custom editing UI (see `skills/catalog.md` -> Presentation).
8
+
9
+ Honor presentation mode (`rules/45-presentation.md`): render HTML only when the mode is on for this
10
+ project (`local/AGENTS.local.md`) or the user asks; otherwise stay in Markdown.
11
+
12
+ Steps:
13
+
14
+ 1. Keep the **source canonical** — the Markdown/spec stays the source of truth; the HTML is a *view*
15
+ generated from it.
16
+ 2. Build ONE self-contained `.html`: inline CSS + JS, **no external/remote `<script>` or CDN**, works
17
+ offline via `file://`. **Escape** any code/diff/user text you embed (no raw injection).
18
+ 3. Write it to `journal/session/artifacts/<YYYY-MM-DD-HHmm>-<slug>.html` (ephemeral, gitignored).
19
+ 4. Return the absolute `file://` path so the user can open it in a browser.
20
+ 5. For editing UIs, include a **"copy as JSON / copy as Markdown"** button so the user can export
21
+ their changes back into the conversation (close the loop).
22
+
23
+ Token-aware: render HTML for deliverables that earn it, not routine replies.
@@ -1,20 +1,20 @@
1
- ---
2
- description: Run the verify script and dispatch the verifier subagent for independent sign-off.
3
- ---
4
-
5
- Verify the current change to Definition-of-Done standard (`rules/30-verification.md`).
6
-
7
- Steps:
8
-
9
- 1. Identify the `verify` command for this project (package script `verify`, or the active
10
- `stack/` profile's command). If none exists, fall back to typecheck + lint + tests.
11
- 2. Run it. Capture real output and exit code.
12
- 3. Spawn the **verifier** subagent (Task/Agent tool) on **fresh context**, passing ONLY:
13
- - the requirements / acceptance criteria for this change,
14
- - the diff (`git diff` of the change),
15
- - the Definition-of-Done checklist.
16
- Do **not** pass your own reasoning or this conversation.
17
- 4. Relay the verifier's structured verdict. If `fail`, the change is **not done** — address the
18
- reasons and re-run. Do not declare done without a `pass` artifact.
19
-
20
- For large or risky changes, also run `/code-review` (or `/code-review ultra`).
1
+ ---
2
+ description: Run the verify script and dispatch the verifier subagent for independent sign-off.
3
+ ---
4
+
5
+ Verify the current change to Definition-of-Done standard (`rules/30-verification.md`).
6
+
7
+ Steps:
8
+
9
+ 1. Identify the `verify` command for this project (package script `verify`, or the active
10
+ `stack/` profile's command). If none exists, fall back to typecheck + lint + tests.
11
+ 2. Run it. Capture real output and exit code.
12
+ 3. Spawn the **verifier** subagent (Task/Agent tool) on **fresh context**, passing ONLY:
13
+ - the requirements / acceptance criteria for this change,
14
+ - the diff (`git diff` of the change),
15
+ - the Definition-of-Done checklist.
16
+ Do **not** pass your own reasoning or this conversation.
17
+ 4. Relay the verifier's structured verdict. If `fail`, the change is **not done** — address the
18
+ reasons and re-run. Do not declare done without a `pass` artifact.
19
+
20
+ For large or risky changes, also run `/code-review` (or `/code-review ultra`).
@@ -1,18 +1,18 @@
1
- # Managed contract surface — everything under `.agents/` is read-only and OVERWRITTEN by
2
- # `grimoire sync` (wholesale replace). This file documents the contract; sync no longer needs
3
- # it to compute carve-outs. One path (file or dir) per line, relative to .agents/.
4
-
5
- AGENTS.md
6
- NAVIGATOR.md
7
- rules/
8
- standards/
9
- stack/
10
- agents/
11
- skills/
12
- commands/
13
- tooling.json
14
-
15
- # Project-owned, NEVER synced — live at the repo ROOT, outside .agents/ (listed for clarity):
16
- # codex/ — knowledge base (domain, requirements, decisions, evidence, runbooks)
17
- # journal/ — agent working state (memory/, backlog/, session/)
18
- # local/ — project override config (loads last, wins)
1
+ # Managed contract surface — everything under `.agents/` is read-only and OVERWRITTEN by
2
+ # `grimoire sync` (wholesale replace). This file documents the contract; sync no longer needs
3
+ # it to compute carve-outs. One path (file or dir) per line, relative to .agents/.
4
+
5
+ AGENTS.md
6
+ NAVIGATOR.md
7
+ rules/
8
+ standards/
9
+ stack/
10
+ agents/
11
+ skills/
12
+ commands/
13
+ tooling.json
14
+
15
+ # Project-owned, NEVER synced — live at the repo ROOT, outside .agents/ (listed for clarity):
16
+ # codex/ — knowledge base (domain, requirements, decisions, evidence, runbooks)
17
+ # journal/ — agent working state (memory/, backlog/, session/)
18
+ # local/ — project override config (loads last, wins)
@@ -1,42 +1,42 @@
1
- ---
2
- updated: 2026-05-31
3
- description: The non-negotiable rules; violating any is a hard error, not a style nit. Read every session.
4
- ---
5
-
6
- # 00 — Always (hard errors)
7
-
8
- Always-on. Violating any of these is a hard error, not a style nit.
9
-
10
- - **Verify before done.** Code is not done until the independent verifier (`30-verification.md`)
11
- returns `pass` on **fresh context**. The author of a change cannot mark it done — bias comes from
12
- shared context. Definition of Done = tests green **AND** verifier `pass` **AND** checklist complete.
13
- For **user-facing, data-collecting** apps, the launch-security checklist
14
- (`standards/launch-security-checklist.md`) is part of Done, not a later pass.
15
- - **Read the knowledge base first.** Before domain/feature work, read `codex/INDEX.md` — the
16
- project's source-of-truth knowledge base (domain, requirements, decisions, evidence). Don't start
17
- blind.
18
- - **Doc-sync same turn.** Any behavior/interface change updates its doc and `journal/memory/` in the **same
19
- turn** as the code. No "I'll document later".
20
- - **Security first.** Never hardcode roles, permissions, secrets, or hostnames. Validate and
21
- authorize on the server. Fail **closed**. (Detail: `50-security.md`.)
22
- - **No hardcoded roles.** Gate behavior through helpers/config, never string literals like
23
- `if (user.role === "admin")`.
24
- - **Effort is not a constraint.** Never reduce scope, skip tests, or pick the lazy design to save
25
- effort. If the work is large, **spawn parallel subagents** — do not cut corners.
26
- - **No silent test gaps.** Shipping a unit of work without a test suite is a *recorded decision*, not
27
- a silent omission: write an ADR (`codex/decisions/`) stating why (spike/throwaway, external constraint) and
28
- when tests get backfilled. A missing test suite with no ADR is a defect.
29
- - **Confirmed values change with their ADR.** When a decision alters ground-truth values the code
30
- reads back (IPC channels, error codes, permission keys, tenant configs, shared enums), the ADR sets
31
- `updates-confirmed-values: yes` and the same PR updates the project's confirmed-values table.
32
- - **Small increments.** One coherent change at a time; keep the diff reviewable. (Detail: `10-working-process.md`.)
33
- - **Surgical changes.** Every changed line traces to the request; don't touch adjacent code you were
34
- not asked to. (Detail: `25-surgical-changes.md`.)
35
- - **Never edit the managed base; customize in `local/`.** In a consuming project, the base
36
- (`.agents/AGENTS.md`, `rules/`, `standards/`, `stack/`, `agents/`, `skills/`, `commands/`,
37
- `tooling.json`) is overwritten by `grimoire sync`. Put every project change under root `local/`
38
- (never synced) — it loads last and wins. Protocol: `local/README.md`.
39
- - **State your assumptions; don't pick silently.** If a requirement is ambiguous, name what is
40
- confusing and present the interpretations — do not choose one quietly. Ask when the wrong guess is
41
- expensive; otherwise pick the obvious default and say so. Push back when a simpler or better
42
- approach exists.
1
+ ---
2
+ updated: 2026-05-31
3
+ description: The non-negotiable rules; violating any is a hard error, not a style nit. Read every session.
4
+ ---
5
+
6
+ # 00 — Always (hard errors)
7
+
8
+ Always-on. Violating any of these is a hard error, not a style nit.
9
+
10
+ - **Verify before done.** Code is not done until the independent verifier (`30-verification.md`)
11
+ returns `pass` on **fresh context**. The author of a change cannot mark it done — bias comes from
12
+ shared context. Definition of Done = tests green **AND** verifier `pass` **AND** checklist complete.
13
+ For **user-facing, data-collecting** apps, the launch-security checklist
14
+ (`standards/launch-security-checklist.md`) is part of Done, not a later pass.
15
+ - **Read the knowledge base first.** Before domain/feature work, read `codex/INDEX.md` — the
16
+ project's source-of-truth knowledge base (domain, requirements, decisions, evidence). Don't start
17
+ blind.
18
+ - **Doc-sync same turn.** Any behavior/interface change updates its doc and `journal/memory/` in the **same
19
+ turn** as the code. No "I'll document later".
20
+ - **Security first.** Never hardcode roles, permissions, secrets, or hostnames. Validate and
21
+ authorize on the server. Fail **closed**. (Detail: `50-security.md`.)
22
+ - **No hardcoded roles.** Gate behavior through helpers/config, never string literals like
23
+ `if (user.role === "admin")`.
24
+ - **Effort is not a constraint.** Never reduce scope, skip tests, or pick the lazy design to save
25
+ effort. If the work is large, **spawn parallel subagents** — do not cut corners.
26
+ - **No silent test gaps.** Shipping a unit of work without a test suite is a *recorded decision*, not
27
+ a silent omission: write an ADR (`codex/decisions/`) stating why (spike/throwaway, external constraint) and
28
+ when tests get backfilled. A missing test suite with no ADR is a defect.
29
+ - **Confirmed values change with their ADR.** When a decision alters ground-truth values the code
30
+ reads back (IPC channels, error codes, permission keys, tenant configs, shared enums), the ADR sets
31
+ `updates-confirmed-values: yes` and the same PR updates the project's confirmed-values table.
32
+ - **Small increments.** One coherent change at a time; keep the diff reviewable. (Detail: `10-working-process.md`.)
33
+ - **Surgical changes.** Every changed line traces to the request; don't touch adjacent code you were
34
+ not asked to. (Detail: `25-surgical-changes.md`.)
35
+ - **Never edit the managed base; customize in `local/`.** In a consuming project, the base
36
+ (`.agents/AGENTS.md`, `rules/`, `standards/`, `stack/`, `agents/`, `skills/`, `commands/`,
37
+ `tooling.json`) is overwritten by `grimoire sync`. Put every project change under root `local/`
38
+ (never synced) — it loads last and wins. Protocol: `local/README.md`.
39
+ - **State your assumptions; don't pick silently.** If a requirement is ambiguous, name what is
40
+ confusing and present the interpretations — do not choose one quietly. Ask when the wrong guess is
41
+ expensive; otherwise pick the obvious default and say so. Push back when a simpler or better
42
+ approach exists.
@@ -1,28 +1,28 @@
1
- ---
2
- updated: 2026-05-31
3
- description: Always-on code-quality essentials; the full standard lives in standards/clean-code.md.
4
- ---
5
-
6
- # 05 — Code quality (standards overview)
7
-
8
- - **Small files.** Split when a file grows past its single responsibility. Prefer many small,
9
- named modules over one large one.
10
- - **Minimal comments — why, not what.** Code says *what*; comments explain *why* only when
11
- non-obvious. Delete comments that restate the code.
12
- - **DRY, but not prematurely.** Extract on the *third* repetition, not the first.
13
- - **YAGNI — climb the ladder.** Before writing, stop at the first rung that holds: skip it → stdlib →
14
- native platform → existing dependency → one line → only then minimal code. No speculative
15
- abstraction, config, or hooks; no error handling for impossible scenarios. Mark a deliberate
16
- shortcut with `// ponytail: <ceiling>, <upgrade path>`. Full ladder + the "never simplify away"
17
- guardrail: `standards/clean-code.md`.
18
- - **Simplicity first.** Minimum code that solves the problem. If 200 lines could be 50, rewrite.
19
- Sanity check: would a senior engineer call this overcomplicated? If yes, simplify.
20
- - **Naming mirrors the domain.** Names come from the problem domain, not the implementation.
21
- Match the surrounding code's idiom, casing, and comment density.
22
-
23
- - **No silent suppression.** `eslint-disable` / `@ts-ignore` / `any` need an inline comment naming
24
- the constraint + a follow-up. Greening CI by disabling a rule without a replacement guard is
25
- tracked tech debt (ADR if structural).
26
-
27
- Full standard: `standards/clean-code.md` (limits, type-safety, performance, suppression) +
28
- `standards/general.md` + the per-language file.
1
+ ---
2
+ updated: 2026-05-31
3
+ description: Always-on code-quality essentials; the full standard lives in standards/clean-code.md.
4
+ ---
5
+
6
+ # 05 — Code quality (standards overview)
7
+
8
+ - **Small files.** Split when a file grows past its single responsibility. Prefer many small,
9
+ named modules over one large one.
10
+ - **Minimal comments — why, not what.** Code says *what*; comments explain *why* only when
11
+ non-obvious. Delete comments that restate the code.
12
+ - **DRY, but not prematurely.** Extract on the *third* repetition, not the first.
13
+ - **YAGNI — climb the ladder.** Before writing, stop at the first rung that holds: skip it → stdlib →
14
+ native platform → existing dependency → one line → only then minimal code. No speculative
15
+ abstraction, config, or hooks; no error handling for impossible scenarios. Mark a deliberate
16
+ shortcut with `// ponytail: <ceiling>, <upgrade path>`. Full ladder + the "never simplify away"
17
+ guardrail: `standards/clean-code.md`.
18
+ - **Simplicity first.** Minimum code that solves the problem. If 200 lines could be 50, rewrite.
19
+ Sanity check: would a senior engineer call this overcomplicated? If yes, simplify.
20
+ - **Naming mirrors the domain.** Names come from the problem domain, not the implementation.
21
+ Match the surrounding code's idiom, casing, and comment density.
22
+
23
+ - **No silent suppression.** `eslint-disable` / `@ts-ignore` / `any` need an inline comment naming
24
+ the constraint + a follow-up. Greening CI by disabling a rule without a replacement guard is
25
+ tracked tech debt (ADR if structural).
26
+
27
+ Full standard: `standards/clean-code.md` (limits, type-safety, performance, suppression) +
28
+ `standards/general.md` + the per-language file.