the-grimoire-cli 0.3.2

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 (103) hide show
  1. package/.agents/AGENTS.md +112 -0
  2. package/.agents/NAVIGATOR.md +168 -0
  3. package/.agents/VERSION +4 -0
  4. package/.agents/agents/INDEX.md +7 -0
  5. package/.agents/agents/verifier.md +50 -0
  6. package/.agents/commands/INDEX.md +11 -0
  7. package/.agents/commands/checkpoint.md +15 -0
  8. package/.agents/commands/grimoire.md +14 -0
  9. package/.agents/commands/onboard.md +56 -0
  10. package/.agents/commands/present.md +23 -0
  11. package/.agents/commands/verify.md +20 -0
  12. package/.agents/grimoire.manifest +18 -0
  13. package/.agents/rules/00-always.md +42 -0
  14. package/.agents/rules/05-code-quality.md +28 -0
  15. package/.agents/rules/10-working-process.md +31 -0
  16. package/.agents/rules/15-skills.md +27 -0
  17. package/.agents/rules/20-modes.md +41 -0
  18. package/.agents/rules/25-surgical-changes.md +29 -0
  19. package/.agents/rules/30-verification.md +36 -0
  20. package/.agents/rules/35-context-economy.md +41 -0
  21. package/.agents/rules/40-handoff.md +25 -0
  22. package/.agents/rules/45-presentation.md +35 -0
  23. package/.agents/rules/50-security.md +30 -0
  24. package/.agents/rules/60-commit-style.md +14 -0
  25. package/.agents/rules/INDEX.md +18 -0
  26. package/.agents/skills/INDEX.md +8 -0
  27. package/.agents/skills/README.md +6 -0
  28. package/.agents/skills/catalog.md +106 -0
  29. package/.agents/skills/find-skills/SKILL.md +142 -0
  30. package/.agents/stack/INDEX.md +9 -0
  31. package/.agents/stack/README.md +66 -0
  32. package/.agents/stack/desktop.md +36 -0
  33. package/.agents/stack/library.md +16 -0
  34. package/.agents/stack/web-app.md +32 -0
  35. package/.agents/standards/INDEX.md +23 -0
  36. package/.agents/standards/accessibility.md +50 -0
  37. package/.agents/standards/architecture.md +39 -0
  38. package/.agents/standards/attribution.md +39 -0
  39. package/.agents/standards/clean-code.md +121 -0
  40. package/.agents/standards/codex.md +69 -0
  41. package/.agents/standards/error-codes.md +41 -0
  42. package/.agents/standards/general.md +46 -0
  43. package/.agents/standards/guardrail-tests.md +40 -0
  44. package/.agents/standards/knowledge-management.md +35 -0
  45. package/.agents/standards/launch-security-checklist.md +45 -0
  46. package/.agents/standards/observability.md +35 -0
  47. package/.agents/standards/release-versioning.md +53 -0
  48. package/.agents/standards/requirements.md +75 -0
  49. package/.agents/standards/security-scanners.md +42 -0
  50. package/.agents/standards/testing-strategy.md +61 -0
  51. package/.agents/standards/typescript.md +19 -0
  52. package/.agents/standards/writing.md +58 -0
  53. package/.agents/tooling.json +19 -0
  54. package/LICENSE +21 -0
  55. package/README.md +139 -0
  56. package/bin/grimoire.mjs +598 -0
  57. package/package.json +32 -0
  58. package/templates/CLAUDE.md +7 -0
  59. package/templates/ci/ci.yml +49 -0
  60. package/templates/ci/sast.yml +44 -0
  61. package/templates/codex/INDEX.md +18 -0
  62. package/templates/codex/README.md +28 -0
  63. package/templates/codex/decisions/0000-template.md +36 -0
  64. package/templates/codex/decisions/INDEX.md +11 -0
  65. package/templates/codex/decisions/README.md +25 -0
  66. package/templates/codex/domain/INDEX.md +14 -0
  67. package/templates/codex/domain/README.md +10 -0
  68. package/templates/codex/evidence/0000-extraction-template.md +36 -0
  69. package/templates/codex/evidence/INDEX.md +11 -0
  70. package/templates/codex/evidence/README.md +15 -0
  71. package/templates/codex/reference/INDEX.md +11 -0
  72. package/templates/codex/reference/README.md +15 -0
  73. package/templates/codex/reference/confirmed-values.md +18 -0
  74. package/templates/codex/requirements/INDEX.md +11 -0
  75. package/templates/codex/requirements/README.md +22 -0
  76. package/templates/codex/requirements/addons/0000-template.md +35 -0
  77. package/templates/codex/requirements/base.md +36 -0
  78. package/templates/codex/requirements/changes/0000-template.md +39 -0
  79. package/templates/codex/resources/INDEX.md +11 -0
  80. package/templates/codex/resources/README.md +17 -0
  81. package/templates/codex/resources/manifest.md +11 -0
  82. package/templates/codex/runbooks/INDEX.md +9 -0
  83. package/templates/codex/runbooks/README.md +8 -0
  84. package/templates/codex/runbooks/incident-runbook-template.md +58 -0
  85. package/templates/gitignore-snippet.txt +12 -0
  86. package/templates/journal/backlog/README.md +18 -0
  87. package/templates/journal/backlog/done/.gitkeep +0 -0
  88. package/templates/journal/memory/MEMORY.md +15 -0
  89. package/templates/journal/session/.gitkeep +0 -0
  90. package/templates/journal/session/archive/.gitkeep +1 -0
  91. package/templates/journal/session/artifacts/.gitkeep +1 -0
  92. package/templates/journal/session/current.md +12 -0
  93. package/templates/lint/README.md +25 -0
  94. package/templates/lint/eslint.config.mjs +33 -0
  95. package/templates/lint/tsconfig.base.json +11 -0
  96. package/templates/local/AGENTS.local.md +33 -0
  97. package/templates/local/README.md +55 -0
  98. package/templates/local/commands/.gitkeep +0 -0
  99. package/templates/local/rules/.gitkeep +0 -0
  100. package/templates/local/skills/.gitkeep +0 -0
  101. package/templates/local/stack/.gitkeep +0 -0
  102. package/templates/local/standards/.gitkeep +0 -0
  103. package/templates/tests/guardrail.invariants.test.ts +59 -0
