@kiwidata/grimoire 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +56 -4
- package/README.md +107 -59
- package/dist/cli/index.js +7 -7
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/check.js +1 -1
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/configure.d.ts +3 -0
- package/dist/commands/configure.d.ts.map +1 -0
- package/dist/commands/configure.js +19 -0
- package/dist/commands/configure.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +2 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/core/check.d.ts.map +1 -1
- package/dist/core/check.js +165 -111
- package/dist/core/check.js.map +1 -1
- package/dist/core/ci.d.ts.map +1 -1
- package/dist/core/ci.js +50 -69
- package/dist/core/ci.js.map +1 -1
- package/dist/core/configure.d.ts +14 -0
- package/dist/core/configure.d.ts.map +1 -0
- package/dist/core/configure.js +434 -0
- package/dist/core/configure.js.map +1 -0
- package/dist/core/detect.d.ts.map +1 -1
- package/dist/core/detect.js +153 -26
- package/dist/core/detect.js.map +1 -1
- package/dist/core/diff.d.ts.map +1 -1
- package/dist/core/diff.js +62 -93
- package/dist/core/diff.js.map +1 -1
- package/dist/core/doc-style.d.ts +0 -4
- package/dist/core/doc-style.d.ts.map +1 -1
- package/dist/core/doc-style.js +103 -22
- package/dist/core/doc-style.js.map +1 -1
- package/dist/core/docs.js +202 -170
- package/dist/core/docs.js.map +1 -1
- package/dist/core/health.d.ts +6 -0
- package/dist/core/health.d.ts.map +1 -1
- package/dist/core/health.js +133 -96
- package/dist/core/health.js.map +1 -1
- package/dist/core/hooks.d.ts +0 -3
- package/dist/core/hooks.d.ts.map +1 -1
- package/dist/core/hooks.js +11 -16
- package/dist/core/hooks.js.map +1 -1
- package/dist/core/init.d.ts +2 -0
- package/dist/core/init.d.ts.map +1 -1
- package/dist/core/init.js +230 -406
- package/dist/core/init.js.map +1 -1
- package/dist/core/list.d.ts.map +1 -1
- package/dist/core/list.js +55 -65
- package/dist/core/list.js.map +1 -1
- package/dist/core/risk-register.d.ts +17 -0
- package/dist/core/risk-register.d.ts.map +1 -0
- package/dist/core/risk-register.js +73 -0
- package/dist/core/risk-register.js.map +1 -0
- package/dist/core/shared-setup.d.ts +0 -40
- package/dist/core/shared-setup.d.ts.map +1 -1
- package/dist/core/shared-setup.js +92 -56
- package/dist/core/shared-setup.js.map +1 -1
- package/dist/core/status.d.ts.map +1 -1
- package/dist/core/status.js +42 -52
- package/dist/core/status.js.map +1 -1
- package/dist/core/test-quality.d.ts +0 -8
- package/dist/core/test-quality.d.ts.map +1 -1
- package/dist/core/test-quality.js +24 -30
- package/dist/core/test-quality.js.map +1 -1
- package/dist/core/trace.d.ts.map +1 -1
- package/dist/core/trace.js +67 -75
- package/dist/core/trace.js.map +1 -1
- package/dist/core/update.d.ts.map +1 -1
- package/dist/core/update.js +61 -11
- package/dist/core/update.js.map +1 -1
- package/dist/core/validate.d.ts +1 -4
- package/dist/core/validate.d.ts.map +1 -1
- package/dist/core/validate.js +126 -148
- package/dist/core/validate.js.map +1 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -3
- package/dist/index.js.map +1 -1
- package/dist/utils/config.d.ts +15 -5
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +63 -42
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/fs.d.ts +0 -12
- package/dist/utils/fs.d.ts.map +1 -1
- package/dist/utils/fs.js +0 -12
- package/dist/utils/fs.js.map +1 -1
- package/dist/utils/paths.d.ts +0 -6
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +0 -6
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/spawn.d.ts +0 -3
- package/dist/utils/spawn.d.ts.map +1 -1
- package/dist/utils/spawn.js +0 -3
- package/dist/utils/spawn.js.map +1 -1
- package/package.json +1 -1
- package/skills/grimoire-apply/SKILL.md +89 -25
- package/skills/grimoire-audit/SKILL.md +21 -1
- package/skills/grimoire-bug/SKILL.md +48 -9
- package/skills/grimoire-commit/SKILL.md +3 -2
- package/skills/grimoire-design/SKILL.md +259 -0
- package/skills/grimoire-design-consult/SKILL.md +200 -0
- package/skills/grimoire-discover/SKILL.md +139 -109
- package/skills/grimoire-draft/SKILL.md +131 -15
- package/skills/grimoire-plan/SKILL.md +119 -46
- package/skills/grimoire-pr/SKILL.md +7 -10
- package/skills/grimoire-pr-review/SKILL.md +46 -115
- package/skills/grimoire-precommit-review/SKILL.md +205 -0
- package/skills/grimoire-refactor/SKILL.md +6 -6
- package/skills/grimoire-review/SKILL.md +95 -156
- package/skills/grimoire-verify/SKILL.md +40 -7
- package/skills/grimoire-vuln-remediate/SKILL.md +107 -0
- package/skills/grimoire-vuln-triage/SKILL.md +109 -0
- package/skills/references/adversarial-personas.md +225 -0
- package/skills/references/brand-tokens-format.md +186 -0
- package/skills/references/code-quality.md +172 -0
- package/skills/references/container-scan-triage.md +102 -0
- package/skills/references/dependency-vuln-triage.md +236 -0
- package/skills/references/design-heuristics.md +138 -0
- package/skills/references/design-input-formats.md +190 -0
- package/skills/references/pattern-guard.md +180 -0
- package/skills/references/principles.md +82 -0
- package/skills/references/refactor-scan-categories.md +154 -2
- package/skills/references/review-personas.md +406 -0
- package/skills/references/security-compliance.md +22 -1
- package/skills/references/testing-contracts.md +1 -1
- package/skills/references/visual-fidelity.md +206 -0
- package/templates/accepted-risks.yml +47 -0
- package/templates/brand-tokens-example.json +13 -0
- package/templates/brand-voice-example.md +22 -0
- package/templates/constraints.md +25 -0
- package/templates/design-tool-setup-stub.md +59 -0
- package/dist/commands/archive.d.ts +0 -3
- package/dist/commands/archive.d.ts.map +0 -1
- package/dist/commands/archive.js +0 -22
- package/dist/commands/archive.js.map +0 -1
- package/dist/commands/log.d.ts +0 -3
- package/dist/commands/log.d.ts.map +0 -1
- package/dist/commands/log.js +0 -15
- package/dist/commands/log.js.map +0 -1
- package/dist/commands/map.d.ts +0 -3
- package/dist/commands/map.d.ts.map +0 -1
- package/dist/commands/map.js +0 -17
- package/dist/commands/map.js.map +0 -1
- package/dist/core/archive.d.ts +0 -9
- package/dist/core/archive.d.ts.map +0 -1
- package/dist/core/archive.js +0 -92
- package/dist/core/archive.js.map +0 -1
- package/dist/core/log.d.ts +0 -8
- package/dist/core/log.d.ts.map +0 -1
- package/dist/core/log.js +0 -150
- package/dist/core/log.js.map +0 -1
- package/dist/core/map.d.ts +0 -9
- package/dist/core/map.d.ts.map +0 -1
- package/dist/core/map.js +0 -302
- package/dist/core/map.js.map +0 -1
- package/templates/dupignore +0 -93
- package/templates/mapignore +0 -58
- package/templates/mapkeys +0 -65
package/AGENTS.md
CHANGED
|
@@ -24,6 +24,43 @@ These principles govern all grimoire work — drafting, planning, reviewing, and
|
|
|
24
24
|
|
|
25
25
|
**Verify before using.** Before importing a module, calling a function, or adding a dependency — confirm it exists. Check `.grimoire/docs/<area>.md` for reusable code with exact paths. Check `.grimoire/docs/data/schema.yml` for real model fields and API endpoints. If you haven't read the file you're importing from, read it (or its area doc) first. Never guess at package names, function signatures, or API paths.
|
|
26
26
|
|
|
27
|
+
## Anti-Loop Protocol
|
|
28
|
+
|
|
29
|
+
Applies everywhere: writing code, running tests, fixing checks, editing files. These rules exist because loops are expensive — each iteration burns context and time, and the later iterations are usually worse than just stopping.
|
|
30
|
+
|
|
31
|
+
### Attempt budget: 3
|
|
32
|
+
|
|
33
|
+
Count attempts per discrete problem (one failing test, one failing check, one broken script). After 3 failed attempts:
|
|
34
|
+
|
|
35
|
+
1. **Stop.** Do not attempt #4.
|
|
36
|
+
2. **Diagnose.** State the pattern: what you tried each time, what failed each time, what's different and what's the same.
|
|
37
|
+
3. **Escalate.** Present the diagnosis to the user and ask how to proceed. Don't silently switch to a different approach without saying so.
|
|
38
|
+
|
|
39
|
+
A "different attempt" means a fundamentally different approach — not the same fix with minor tweaks. If attempt 2 makes the same type of change as attempt 1, it counts as the same attempt.
|
|
40
|
+
|
|
41
|
+
### Change approach after 2 failures of the same type
|
|
42
|
+
|
|
43
|
+
If the second failure looks like the first failure (same error class, same location, same check), the approach is wrong — not the implementation. Don't attempt a third narrow fix. Step back and ask: is the whole approach wrong? Is there a simpler path?
|
|
44
|
+
|
|
45
|
+
Examples:
|
|
46
|
+
- Two shell scripts with portability bugs → stop writing scripts, use prose or build into the tool
|
|
47
|
+
- Two attempts to fix the same failing test → reread the test and the code together, don't just tweak values
|
|
48
|
+
- Two check failures on the same file → run the check manually and read the full output before editing
|
|
49
|
+
|
|
50
|
+
### Pre-validate before acting
|
|
51
|
+
|
|
52
|
+
Don't use side-effect actions (commits, test runs, check runs) as the primary validator. Validate first, then act.
|
|
53
|
+
|
|
54
|
+
- Shell scripts: run against the actual codebase before embedding in any file
|
|
55
|
+
- Commits: run `grimoire check <step>` manually, fix all issues, then commit once
|
|
56
|
+
- Code: read the function you're calling before calling it — don't rely on the compiler or test runner to catch typos in function names
|
|
57
|
+
|
|
58
|
+
### Diagnose before fixing
|
|
59
|
+
|
|
60
|
+
After any failure, state what you observe before proposing a fix. One sentence: what failed, where, and why. If you can't state the why, you're not ready to fix it.
|
|
61
|
+
|
|
62
|
+
This applies especially to test failures. "The test failed" is not a diagnosis. "The test expected `302` but got `200` because the redirect middleware isn't registered in the test client" is.
|
|
63
|
+
|
|
27
64
|
## When to Use Grimoire
|
|
28
65
|
|
|
29
66
|
Use grimoire when the user's request involves:
|
|
@@ -94,10 +131,9 @@ User has a request
|
|
|
94
131
|
│
|
|
95
132
|
├─ "Setting up grimoire on an existing project"
|
|
96
133
|
│ 1. `grimoire init` → creates .grimoire/ directory and config
|
|
97
|
-
│ 2.
|
|
98
|
-
│ 3. `/grimoire:
|
|
99
|
-
│ 4. `/grimoire:
|
|
100
|
-
│ 5. Start working: `/grimoire:draft` for new changes, `/grimoire:bug` for fixes
|
|
134
|
+
│ 2. `/grimoire:discover` → generates conventions files, data schema, project context (requires codebase-memory-mcp)
|
|
135
|
+
│ 3. `/grimoire:audit` → discovers undocumented features and decisions
|
|
136
|
+
│ 4. Start working: `/grimoire:draft` for new changes, `/grimoire:bug` for fixes
|
|
101
137
|
│
|
|
102
138
|
└─ "Setting up grimoire on a new/greenfield project"
|
|
103
139
|
1. `grimoire init` → creates .grimoire/ directory and config
|
|
@@ -215,3 +251,19 @@ This is what makes `grimoire trace` and `grimoire log` work. Without it, the com
|
|
|
215
251
|
|
|
216
252
|
### Step Definitions
|
|
217
253
|
Organize by **domain concept**, NOT by feature file. Check the project's existing test setup and match its BDD framework conventions. See the active skill's testing reference for ecosystem-specific patterns.
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
<!-- GRIMOIRE:START -->
|
|
257
|
+
## Caveman Mode
|
|
258
|
+
|
|
259
|
+
Respond terse like smart caveman at **lite** intensity. All technical substance stay. Only fluff die.
|
|
260
|
+
|
|
261
|
+
Rules: No filler/hedging. Keep articles + full sentences. Professional but tight.
|
|
262
|
+
|
|
263
|
+
Auto-clarity exception: revert to normal for security warnings, irreversible action confirmations, and multi-step sequences where fragments risk misread.
|
|
264
|
+
|
|
265
|
+
Boundaries: code, commits, PRs written normally. Stop with "stop caveman" or "normal mode".
|
|
266
|
+
|
|
267
|
+
<!-- caveman:lite — based on github.com/JuliusBrussee/caveman -->
|
|
268
|
+
|
|
269
|
+
<!-- GRIMOIRE:END -->
|
package/README.md
CHANGED
|
@@ -15,10 +15,10 @@ The software industry spent decades learning hard lessons about building reliabl
|
|
|
15
15
|
|
|
16
16
|
Grimoire adds the missing discipline:
|
|
17
17
|
|
|
18
|
-
- **
|
|
18
|
+
- **One home per fact** — actor-observable behavior is a Gherkin `.feature`; security/NFR/observability invariants are a constraints register; trade-offs are MADR decisions; data is a schema; code structure is the live graph. No fact lives in two places.
|
|
19
19
|
- **Plans before implementation** — concrete task lists with exact file paths, not "implement the feature"
|
|
20
|
-
- **Tests that actually test** —
|
|
21
|
-
- **Codebase knowledge without exploration** — area docs
|
|
20
|
+
- **Tests that actually test** — test-first discipline at the right level (red-green BDD for behavior, unit tests for invariants) with assertion quality checks
|
|
21
|
+
- **Codebase knowledge without exploration** — intent-focused area docs + data schemas, with live structure (symbols, call graphs, reusable code) from codebase-memory-mcp so the AI doesn't waste context reading files
|
|
22
22
|
- **Full audit trail** — every commit traces back to a requirement via git trailers
|
|
23
23
|
- **Architecture decisions on record** — MADR decision records so the AI doesn't re-litigate choices
|
|
24
24
|
|
|
@@ -31,7 +31,7 @@ npm install -g @kiwidata/grimoire
|
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
<details>
|
|
34
|
-
<summary>Install from source</summary>
|
|
34
|
+
<summary>Install from source (contributors / development only)</summary>
|
|
35
35
|
|
|
36
36
|
Requires Node.js 20+ and git.
|
|
37
37
|
|
|
@@ -41,7 +41,7 @@ cd grimoire
|
|
|
41
41
|
npm install
|
|
42
42
|
npm run build
|
|
43
43
|
npm link # makes `grimoire` available globally
|
|
44
|
-
grimoire --version # should print
|
|
44
|
+
grimoire --version # should print the installed version
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
To update after pulling new changes:
|
|
@@ -64,7 +64,8 @@ To unlink: `npm unlink -g @kiwidata/grimoire`
|
|
|
64
64
|
```bash
|
|
65
65
|
cd my-project
|
|
66
66
|
grimoire init # Auto-detect tools, configure checks, install skills
|
|
67
|
-
|
|
67
|
+
# Structure comes from codebase-memory-mcp (live). Run /grimoire:discover
|
|
68
|
+
# once to generate intent-focused area docs + data schema.
|
|
68
69
|
```
|
|
69
70
|
|
|
70
71
|
Then talk to your AI assistant:
|
|
@@ -73,14 +74,15 @@ Then talk to your AI assistant:
|
|
|
73
74
|
You: "Users should be able to log in with 2FA"
|
|
74
75
|
|
|
75
76
|
→ /grimoire:draft Creates login.feature with Given/When/Then scenarios
|
|
76
|
-
→ /grimoire:plan Generates tasks: write
|
|
77
|
-
→ /grimoire:review (optional) Product, security,
|
|
78
|
-
→ /grimoire:apply Implements
|
|
77
|
+
→ /grimoire:plan Generates tasks: write the test, then production code
|
|
78
|
+
→ /grimoire:review (optional) Product, security, engineering + principles review
|
|
79
|
+
→ /grimoire:apply Implements test-first (BDD for behavior, unit for invariants)
|
|
79
80
|
→ /grimoire:verify Confirms all scenarios pass, no regressions
|
|
80
|
-
→ grimoire archive Syncs to baseline, archives manifest
|
|
81
81
|
→ grimoire pr Generates PR description from artifacts
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
+
Artifacts are edited **live on a feature branch** — `git diff` is the staging area. There is no copy-into-change-folder and no promote step.
|
|
85
|
+
|
|
84
86
|
<details>
|
|
85
87
|
<summary>What <code>grimoire init</code> creates</summary>
|
|
86
88
|
|
|
@@ -88,7 +90,7 @@ Interactive setup that auto-detects your project's tools and asks preferences fo
|
|
|
88
90
|
|
|
89
91
|
- `AGENTS.md` — workflow instructions read by AI coding assistants
|
|
90
92
|
- `.grimoire/config.yaml` — tool configuration and check pipeline
|
|
91
|
-
- `.grimoire/` — decisions, docs, change tracking
|
|
93
|
+
- `.grimoire/` — decisions, docs (area docs + `constraints.md` register), and change tracking
|
|
92
94
|
- `features/` — where Gherkin specs live
|
|
93
95
|
- `.claude/skills/` — Claude Code skill definitions (ignored by other agents)
|
|
94
96
|
- `.git/hooks/pre-commit` — runs `grimoire check` before commits
|
|
@@ -101,43 +103,49 @@ Use `grimoire init --no-detect` to skip interactive tool detection. Most unconfi
|
|
|
101
103
|
|
|
102
104
|
### 1. Draft — Define what you're building
|
|
103
105
|
|
|
104
|
-
Grimoire routes your request to
|
|
106
|
+
Grimoire routes your request to its one correct home (an admission test keeps each artifact type clean):
|
|
105
107
|
|
|
106
|
-
- **"Users should be able to log in with 2FA"** → Gherkin feature
|
|
108
|
+
- **"Users should be able to log in with 2FA"** (external actor, observable) → Gherkin feature
|
|
109
|
+
- **"Logs must never contain PII"** (an invariant, no actor) → `constraints.md` register, **not** a `.feature`
|
|
107
110
|
- **"We should use PostgreSQL instead of MySQL"** → MADR decision record
|
|
108
111
|
- **"The login page is broken"** → `/grimoire:bug` (reproduce first, then fix)
|
|
109
112
|
- **"A tester found a problem"** → `/grimoire:bug-report` → `/grimoire:bug-triage` → routed fix
|
|
110
113
|
|
|
111
|
-
Produces `.feature` files (with security tags like `@security`, `@auth`, `@pii`, `@pci-dss` when applicable), decision records, `data.yml` for schema changes, and a manifest tracking the change.
|
|
114
|
+
A `.feature` is allowed only if it has an external actor, is observable without reading code/logs, uses domain language, and survives a reimplementation. Security controls, NFRs, and observability guarantees are invariants → they live in the constraints register. Produces `.feature` files (with security tags like `@security`, `@auth`, `@pii`, `@pci-dss` when applicable), constraint entries, decision records, `data.yml` for schema changes, and a manifest tracking the change.
|
|
112
115
|
|
|
113
116
|
### 2. Plan — Generate concrete tasks
|
|
114
117
|
|
|
115
118
|
Every scenario becomes a pair: write the step definition (test), then write the production code. Tasks reference exact file paths, exact assertions, and real patterns from area docs. Data changes (models, migrations) are ordered before feature code.
|
|
116
119
|
|
|
117
|
-
The plan skill reads
|
|
120
|
+
The plan skill reads area docs for conventions and boundaries, and queries the code graph for reusable utilities and exact symbols — so the AI plans with real codebase knowledge, not guesses. Each task is tagged with its verification level: `scenario` (behavior), `unit-invariant` (a constraint), or `characterization` (internal/refactor).
|
|
118
121
|
|
|
119
122
|
### 3. Review — Multi-perspective design review (optional)
|
|
120
123
|
|
|
121
|
-
|
|
124
|
+
Personas validate the change before any code is written:
|
|
122
125
|
|
|
123
126
|
- **Product manager** — completeness, missing edge cases, unclear requirements
|
|
124
127
|
- **Senior engineer** — simplicity, code reuse, architecture fit, task quality
|
|
125
128
|
- **Security engineer** — STRIDE threat analysis, OWASP Top 10 / CWE classification, compliance verification (PCI-DSS, HIPAA, GDPR, SOC2 when configured), input validation, auth boundaries, vulnerable dependencies, secrets
|
|
126
129
|
- **QA engineer** — testability, negative scenarios, edge cases, observability, regression risk
|
|
127
130
|
- **Data engineer** — schema design, migration safety, index coverage (when `data.yml` present)
|
|
131
|
+
- **Principles auditor** — flags duplicate homes (DRY), second ways to do a thing (one right way), reinvented wheels, speculative complexity (KISS), and any `.feature` that is really a constraint
|
|
128
132
|
|
|
129
133
|
Issues flagged as **blocker** or **suggestion**. Security findings tagged with OWASP category and CWE ID. Skip for small/low-risk changes.
|
|
130
134
|
|
|
131
|
-
### 4. Apply — Build
|
|
135
|
+
### 4. Apply — Build test-first at the right level
|
|
136
|
+
|
|
137
|
+
Red-green discipline stays; the test *vehicle* matches the task's `verify:` tag — a Gherkin step definition for `scenario` tasks, a unit/integration test for `unit-invariant` and `characterization` tasks. (No `.feature` is forced onto a constraint or an internal change — that's what filled feature files with slop.)
|
|
132
138
|
|
|
133
139
|
For each task:
|
|
134
|
-
1. Write the
|
|
140
|
+
1. Write the failing test at the task's level
|
|
135
141
|
2. Run it — **must fail** (red). A test that passes immediately is broken.
|
|
136
142
|
3. Write production code
|
|
137
143
|
4. Run it — **must pass** (green)
|
|
138
144
|
5. Test quality check — verify strong assertions, not `assert True`
|
|
139
145
|
6. Mark done, move to next task
|
|
140
146
|
|
|
147
|
+
Artifacts are edited **live on the feature branch** the whole time — no promote step. Finalize just flips decision status to `accepted` and removes the ephemeral change folder.
|
|
148
|
+
|
|
141
149
|
**Session management:** Each task (or group of 2-3) runs in a fresh subagent to avoid context bloat. `tasks.md` is the coordination mechanism — if the session is interrupted, the next agent picks up where you left off.
|
|
142
150
|
|
|
143
151
|
**Stuck detection:** After 3 failed attempts with different approaches on a single task, the agent stops and asks for help instead of looping.
|
|
@@ -151,11 +159,23 @@ For each task:
|
|
|
151
159
|
- **Security compliance** — verifies plan-stage security patterns were followed (parameterized queries, bcrypt, no hardcoded secrets), checks review blockers were addressed, runs OWASP Top 10 surface scan on the diff, validates security-tagged scenarios (`@security`, `@auth`, `@pii`, `@pci-dss`, etc.)
|
|
152
160
|
- **Dead features** — specs that exist but code no longer implements
|
|
153
161
|
|
|
154
|
-
### 6. PR
|
|
162
|
+
### 6. PR
|
|
163
|
+
|
|
164
|
+
`grimoire pr` generates a PR description from the branch diff, features, decisions, and task progress. Optional `--review` runs an LLM review of the actual diff. `--create` creates via `gh` or `glab`.
|
|
165
|
+
|
|
166
|
+
There is no archive step. Features, decisions, constraints, and schema were edited live on the branch; the PR diff *is* the change, and git history + the `Change: <id>` commit trailer are the record.
|
|
155
167
|
|
|
156
|
-
|
|
168
|
+
## For UI/UX designers
|
|
157
169
|
|
|
158
|
-
|
|
170
|
+
Grimoire treats design as a first-class spec input, not an afterthought.
|
|
171
|
+
|
|
172
|
+
- **Brand capture at init** — `grimoire init` offers to capture colors, type, spacing, and voice into `.grimoire/brand/` (DTCG tokens). Skip-able; can be added later via `grimoire-design --capture-brand`.
|
|
173
|
+
- **Consult (optional)** — `/grimoire:design-consult` runs a pre-design Q&A. Security and data personas interview the designer about the proposed change *before* any artifacts exist, surfacing assumptions and constraints early. No findings, no blockers — just questions whose answers will shape the design.
|
|
174
|
+
- **Design** — `/grimoire:design` walks: problem statement → user flow & pain points → variants (Figma MCP, static HTML, or ASCII) → required component states (default/loading/empty/error) → proposed Gherkin scenarios for each (component × state).
|
|
175
|
+
- **Handoff** — accepted scenarios feed `/grimoire:draft` (manifest + ADRs), then `/grimoire:plan` (tasks), then `/grimoire:review` — **mandatory at complexity 4** with surface-conditional adversarial personas (keyboard, screen-reader, contrast on web; touch + gesture on mobile; keyboard-only on TUI).
|
|
176
|
+
- **Revision** — `/grimoire:design --revise` re-enters an existing design without restarting. Shows current variants and Gherkin, asks what to change, regenerates only the affected artifacts. Previously-accepted scenarios are not overwritten without confirmation.
|
|
177
|
+
|
|
178
|
+
Brand-drift lint (`grimoire-design --lint`) cross-references hardcoded colors / px / fonts against `.grimoire/brand/tokens.json` and suggests token replacements. Wired into precommit-review when tokens exist.
|
|
159
179
|
|
|
160
180
|
## Walkthrough
|
|
161
181
|
|
|
@@ -298,17 +318,16 @@ The AI runs `/grimoire:verify`:
|
|
|
298
318
|
## Suggestions
|
|
299
319
|
- Consider adding a rate-limiting scenario for repeated failed TOTP attempts
|
|
300
320
|
|
|
301
|
-
Recommendation: Ready to
|
|
321
|
+
Recommendation: Ready to commit and open a PR.
|
|
302
322
|
```
|
|
303
323
|
|
|
304
|
-
### PR
|
|
324
|
+
### PR
|
|
305
325
|
|
|
306
326
|
```bash
|
|
307
327
|
grimoire pr --create # Creates PR via gh with full description
|
|
308
|
-
grimoire archive add-2fa-login # Syncs features, accepts decision, archives manifest
|
|
309
328
|
```
|
|
310
329
|
|
|
311
|
-
The feature
|
|
330
|
+
The feature file was edited live at `features/auth/login.feature` on the branch; the decision is live at `.grimoire/decisions/0003-totp-library.md` with status flipped to `accepted` at finalize; the ephemeral change folder was removed. The PR diff is the change — there's no archive step.
|
|
312
331
|
|
|
313
332
|
`grimoire trace src/views/auth.py:42` now shows: commit `abc123` → Change: `add-2fa-login` → features: `auth/login.feature` → decision: `0003-totp-library.md`.
|
|
314
333
|
|
|
@@ -384,7 +403,7 @@ Skill also drafts the missing scenario into `features/checkout/place-order.featu
|
|
|
384
403
|
- [ ] No regression in existing checkout suite
|
|
385
404
|
```
|
|
386
405
|
|
|
387
|
-
Commit trailer: `Bug: 0042-place-order-timeout`. Tester runs through the checklist, marks complete, and the bug
|
|
406
|
+
Commit trailer: `Bug: 0042-place-order-timeout`. Tester runs through the checklist, marks complete, and the bug closes alongside the change when the PR merges.
|
|
388
407
|
|
|
389
408
|
</details>
|
|
390
409
|
|
|
@@ -422,13 +441,15 @@ Grimoire owns the **inner loop** — the Dev and Sec portions of DevSecOps. Ops
|
|
|
422
441
|
| Requirements engineering | Gherkin specs as executable acceptance tests | Draft skill |
|
|
423
442
|
| Architecture decisions | MADR records with cost-of-ownership | Draft skill |
|
|
424
443
|
| Design review | Multi-persona review before code is written | Review skill |
|
|
425
|
-
| Test-driven development |
|
|
444
|
+
| Test-driven development | Test-first: red-green BDD for behavior, unit tests for invariants | Apply skill |
|
|
426
445
|
| Test quality | Static analysis for weak/empty/tautological tests | `grimoire test-quality`, verify skill |
|
|
427
446
|
| Regression prevention | All existing tests must pass; regressions block completion | Apply + verify skills |
|
|
428
|
-
| Change management | Manifests, task tracking, session resumption,
|
|
447
|
+
| Change management | Manifests, task tracking, session resumption, live-on-branch edits | Full lifecycle |
|
|
429
448
|
| Traceability | Every commit → change → feature → decision | `grimoire trace` |
|
|
430
449
|
| Security review | STRIDE threat modeling, OWASP/CWE tagging at design time | Review + plan + verify skills |
|
|
431
450
|
| Security tooling | SAST, SCA, secrets scanning in pre-commit pipeline | `grimoire check` |
|
|
451
|
+
| Vulnerability triage | CVE noise → VEX verdict + hotfix-now/next-release, scored on KEV/EPSS/reachability vs deployment + recorded controls | Vuln-triage skill |
|
|
452
|
+
| Vulnerability remediation | Triaged findings → bug-tracker tickets, risk-accept register with expiry (feeds back into triage *and* the `dep_audit`/`security` check gate), change stubs for non-trivial fixes | Vuln-remediate skill |
|
|
432
453
|
| Bug discipline | Reproduce-first fixes, structured triage, confidential security handling | Bug workflow skills |
|
|
433
454
|
| Exploratory testing | Gap analysis, coverage mapping, charter-based sessions | Bug-explore + bug-session skills |
|
|
434
455
|
| Tech debt tracking | Structured debt register with severity and formal exceptions | Refactor skill |
|
|
@@ -453,35 +474,50 @@ Grimoire's security capabilities are **AI-mediated at design time**, not static
|
|
|
453
474
|
|
|
454
475
|
This means security coverage depends on: (1) configuring the right tools in your check pipeline, and (2) the AI following its own instructions. Projects that run `grimoire init` with detection get solid defaults. Projects that skip detection should configure `tools.security`, `tools.dep_audit`, and `tools.secrets` in `.grimoire/config.yaml`.
|
|
455
476
|
|
|
477
|
+
**Vulnerability triage.** Scanners (`npm audit`, `pip-audit`, `osv-scanner`) rank CVEs by CVSS base score, which knows nothing about your deployment — so they over-escalate. The vuln-triage skill scores each advisory the way it actually matters here: KEV (known-exploited), EPSS (exploit probability), reachability (is the vulnerable code even on our execute path), and exposure/controls read from `context.yml` + MADR decisions — never a new config file. The output is a [VEX](https://www.cisa.gov/sites/default/files/2023-04/minimum-requirements-for-vex-508c.pdf) verdict per CVE (`not_affected` with a justification code suppresses noise auditably) and, for the survivors, the only decision that matters: **drop-everything hotfix vs next release cycle**. A Contrarian calibration pass (the same one from the review engine) steel-mans "we're not affected" against every escalation to kill manufactured emergencies. Full rubric in `skills/references/dependency-vuln-triage.md`. Accepted findings land in `.grimoire/security/accepted-risks.yml` with an expiry; the `dep_audit` and `security` check steps read that register and suppress an advisory only while its entry is unexpired — so the commit gate stops blocking on triaged-away findings (e.g. a dev-only CVE) without silently ignoring new ones.
|
|
478
|
+
|
|
479
|
+
**Supply chain defense.** For apps and services, the review and verify skills treat any dependency add/upgrade without a committed lockfile (and integrity hashes, where the ecosystem supports them) as a **blocker** — motivated by recent npm / PyPI / RubyGems / Cargo maintainer-account compromises that auto-installed through floating version ranges. Per-ecosystem rules cover `package.json` + lockfile (no `^`/`~`/`*`/`latest` for apps), `uv.lock` / `poetry.lock` / `pip-compile --generate-hashes`, `Gemfile.lock` with `CHECKSUMS` (Bundler 2.5+), `Cargo.lock` for binaries, and `go.mod` + `go.sum`. CI must install from the lockfile (`npm ci`, `pnpm install --frozen-lockfile`, `yarn install --immutable`, `uv sync --frozen`, `pip install --require-hashes`, `bundle install --deployment`, `cargo build --locked`, `go build` with `-mod=readonly`). Libraries published to a registry are out of scope — keep compatible ranges in your published manifest. Full ruleset in `skills/references/security-compliance.md`.
|
|
480
|
+
|
|
456
481
|
Grimoire does not provide compliance framework enforcement (OWASP ASVS checklists, CWE mapping), SBOM generation, artifact signing, or DAST. These require dedicated security tooling.
|
|
457
482
|
|
|
458
483
|
## Features
|
|
459
484
|
|
|
460
485
|
### Codebase Intelligence
|
|
461
486
|
|
|
462
|
-
|
|
463
|
-
grimoire map # Structural snapshot (.grimoire/docs/.snapshot.json)
|
|
464
|
-
grimoire map --refresh # Diff against existing docs, show gaps
|
|
465
|
-
grimoire map --duplicates # Run jscpd duplicate detection
|
|
466
|
-
grimoire map --depth <n> # Max directory depth to scan (default 4)
|
|
467
|
-
```
|
|
468
|
-
|
|
469
|
-
Snapshots the directory layout, language mix, and per-area metrics so area docs and plans don't have to re-explore the tree. No native dependencies.
|
|
487
|
+
Structure is **live, not stored.** Symbols, call graphs, data-flow, dead code, and reusable utilities come from [codebase-memory-mcp](https://github.com/DeusData/codebase-memory-mcp) on demand (`search_graph`, `get_architecture`, `trace_path`) — there is no frozen snapshot to go stale. `grimoire init` offers to install it.
|
|
470
488
|
|
|
471
|
-
|
|
489
|
+
Duplicate detection and convention-drift checks live in `grimoire health` (config-driven). Grimoire stores only what the graph *can't* derive — intent, boundaries, decisions, constraints.
|
|
472
490
|
|
|
473
491
|
### Area Docs & Data Schema
|
|
474
492
|
|
|
475
|
-
|
|
493
|
+
`/grimoire:discover` generates **intent-focused** docs in `.grimoire/docs/`:
|
|
476
494
|
|
|
477
495
|
- Purpose and boundaries of each module
|
|
478
|
-
-
|
|
479
|
-
-
|
|
480
|
-
|
|
496
|
+
- Conventions (naming, structure) with exemplar file references
|
|
497
|
+
- Where new code of each type goes
|
|
498
|
+
|
|
499
|
+
Area docs deliberately do **not** list key files or a reusable-code inventory — that's structure, and the graph regenerates it live (a frozen copy drifts). Discover runs only when an area's *intent* changes, not on every code change.
|
|
481
500
|
|
|
482
501
|
`.grimoire/docs/data/schema.yml` captures your data layer — SQL tables, document collections, external API contracts — so the AI reads this instead of model files.
|
|
483
502
|
|
|
484
|
-
`grimoire docs` generates a browsable `.grimoire/docs/OVERVIEW.md`
|
|
503
|
+
`grimoire docs` generates a browsable `.grimoire/docs/OVERVIEW.md` — the single human entry point: what the app is, its actors, capabilities (grouped by functional story), constraints, architecture, and decisions, each linking down.
|
|
504
|
+
|
|
505
|
+
### Rendering into your doc site
|
|
506
|
+
|
|
507
|
+
`grimoire docs` emits **portable CommonMark** — grimoire owns the spec *storage* (features, constraints, decisions, schema); your existing doc tool owns *rendering*. Grimoire ships no renderer and standardizes on no doc tool. Include the output wherever your project already publishes:
|
|
508
|
+
|
|
509
|
+
- **Sphinx** (with [myst-parser](https://myst-parser.readthedocs.io)): point grimoire at your docs tree and include the page in a toctree —
|
|
510
|
+
```bash
|
|
511
|
+
grimoire docs -o docs/overview.md
|
|
512
|
+
```
|
|
513
|
+
````markdown
|
|
514
|
+
```{include} overview.md
|
|
515
|
+
```
|
|
516
|
+
````
|
|
517
|
+
- **MkDocs**: `grimoire docs -o docs/overview.md`, then add `overview.md` to `nav:`.
|
|
518
|
+
- **No doc tool**: read `.grimoire/docs/OVERVIEW.md` directly — it's plain markdown.
|
|
519
|
+
|
|
520
|
+
The source artifacts stay tool-agnostic, so the AI workflow doesn't depend on any renderer. Regenerate `OVERVIEW.md` whenever artifacts change (`grimoire-apply` does this at finalize).
|
|
485
521
|
|
|
486
522
|
### Pre-Commit Pipeline
|
|
487
523
|
|
|
@@ -549,8 +585,8 @@ Developer picks it up → /grimoire:bug-triage → classify root cause
|
|
|
549
585
|
Every commit includes a `Change:` git trailer linking code → commit → change → feature → decision.
|
|
550
586
|
|
|
551
587
|
```bash
|
|
552
|
-
grimoire trace src/auth.py:42
|
|
553
|
-
|
|
588
|
+
grimoire trace src/auth.py:42 # What requirement introduced this line?
|
|
589
|
+
git log --grep "Change: add-2fa-login" # Every commit for a change, via its trailer
|
|
554
590
|
```
|
|
555
591
|
|
|
556
592
|
### Project Health
|
|
@@ -560,14 +596,15 @@ grimoire health
|
|
|
560
596
|
|
|
561
597
|
features 100% ██████████ 12 scenarios in 5 files
|
|
562
598
|
decisions 89% █████████░ 8/9 current
|
|
563
|
-
area docs
|
|
599
|
+
area docs 100% ██████████ 6 areas documented
|
|
564
600
|
data schema 100% ██████████ 4 models documented
|
|
601
|
+
conventions drift 100% ██████████ no drift — paths match
|
|
565
602
|
test coverage 60% ██████░░░░ 3/5 features have step definitions
|
|
566
603
|
unit coverage 82% █████████░ 82% line coverage
|
|
567
604
|
duplicates — 2 clones detected
|
|
568
605
|
complexity — no high-complexity functions
|
|
569
606
|
|
|
570
|
-
Overall
|
|
607
|
+
Overall 87% █████████░
|
|
571
608
|
```
|
|
572
609
|
|
|
573
610
|
### Contract Testing
|
|
@@ -626,22 +663,27 @@ grimoire init --agent copilot # .github/copilot-instructions.m
|
|
|
626
663
|
|-------|---------|
|
|
627
664
|
| `/grimoire:draft` | Draft features and/or decisions collaboratively |
|
|
628
665
|
| `/grimoire:plan` | Generate detailed implementation tasks from specs |
|
|
629
|
-
| `/grimoire:review` | Multi-perspective design review (PM, engineer, security, QA, data) |
|
|
630
|
-
| `/grimoire:apply` | Execute tasks
|
|
666
|
+
| `/grimoire:review` | Multi-perspective design review (PM, engineer, security, QA, data, principles) |
|
|
667
|
+
| `/grimoire:apply` | Execute tasks test-first at the right level (BDD for behavior, unit for invariants) |
|
|
631
668
|
| `/grimoire:verify` | Post-implementation verification + test quality |
|
|
632
669
|
| `/grimoire:audit` | Discover undocumented features and decisions |
|
|
633
670
|
| `/grimoire:remove` | Tracked feature removal with impact assessment |
|
|
634
|
-
| `/grimoire:discover` | Generate area docs and data schema
|
|
671
|
+
| `/grimoire:discover` | Generate intent-focused area docs and data schema |
|
|
635
672
|
| `/grimoire:refactor` | Find, prioritize, and track tech debt |
|
|
636
673
|
| `/grimoire:bug` | Disciplined bug fix with reproduction test first |
|
|
637
674
|
| `/grimoire:bug-report` | Structured bug reporting (accepts test tool output) |
|
|
638
675
|
| `/grimoire:bug-triage` | Classify and route bug reports |
|
|
676
|
+
| `/grimoire:vuln-triage` | Triage vuln scans (npm audit / pip-audit / Trivy / any tool) against deployment + controls — hotfix-now vs next release |
|
|
677
|
+
| `/grimoire:vuln-remediate` | File triaged vulns — tickets in the bug tracker, risk-accept register with expiry, change stubs for big fixes |
|
|
639
678
|
| `/grimoire:bug-explore` | AI-guided exploratory testing and gap analysis |
|
|
640
679
|
| `/grimoire:bug-session` | Charter-based exploratory testing sessions |
|
|
641
680
|
| `/grimoire:branch-guard` | Enforce branch hygiene before starting new feature work (also wired as a hook) |
|
|
642
681
|
| `/grimoire:commit` | Contextual commit messages with change trailers |
|
|
643
682
|
| `/grimoire:pr` | Generate PR description + optional diff review |
|
|
644
683
|
| `/grimoire:pr-review` | Review a teammate's PR with the multi-persona lens |
|
|
684
|
+
| `/grimoire:precommit-review` | Multi-persona review of your own staged/unstaged diff before commit |
|
|
685
|
+
| `/grimoire:design` | Generate UI/UX designs — problem → variants → states → derived Gherkin |
|
|
686
|
+
| `/grimoire:design-consult` | Pre-design Q&A with security and data personas before any artifacts exist |
|
|
645
687
|
|
|
646
688
|
</details>
|
|
647
689
|
|
|
@@ -666,11 +708,6 @@ grimoire init --agent copilot # .github/copilot-instructions.m
|
|
|
666
708
|
| `grimoire status <id>` | Show change status, branch, and task progress |
|
|
667
709
|
| `grimoire validate [id]` | Validate features, decisions, and manifests |
|
|
668
710
|
| `grimoire validate --strict` | Enable strict validation |
|
|
669
|
-
| `grimoire archive <id> [-y]` | Archive a completed change (`-y` skips confirmation) |
|
|
670
|
-
| `grimoire map` | Structural codebase scan |
|
|
671
|
-
| `grimoire map --duplicates` | Run jscpd duplicate detection |
|
|
672
|
-
| `grimoire map --refresh` | Diff against existing docs, show gaps |
|
|
673
|
-
| `grimoire map --depth <n>` | Max directory depth to scan (default 4) |
|
|
674
711
|
| `grimoire check [steps...]` | Run pre-commit pipeline |
|
|
675
712
|
| `grimoire ci` | Run CI pipeline |
|
|
676
713
|
| `grimoire ci --setup` | Generate `.github/workflows/grimoire.yml` template |
|
|
@@ -680,7 +717,6 @@ grimoire init --agent copilot # .github/copilot-instructions.m
|
|
|
680
717
|
| `grimoire pr --create` | Create PR via gh/glab |
|
|
681
718
|
| `grimoire pr --review` | Run post-implementation LLM review of diff |
|
|
682
719
|
| `grimoire test-quality [files]` | Analyze test files for quality issues |
|
|
683
|
-
| `grimoire log [--from <ref>] [--to <ref>]` | Generate change log / release notes |
|
|
684
720
|
| `grimoire trace <file[:line]>` | Trace file to originating grimoire change |
|
|
685
721
|
| `grimoire diff <id>` | Compare proposed change specs against the baseline |
|
|
686
722
|
| `grimoire docs [-o <path>]` | Generate human-readable project overview |
|
|
@@ -793,6 +829,16 @@ testing_tools:
|
|
|
793
829
|
|
|
794
830
|
## Contributing
|
|
795
831
|
|
|
832
|
+
Issues and pull requests welcome at [github.com/kiwi-data/grimoire](https://github.com/kiwi-data/grimoire). Grimoire dogfoods itself — `.grimoire/` in this repo is built using grimoire skills, so contributions are expected to go through the same `draft → plan → apply → verify → pr` workflow described above.
|
|
833
|
+
|
|
834
|
+
**Before opening a PR:**
|
|
835
|
+
|
|
836
|
+
- `npm run build && npm test && npm run lint` — all green
|
|
837
|
+
- `grimoire check` — pre-commit pipeline green
|
|
838
|
+
- New behavior has a Gherkin scenario in `features/` (or a decision record under `.grimoire/decisions/` if it's an architectural choice)
|
|
839
|
+
- Commit messages include a `Change:` trailer when the work is part of a tracked change
|
|
840
|
+
- For dependency adds/upgrades: lockfile committed, no floating version ranges in `package.json` (see Security model above)
|
|
841
|
+
|
|
796
842
|
<details>
|
|
797
843
|
<summary>Development setup and project structure</summary>
|
|
798
844
|
|
|
@@ -826,7 +872,7 @@ grimoire/
|
|
|
826
872
|
### Adding a New Skill
|
|
827
873
|
|
|
828
874
|
1. Create `skills/grimoire-<name>/SKILL.md` with trigger, prerequisites, workflow, and important notes
|
|
829
|
-
2. Add `"grimoire-<name>"` to the `
|
|
875
|
+
2. Add `"grimoire-<name>"` to the `SKILL_NAMES` array in `src/core/shared-setup.ts` (shared by init and update)
|
|
830
876
|
3. Build and test: `npm run build && node bin/grimoire.js update .`
|
|
831
877
|
|
|
832
878
|
Skills are pure markdown — instructions for the AI, not executable code.
|
|
@@ -847,12 +893,14 @@ Skills are pure markdown — instructions for the AI, not executable code.
|
|
|
847
893
|
|
|
848
894
|
## Philosophy
|
|
849
895
|
|
|
850
|
-
- **
|
|
851
|
-
- **
|
|
896
|
+
- **One home per fact.** Behavior → feature; invariant → constraint; trade-off → decision; data → schema; structure → the live graph. No fact in two places (DRY).
|
|
897
|
+
- **One right way.** Each thing has a single sanctioned approach. Two ways to do the same job is a defect, even if both work.
|
|
898
|
+
- **Don't reinvent the wheel.** Use the tool that exists — git for isolation/staging/history, standard libraries for crypto/auth/parsing — not a bespoke grimoire clone of it.
|
|
899
|
+
- **Features are tests — when they're behavior.** A `.feature` is the requirement and the acceptance test, but only for actor-observable behavior. Invariants are unit-tested constraints, not Gherkin.
|
|
900
|
+
- **Red-green is mandatory.** A test must fail before it passes — at the right level (BDD for behavior, unit for invariants).
|
|
852
901
|
- **Decisions are documented.** Architecture choices that aren't written down get relitigated.
|
|
853
902
|
- **Reproduce before you fix.** Every bug gets a failing test before any code changes.
|
|
854
903
|
- **Simple over clever.** Less code, fewer abstractions, smallest surface area.
|
|
855
|
-
- **Verify before using.** Confirm imports, functions, and packages exist before writing code that depends on them.
|
|
856
904
|
- **Removal is deliberate.** Removing a feature gets the same rigor as adding one.
|
|
857
905
|
- **The fix is upstream.** You don't fix codebase entropy by reviewing harder — you fix it by requiring specs before code.
|
|
858
906
|
|
package/dist/cli/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
1
4
|
import { Command } from "commander";
|
|
2
5
|
import { initCommand } from "../commands/init.js";
|
|
3
6
|
import { updateCommand } from "../commands/update.js";
|
|
4
7
|
import { validateCommand } from "../commands/validate.js";
|
|
5
8
|
import { listCommand } from "../commands/list.js";
|
|
6
9
|
import { statusCommand } from "../commands/status.js";
|
|
7
|
-
import { archiveCommand } from "../commands/archive.js";
|
|
8
|
-
import { mapCommand } from "../commands/map.js";
|
|
9
10
|
import { checkCommand } from "../commands/check.js";
|
|
10
|
-
import { logCommand } from "../commands/log.js";
|
|
11
11
|
import { traceCommand } from "../commands/trace.js";
|
|
12
12
|
import { docsCommand } from "../commands/docs.js";
|
|
13
13
|
import { healthCommand } from "../commands/health.js";
|
|
@@ -16,20 +16,19 @@ import { testQualityCommand } from "../commands/test-quality.js";
|
|
|
16
16
|
import { diffCommand } from "../commands/diff.js";
|
|
17
17
|
import { ciCommand } from "../commands/ci.js";
|
|
18
18
|
import { branchCheckCommand } from "../commands/branch-check.js";
|
|
19
|
+
import { configureCommand } from "../commands/configure.js";
|
|
20
|
+
const pkg = JSON.parse(readFileSync(join(dirname(fileURLToPath(import.meta.url)), "..", "..", "package.json"), "utf-8"));
|
|
19
21
|
const program = new Command();
|
|
20
22
|
program
|
|
21
23
|
.name("grimoire")
|
|
22
24
|
.description("Gherkin + MADR spec-driven development for AI coding assistants")
|
|
23
|
-
.version(
|
|
25
|
+
.version(pkg.version);
|
|
24
26
|
program.addCommand(initCommand);
|
|
25
27
|
program.addCommand(updateCommand);
|
|
26
28
|
program.addCommand(validateCommand);
|
|
27
29
|
program.addCommand(listCommand);
|
|
28
30
|
program.addCommand(statusCommand);
|
|
29
|
-
program.addCommand(archiveCommand);
|
|
30
|
-
program.addCommand(mapCommand);
|
|
31
31
|
program.addCommand(checkCommand);
|
|
32
|
-
program.addCommand(logCommand);
|
|
33
32
|
program.addCommand(traceCommand);
|
|
34
33
|
program.addCommand(docsCommand);
|
|
35
34
|
program.addCommand(healthCommand);
|
|
@@ -38,5 +37,6 @@ program.addCommand(testQualityCommand);
|
|
|
38
37
|
program.addCommand(diffCommand);
|
|
39
38
|
program.addCommand(ciCommand);
|
|
40
39
|
program.addCommand(branchCheckCommand);
|
|
40
|
+
program.addCommand(configureCommand);
|
|
41
41
|
program.parse();
|
|
42
42
|
//# sourceMappingURL=index.js.map
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OA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,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;QAC3C,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,IAAI,KAAK,CAAC;QAC5C,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,IAAI;QAChC,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,KAAK;KAC5B,CAAC,CAAC;IACH,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../../src/commands/configure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,eAAO,MAAM,gBAAgB,SAwBzB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { configureProject, SECTION_LABELS } from "../core/configure.js";
|
|
3
|
+
const VALID_SECTIONS = Object.keys(SECTION_LABELS);
|
|
4
|
+
export const configureCommand = new Command("configure")
|
|
5
|
+
.description("Configure grimoire options deferred from init: compliance, design tool, LLM models, bug trackers, testing tools")
|
|
6
|
+
.argument("[section]", `Section to configure: ${VALID_SECTIONS.join(", ")} (omit for interactive menu)`)
|
|
7
|
+
.argument("[path]", "Project root directory", ".")
|
|
8
|
+
.action(async (section, path) => {
|
|
9
|
+
const root = require("node:path").join(process.cwd(), path);
|
|
10
|
+
const sections = section && VALID_SECTIONS.includes(section)
|
|
11
|
+
? [section]
|
|
12
|
+
: undefined;
|
|
13
|
+
if (section && !sections) {
|
|
14
|
+
console.error(`Unknown section "${section}". Valid: ${VALID_SECTIONS.join(", ")}`);
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
await configureProject(root, sections);
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=configure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configure.js","sourceRoot":"","sources":["../../src/commands/configure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAoB,MAAM,sBAAsB,CAAC;AAE1F,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,cAAc,CAAkB,CAAC;AAEpE,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,OAAO,CAAC,WAAW,CAAC;KACrD,WAAW,CACV,iHAAiH,CAClH;KACA,QAAQ,CACP,WAAW,EACX,yBAAyB,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,8BAA8B,CACjF;KACA,QAAQ,CAAC,QAAQ,EAAE,wBAAwB,EAAE,GAAG,CAAC;KACjD,MAAM,CAAC,KAAK,EAAE,OAA2B,EAAE,IAAY,EAAE,EAAE;IAC1D,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,CAAC;IAC5D,MAAM,QAAQ,GACZ,OAAO,IAAK,cAA2B,CAAC,QAAQ,CAAC,OAAO,CAAC;QACvD,CAAC,CAAC,CAAC,OAAsB,CAAC;QAC1B,CAAC,CAAC,SAAS,CAAC;IAEhB,IAAI,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;QACzB,OAAO,CAAC,KAAK,CACX,oBAAoB,OAAO,aAAa,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACpE,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACzC,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,eAAO,MAAM,WAAW,SAoBpB,CAAC"}
|
package/dist/commands/init.js
CHANGED
|
@@ -9,12 +9,14 @@ export const initCommand = new Command("init")
|
|
|
9
9
|
.option("--agent <type>", "Add an AI agent: claude, opencode, codex, cursor, copilot (can be repeated)", collect, [])
|
|
10
10
|
.option("--install-codebase-memory-mcp", "Mark codebase-memory-mcp as a recommended integration (prints install command at end)")
|
|
11
11
|
.option("--install-caveman-plugin", "Mark caveman skill plugin as a recommended integration (prints install command at end)")
|
|
12
|
+
.option("--full", "Also run all deferred configure sections (compliance, design, LLM models, bug trackers, testing tools)")
|
|
12
13
|
.action(async (path, options) => {
|
|
13
14
|
await initProject(path, {
|
|
14
15
|
skipAgents: options.skipAgents ?? false,
|
|
15
16
|
skipSkills: options.skipSkills ?? false,
|
|
16
17
|
noDetect: options.detect === false,
|
|
17
18
|
agents: options.agent ?? [],
|
|
19
|
+
full: options.full ?? false,
|
|
18
20
|
installCodebaseMemoryMcp: options.installCodebaseMemoryMcp,
|
|
19
21
|
installCavemanPlugin: options.installCavemanPlugin,
|
|
20
22
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;KAC3C,WAAW,CA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