@kiwidata/grimoire 0.1.4 → 0.1.6
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/.claude-plugin/plugin.json +2 -2
- package/AGENTS.md +21 -25
- package/LICENSE +36 -0
- package/README.md +86 -61
- package/dist/cli/index.js +2 -43
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/program.d.ts +4 -0
- package/dist/cli/program.d.ts.map +1 -0
- package/dist/cli/program.js +45 -0
- package/dist/cli/program.js.map +1 -0
- package/dist/commands/configure.d.ts.map +1 -1
- package/dist/commands/configure.js +2 -1
- package/dist/commands/configure.js.map +1 -1
- package/dist/core/check.d.ts.map +1 -1
- package/dist/core/check.js +47 -11
- package/dist/core/check.js.map +1 -1
- package/dist/core/ci.d.ts.map +1 -1
- package/dist/core/ci.js +2 -2
- package/dist/core/ci.js.map +1 -1
- package/dist/core/doc-style.d.ts.map +1 -1
- package/dist/core/doc-style.js +76 -0
- package/dist/core/doc-style.js.map +1 -1
- package/dist/core/docs.d.ts.map +1 -1
- package/dist/core/docs.js +93 -74
- 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 +78 -21
- package/dist/core/health.js.map +1 -1
- package/dist/core/hooks.d.ts.map +1 -1
- package/dist/core/hooks.js +17 -19
- package/dist/core/hooks.js.map +1 -1
- package/dist/core/list.d.ts.map +1 -1
- package/dist/core/list.js +4 -7
- package/dist/core/list.js.map +1 -1
- package/dist/core/pr.d.ts.map +1 -1
- package/dist/core/pr.js +0 -8
- package/dist/core/pr.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.map +1 -1
- package/dist/core/shared-setup.js +5 -4
- package/dist/core/shared-setup.js.map +1 -1
- package/dist/core/status.d.ts.map +1 -1
- package/dist/core/status.js +3 -3
- package/dist/core/status.js.map +1 -1
- package/dist/core/trace.d.ts.map +1 -1
- package/dist/core/trace.js +37 -35
- package/dist/core/trace.js.map +1 -1
- package/dist/core/update.d.ts.map +1 -1
- package/dist/core/update.js +1 -10
- package/dist/core/update.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/package.json +19 -2
- package/skills/grimoire-apply/SKILL.md +40 -37
- package/skills/grimoire-audit/SKILL.md +4 -1
- package/skills/grimoire-bug/SKILL.md +7 -3
- package/skills/grimoire-commit/SKILL.md +1 -1
- package/skills/grimoire-design/SKILL.md +3 -3
- package/skills/grimoire-discover/SKILL.md +77 -110
- package/skills/grimoire-draft/SKILL.md +55 -18
- package/skills/grimoire-plan/SKILL.md +58 -52
- package/skills/grimoire-pr/SKILL.md +7 -8
- package/skills/grimoire-pr-review/SKILL.md +2 -1
- package/skills/grimoire-refactor/SKILL.md +3 -3
- package/skills/grimoire-review/SKILL.md +13 -1
- package/skills/grimoire-verify/SKILL.md +19 -7
- package/skills/grimoire-vuln-remediate/SKILL.md +107 -0
- package/skills/grimoire-vuln-triage/SKILL.md +109 -0
- package/skills/references/artifact-map.md +44 -0
- package/skills/references/code-quality.md +41 -9
- package/skills/references/container-scan-triage.md +102 -0
- package/skills/references/dependency-vuln-triage.md +236 -0
- package/skills/references/principles.md +82 -0
- package/skills/references/refactor-scan-categories.md +2 -2
- package/skills/references/review-personas.md +13 -6
- package/skills/references/test-baseline.md +55 -0
- package/skills/references/testing-contracts.md +1 -1
- package/templates/accepted-risks.yml +47 -0
- package/templates/constraints.md +25 -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 -16
- 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 -81
- 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 -140
- package/dist/core/log.js.map +0 -1
- package/dist/core/map.d.ts +0 -22
- package/dist/core/map.d.ts.map +0 -1
- package/dist/core/map.js +0 -365
- package/dist/core/map.js.map +0 -1
- package/templates/dupignore +0 -93
- package/templates/mapignore +0 -58
- package/templates/mapkeys +0 -65
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "grimoire",
|
|
3
3
|
"description": "BDD-powered AI coding assistant — Gherkin specs, MADR decisions, and red-green development for AI agents",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.5",
|
|
5
5
|
"author": "Kiwi Data",
|
|
6
|
-
"homepage": "https://github.com/
|
|
6
|
+
"homepage": "https://github.com/KiwiData-AI/grimoire",
|
|
7
7
|
"license": "MIT"
|
|
8
8
|
}
|
package/AGENTS.md
CHANGED
|
@@ -22,7 +22,7 @@ These principles govern all grimoire work — drafting, planning, reviewing, and
|
|
|
22
22
|
|
|
23
23
|
**Errors at the boundary.** Validate user input and external data at the edges. Internal code can trust its callers — don't defensive-program against situations that can't happen.
|
|
24
24
|
|
|
25
|
-
**Verify before using.** Before importing a module, calling a function, or adding a dependency — confirm it exists.
|
|
25
|
+
**Verify before using.** Before importing a module, calling a function, or adding a dependency — confirm it exists. Query the codebase graph (codebase-memory-mcp: `search_graph`, `get_code_snippet`) for reusable code, exact symbols, and file paths — structure is read live, never from a frozen doc. Read `.grimoire/docs/<area>.md` for an area's purpose, boundaries, and conventions, and the data schema for real model fields and API endpoints. If you haven't read the file you're importing from, read it first. Never guess at package names, function signatures, or API paths.
|
|
26
26
|
|
|
27
27
|
## Anti-Loop Protocol
|
|
28
28
|
|
|
@@ -131,7 +131,7 @@ User has a request
|
|
|
131
131
|
│
|
|
132
132
|
├─ "Setting up grimoire on an existing project"
|
|
133
133
|
│ 1. `grimoire init` → creates .grimoire/ directory and config
|
|
134
|
-
│ 2. `/grimoire:discover` → generates
|
|
134
|
+
│ 2. `/grimoire:discover` → generates intent-focused area docs + data schema (queries codebase-memory-mcp for live structure when available)
|
|
135
135
|
│ 3. `/grimoire:audit` → discovers undocumented features and decisions
|
|
136
136
|
│ 4. Start working: `/grimoire:draft` for new changes, `/grimoire:bug` for fixes
|
|
137
137
|
│
|
|
@@ -148,17 +148,16 @@ Skills also have a **Done** section that signals when the workflow is complete.
|
|
|
148
148
|
|
|
149
149
|
## Workflow: Creating or Changing a Feature
|
|
150
150
|
|
|
151
|
-
|
|
151
|
+
The end-to-end flow for adding or modifying behavior is six stages, each owned by a skill:
|
|
152
152
|
|
|
153
|
-
|
|
154
|
-
2. **Draft** (`/grimoire:draft`): Qualify the request. Draft `.feature` files and/or ADRs. Write manifest. Collaborate until the user approves. Update manifest status to `approved`.
|
|
155
|
-
3. **Plan** (`/grimoire:plan`): Read approved artifacts. Generate `tasks.md` with red-green test pairs for each scenario. Review with user.
|
|
156
|
-
4. **Review** (`/grimoire:review`): *Optional.* Multi-persona design review — product manager (completeness), senior engineer (simplicity and feasibility), security engineer (vulnerabilities), QA engineer (testability and edge cases). Fix blockers before coding.
|
|
157
|
-
5. **Apply** (`/grimoire:apply`): Work through tasks. For each: write test (must fail), write code (must pass), mark done. Update manifest status to `implementing`.
|
|
158
|
-
6. **Verify** (`/grimoire:verify`): Confirm all scenarios pass, no regressions, decisions followed. Generate report.
|
|
159
|
-
7. **Archive** (`grimoire archive <id>`): Sync features/decisions to baseline. Archive manifest. Update manifest status to `complete`.
|
|
153
|
+
**Draft** (`/grimoire:draft`) → **Plan** (`/grimoire:plan`) → **Review** (`/grimoire:review`, optional) → **Apply** (`/grimoire:apply`) → **Verify** (`/grimoire:verify`) → **PR** (`grimoire pr`).
|
|
160
154
|
|
|
161
|
-
Each
|
|
155
|
+
Each skill's SKILL.md is the authoritative home for that stage's mechanics; the README "Workflow" section is the narrative walkthrough. Do not re-derive stage steps here — invoke the skill. The operational invariants that bind every stage:
|
|
156
|
+
|
|
157
|
+
- **Manifest status tracks progress:** `approved` after draft, `implementing` during apply, `accepted` at PR.
|
|
158
|
+
- **Live on the branch.** Features, decisions, constraints, and schema are edited directly on the feature branch — no copy-into-change-folder, no promote step.
|
|
159
|
+
- **No archive step.** The PR diff *is* the change; git history plus the `Change: <id>` commit trailer are the record. PR finalize just flips decision status to `accepted` and removes the ephemeral change folder.
|
|
160
|
+
- **The user drives the pace.** Review mode (default) approves every file change before writing; autonomous mode works the full task list, stopping only on blockers.
|
|
162
161
|
|
|
163
162
|
### IMPORTANT: tasks.md Is the Plan
|
|
164
163
|
|
|
@@ -179,24 +178,22 @@ If a task seems wrong or impossible during apply:
|
|
|
179
178
|
|
|
180
179
|
## Directory Structure
|
|
181
180
|
|
|
181
|
+
Features, decisions, constraints, and schema are edited **live on the feature branch** — `git diff` is the staging area. A change folder holds only the ephemeral coordination artifacts (manifest + tasks) and is removed at finalize; the PR diff and git history are the record. There is no proposed-copy tree and no archive tree.
|
|
182
|
+
|
|
182
183
|
```
|
|
183
184
|
project-root/
|
|
184
|
-
├── features/ # Gherkin
|
|
185
|
+
├── features/ # Gherkin specs — behavioral truth (edited live)
|
|
185
186
|
│ └── <capability>/
|
|
186
187
|
│ └── <name>.feature
|
|
187
188
|
├── .grimoire/
|
|
188
|
-
│ ├── decisions/ # MADR
|
|
189
|
+
│ ├── decisions/ # MADR records — architectural truth (edited live)
|
|
189
190
|
│ │ ├── 0001-short-title.md
|
|
190
191
|
│ │ └── template.md
|
|
191
|
-
│ ├──
|
|
192
|
-
│
|
|
193
|
-
│
|
|
194
|
-
│
|
|
195
|
-
│
|
|
196
|
-
│ │ └── decisions/ # new/updated ADRs
|
|
197
|
-
│ └── archive/ # completed changes (manifests only)
|
|
198
|
-
│ └── YYYY-MM-DD-<change-id>/
|
|
199
|
-
│ └── manifest.md
|
|
192
|
+
│ ├── docs/ # intent-focused area docs, data schema, constraints.md register, OVERVIEW.md
|
|
193
|
+
│ └── changes/ # ephemeral per-change coordination — removed at finalize
|
|
194
|
+
│ └── <change-id>/
|
|
195
|
+
│ ├── manifest.md
|
|
196
|
+
│ └── tasks.md
|
|
200
197
|
```
|
|
201
198
|
|
|
202
199
|
## Conventions
|
|
@@ -206,9 +203,8 @@ Every manifest has a `status` field in YAML frontmatter:
|
|
|
206
203
|
- `draft` — being written, not yet reviewed
|
|
207
204
|
- `approved` — reviewed by user, ready for planning/implementation
|
|
208
205
|
- `implementing` — tasks are being worked on
|
|
209
|
-
- `complete` — all tasks done, ready to archive
|
|
210
206
|
|
|
211
|
-
Update the status as the change progresses. The CLI reads this to report change state.
|
|
207
|
+
Update the status as the change progresses. The CLI reads this to report change state. There is no `complete`/archive state — finalize removes the ephemeral change folder once the PR is opened; git history is the record.
|
|
212
208
|
|
|
213
209
|
### Change IDs
|
|
214
210
|
- Kebab-case, verb-led: `add-two-factor-auth`, `update-login-flow`, `remove-legacy-api`
|
|
@@ -237,7 +233,7 @@ Change: add-2fa-login
|
|
|
237
233
|
Scenarios: "Login with valid TOTP code", "Login with expired TOTP code"
|
|
238
234
|
```
|
|
239
235
|
|
|
240
|
-
This is what makes `grimoire trace`
|
|
236
|
+
This is what makes `grimoire trace` work. Without it, the commit is invisible to the audit trail. `Scenarios:` and `Decisions:` trailers are included when relevant.
|
|
241
237
|
|
|
242
238
|
### Feature Organization
|
|
243
239
|
- One capability per directory: `features/auth/`, `features/documents/`
|
package/LICENSE
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kiwi Data
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
--- Additional Restriction ---
|
|
24
|
+
|
|
25
|
+
Notwithstanding the permissions granted above, the Software and its
|
|
26
|
+
accompanying documentation may NOT be used, in whole or in part, as training
|
|
27
|
+
data, fine-tuning data, or any other input for training, developing, or
|
|
28
|
+
improving any machine learning model, large language model, generative AI
|
|
29
|
+
system, or similar automated system, without the prior written permission of
|
|
30
|
+
the copyright holder.
|
|
31
|
+
|
|
32
|
+
This restriction is an additional condition on the rights granted above. Use
|
|
33
|
+
of the Software constitutes acceptance of this condition. For the avoidance of
|
|
34
|
+
doubt, this restriction applies regardless of whether such use would otherwise
|
|
35
|
+
be considered fair use or permitted under applicable law, to the maximum
|
|
36
|
+
extent such a restriction is enforceable.
|
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
|
|
|
@@ -36,12 +36,12 @@ npm install -g @kiwidata/grimoire
|
|
|
36
36
|
Requires Node.js 20+ and git.
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
|
-
git clone https://github.com/
|
|
39
|
+
git clone https://github.com/KiwiData-AI/grimoire.git
|
|
40
40
|
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,11 @@ 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
|
|
155
163
|
|
|
156
|
-
`grimoire pr` generates a PR description from
|
|
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`.
|
|
157
165
|
|
|
158
|
-
|
|
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.
|
|
159
167
|
|
|
160
168
|
## For UI/UX designers
|
|
161
169
|
|
|
@@ -310,17 +318,16 @@ The AI runs `/grimoire:verify`:
|
|
|
310
318
|
## Suggestions
|
|
311
319
|
- Consider adding a rate-limiting scenario for repeated failed TOTP attempts
|
|
312
320
|
|
|
313
|
-
Recommendation: Ready to
|
|
321
|
+
Recommendation: Ready to commit and open a PR.
|
|
314
322
|
```
|
|
315
323
|
|
|
316
|
-
### PR
|
|
324
|
+
### PR
|
|
317
325
|
|
|
318
326
|
```bash
|
|
319
327
|
grimoire pr --create # Creates PR via gh with full description
|
|
320
|
-
grimoire archive add-2fa-login # Syncs features, accepts decision, archives manifest
|
|
321
328
|
```
|
|
322
329
|
|
|
323
|
-
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.
|
|
324
331
|
|
|
325
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`.
|
|
326
333
|
|
|
@@ -396,7 +403,7 @@ Skill also drafts the missing scenario into `features/checkout/place-order.featu
|
|
|
396
403
|
- [ ] No regression in existing checkout suite
|
|
397
404
|
```
|
|
398
405
|
|
|
399
|
-
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.
|
|
400
407
|
|
|
401
408
|
</details>
|
|
402
409
|
|
|
@@ -434,13 +441,15 @@ Grimoire owns the **inner loop** — the Dev and Sec portions of DevSecOps. Ops
|
|
|
434
441
|
| Requirements engineering | Gherkin specs as executable acceptance tests | Draft skill |
|
|
435
442
|
| Architecture decisions | MADR records with cost-of-ownership | Draft skill |
|
|
436
443
|
| Design review | Multi-persona review before code is written | Review skill |
|
|
437
|
-
| Test-driven development |
|
|
444
|
+
| Test-driven development | Test-first: red-green BDD for behavior, unit tests for invariants | Apply skill |
|
|
438
445
|
| Test quality | Static analysis for weak/empty/tautological tests | `grimoire test-quality`, verify skill |
|
|
439
446
|
| Regression prevention | All existing tests must pass; regressions block completion | Apply + verify skills |
|
|
440
|
-
| Change management | Manifests, task tracking, session resumption,
|
|
447
|
+
| Change management | Manifests, task tracking, session resumption, live-on-branch edits | Full lifecycle |
|
|
441
448
|
| Traceability | Every commit → change → feature → decision | `grimoire trace` |
|
|
442
449
|
| Security review | STRIDE threat modeling, OWASP/CWE tagging at design time | Review + plan + verify skills |
|
|
443
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 |
|
|
444
453
|
| Bug discipline | Reproduce-first fixes, structured triage, confidential security handling | Bug workflow skills |
|
|
445
454
|
| Exploratory testing | Gap analysis, coverage mapping, charter-based sessions | Bug-explore + bug-session skills |
|
|
446
455
|
| Tech debt tracking | Structured debt register with severity and formal exceptions | Refactor skill |
|
|
@@ -465,6 +474,8 @@ Grimoire's security capabilities are **AI-mediated at design time**, not static
|
|
|
465
474
|
|
|
466
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`.
|
|
467
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
|
+
|
|
468
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`.
|
|
469
480
|
|
|
470
481
|
Grimoire does not provide compliance framework enforcement (OWASP ASVS checklists, CWE mapping), SBOM generation, artifact signing, or DAST. These require dedicated security tooling.
|
|
@@ -473,29 +484,40 @@ Grimoire does not provide compliance framework enforcement (OWASP ASVS checklist
|
|
|
473
484
|
|
|
474
485
|
### Codebase Intelligence
|
|
475
486
|
|
|
476
|
-
|
|
477
|
-
grimoire map # Structural snapshot (.grimoire/docs/.snapshot.json)
|
|
478
|
-
grimoire map --refresh # Diff against existing docs, show gaps
|
|
479
|
-
grimoire map --duplicates # Run jscpd duplicate detection
|
|
480
|
-
grimoire map --depth <n> # Max directory depth to scan (default 4)
|
|
481
|
-
```
|
|
482
|
-
|
|
483
|
-
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.
|
|
484
488
|
|
|
485
|
-
|
|
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.
|
|
486
490
|
|
|
487
491
|
### Area Docs & Data Schema
|
|
488
492
|
|
|
489
|
-
|
|
493
|
+
`/grimoire:discover` generates **intent-focused** docs in `.grimoire/docs/`:
|
|
490
494
|
|
|
491
495
|
- Purpose and boundaries of each module
|
|
492
|
-
-
|
|
493
|
-
-
|
|
494
|
-
|
|
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.
|
|
495
500
|
|
|
496
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.
|
|
497
502
|
|
|
498
|
-
`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).
|
|
499
521
|
|
|
500
522
|
### Pre-Commit Pipeline
|
|
501
523
|
|
|
@@ -518,6 +540,8 @@ grimoire check
|
|
|
518
540
|
|
|
519
541
|
Auto-detected during `grimoire init`. Any tool can use `name: llm` with a `prompt:` for AI-powered review. Also sets up enforcement hooks for Claude Code (`.claude/hooks.json`) and git (`.git/hooks/pre-commit`).
|
|
520
542
|
|
|
543
|
+
> ⚠️ **Security: `.grimoire/config.yaml` is trusted code.** `grimoire check` and `grimoire health` execute the shell commands defined in your config's tool steps (`command:` / `check_command:`), and the installed pre-commit hook runs `grimoire check` automatically on every commit. This is the same trust model as `npm` scripts, `Makefile`s, or git hooks — the config can run any command on your machine. **Do not run `grimoire check`/`health`, commit, or let an AI agent commit in a freshly cloned untrusted repository** until you have reviewed its `.grimoire/config.yaml`. Grimoire never sends your code anywhere: the only network calls are an npm version check (your package name only; opt out with `GRIMOIRE_NO_UPDATE_CHECK=1`) and piping diffs to the LLM CLI *you* configured.
|
|
544
|
+
|
|
521
545
|
### Test Quality
|
|
522
546
|
|
|
523
547
|
```bash
|
|
@@ -563,8 +587,8 @@ Developer picks it up → /grimoire:bug-triage → classify root cause
|
|
|
563
587
|
Every commit includes a `Change:` git trailer linking code → commit → change → feature → decision.
|
|
564
588
|
|
|
565
589
|
```bash
|
|
566
|
-
grimoire trace src/auth.py:42
|
|
567
|
-
|
|
590
|
+
grimoire trace src/auth.py:42 # What requirement introduced this line?
|
|
591
|
+
git log --grep "Change: add-2fa-login" # Every commit for a change, via its trailer
|
|
568
592
|
```
|
|
569
593
|
|
|
570
594
|
### Project Health
|
|
@@ -574,14 +598,15 @@ grimoire health
|
|
|
574
598
|
|
|
575
599
|
features 100% ██████████ 12 scenarios in 5 files
|
|
576
600
|
decisions 89% █████████░ 8/9 current
|
|
577
|
-
area docs
|
|
601
|
+
area docs 100% ██████████ 6 areas documented
|
|
578
602
|
data schema 100% ██████████ 4 models documented
|
|
603
|
+
conventions drift 100% ██████████ no drift — paths match
|
|
579
604
|
test coverage 60% ██████░░░░ 3/5 features have step definitions
|
|
580
605
|
unit coverage 82% █████████░ 82% line coverage
|
|
581
606
|
duplicates — 2 clones detected
|
|
582
607
|
complexity — no high-complexity functions
|
|
583
608
|
|
|
584
|
-
Overall
|
|
609
|
+
Overall 87% █████████░
|
|
585
610
|
```
|
|
586
611
|
|
|
587
612
|
### Contract Testing
|
|
@@ -640,16 +665,18 @@ grimoire init --agent copilot # .github/copilot-instructions.m
|
|
|
640
665
|
|-------|---------|
|
|
641
666
|
| `/grimoire:draft` | Draft features and/or decisions collaboratively |
|
|
642
667
|
| `/grimoire:plan` | Generate detailed implementation tasks from specs |
|
|
643
|
-
| `/grimoire:review` | Multi-perspective design review (PM, engineer, security, QA, data) |
|
|
644
|
-
| `/grimoire:apply` | Execute tasks
|
|
668
|
+
| `/grimoire:review` | Multi-perspective design review (PM, engineer, security, QA, data, principles) |
|
|
669
|
+
| `/grimoire:apply` | Execute tasks test-first at the right level (BDD for behavior, unit for invariants) |
|
|
645
670
|
| `/grimoire:verify` | Post-implementation verification + test quality |
|
|
646
671
|
| `/grimoire:audit` | Discover undocumented features and decisions |
|
|
647
672
|
| `/grimoire:remove` | Tracked feature removal with impact assessment |
|
|
648
|
-
| `/grimoire:discover` | Generate area docs and data schema
|
|
673
|
+
| `/grimoire:discover` | Generate intent-focused area docs and data schema |
|
|
649
674
|
| `/grimoire:refactor` | Find, prioritize, and track tech debt |
|
|
650
675
|
| `/grimoire:bug` | Disciplined bug fix with reproduction test first |
|
|
651
676
|
| `/grimoire:bug-report` | Structured bug reporting (accepts test tool output) |
|
|
652
677
|
| `/grimoire:bug-triage` | Classify and route bug reports |
|
|
678
|
+
| `/grimoire:vuln-triage` | Triage vuln scans (npm audit / pip-audit / Trivy / any tool) against deployment + controls — hotfix-now vs next release |
|
|
679
|
+
| `/grimoire:vuln-remediate` | File triaged vulns — tickets in the bug tracker, risk-accept register with expiry, change stubs for big fixes |
|
|
653
680
|
| `/grimoire:bug-explore` | AI-guided exploratory testing and gap analysis |
|
|
654
681
|
| `/grimoire:bug-session` | Charter-based exploratory testing sessions |
|
|
655
682
|
| `/grimoire:branch-guard` | Enforce branch hygiene before starting new feature work (also wired as a hook) |
|
|
@@ -672,22 +699,19 @@ grimoire init --agent copilot # .github/copilot-instructions.m
|
|
|
672
699
|
| `grimoire init --skip-agents` | Skip generating AGENTS.md instructions |
|
|
673
700
|
| `grimoire init --skip-skills` | Skip installing skills for selected agents |
|
|
674
701
|
| `grimoire init --no-detect` | Skip auto-detection of project tools |
|
|
702
|
+
| `grimoire init --full` | Also run all deferred configure sections (compliance, design, LLM models, bug trackers, testing tools) |
|
|
675
703
|
| `grimoire init --install-codebase-memory-mcp` | Mark codebase-memory-mcp as a recommended integration |
|
|
676
704
|
| `grimoire init --install-caveman-plugin` | Mark caveman skill plugin as a recommended integration |
|
|
677
705
|
| `grimoire update [path]` | Update AGENTS.md, skills, and hooks to latest version |
|
|
678
706
|
| `grimoire update --skip-agents\|--skip-skills\|--skip-hooks\|--skip-templates\|--skip-config` | Skip parts of the update |
|
|
679
707
|
| `grimoire update --force-templates` | Overwrite existing template files |
|
|
708
|
+
| `grimoire configure [section]` | Configure options deferred from init: compliance, design tool, LLM models, bug trackers, testing tools (omit section for interactive menu) |
|
|
680
709
|
| `grimoire list` | List active changes (with conflict detection) |
|
|
681
710
|
| `grimoire list --features` | List feature files |
|
|
682
711
|
| `grimoire list --decisions` | List decision records |
|
|
683
712
|
| `grimoire status <id>` | Show change status, branch, and task progress |
|
|
684
713
|
| `grimoire validate [id]` | Validate features, decisions, and manifests |
|
|
685
714
|
| `grimoire validate --strict` | Enable strict validation |
|
|
686
|
-
| `grimoire archive <id> [-y]` | Archive a completed change (`-y` skips confirmation) |
|
|
687
|
-
| `grimoire map` | Structural codebase scan |
|
|
688
|
-
| `grimoire map --duplicates` | Run jscpd duplicate detection |
|
|
689
|
-
| `grimoire map --refresh` | Diff against existing docs, show gaps |
|
|
690
|
-
| `grimoire map --depth <n>` | Max directory depth to scan (default 4) |
|
|
691
715
|
| `grimoire check [steps...]` | Run pre-commit pipeline |
|
|
692
716
|
| `grimoire ci` | Run CI pipeline |
|
|
693
717
|
| `grimoire ci --setup` | Generate `.github/workflows/grimoire.yml` template |
|
|
@@ -697,7 +721,6 @@ grimoire init --agent copilot # .github/copilot-instructions.m
|
|
|
697
721
|
| `grimoire pr --create` | Create PR via gh/glab |
|
|
698
722
|
| `grimoire pr --review` | Run post-implementation LLM review of diff |
|
|
699
723
|
| `grimoire test-quality [files]` | Analyze test files for quality issues |
|
|
700
|
-
| `grimoire log [--from <ref>] [--to <ref>]` | Generate change log / release notes |
|
|
701
724
|
| `grimoire trace <file[:line]>` | Trace file to originating grimoire change |
|
|
702
725
|
| `grimoire diff <id>` | Compare proposed change specs against the baseline |
|
|
703
726
|
| `grimoire docs [-o <path>]` | Generate human-readable project overview |
|
|
@@ -810,7 +833,7 @@ testing_tools:
|
|
|
810
833
|
|
|
811
834
|
## Contributing
|
|
812
835
|
|
|
813
|
-
Issues and pull requests welcome at [github.com/
|
|
836
|
+
Issues and pull requests welcome at [github.com/KiwiData-AI/grimoire](https://github.com/KiwiData-AI/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.
|
|
814
837
|
|
|
815
838
|
**Before opening a PR:**
|
|
816
839
|
|
|
@@ -826,7 +849,7 @@ Issues and pull requests welcome at [github.com/kiwi-data/grimoire](https://gith
|
|
|
826
849
|
### Development Setup
|
|
827
850
|
|
|
828
851
|
```bash
|
|
829
|
-
git clone https://github.com/
|
|
852
|
+
git clone https://github.com/KiwiData-AI/grimoire.git
|
|
830
853
|
cd grimoire
|
|
831
854
|
npm install
|
|
832
855
|
npm run build # Compile TypeScript
|
|
@@ -853,7 +876,7 @@ grimoire/
|
|
|
853
876
|
### Adding a New Skill
|
|
854
877
|
|
|
855
878
|
1. Create `skills/grimoire-<name>/SKILL.md` with trigger, prerequisites, workflow, and important notes
|
|
856
|
-
2. Add `"grimoire-<name>"` to the `
|
|
879
|
+
2. Add `"grimoire-<name>"` to the `SKILL_NAMES` array in `src/core/shared-setup.ts` (shared by init and update)
|
|
857
880
|
3. Build and test: `npm run build && node bin/grimoire.js update .`
|
|
858
881
|
|
|
859
882
|
Skills are pure markdown — instructions for the AI, not executable code.
|
|
@@ -874,12 +897,14 @@ Skills are pure markdown — instructions for the AI, not executable code.
|
|
|
874
897
|
|
|
875
898
|
## Philosophy
|
|
876
899
|
|
|
877
|
-
- **
|
|
878
|
-
- **
|
|
900
|
+
- **One home per fact.** Behavior → feature; invariant → constraint; trade-off → decision; data → schema; structure → the live graph. No fact in two places (DRY).
|
|
901
|
+
- **One right way.** Each thing has a single sanctioned approach. Two ways to do the same job is a defect, even if both work.
|
|
902
|
+
- **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.
|
|
903
|
+
- **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.
|
|
904
|
+
- **Red-green is mandatory.** A test must fail before it passes — at the right level (BDD for behavior, unit for invariants).
|
|
879
905
|
- **Decisions are documented.** Architecture choices that aren't written down get relitigated.
|
|
880
906
|
- **Reproduce before you fix.** Every bug gets a failing test before any code changes.
|
|
881
907
|
- **Simple over clever.** Less code, fewer abstractions, smallest surface area.
|
|
882
|
-
- **Verify before using.** Confirm imports, functions, and packages exist before writing code that depends on them.
|
|
883
908
|
- **Removal is deliberate.** Removing a feature gets the same rigor as adding one.
|
|
884
909
|
- **The fix is upstream.** You don't fix codebase entropy by reviewing harder — you fix it by requiring specs before code.
|
|
885
910
|
|
package/dist/cli/index.js
CHANGED
|
@@ -1,44 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { updateCommand } from "../commands/update.js";
|
|
4
|
-
import { validateCommand } from "../commands/validate.js";
|
|
5
|
-
import { listCommand } from "../commands/list.js";
|
|
6
|
-
import { statusCommand } from "../commands/status.js";
|
|
7
|
-
import { archiveCommand } from "../commands/archive.js";
|
|
8
|
-
import { mapCommand } from "../commands/map.js";
|
|
9
|
-
import { checkCommand } from "../commands/check.js";
|
|
10
|
-
import { logCommand } from "../commands/log.js";
|
|
11
|
-
import { traceCommand } from "../commands/trace.js";
|
|
12
|
-
import { docsCommand } from "../commands/docs.js";
|
|
13
|
-
import { healthCommand } from "../commands/health.js";
|
|
14
|
-
import { prCommand } from "../commands/pr.js";
|
|
15
|
-
import { testQualityCommand } from "../commands/test-quality.js";
|
|
16
|
-
import { diffCommand } from "../commands/diff.js";
|
|
17
|
-
import { ciCommand } from "../commands/ci.js";
|
|
18
|
-
import { branchCheckCommand } from "../commands/branch-check.js";
|
|
19
|
-
import { configureCommand } from "../commands/configure.js";
|
|
20
|
-
const program = new Command();
|
|
21
|
-
program
|
|
22
|
-
.name("grimoire")
|
|
23
|
-
.description("Gherkin + MADR spec-driven development for AI coding assistants")
|
|
24
|
-
.version("0.1.2");
|
|
25
|
-
program.addCommand(initCommand);
|
|
26
|
-
program.addCommand(updateCommand);
|
|
27
|
-
program.addCommand(validateCommand);
|
|
28
|
-
program.addCommand(listCommand);
|
|
29
|
-
program.addCommand(statusCommand);
|
|
30
|
-
program.addCommand(archiveCommand);
|
|
31
|
-
program.addCommand(mapCommand);
|
|
32
|
-
program.addCommand(checkCommand);
|
|
33
|
-
program.addCommand(logCommand);
|
|
34
|
-
program.addCommand(traceCommand);
|
|
35
|
-
program.addCommand(docsCommand);
|
|
36
|
-
program.addCommand(healthCommand);
|
|
37
|
-
program.addCommand(prCommand);
|
|
38
|
-
program.addCommand(testQualityCommand);
|
|
39
|
-
program.addCommand(diffCommand);
|
|
40
|
-
program.addCommand(ciCommand);
|
|
41
|
-
program.addCommand(branchCheckCommand);
|
|
42
|
-
program.addCommand(configureCommand);
|
|
43
|
-
program.parse();
|
|
1
|
+
import { buildProgram } from "./program.js";
|
|
2
|
+
buildProgram().parse();
|
|
44
3
|
//# 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,cAAc,CAAC;AAE5C,YAAY,EAAE,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../../src/cli/program.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqBpC,yFAAyF;AACzF,wBAAgB,YAAY,IAAI,OAAO,CAyBtC"}
|