@@ -0,0 +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.
@@ -0,0 +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.
@@ -0,0 +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.
@@ -0,0 +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).
@@ -0,0 +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.
@@ -0,0 +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.
@@ -0,0 +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.
@@ -0,0 +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`).
@@ -0,0 +1,14 @@
1
+ ---
2
+ updated: 2026-05-31
3
+ description: Conventional Commits and the project's commit/PR conventions.
4
+ ---
5
+
6
+ # 60 — Commit style
7
+
8
+ - **Conventional Commits.** `type(scope): subject` — `feat` `fix` `docs` `refactor` `test` `chore`
9
+ `perf` `build` `ci`. Imperative mood, lower-case subject, no trailing period.
10
+ - **One logical change per commit.** Reviewable diffs; no "misc fixes" grab-bags.
11
+ - **Hooks run.** husky + lint-staged on commit. **No `--no-verify`** — the one exception is a
12
+ HOTFIX emergency commit (`20-modes.md`), which must be cleaned up afterward.
13
+ - **Body explains why** when the change is non-obvious. Reference the `journal/backlog/` id or ADR.
14
+ - **Never bypass signing** unless explicitly asked.
@@ -0,0 +1,18 @@
1
+ # rules — 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
+ | `00-always.md` | The non-negotiable rules; violating any is a hard error, not a style nit. |
8
+ | `05-code-quality.md` | Always-on code-quality essentials; the full standard lives in standards/clean-code.md. |
9
+ | `10-working-process.md` | How to work a task end to end: plan, task contract, right altitude, small increments, tools, TDD. |
10
+ | `15-skills.md` | Consult skills/catalog.md and use the right skill/plugin/MCP before improvising. |
11
+ | `20-modes.md` | NORMAL vs HOTFIX: how a user phrase sets the working mode and what each mode requires. |
12
+ | `25-surgical-changes.md` | Touch only what the request needs; do not refactor or "improve" adjacent code. |
13
+ | `30-verification.md` | The independent verifier: the author cannot mark their own work done; verify on fresh context. |
14
+ | `35-context-economy.md` | Keep entry and always-on files lean; push detail to references read on demand. |
15
+ | `40-handoff.md` | Route every incoming request to exactly one home: chat, backlog, hotfix, or field-report. |
16
+ | `45-presentation.md` | When and how to render human-facing deliverables as HTML instead of long Markdown. |
17
+ | `50-security.md` | Server-side authorization, no hardcoded secrets/roles, fail closed. |
18
+ | `60-commit-style.md` | Conventional Commits and the project's commit/PR conventions. |
@@ -0,0 +1,8 @@
1
+ # skills — 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
+ | `catalog.md` | Capability catalog — What to reach for, by trigger. |
8
+ | `find-skills/` | Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that ca… |
@@ -0,0 +1,6 @@
1
+ # skills — reusable, re-runnable workflows
2
+
3
+ Portable skill files (Claude Code `skills/` format) that any project inherits. v0.1 ships the
4
+ verification workflow as a command + subagent (`commands/verify.md`, `agents/verifier.md`) rather
5
+ than a standalone skill. Add skills here as patterns prove reusable across projects; they sync as a
6
+ managed path.
@@ -0,0 +1,106 @@
1
+ # Capability catalog
2
+
3
+ What to reach for, by trigger. **Primary** = default choice. **Alternates** = equivalents when the
4
+ primary is unavailable or you want a second opinion. Anything not here → run `find-skills`.
5
+
6
+ > The mattpocock engineering skills below require `/setup-matt-pocock-skills` once per repo
7
+ > (configures the issue tracker, triage label vocabulary, and doc layout they consume).
8
+ >
9
+ > Bare-named MCPs in this catalog (`context7`, `exa`, `github`) ship **with the `ecc` plugin** —
10
+ > `grimoire bootstrap` enabling `ecc` wires them; they intentionally have no separate `tooling.json`
11
+ > `mcp` entry. Only standalone servers (`playwright`, `stitch`) live in `tooling.json`.
12
+
13
+ ## Process & engineering
14
+
15
+ | When you are… | Primary | Alternates | Layer |
16
+ |---|---|---|---|
17
+ | starting a new feature | `superpowers:brainstorming` | — | skill |
18
+ | aligning before a change | `grill-me` / `grill-with-docs` | — | skill |
19
+ | writing the implementation plan | `superpowers:writing-plans` | `ecc:plan` | skill |
20
+ | writing code test-first | `tdd` | `superpowers:test-driven-development` | skill |
21
+ | chasing a hard bug / perf regression | `diagnose` | `superpowers:systematic-debugging` | skill |
22
+ | improving architecture (ball of mud) | `improve-codebase-architecture` | — | skill |
23
+ | designing a module's layering | `standards/architecture.md` | `improve-codebase-architecture` | doc |
24
+ | production logging / observability | `standards/observability.md` | — | doc |
25
+ | understanding unfamiliar code | `zoom-out` | — | skill |
26
+ | compacting the session for handoff | `handoff` | — | skill |
27
+ | managing work-state / second brain | `standards/knowledge-management.md` | — | doc |
28
+ | throwaway prototype to flesh out a design | `prototype` | — | skill |
29
+ | turning context into a PRD | `to-prd` | `ecc:plan-prd` | skill |
30
+ | breaking a plan into issues | `to-issues` | — | skill |
31
+ | triaging incoming issues | `triage` | — | skill |
32
+ | writing a new skill | `write-a-skill` | `skill-creator` | skill |
33
+ | isolating parallel work | `superpowers:using-git-worktrees` | `superpowers:dispatching-parallel-agents` | skill |
34
+
35
+ ## Review, security, quality
36
+
37
+ | When you are… | Primary | Alternates | Layer |
38
+ |---|---|---|---|
39
+ | reviewing before merge | `ecc:code-review` | `superpowers:requesting-code-review`, `/code-review` | skill |
40
+ | auditing security-sensitive code | `ecc:security-review` | `ecc:security-scan` | skill |
41
+ | gating a launch (privacy + security) | `standards/launch-security-checklist.md` | `ecc:security-review`, SAST (`standards/security-scanners.md`) | doc |
42
+ | confirming work is done | `verifier` (Grimoire) | `superpowers:verification-before-completion` | subagent |
43
+ | cleaning dead code | `ecc:refactor-clean` | — | skill |
44
+ | running the quality gate | `ecc:quality-gate` | — | skill |
45
+ | writing or reviewing code to standard | `standards/clean-code.md` | `templates/lint/` (enforcement) | doc |
46
+ | writing or editing an agent-facing doc | `standards/writing.md` | — | doc |
47
+ | guarding structural invariants (drift) | `standards/guardrail-tests.md` | — | doc |
48
+ | recording a decision (incl. no-test rationale) | `codex/decisions/` (`0000-template.md`) | — | doc |
49
+
50
+ ## Web / Next.js (pharmaceutical-hub)
51
+
52
+ | When you are… | Primary | Alternates | Layer |
53
+ |---|---|---|---|
54
+ | building a React component | `ecc:react-patterns` | `ecc:react-performance` | skill |
55
+ | reviewing React/TSX | `ecc:react-review` | — | skill |
56
+ | writing React tests | `ecc:react-test` | `tdd` | skill |
57
+ | fixing a React/Next build | `ecc:react-build` | `ecc:build-fix` | skill |
58
+ | Next.js / Turbopack specifics | `ecc:nextjs-turbopack` | — | skill |
59
+ | accessibility pass | `ecc:frontend-a11y` | `web-design-guidelines` | skill |
60
+ | designing an API | `ecc:api-design` | `ecc:backend-patterns` | skill |
61
+ | DB schema / queries | `ecc:postgres-patterns` | `ecc:prisma-patterns` | skill |
62
+ | DB migration | `ecc:database-migrations` | — | skill |
63
+
64
+ ## Healthcare (both repos are medical)
65
+
66
+ | When you are… | Primary | Alternates | Layer |
67
+ |---|---|---|---|
68
+ | handling PHI / privacy | `ecc:healthcare-phi-compliance` | `ecc:hipaa-compliance` | skill |
69
+ | EMR/EHR data patterns | `ecc:healthcare-emr-patterns` | — | skill |
70
+ | clinical decision support | `ecc:healthcare-cdss-patterns` | — | skill |
71
+ | evaluating a health-AI feature | `ecc:healthcare-eval-harness` | — | skill |
72
+
73
+ ## Design / UI
74
+
75
+ | When you are… | Primary | Alternates | Layer |
76
+ |---|---|---|---|
77
+ | designing UI/UX | `ui-ux-pro-max` | `andrej-karpathy` | skill |
78
+ | turning a mockup into UI code | `stitch` (MCP) | — | mcp |
79
+
80
+ > **Deprecated — do not use:** `frontend-design` (replaced by `ui-ux-pro-max`).
81
+
82
+ ## Research, docs, MCP
83
+
84
+ | When you are… | Primary | Alternates | Layer |
85
+ |---|---|---|---|
86
+ | researching an unknown topic | `ecc:deep-research` | `exa` (MCP) | skill |
87
+ | looking up a library / API | `context7` (MCP) | `ecc:documentation-lookup` | mcp |
88
+ | browser QA / e2e / visual check | `playwright` (MCP) | `ecc:e2e-testing` | mcp |
89
+ | repo / PR operations | `ecc:pr` | `github` (MCP), `/pr` | skill |
90
+ | need a capability you lack | `find-skills` | — | skill |
91
+
92
+ ## Presentation (HTML for humans)
93
+
94
+ Render with `/present` when presentation mode is on (`rules/45-presentation.md`). HTML is an
95
+ ephemeral view; the Markdown/spec stays canonical.
96
+
97
+ | When you are… | Primary | Alternates | Layer |
98
+ |---|---|---|---|
99
+ | comparing specs / designs side by side | `/present` (HTML) | `superpowers:brainstorming` visual companion | command |
100
+ | presenting a code review to a human | `/present` (HTML dashboard) | `ecc:code-review` | command |
101
+ | writing a report / explainer | `/present` (HTML) | — | command |
102
+ | showing a design prototype | `prototype` | `/present` (HTML) | skill |
103
+ | building a custom editing UI (copy-as-JSON) | `/present` (HTML) | — | command |
104
+ ## Communication
105
+
106
+ `pordee` (Thai-compressed) and `caveman` (terse) are session-level toggles set by the user.
@@ -0,0 +1,142 @@
1
+ ---
2
+ name: find-skills
3
+ description: Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
4
+ ---
5
+
6
+ # Find Skills
7
+
8
+ This skill helps you discover and install skills from the open agent skills ecosystem.
9
+
10
+ ## When to Use This Skill
11
+
12
+ Use this skill when the user:
13
+
14
+ - Asks "how do I do X" where X might be a common task with an existing skill
15
+ - Says "find a skill for X" or "is there a skill for X"
16
+ - Asks "can you do X" where X is a specialized capability
17
+ - Expresses interest in extending agent capabilities
18
+ - Wants to search for tools, templates, or workflows
19
+ - Mentions they wish they had help with a specific domain (design, testing, deployment, etc.)
20
+
21
+ ## What is the Skills CLI?
22
+
23
+ The Skills CLI (`npx skills`) is the package manager for the open agent skills ecosystem. Skills are modular packages that extend agent capabilities with specialized knowledge, workflows, and tools.
24
+
25
+ **Key commands:**
26
+
27
+ - `npx skills find [query]` - Search for skills interactively or by keyword
28
+ - `npx skills add <package>` - Install a skill from GitHub or other sources
29
+ - `npx skills check` - Check for skill updates
30
+ - `npx skills update` - Update all installed skills
31
+
32
+ **Browse skills at:** https://skills.sh/
33
+
34
+ ## How to Help Users Find Skills
35
+
36
+ ### Step 1: Understand What They Need
37
+
38
+ When a user asks for help with something, identify:
39
+
40
+ 1. The domain (e.g., React, testing, design, deployment)
41
+ 2. The specific task (e.g., writing tests, creating animations, reviewing PRs)
42
+ 3. Whether this is a common enough task that a skill likely exists
43
+
44
+ ### Step 2: Check the Leaderboard First
45
+
46
+ Before running a CLI search, check the [skills.sh leaderboard](https://skills.sh/) to see if a well-known skill already exists for the domain. The leaderboard ranks skills by total installs, surfacing the most popular and battle-tested options.
47
+
48
+ For example, top skills for web development include:
49
+ - `vercel-labs/agent-skills` — React, Next.js, web design (100K+ installs each)
50
+ - `anthropics/skills` — Frontend design, document processing (100K+ installs)
51
+
52
+ ### Step 3: Search for Skills
53
+
54
+ If the leaderboard doesn't cover the user's need, run the find command:
55
+
56
+ ```bash
57
+ npx skills find [query]
58
+ ```
59
+
60
+ For example:
61
+
62
+ - User asks "how do I make my React app faster?" → `npx skills find react performance`
63
+ - User asks "can you help me with PR reviews?" → `npx skills find pr review`
64
+ - User asks "I need to create a changelog" → `npx skills find changelog`
65
+
66
+ ### Step 4: Verify Quality Before Recommending
67
+
68
+ **Do not recommend a skill based solely on search results.** Always verify:
69
+
70
+ 1. **Install count** — Prefer skills with 1K+ installs. Be cautious with anything under 100.
71
+ 2. **Source reputation** — Official sources (`vercel-labs`, `anthropics`, `microsoft`) are more trustworthy than unknown authors.
72
+ 3. **GitHub stars** — Check the source repository. A skill from a repo with <100 stars should be treated with skepticism.
73
+
74
+ ### Step 5: Present Options to the User
75
+
76
+ When you find relevant skills, present them to the user with:
77
+
78
+ 1. The skill name and what it does
79
+ 2. The install count and source
80
+ 3. The install command they can run
81
+ 4. A link to learn more at skills.sh
82
+
83
+ Example response:
84
+
85
+ ```
86
+ I found a skill that might help! The "react-best-practices" skill provides
87
+ React and Next.js performance optimization guidelines from Vercel Engineering.
88
+ (185K installs)
89
+
90
+ To install it:
91
+ npx skills add vercel-labs/agent-skills@react-best-practices
92
+
93
+ Learn more: https://skills.sh/vercel-labs/agent-skills/react-best-practices
94
+ ```
95
+
96
+ ### Step 6: Offer to Install
97
+
98
+ If the user wants to proceed, you can install the skill for them:
99
+
100
+ ```bash
101
+ npx skills add <owner/repo@skill> -g -y
102
+ ```
103
+
104
+ The `-g` flag installs globally (user-level) and `-y` skips confirmation prompts.
105
+
106
+ ## Common Skill Categories
107
+
108
+ When searching, consider these common categories:
109
+
110
+ | Category | Example Queries |
111
+ | --------------- | ---------------------------------------- |
112
+ | Web Development | react, nextjs, typescript, css, tailwind |
113
+ | Testing | testing, jest, playwright, e2e |
114
+ | DevOps | deploy, docker, kubernetes, ci-cd |
115
+ | Documentation | docs, readme, changelog, api-docs |
116
+ | Code Quality | review, lint, refactor, best-practices |
117
+ | Design | ui, ux, design-system, accessibility |
118
+ | Productivity | workflow, automation, git |
119
+
120
+ ## Tips for Effective Searches
121
+
122
+ 1. **Use specific keywords**: "react testing" is better than just "testing"
123
+ 2. **Try alternative terms**: If "deploy" doesn't work, try "deployment" or "ci-cd"
124
+ 3. **Check popular sources**: Many skills come from `vercel-labs/agent-skills` or `ComposioHQ/awesome-claude-skills`
125
+
126
+ ## When No Skills Are Found
127
+
128
+ If no relevant skills exist:
129
+
130
+ 1. Acknowledge that no existing skill was found
131
+ 2. Offer to help with the task directly using your general capabilities
132
+ 3. Suggest the user could create their own skill with `npx skills init`
133
+
134
+ Example:
135
+
136
+ ```
137
+ I searched for skills related to "xyz" but didn't find any matches.
138
+ I can still help you with this task directly! Would you like me to proceed?
139
+
140
+ If this is something you do often, you could create your own skill:
141
+ npx skills init my-xyz-skill
142
+ ```
@@ -0,0 +1,9 @@
1
+ # stack — 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
+ | `desktop.md` | Profile: desktop — Default for Electron / desktop apps (harvested from ever-sync-adapter). |
8
+ | `library.md` | Profile: library — Default for published or internal reusable packages. |
9
+ | `web-app.md` | Profile: web-app — Default for full-stack / front-end web projects. |
@@ -0,0 +1,66 @@
1
+ # Stack — tech-stack presets
2
+
3
+ A **profile** pins the framework, lint/format, test setup, and CI scaffold for a project type.
4
+ Pick one at `init`; record the active profile in `local/AGENTS.local.md`.
5
+
6
+ ## Profiles (v0.1 starter set)
7
+
8
+ - `web-app.md` — full-stack / front-end web.
9
+ - `desktop.md` — Electron / desktop app.
10
+ - `library.md` — published or internal reusable package.
11
+
12
+ ## Testing-policy knob (per profile, project chooses — not hardcoded)
13
+
14
+ | Policy | Meaning |
15
+ |---|---|
16
+ | `tdd-mandatory` | Red-green-refactor required before merge (ever-sync style). |
17
+ | `test-ready-deferred` | Test harness wired; tests written as features stabilize (pharma style). |
18
+ | `none` | No automated tests (spikes/throwaway only). **Requires a recorded ADR** (`codex/decisions/`) — see `rules/00-always.md` "No silent test gaps". |
19
+
20
+ ## The `verify` script
21
+
22
+ Every profile defines a `verify` command — the single gate the **verifier** runs
23
+ (`rules/30-verification.md`):
24
+
25
+ ```
26
+ verify = typecheck + lint + test + coverage + format:check
27
+ ```
28
+
29
+ Wire it as a package script (`npm run verify`) so it is one command everywhere. The verifier runs it
30
+ and quotes the real output; "looks good" is never acceptable.
31
+
32
+ ## Knowledge retrieval — graphify (ADR 0006)
33
+
34
+ Grimoire does **not** ship a homegrown retrieval engine. Searching the codebase (and `codex/`) is
35
+ delegated to **graphify**, a code+docs knowledge graph. The base prescribes the convention; install is
36
+ per-machine.
37
+
38
+ - **Install** (one-time, per machine): `uv tool install graphifyy` then `graphify install`.
39
+ - **Build / refresh** the graph for a repo: `graphify .` (PowerShell: no leading slash). Code is
40
+ extracted locally via AST (free, no API); docs/PDFs use the IDE session model (no separate key).
41
+ `graphify hook install` rebuilds the code graph on every commit (AST only, free).
42
+ - **Query-first**: prefer `graphify query "<question>"` / `graphify path A B` / `graphify explain X`
43
+ over grepping raw files or reading the whole report — it is the cheaper, structured path.
44
+ - **Commit policy**: `graphify-out/` is committed so the team shares one map; local-only artifacts
45
+ (`cost.json`, `cache/`, `.graphify_python`) are gitignored (`templates/gitignore-snippet.txt`).
46
+ - **`codex/` is the source of truth** graphify indexes — content vs retrieval stay separate.
47
+
48
+ Optional personal layer (not a base dependency): **obsidian-wiki** maintains a cross-project Obsidian
49
+ vault via the coding agent (Karpathy LLM-Wiki). Install it in your global agent skills, never in the
50
+ managed contract.
51
+
52
+ ## Laziness enforcement — ponytail (ADR 0007)
53
+
54
+ The **principle** lives in the contract: `standards/clean-code.md` owns the ladder, the "never
55
+ simplify away" guardrail, and the `ponytail:` shortcut marker — tool-agnostic, every agent gets it.
56
+ **Enforcement automation** is delegated to the **ponytail** plugin (skill-capable hosts: Claude Code,
57
+ Codex, OpenCode, Gemini, pi); install is per-machine, optional.
58
+
59
+ - **Install** (Claude Code): `/plugin marketplace add DietrichGebert/ponytail` then
60
+ `/plugin install ponytail@ponytail`. Other hosts: see the ponytail README.
61
+ - **`/ponytail-review`** — review the current diff for over-engineering; hands back a delete-list.
62
+ - **`/ponytail-audit`** — same, whole repo instead of the diff.
63
+ - **`/ponytail-debt`** — harvest the `ponytail:` shortcut markers into a ledger so "later" isn't
64
+ "never". This is why the marker token in `clean-code.md` is literally `ponytail:`.
65
+ - Without the plugin the principle still holds (the marker is self-documenting); you just lose the
66
+ automated harvest/review.