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.
Files changed (95) hide show
  1. package/.agents/AGENTS.md +112 -112
  2. package/.agents/NAVIGATOR.md +193 -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 +71 -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 +20 -19
  53. package/LICENSE +1 -1
  54. package/README.md +139 -139
  55. package/bin/grimoire.mjs +667 -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,31 +1,31 @@
1
- ---
2
- updated: 2026-05-31
3
- description: 'How to work a task end to end: plan, task contract, right altitude, small increments, tools, TDD.'
4
- ---
5
-
6
- # 10 — Working process
7
-
8
- - **Plan before code.** For anything beyond a trivial edit, state the plan (files, approach,
9
- test strategy) before touching code. For large/ambiguous work, get a thumbs-up first.
10
- - **Goal-driven.** Turn the task into a verifiable goal before starting: "fix the bug" → "write a
11
- test that reproduces it, then make it pass". Strong success criteria let you loop to done without
12
- re-asking; weak ones ("make it work") force constant clarification.
13
- - **Task contract.** Before non-trivial code, state the contract: the verifiable **goal**, explicit
14
- **acceptance criteria**, and what is **out of scope**. The verifier checks output against it — "done"
15
- means the criteria are met and nothing out-of-scope crept in.
16
- - **Right altitude.** Match effort and abstraction to the ask. Do the full *right* thing for the
17
- actual request — neither gold-plate (speculative abstraction; YAGNI, `rules/05`) nor scope-cut to
18
- save effort (`rules/00`). When the right altitude is unclear, state your read and proceed.
19
- - **Ask before large work.** Multi-session, schema-changing, or architecture-shifting work →
20
- route to **BACKLOG** (`40-handoff.md`) and confirm scope before starting.
21
- - **Small increments.** Land coherent, reviewable slices. Vertical (tracer-bullet) over horizontal.
22
- - **Use the tools.** When a skill or command fits the task, use it instead of improvising.
23
- - **Adapt external guidance.** When applying an article, talk, or vendor doc, extract the principle and fit it to this stack and domain. Vendor names and examples in the source are illustrations, not mandates — keep the core tool-agnostic.
24
- - **Update NOW.** Keep `journal/session/current.md` reflecting the live state (focus / last-done /
25
- next-step / blockers). Rewrite in place; do not append.
26
- - **Session hygiene.** Batch related asks into one well-planned request — every prompt reloads the
27
- always-on context, so one-shotting beats drip-feeding. Finish a task, then compact or clear:
28
- continuity lives in the three homes (`standards/knowledge-management.md`), not in chat history.
29
- For work-in-progress, capture state via `journal/session/current.md` or the `handoff` skill before clearing.
30
- - **TDD per stack policy.** Follow the active profile's testing policy
31
- (`tdd-mandatory` | `test-ready-deferred` | `none`) — see `stack/`.
1
+ ---
2
+ updated: 2026-05-31
3
+ description: 'How to work a task end to end: plan, task contract, right altitude, small increments, tools, TDD.'
4
+ ---
5
+
6
+ # 10 — Working process
7
+
8
+ - **Plan before code.** For anything beyond a trivial edit, state the plan (files, approach,
9
+ test strategy) before touching code. For large/ambiguous work, get a thumbs-up first.
10
+ - **Goal-driven.** Turn the task into a verifiable goal before starting: "fix the bug" → "write a
11
+ test that reproduces it, then make it pass". Strong success criteria let you loop to done without
12
+ re-asking; weak ones ("make it work") force constant clarification.
13
+ - **Task contract.** Before non-trivial code, state the contract: the verifiable **goal**, explicit
14
+ **acceptance criteria**, and what is **out of scope**. The verifier checks output against it — "done"
15
+ means the criteria are met and nothing out-of-scope crept in.
16
+ - **Right altitude.** Match effort and abstraction to the ask. Do the full *right* thing for the
17
+ actual request — neither gold-plate (speculative abstraction; YAGNI, `rules/05`) nor scope-cut to
18
+ save effort (`rules/00`). When the right altitude is unclear, state your read and proceed.
19
+ - **Ask before large work.** Multi-session, schema-changing, or architecture-shifting work →
20
+ route to **BACKLOG** (`40-handoff.md`) and confirm scope before starting.
21
+ - **Small increments.** Land coherent, reviewable slices. Vertical (tracer-bullet) over horizontal.
22
+ - **Use the tools.** When a skill or command fits the task, use it instead of improvising.
23
+ - **Adapt external guidance.** When applying an article, talk, or vendor doc, extract the principle and fit it to this stack and domain. Vendor names and examples in the source are illustrations, not mandates — keep the core tool-agnostic.
24
+ - **Update NOW.** Keep `journal/session/current.md` reflecting the live state (focus / last-done /
25
+ next-step / blockers). Rewrite in place; do not append.
26
+ - **Session hygiene.** Batch related asks into one well-planned request — every prompt reloads the
27
+ always-on context, so one-shotting beats drip-feeding. Finish a task, then compact or clear:
28
+ continuity lives in the three homes (`standards/knowledge-management.md`), not in chat history.
29
+ For work-in-progress, capture state via `journal/session/current.md` or the `handoff` skill before clearing.
30
+ - **TDD per stack policy.** Follow the active profile's testing policy
31
+ (`tdd-mandatory` | `test-ready-deferred` | `none`) — see `stack/`.
@@ -1,27 +1,27 @@
1
- ---
2
- updated: 2026-05-31
3
- description: Consult skills/catalog.md and use the right skill/plugin/MCP before improvising.
4
- ---
5
-
6
- # 15 — Use the right tool (skills / plugins / MCP)
7
-
8
- Before improvising any non-trivial task, **consult `skills/catalog.md`** and invoke the primary
9
- capability for the trigger. If the catalog does not cover it, run **`find-skills`** before
10
- hand-rolling a solution. For multi-step work, run the matching **workflow chain** end to end — do
11
- not stop early.
12
-
13
- Precedence: this rule defers to `local/`. A project may swap a primary (e.g. pin
14
- `superpowers:test-driven-development` instead of `tdd`) or disable a tool in `local/AGENTS.local.md`.
15
-
16
- ## Workflow chains
17
-
18
- - **Feature:** `brainstorming → writing-plans → [using-git-worktrees] → tdd → verifier → ecc:code-review → ecc:pr`
19
- - **Bugfix:** `diagnose → tdd (reproduce) → verifier → ecc:pr`
20
- - **UI:** `stitch (mockup) → ui-ux-pro-max → react-test → ecc:frontend-a11y → playwright (visual) → verifier`
21
- - **Architecture:** `improve-codebase-architecture → grill-with-docs → writing-plans → …`
22
- - **Research-first:** `ecc:deep-research → brainstorming → …`
23
-
24
- The required tools for this project are declared in `tooling.json`; run `grimoire bootstrap` to
25
- install/enable them. The mattpocock engineering skills (`tdd`, `diagnose`, `to-prd`, `to-issues`,
26
- `triage`, `improve-codebase-architecture`, `zoom-out`) require running `/setup-matt-pocock-skills`
27
- once per repo first.
1
+ ---
2
+ updated: 2026-05-31
3
+ description: Consult skills/catalog.md and use the right skill/plugin/MCP before improvising.
4
+ ---
5
+
6
+ # 15 — Use the right tool (skills / plugins / MCP)
7
+
8
+ Before improvising any non-trivial task, **consult `skills/catalog.md`** and invoke the primary
9
+ capability for the trigger. If the catalog does not cover it, run **`find-skills`** before
10
+ hand-rolling a solution. For multi-step work, run the matching **workflow chain** end to end — do
11
+ not stop early.
12
+
13
+ Precedence: this rule defers to `local/`. A project may swap a primary (e.g. pin
14
+ `superpowers:test-driven-development` instead of `tdd`) or disable a tool in `local/AGENTS.local.md`.
15
+
16
+ ## Workflow chains
17
+
18
+ - **Feature:** `brainstorming → writing-plans → [using-git-worktrees] → tdd → verifier → ecc:code-review → ecc:pr`
19
+ - **Bugfix:** `diagnose → tdd (reproduce) → verifier → ecc:pr`
20
+ - **UI:** `stitch (mockup) → ui-ux-pro-max → react-test → ecc:frontend-a11y → playwright (visual) → verifier`
21
+ - **Architecture:** `improve-codebase-architecture → grill-with-docs → writing-plans → …`
22
+ - **Research-first:** `ecc:deep-research → brainstorming → …`
23
+
24
+ The required tools for this project are declared in `tooling.json`; run `grimoire bootstrap` to
25
+ install/enable them. The mattpocock engineering skills (`tdd`, `diagnose`, `to-prd`, `to-issues`,
26
+ `triage`, `improve-codebase-architecture`, `zoom-out`) require running `/setup-matt-pocock-skills`
27
+ once per repo first.
@@ -1,41 +1,41 @@
1
- ---
2
- updated: 2026-05-31
3
- description: 'NORMAL vs HOTFIX: how a user phrase sets the working mode and what each mode requires.'
4
- ---
5
-
6
- # 20 — Modes: NORMAL vs HOTFIX
7
-
8
- A mode is set by a user phrase and **persists for the whole session**. Record it at the top of
9
- `journal/session/current.md`.
10
-
11
- ## NORMAL (default)
12
-
13
- Full discipline:
14
- - Plan before code; TDD per the active stack testing-policy.
15
- - Full `verify` script (`stack/`): typecheck + lint + test + coverage + format:check.
16
- - Docs and `journal/memory/` updated **same turn** as the change.
17
- - Commits go through hooks (husky + lint-staged). No `--no-verify`.
18
- - The verifier must `pass` before "done".
19
-
20
- ## HOTFIX (on-site fire)
21
-
22
- Triggered by phrases like "hotfix", "production down", "on-site fire" (localize the trigger words
23
- per project in `local/`). Once declared, HOTFIX **persists the whole session** — don't silently
24
- revert on the next message. Minimize blast radius:
25
- - **Smallest diff** — one file if possible.
26
- - **TDD waived** — backfill tests in the cleanup item.
27
- - **Gate the new path behind an env flag** — single-unset rollback. Document the flag and how to
28
- unset it **in the commit body**, so an operator who only has `git log` can roll back.
29
- - `--no-verify` **allowed** for the emergency commit only.
30
- - **Never `npm ci`** (or any clean-install that wipes deps) on-site — a cancelled run leaves a
31
- half-installed tree and a dead app. If deps are unchanged, build only; otherwise `npm install`
32
- (resumable).
33
- - **Log a `journal/backlog/` item** (`priority: hotfix`) with: a `Hypothesis:` line (keep the disproven ones
34
- too), the env flag + rollback, and a cleanup checklist (tests to backfill, flag to remove, ADR if
35
- implied). An empty cleanup section means the HOTFIX is undocumented.
36
-
37
- **Environmental fire ≠ code fire.** If the on-site cause is hardware / OS / network / AV (RAM,
38
- keyring, co-tenant load), it is **not** a HOTFIX. Route per `40-handoff.md` — record in `journal/memory/` as
39
- a `type: field-report`, do not patch code.
40
-
41
- Leaving HOTFIX → the cleanup item must be closed under NORMAL discipline.
1
+ ---
2
+ updated: 2026-05-31
3
+ description: 'NORMAL vs HOTFIX: how a user phrase sets the working mode and what each mode requires.'
4
+ ---
5
+
6
+ # 20 — Modes: NORMAL vs HOTFIX
7
+
8
+ A mode is set by a user phrase and **persists for the whole session**. Record it at the top of
9
+ `journal/session/current.md`.
10
+
11
+ ## NORMAL (default)
12
+
13
+ Full discipline:
14
+ - Plan before code; TDD per the active stack testing-policy.
15
+ - Full `verify` script (`stack/`): typecheck + lint + test + coverage + format:check.
16
+ - Docs and `journal/memory/` updated **same turn** as the change.
17
+ - Commits go through hooks (husky + lint-staged). No `--no-verify`.
18
+ - The verifier must `pass` before "done".
19
+
20
+ ## HOTFIX (on-site fire)
21
+
22
+ Triggered by phrases like "hotfix", "production down", "on-site fire" (localize the trigger words
23
+ per project in `local/`). Once declared, HOTFIX **persists the whole session** — don't silently
24
+ revert on the next message. Minimize blast radius:
25
+ - **Smallest diff** — one file if possible.
26
+ - **TDD waived** — backfill tests in the cleanup item.
27
+ - **Gate the new path behind an env flag** — single-unset rollback. Document the flag and how to
28
+ unset it **in the commit body**, so an operator who only has `git log` can roll back.
29
+ - `--no-verify` **allowed** for the emergency commit only.
30
+ - **Never `npm ci`** (or any clean-install that wipes deps) on-site — a cancelled run leaves a
31
+ half-installed tree and a dead app. If deps are unchanged, build only; otherwise `npm install`
32
+ (resumable).
33
+ - **Log a `journal/backlog/` item** (`priority: hotfix`) with: a `Hypothesis:` line (keep the disproven ones
34
+ too), the env flag + rollback, and a cleanup checklist (tests to backfill, flag to remove, ADR if
35
+ implied). An empty cleanup section means the HOTFIX is undocumented.
36
+
37
+ **Environmental fire ≠ code fire.** If the on-site cause is hardware / OS / network / AV (RAM,
38
+ keyring, co-tenant load), it is **not** a HOTFIX. Route per `40-handoff.md` — record in `journal/memory/` as
39
+ a `type: field-report`, do not patch code.
40
+
41
+ Leaving HOTFIX → the cleanup item must be closed under NORMAL discipline.
@@ -1,29 +1,29 @@
1
- ---
2
- updated: 2026-05-31
3
- description: Touch only what the request needs; do not refactor or "improve" adjacent code.
4
- ---
5
-
6
- # 25 — Surgical changes
7
-
8
- Touch only what you must. Clean up only your own mess.
9
-
10
- ## When editing existing code
11
-
12
- - **Change only what the request needs.** Every changed line must trace directly to the task. If you
13
- cannot explain why a line changed in terms of the request, revert it.
14
- - **Do not "improve" adjacent code, comments, or formatting.** Not yours to touch this turn.
15
- - **Do not refactor what is not broken.** Unrelated refactoring is a separate, named task.
16
- - **Match the existing style** even if you would do it differently. Mirror the surrounding idiom,
17
- casing, and comment density.
18
- - **Notice ≠ delete.** If you spot unrelated dead code, **mention it** — do not remove it unless asked.
19
-
20
- ## Orphans
21
-
22
- - Remove imports / variables / functions that **your** change made unused.
23
- - Do **not** remove pre-existing dead code unless the task asks for it.
24
-
25
- ## The test
26
-
27
- > Could a reviewer read the diff and see nothing in it that the request did not call for?
28
-
29
- If not, trim the diff until they can.
1
+ ---
2
+ updated: 2026-05-31
3
+ description: Touch only what the request needs; do not refactor or "improve" adjacent code.
4
+ ---
5
+
6
+ # 25 — Surgical changes
7
+
8
+ Touch only what you must. Clean up only your own mess.
9
+
10
+ ## When editing existing code
11
+
12
+ - **Change only what the request needs.** Every changed line must trace directly to the task. If you
13
+ cannot explain why a line changed in terms of the request, revert it.
14
+ - **Do not "improve" adjacent code, comments, or formatting.** Not yours to touch this turn.
15
+ - **Do not refactor what is not broken.** Unrelated refactoring is a separate, named task.
16
+ - **Match the existing style** even if you would do it differently. Mirror the surrounding idiom,
17
+ casing, and comment density.
18
+ - **Notice ≠ delete.** If you spot unrelated dead code, **mention it** — do not remove it unless asked.
19
+
20
+ ## Orphans
21
+
22
+ - Remove imports / variables / functions that **your** change made unused.
23
+ - Do **not** remove pre-existing dead code unless the task asks for it.
24
+
25
+ ## The test
26
+
27
+ > Could a reviewer read the diff and see nothing in it that the request did not call for?
28
+
29
+ If not, trim the diff until they can.
@@ -1,36 +1,36 @@
1
- ---
2
- updated: 2026-05-31
3
- description: 'The independent verifier: the author cannot mark their own work done; verify on fresh context.'
4
- ---
5
-
6
- # 30 — Verification (independent verifier)
7
-
8
- **Principle: the agent that writes code cannot mark it done.** Bias comes from *shared context*,
9
- not from the model. Cut the context → cut the bias. One Claude Code subscription is enough via a
10
- **subagent with fresh context** — the **verifier**.
11
-
12
- ## Flow (one session)
13
-
14
- 1. Implementer (main thread) finishes the change.
15
- 2. Main spawns the **verifier** subagent, passing **only**: the requirements, the diff, and the
16
- checklist. **Not** the implementer's reasoning or conversation.
17
- 3. The verifier is prompted to **refute** (skeptic; default to FAIL when unsure). It **runs the real
18
- commands** (`verify` script — tests/build/lint) and **quotes real output**. No "looks good".
19
- 4. The verifier returns a structured verdict: `pass | fail` + reasons + commands run + quoted output,
20
- saved as an artifact.
21
- 5. **Definition of Done** = tests green **AND** verifier `pass` **AND** checklist complete. Missing
22
- any one → not done.
23
-
24
- ## Scaling
25
-
26
- - Large work → multiple verifier lenses (correctness / security / requirements-match), run in parallel.
27
- - Same model family shares blind spots. Mitigate with: refute-style prompt, mandatory quoted
28
- evidence, optionally run the verifier on a different model tier. Cross-model verification arrives
29
- free when a second tool is added later.
30
-
31
- ## Tool binding
32
-
33
- - Tool-agnostic: this file states the protocol in prose — any agent can follow it.
34
- - Claude Code: subagent `agents/verifier.md` + command `commands/verify.md`. For big changes, pair
35
- with `/code-review` (or `/code-review ultra`).
36
- - A Stop-hook may warn if "done" is declared without a verifier artifact (per-project opt-in).
1
+ ---
2
+ updated: 2026-05-31
3
+ description: 'The independent verifier: the author cannot mark their own work done; verify on fresh context.'
4
+ ---
5
+
6
+ # 30 — Verification (independent verifier)
7
+
8
+ **Principle: the agent that writes code cannot mark it done.** Bias comes from *shared context*,
9
+ not from the model. Cut the context → cut the bias. One Claude Code subscription is enough via a
10
+ **subagent with fresh context** — the **verifier**.
11
+
12
+ ## Flow (one session)
13
+
14
+ 1. Implementer (main thread) finishes the change.
15
+ 2. Main spawns the **verifier** subagent, passing **only**: the requirements, the diff, and the
16
+ checklist. **Not** the implementer's reasoning or conversation.
17
+ 3. The verifier is prompted to **refute** (skeptic; default to FAIL when unsure). It **runs the real
18
+ commands** (`verify` script — tests/build/lint) and **quotes real output**. No "looks good".
19
+ 4. The verifier returns a structured verdict: `pass | fail` + reasons + commands run + quoted output,
20
+ saved as an artifact.
21
+ 5. **Definition of Done** = tests green **AND** verifier `pass` **AND** checklist complete. Missing
22
+ any one → not done.
23
+
24
+ ## Scaling
25
+
26
+ - Large work → multiple verifier lenses (correctness / security / requirements-match), run in parallel.
27
+ - Same model family shares blind spots. Mitigate with: refute-style prompt, mandatory quoted
28
+ evidence, optionally run the verifier on a different model tier. Cross-model verification arrives
29
+ free when a second tool is added later.
30
+
31
+ ## Tool binding
32
+
33
+ - Tool-agnostic: this file states the protocol in prose — any agent can follow it.
34
+ - Claude Code: subagent `agents/verifier.md` + command `commands/verify.md`. For big changes, pair
35
+ with `/code-review` (or `/code-review ultra`).
36
+ - A Stop-hook may warn if "done" is declared without a verifier artifact (per-project opt-in).
@@ -1,41 +1,41 @@
1
- ---
2
- updated: 2026-05-31
3
- description: Keep entry and always-on files lean; push detail to references read on demand.
4
- ---
5
-
6
- # 35 — Context economy (keep entry files lean)
7
-
8
- Entry and always-loaded files are read every session — bloat there taxes every turn (tokens +
9
- latency). Keep them lean; push detail to reference files reached on demand. This is the whole point
10
- of the load-order in `AGENTS.md`: start narrow, pull in depth only when the task needs it.
11
-
12
- How to write any of these docs (lead, voice, structure, versioning): `standards/writing.md`.
13
-
14
- ## Budget
15
-
16
- - **Entry files** (`CLAUDE.md`, `.agents/AGENTS.md`, `local/AGENTS.local.md`): target **≤250 lines**,
17
- **hard ceiling 300**. Line count is a proxy — the real test is *"is every line read most sessions?"*
18
- - **Each rule / standard file:** one focused topic. If a file grows past its single concern, split it.
19
- - **Skills / commands:** a skill body loads in full **when invoked** (its name + description load
20
- cheaply; the body does not, until used). Keep a skill focused, **~200 lines max** — split a larger
21
- one into sub-skills so unrelated capability is not pulled into context on use.
22
- - **`journal/memory/MEMORY.md`:** one line per memory; the fact itself lives in its own card.
23
-
24
- ## What an entry file keeps (and little else)
25
-
26
- - tone / persona
27
- - the hardest **always-on** rules (full text lives in `rules/00-always.md`)
28
- - load order + routing map (where to find everything)
29
- - pointers to references (`rules/ standards/ stack/ journal/memory/ local/`)
30
- - precedence / customization note
31
-
32
- ## What moves out (linked, read on demand)
33
-
34
- full rule text · coding standards · stack configs · the capability catalog · ADRs · examples · any
35
- long procedure. Replace the moved section with a one-line pointer — never inline a catalog or a long
36
- procedure into an entry file.
37
-
38
- ## When an entry file crosses the ceiling
39
-
40
- Move the least-daily section into its matching reference file (or a new one) and leave a one-line
41
- pointer behind. Re-check after every edit that adds to an entry file.
1
+ ---
2
+ updated: 2026-05-31
3
+ description: Keep entry and always-on files lean; push detail to references read on demand.
4
+ ---
5
+
6
+ # 35 — Context economy (keep entry files lean)
7
+
8
+ Entry and always-loaded files are read every session — bloat there taxes every turn (tokens +
9
+ latency). Keep them lean; push detail to reference files reached on demand. This is the whole point
10
+ of the load-order in `AGENTS.md`: start narrow, pull in depth only when the task needs it.
11
+
12
+ How to write any of these docs (lead, voice, structure, versioning): `standards/writing.md`.
13
+
14
+ ## Budget
15
+
16
+ - **Entry files** (`CLAUDE.md`, `.agents/AGENTS.md`, `local/AGENTS.local.md`): target **≤250 lines**,
17
+ **hard ceiling 300**. Line count is a proxy — the real test is *"is every line read most sessions?"*
18
+ - **Each rule / standard file:** one focused topic. If a file grows past its single concern, split it.
19
+ - **Skills / commands:** a skill body loads in full **when invoked** (its name + description load
20
+ cheaply; the body does not, until used). Keep a skill focused, **~200 lines max** — split a larger
21
+ one into sub-skills so unrelated capability is not pulled into context on use.
22
+ - **`journal/memory/MEMORY.md`:** one line per memory; the fact itself lives in its own card.
23
+
24
+ ## What an entry file keeps (and little else)
25
+
26
+ - tone / persona
27
+ - the hardest **always-on** rules (full text lives in `rules/00-always.md`)
28
+ - load order + routing map (where to find everything)
29
+ - pointers to references (`rules/ standards/ stack/ journal/memory/ local/`)
30
+ - precedence / customization note
31
+
32
+ ## What moves out (linked, read on demand)
33
+
34
+ full rule text · coding standards · stack configs · the capability catalog · ADRs · examples · any
35
+ long procedure. Replace the moved section with a one-line pointer — never inline a catalog or a long
36
+ procedure into an entry file.
37
+
38
+ ## When an entry file crosses the ceiling
39
+
40
+ Move the least-daily section into its matching reference file (or a new one) and leave a one-line
41
+ pointer behind. Re-check after every edit that adds to an entry file.
@@ -1,25 +1,25 @@
1
- ---
2
- updated: 2026-05-31
3
- description: 'Route every incoming request to exactly one home: chat, backlog, hotfix, or field-report.'
4
- ---
5
-
6
- # 40 — Handoff routing
7
-
8
- Every incoming chat request routes to exactly one of:
9
-
10
- - **do-now** — single-commit, finishable this session, no ADR needed. No file; just do it and update
11
- `journal/session/current.md`.
12
- - **BACKLOG** — multi-session, needs an ADR, touches schema/architecture, or the user says "add to
13
- backlog". Create a `journal/backlog/<id>.md` item (`status: open`, `priority: normal`).
14
- - **HOTFIX** — production fire in the **code**. Create a `journal/backlog/<id>.md` item (`priority: hotfix`)
15
- with a cleanup checklist, then fix under HOTFIX mode (`20-modes.md`).
16
- - **FIELD-REPORT** — on-site issue whose cause is **environmental** (hardware / OS / network / AV),
17
- not the codebase. Record as a `journal/memory/` `type: field-report`; don't patch code. Grep field-reports
18
- before assuming a code defect.
19
-
20
- Decision rule of thumb:
21
-
22
- > Right-now & small → do-now. Big / needs-a-decision / "later" → BACKLOG. Code on fire → HOTFIX.
23
- > Site/environment on fire → FIELD-REPORT.
24
-
25
- When unsure between do-now and BACKLOG, prefer BACKLOG and confirm scope before building.
1
+ ---
2
+ updated: 2026-05-31
3
+ description: 'Route every incoming request to exactly one home: chat, backlog, hotfix, or field-report.'
4
+ ---
5
+
6
+ # 40 — Handoff routing
7
+
8
+ Every incoming chat request routes to exactly one of:
9
+
10
+ - **do-now** — single-commit, finishable this session, no ADR needed. No file; just do it and update
11
+ `journal/session/current.md`.
12
+ - **BACKLOG** — multi-session, needs an ADR, touches schema/architecture, or the user says "add to
13
+ backlog". Create a `journal/backlog/<id>.md` item (`status: open`, `priority: normal`).
14
+ - **HOTFIX** — production fire in the **code**. Create a `journal/backlog/<id>.md` item (`priority: hotfix`)
15
+ with a cleanup checklist, then fix under HOTFIX mode (`20-modes.md`).
16
+ - **FIELD-REPORT** — on-site issue whose cause is **environmental** (hardware / OS / network / AV),
17
+ not the codebase. Record as a `journal/memory/` `type: field-report`; don't patch code. Grep field-reports
18
+ before assuming a code defect.
19
+
20
+ Decision rule of thumb:
21
+
22
+ > Right-now & small → do-now. Big / needs-a-decision / "later" → BACKLOG. Code on fire → HOTFIX.
23
+ > Site/environment on fire → FIELD-REPORT.
24
+
25
+ When unsure between do-now and BACKLOG, prefer BACKLOG and confirm scope before building.
@@ -1,35 +1,35 @@
1
- ---
2
- updated: 2026-05-31
3
- description: When and how to render human-facing deliverables as HTML instead of long Markdown.
4
- ---
5
-
6
- # 45 — Presentation (HTML for humans)
7
-
8
- Long Markdown gets skimmed. For human-facing deliverables an interactive HTML page communicates
9
- better — tables, side-by-side comparisons, diff annotations, SVG diagrams, toggles. Render with
10
- `/present` (`commands/present.md`).
11
-
12
- ## Toggle (default off)
13
-
14
- - Project default: set in `local/AGENTS.local.md` ("Presentation mode").
15
- - Session override: user says **"html on" / "html off"**. When off, reply in Markdown only.
16
- - Even when on, use HTML for the deliverable types below — not routine replies.
17
-
18
- ## Use HTML for
19
-
20
- spec comparison · code-review dashboard · report / explainer · design prototype · custom editing UI.
21
- (Catalog: `skills/catalog.md` -> Presentation.)
22
-
23
- ## Guardrails
24
-
25
- - **Agent files stay Markdown.** Load-path files an agent parses — `AGENTS.md`, `SKILL.md`, `rules/`,
26
- `standards/`, `tooling.json`, `INDEX.md`, `journal/memory/`, context files — are never rendered as HTML.
27
- HTML is only a human-facing *view* of a deliverable; the agent-readable + git-diffable source is
28
- always Markdown.
29
- - **Source stays canonical.** HTML is an ephemeral *view* generated from the Markdown/spec — never
30
- the source of truth. Durable decisions still land in `docs/`, `journal/memory/`, specs.
31
- - **Self-contained + offline.** One file, inline CSS/JS, no remote `<script>`/CDN.
32
- - **Security.** Escape embedded code/diff/user text; never run untrusted script; no secrets in the page.
33
- - **Ephemeral.** Artifacts live in `journal/session/artifacts/` (gitignored). Don't commit them.
34
- - **Close the loop.** Editing UIs export back as JSON/Markdown so changes re-enter the workflow.
35
- - **Token-aware.** Generating HTML is expensive; reserve it for deliverables that earn it.
1
+ ---
2
+ updated: 2026-05-31
3
+ description: When and how to render human-facing deliverables as HTML instead of long Markdown.
4
+ ---
5
+
6
+ # 45 — Presentation (HTML for humans)
7
+
8
+ Long Markdown gets skimmed. For human-facing deliverables an interactive HTML page communicates
9
+ better — tables, side-by-side comparisons, diff annotations, SVG diagrams, toggles. Render with
10
+ `/present` (`commands/present.md`).
11
+
12
+ ## Toggle (default off)
13
+
14
+ - Project default: set in `local/AGENTS.local.md` ("Presentation mode").
15
+ - Session override: user says **"html on" / "html off"**. When off, reply in Markdown only.
16
+ - Even when on, use HTML for the deliverable types below — not routine replies.
17
+
18
+ ## Use HTML for
19
+
20
+ spec comparison · code-review dashboard · report / explainer · design prototype · custom editing UI.
21
+ (Catalog: `skills/catalog.md` -> Presentation.)
22
+
23
+ ## Guardrails
24
+
25
+ - **Agent files stay Markdown.** Load-path files an agent parses — `AGENTS.md`, `SKILL.md`, `rules/`,
26
+ `standards/`, `tooling.json`, `INDEX.md`, `journal/memory/`, context files — are never rendered as HTML.
27
+ HTML is only a human-facing *view* of a deliverable; the agent-readable + git-diffable source is
28
+ always Markdown.
29
+ - **Source stays canonical.** HTML is an ephemeral *view* generated from the Markdown/spec — never
30
+ the source of truth. Durable decisions still land in `docs/`, `journal/memory/`, specs.
31
+ - **Self-contained + offline.** One file, inline CSS/JS, no remote `<script>`/CDN.
32
+ - **Security.** Escape embedded code/diff/user text; never run untrusted script; no secrets in the page.
33
+ - **Ephemeral.** Artifacts live in `journal/session/artifacts/` (gitignored). Don't commit them.
34
+ - **Close the loop.** Editing UIs export back as JSON/Markdown so changes re-enter the workflow.
35
+ - **Token-aware.** Generating HTML is expensive; reserve it for deliverables that earn it.
@@ -1,30 +1,30 @@
1
- ---
2
- updated: 2026-05-31
3
- description: Server-side authorization, no hardcoded secrets/roles, fail closed.
4
- ---
5
-
6
- # 50 — Security
7
-
8
- - **Permissions via helpers, not literals.** Authorize through a single helper/policy layer.
9
- Never `if (role === "admin")` scattered across the code.
10
- - **Validate + authorize on the server.** Client checks are UX only; the server is the boundary.
11
- Validate every input; reject by default.
12
- - **Fail closed.** On error, missing data, or unknown state → deny, do not allow.
13
- - **Parameterized queries only.** Never string-concatenate SQL or shell. No dynamic `eval`.
14
- - **No secrets in code or logs.** Secrets come from env/secret-store. Never commit them; never log
15
- them. Scrub before logging.
16
- - **Least privilege.** Tokens, DB roles, and API scopes get the minimum needed.
17
- - **Row-level authorization.** Every user row is restricted to its owner (Postgres/Supabase RLS or
18
- an app-layer check). **Default-deny** — zero policies means a wide-open database.
19
- - **Test the abuse paths.** Wrong password, reset for a non-existent email (no user enumeration),
20
- expired session, malformed/oversized input — not just the happy path.
21
- - **Security headers.** Set CSP, HSTS, X-Content-Type-Options, X-Frame-Options, Referrer-Policy.
22
- - **Privacy by default.** Collect the minimum personal data, know where it lives, publish a privacy
23
- policy (GDPR/CCPA/PDPA; PHI → HIPAA).
24
- - **Validate env at startup.** Required env vars are checked at the init boundary with a clear error — never `process.env.X!` at use sites.
25
- - **Secrets at rest.** Desktop/native apps store secrets in the OS keystore (Electron `safeStorage` / OS keychain), never plaintext on disk.
26
- - **Dependencies.** Pin versions; review before adding; prefer the std lib when it suffices.
27
-
28
- **Before launching a user-facing, data-collecting app:** clear `standards/launch-security-checklist.md`
29
- (privacy · row-level authz · abuse-path tests · server validation · headers · OWASP) and run a SAST
30
- scan (`standards/security-scanners.md`). This is part of Definition of Done (`rules/30-verification.md`).
1
+ ---
2
+ updated: 2026-05-31
3
+ description: Server-side authorization, no hardcoded secrets/roles, fail closed.
4
+ ---
5
+
6
+ # 50 — Security
7
+
8
+ - **Permissions via helpers, not literals.** Authorize through a single helper/policy layer.
9
+ Never `if (role === "admin")` scattered across the code.
10
+ - **Validate + authorize on the server.** Client checks are UX only; the server is the boundary.
11
+ Validate every input; reject by default.
12
+ - **Fail closed.** On error, missing data, or unknown state → deny, do not allow.
13
+ - **Parameterized queries only.** Never string-concatenate SQL or shell. No dynamic `eval`.
14
+ - **No secrets in code or logs.** Secrets come from env/secret-store. Never commit them; never log
15
+ them. Scrub before logging.
16
+ - **Least privilege.** Tokens, DB roles, and API scopes get the minimum needed.
17
+ - **Row-level authorization.** Every user row is restricted to its owner (Postgres/Supabase RLS or
18
+ an app-layer check). **Default-deny** — zero policies means a wide-open database.
19
+ - **Test the abuse paths.** Wrong password, reset for a non-existent email (no user enumeration),
20
+ expired session, malformed/oversized input — not just the happy path.
21
+ - **Security headers.** Set CSP, HSTS, X-Content-Type-Options, X-Frame-Options, Referrer-Policy.
22
+ - **Privacy by default.** Collect the minimum personal data, know where it lives, publish a privacy
23
+ policy (GDPR/CCPA/PDPA; PHI → HIPAA).
24
+ - **Validate env at startup.** Required env vars are checked at the init boundary with a clear error — never `process.env.X!` at use sites.
25
+ - **Secrets at rest.** Desktop/native apps store secrets in the OS keystore (Electron `safeStorage` / OS keychain), never plaintext on disk.
26
+ - **Dependencies.** Pin versions; review before adding; prefer the std lib when it suffices.
27
+
28
+ **Before launching a user-facing, data-collecting app:** clear `standards/launch-security-checklist.md`
29
+ (privacy · row-level authz · abuse-path tests · server validation · headers · OWASP) and run a SAST
30
+ scan (`standards/security-scanners.md`). This is part of Definition of Done (`rules/30-verification.md`).