@kiwidata/grimoire 0.1.1
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 +8 -0
- package/AGENTS.md +217 -0
- package/README.md +748 -0
- package/bin/grimoire.js +2 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +42 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/commands/archive.d.ts +3 -0
- package/dist/commands/archive.d.ts.map +1 -0
- package/dist/commands/archive.js +22 -0
- package/dist/commands/archive.js.map +1 -0
- package/dist/commands/branch-check.d.ts +3 -0
- package/dist/commands/branch-check.d.ts.map +1 -0
- package/dist/commands/branch-check.js +16 -0
- package/dist/commands/branch-check.js.map +1 -0
- package/dist/commands/check.d.ts +3 -0
- package/dist/commands/check.d.ts.map +1 -0
- package/dist/commands/check.js +22 -0
- package/dist/commands/check.js.map +1 -0
- package/dist/commands/ci.d.ts +3 -0
- package/dist/commands/ci.d.ts.map +1 -0
- package/dist/commands/ci.js +18 -0
- package/dist/commands/ci.js.map +1 -0
- package/dist/commands/diff.d.ts +3 -0
- package/dist/commands/diff.d.ts.map +1 -0
- package/dist/commands/diff.js +10 -0
- package/dist/commands/diff.js.map +1 -0
- package/dist/commands/docs.d.ts +3 -0
- package/dist/commands/docs.d.ts.map +1 -0
- package/dist/commands/docs.js +11 -0
- package/dist/commands/docs.js.map +1 -0
- package/dist/commands/health.d.ts +3 -0
- package/dist/commands/health.d.ts.map +1 -0
- package/dist/commands/health.js +13 -0
- package/dist/commands/health.js.map +1 -0
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +21 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/list.d.ts +3 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +22 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/log.d.ts +3 -0
- package/dist/commands/log.d.ts.map +1 -0
- package/dist/commands/log.js +15 -0
- package/dist/commands/log.js.map +1 -0
- package/dist/commands/map.d.ts +3 -0
- package/dist/commands/map.d.ts.map +1 -0
- package/dist/commands/map.js +17 -0
- package/dist/commands/map.js.map +1 -0
- package/dist/commands/pr.d.ts +3 -0
- package/dist/commands/pr.d.ts.map +1 -0
- package/dist/commands/pr.js +17 -0
- package/dist/commands/pr.js.map +1 -0
- package/dist/commands/status.d.ts +3 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +12 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/test-quality.d.ts +3 -0
- package/dist/commands/test-quality.d.ts.map +1 -0
- package/dist/commands/test-quality.js +37 -0
- package/dist/commands/test-quality.js.map +1 -0
- package/dist/commands/trace.d.ts +3 -0
- package/dist/commands/trace.d.ts.map +1 -0
- package/dist/commands/trace.js +12 -0
- package/dist/commands/trace.js.map +1 -0
- package/dist/commands/update.d.ts +3 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +22 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/validate.d.ts +3 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +17 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/core/archive.d.ts +9 -0
- package/dist/core/archive.d.ts.map +1 -0
- package/dist/core/archive.js +92 -0
- package/dist/core/archive.js.map +1 -0
- package/dist/core/branch-check.d.ts +27 -0
- package/dist/core/branch-check.d.ts.map +1 -0
- package/dist/core/branch-check.js +205 -0
- package/dist/core/branch-check.js.map +1 -0
- package/dist/core/check.d.ts +24 -0
- package/dist/core/check.d.ts.map +1 -0
- package/dist/core/check.js +372 -0
- package/dist/core/check.js.map +1 -0
- package/dist/core/ci.d.ts +24 -0
- package/dist/core/ci.d.ts.map +1 -0
- package/dist/core/ci.js +162 -0
- package/dist/core/ci.js.map +1 -0
- package/dist/core/detect.d.ts +10 -0
- package/dist/core/detect.d.ts.map +1 -0
- package/dist/core/detect.js +368 -0
- package/dist/core/detect.js.map +1 -0
- package/dist/core/diff.d.ts +29 -0
- package/dist/core/diff.d.ts.map +1 -0
- package/dist/core/diff.js +197 -0
- package/dist/core/diff.js.map +1 -0
- package/dist/core/doc-style.d.ts +16 -0
- package/dist/core/doc-style.d.ts.map +1 -0
- package/dist/core/doc-style.js +192 -0
- package/dist/core/doc-style.js.map +1 -0
- package/dist/core/docs.d.ts +6 -0
- package/dist/core/docs.d.ts.map +1 -0
- package/dist/core/docs.js +478 -0
- package/dist/core/docs.js.map +1 -0
- package/dist/core/health.d.ts +7 -0
- package/dist/core/health.d.ts.map +1 -0
- package/dist/core/health.js +489 -0
- package/dist/core/health.js.map +1 -0
- package/dist/core/hooks.d.ts +5 -0
- package/dist/core/hooks.d.ts.map +1 -0
- package/dist/core/hooks.js +168 -0
- package/dist/core/hooks.js.map +1 -0
- package/dist/core/init.d.ts +9 -0
- package/dist/core/init.d.ts.map +1 -0
- package/dist/core/init.js +563 -0
- package/dist/core/init.js.map +1 -0
- package/dist/core/list.d.ts +4 -0
- package/dist/core/list.d.ts.map +1 -0
- package/dist/core/list.js +170 -0
- package/dist/core/list.js.map +1 -0
- package/dist/core/log.d.ts +8 -0
- package/dist/core/log.d.ts.map +1 -0
- package/dist/core/log.js +150 -0
- package/dist/core/log.js.map +1 -0
- package/dist/core/map.d.ts +9 -0
- package/dist/core/map.d.ts.map +1 -0
- package/dist/core/map.js +302 -0
- package/dist/core/map.js.map +1 -0
- package/dist/core/pr.d.ts +9 -0
- package/dist/core/pr.d.ts.map +1 -0
- package/dist/core/pr.js +273 -0
- package/dist/core/pr.js.map +1 -0
- package/dist/core/shared-setup.d.ts +52 -0
- package/dist/core/shared-setup.d.ts.map +1 -0
- package/dist/core/shared-setup.js +221 -0
- package/dist/core/shared-setup.js.map +1 -0
- package/dist/core/status.d.ts +6 -0
- package/dist/core/status.d.ts.map +1 -0
- package/dist/core/status.js +114 -0
- package/dist/core/status.js.map +1 -0
- package/dist/core/test-quality.d.ts +33 -0
- package/dist/core/test-quality.d.ts.map +1 -0
- package/dist/core/test-quality.js +378 -0
- package/dist/core/test-quality.js.map +1 -0
- package/dist/core/trace.d.ts +6 -0
- package/dist/core/trace.d.ts.map +1 -0
- package/dist/core/trace.js +211 -0
- package/dist/core/trace.js.map +1 -0
- package/dist/core/update.d.ts +10 -0
- package/dist/core/update.d.ts.map +1 -0
- package/dist/core/update.js +149 -0
- package/dist/core/update.js.map +1 -0
- package/dist/core/validate.d.ts +20 -0
- package/dist/core/validate.d.ts.map +1 -0
- package/dist/core/validate.js +275 -0
- package/dist/core/validate.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/utils/config.d.ts +61 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/config.js +172 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/fs.d.ts +17 -0
- package/dist/utils/fs.d.ts.map +1 -0
- package/dist/utils/fs.js +38 -0
- package/dist/utils/fs.js.map +1 -0
- package/dist/utils/paths.d.ts +10 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +35 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/utils/spawn.d.ts +5 -0
- package/dist/utils/spawn.d.ts.map +1 -0
- package/dist/utils/spawn.js +34 -0
- package/dist/utils/spawn.js.map +1 -0
- package/package.json +68 -0
- package/skills/grimoire-apply/SKILL.md +274 -0
- package/skills/grimoire-audit/SKILL.md +129 -0
- package/skills/grimoire-branch-guard/SKILL.md +111 -0
- package/skills/grimoire-bug/SKILL.md +160 -0
- package/skills/grimoire-bug-explore/SKILL.md +242 -0
- package/skills/grimoire-bug-report/SKILL.md +237 -0
- package/skills/grimoire-bug-session/SKILL.md +222 -0
- package/skills/grimoire-bug-triage/SKILL.md +274 -0
- package/skills/grimoire-commit/SKILL.md +150 -0
- package/skills/grimoire-discover/SKILL.md +297 -0
- package/skills/grimoire-draft/SKILL.md +202 -0
- package/skills/grimoire-plan/SKILL.md +329 -0
- package/skills/grimoire-pr/SKILL.md +134 -0
- package/skills/grimoire-pr-review/SKILL.md +240 -0
- package/skills/grimoire-refactor/SKILL.md +251 -0
- package/skills/grimoire-remove/SKILL.md +112 -0
- package/skills/grimoire-review/SKILL.md +247 -0
- package/skills/grimoire-verify/SKILL.md +223 -0
- package/skills/references/bug-classification.md +154 -0
- package/skills/references/build-vs-buy.md +77 -0
- package/skills/references/elicitation-personas.md +118 -0
- package/skills/references/refactor-register-format.md +88 -0
- package/skills/references/refactor-scan-categories.md +102 -0
- package/skills/references/schema-format.md +68 -0
- package/skills/references/security-compliance.md +110 -0
- package/skills/references/testing-contracts.md +93 -0
- package/templates/context.yml +110 -0
- package/templates/debt-exceptions.yml +61 -0
- package/templates/decision.md +50 -0
- package/templates/dupignore +93 -0
- package/templates/example.feature +24 -0
- package/templates/manifest.md +29 -0
- package/templates/mapignore +58 -0
- package/templates/mapkeys +65 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "grimoire",
|
|
3
|
+
"description": "BDD-powered AI coding assistant — Gherkin specs, MADR decisions, and red-green development for AI agents",
|
|
4
|
+
"version": "0.1.1",
|
|
5
|
+
"author": "Kiwi Data",
|
|
6
|
+
"homepage": "https://github.com/kiwi-data/grimoire",
|
|
7
|
+
"license": "MIT"
|
|
8
|
+
}
|
package/AGENTS.md
ADDED
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# Grimoire — AI Assistant Instructions
|
|
2
|
+
|
|
3
|
+
Grimoire is a spec-driven development workflow using **Gherkin** for behavioral requirements and **MADR** for architecture decisions. These instructions apply to any AI coding assistant.
|
|
4
|
+
|
|
5
|
+
## Engineering Principles
|
|
6
|
+
|
|
7
|
+
These principles govern all grimoire work — drafting, planning, reviewing, and implementing.
|
|
8
|
+
|
|
9
|
+
**Simple over clever.** Choose the straightforward approach. A few lines of obvious code beat an elegant abstraction. If a junior developer would need to pause and think about how it works, simplify it.
|
|
10
|
+
|
|
11
|
+
**Less code is more.** Every line is a liability — it must be read, tested, maintained, and debugged. Delete what you can. Inline what's used once. Don't write code "in case we need it later."
|
|
12
|
+
|
|
13
|
+
**Don't abstract early.** Three copies of similar code is fine. An abstraction should be extracted when a clear, stable pattern has emerged — not when you see the first hint of repetition. Wrong abstractions are harder to fix than duplicated code.
|
|
14
|
+
|
|
15
|
+
**Solve the problem in front of you.** Do not add configurability, feature flags, extension points, plugin systems, or generic interfaces unless the task specifically calls for them. Build for the current requirement, not imagined future ones.
|
|
16
|
+
|
|
17
|
+
**Use what exists.** Before writing anything, check what's already in the codebase. Use existing utilities, patterns, conventions, and libraries. Read `.grimoire/docs/` if area docs exist. A new dependency or utility needs a reason.
|
|
18
|
+
|
|
19
|
+
**Small surface area.** Fewer public functions, fewer parameters, fewer options. A function that does one thing with two parameters beats one that does three things with six parameters and a config object.
|
|
20
|
+
|
|
21
|
+
**Obvious structure.** Follow the project's existing file layout, naming conventions, and patterns. New code should look like it was written by the same team. Don't reorganize, rename, or "improve" structure that isn't part of your change.
|
|
22
|
+
|
|
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
|
+
|
|
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
|
+
|
|
27
|
+
## When to Use Grimoire
|
|
28
|
+
|
|
29
|
+
Use grimoire when the user's request involves:
|
|
30
|
+
- New user-facing functionality (→ Gherkin feature)
|
|
31
|
+
- Changes to existing behavior (→ Gherkin feature)
|
|
32
|
+
- Technology or architecture decisions (→ MADR decision record)
|
|
33
|
+
- Non-functional requirements like performance targets or security policies (→ MADR decision record)
|
|
34
|
+
|
|
35
|
+
**Do NOT use grimoire for:**
|
|
36
|
+
- Bug fixes — the feature file already describes correct behavior. Just fix the code.
|
|
37
|
+
- Pure refactoring — no behavior change means no scenario change. May warrant an ADR if architectural.
|
|
38
|
+
- Config changes, dependency updates, formatting — no behavioral or architectural impact.
|
|
39
|
+
|
|
40
|
+
**Routing rule:** If the request is expressible as Given/When/Then, it's a Gherkin feature. If it's a trade-off, choice, or structural decision, it's an ADR. If it's neither, it doesn't belong in grimoire.
|
|
41
|
+
|
|
42
|
+
## Decision Tree: What Do I Do?
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
User has a request
|
|
46
|
+
│
|
|
47
|
+
├─ "Something is broken / not working right"
|
|
48
|
+
│ │
|
|
49
|
+
│ ├─ Reporter is a tester / non-developer?
|
|
50
|
+
│ │ → /grimoire:bug-report → structured bug report with spec references
|
|
51
|
+
│ │
|
|
52
|
+
│ ├─ Developer picking up a bug report?
|
|
53
|
+
│ │ → /grimoire:bug-triage → validate, reject with evidence, or request info
|
|
54
|
+
│ │ If validated → /grimoire:bug for the fix (repro test first)
|
|
55
|
+
│ │
|
|
56
|
+
│ └─ Developer found it themselves?
|
|
57
|
+
│ → /grimoire:bug → reproduce first, write failing test, then fix
|
|
58
|
+
│
|
|
59
|
+
├─ "What could break? What are we missing?"
|
|
60
|
+
│ → /grimoire:bug-explore → exploratory testing, gap analysis, edge cases
|
|
61
|
+
│
|
|
62
|
+
├─ "I want to add / change / remove functionality"
|
|
63
|
+
│ │
|
|
64
|
+
│ ├─ Adding new behavior?
|
|
65
|
+
│ │ → /grimoire:draft → write new .feature file
|
|
66
|
+
│ │
|
|
67
|
+
│ ├─ Changing existing behavior?
|
|
68
|
+
│ │ → /grimoire:draft → modify existing .feature file
|
|
69
|
+
│ │
|
|
70
|
+
│ ├─ Removing a feature?
|
|
71
|
+
│ │ → /grimoire:remove → tracked removal with impact assessment
|
|
72
|
+
│ │
|
|
73
|
+
│ └─ Does it also involve a technology/architecture choice?
|
|
74
|
+
│ → Draft BOTH: .feature file + MADR decision record in the same change
|
|
75
|
+
│
|
|
76
|
+
├─ "We should use X instead of Y" / "How should we architect this?"
|
|
77
|
+
│ → /grimoire:draft → MADR decision record (not a feature)
|
|
78
|
+
│
|
|
79
|
+
├─ "We need to handle X concurrent users / meet Y compliance"
|
|
80
|
+
│ → /grimoire:draft → MADR decision record (non-functional requirement)
|
|
81
|
+
│
|
|
82
|
+
├─ "What do we have? What's documented?"
|
|
83
|
+
│ → /grimoire:audit → discover undocumented features and decisions
|
|
84
|
+
│
|
|
85
|
+
├─ "Is everything implemented correctly?"
|
|
86
|
+
│ → /grimoire:verify → check code matches specs
|
|
87
|
+
│
|
|
88
|
+
├─ "Refactor / clean up / reorganize"
|
|
89
|
+
│ → Don't use grimoire (no behavior change). UNLESS the refactoring
|
|
90
|
+
│ changes module boundaries or patterns — then write an ADR.
|
|
91
|
+
│
|
|
92
|
+
├─ "Update config / deps / formatting"
|
|
93
|
+
│ → Don't use grimoire. Just do it.
|
|
94
|
+
│
|
|
95
|
+
├─ "Setting up grimoire on an existing project"
|
|
96
|
+
│ 1. `grimoire init` → creates .grimoire/ directory and config
|
|
97
|
+
│ 2. `grimoire map` → scans codebase structure into .snapshot.json
|
|
98
|
+
│ 3. `/grimoire:discover` → generates area docs, data schema, project context
|
|
99
|
+
│ 4. `/grimoire:audit` → discovers undocumented features and decisions
|
|
100
|
+
│ 5. Start working: `/grimoire:draft` for new changes, `/grimoire:bug` for fixes
|
|
101
|
+
│
|
|
102
|
+
└─ "Setting up grimoire on a new/greenfield project"
|
|
103
|
+
1. `grimoire init` → creates .grimoire/ directory and config
|
|
104
|
+
2. Start working: `/grimoire:draft` for the first feature
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Skill Routing
|
|
108
|
+
|
|
109
|
+
Every grimoire skill has a **Routing** section that redirects to the correct skill when a mismatch is detected. If you start a skill and realize the user's request doesn't match, check the Routing section — it tells you where to go instead.
|
|
110
|
+
|
|
111
|
+
Skills also have a **Done** section that signals when the workflow is complete. When you reach it, present results and wait for the user's next instruction. Do not invent follow-up actions.
|
|
112
|
+
|
|
113
|
+
## Workflow: Creating or Changing a Feature
|
|
114
|
+
|
|
115
|
+
This is the end-to-end flow for the most common operation — adding or modifying behavior:
|
|
116
|
+
|
|
117
|
+
1. **User describes what they want**
|
|
118
|
+
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`.
|
|
119
|
+
3. **Plan** (`/grimoire:plan`): Read approved artifacts. Generate `tasks.md` with red-green test pairs for each scenario. Review with user.
|
|
120
|
+
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.
|
|
121
|
+
5. **Apply** (`/grimoire:apply`): Work through tasks. For each: write test (must fail), write code (must pass), mark done. Update manifest status to `implementing`.
|
|
122
|
+
6. **Verify** (`/grimoire:verify`): Confirm all scenarios pass, no regressions, decisions followed. Generate report.
|
|
123
|
+
7. **Archive** (`grimoire archive <id>`): Sync features/decisions to baseline. Archive manifest. Update manifest status to `complete`.
|
|
124
|
+
|
|
125
|
+
Each stage has a skill. The user drives the pace. In review mode (default), every file change is approved before writing. In autonomous mode, the agent works through the full task list, stopping only on blockers.
|
|
126
|
+
|
|
127
|
+
### IMPORTANT: tasks.md Is the Plan
|
|
128
|
+
|
|
129
|
+
When `tasks.md` exists for a change, it IS the plan. **Do not enter plan mode. Do not create your own plan. Do not re-derive tasks from the feature files.**
|
|
130
|
+
|
|
131
|
+
The plan was created in the plan stage with specific file paths, specific assertions, and specific implementation details. It was reviewed and approved by the user. The apply stage executes it — nothing more.
|
|
132
|
+
|
|
133
|
+
This matters because:
|
|
134
|
+
- The plan was written with full codebase context (real file paths, real patterns)
|
|
135
|
+
- The user already approved the approach
|
|
136
|
+
- Re-planning wastes time and may diverge from what was agreed
|
|
137
|
+
- `tasks.md` supports resume — a new session should pick up where the last one left off, not start over
|
|
138
|
+
|
|
139
|
+
If a task seems wrong or impossible during apply:
|
|
140
|
+
1. Flag it to the user with a specific explanation
|
|
141
|
+
2. Wait for the user to decide: fix the task, skip it, or go back to plan
|
|
142
|
+
3. Do NOT silently rewrite or reorder tasks
|
|
143
|
+
|
|
144
|
+
## Directory Structure
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
project-root/
|
|
148
|
+
├── features/ # Gherkin baseline — behavioral truth
|
|
149
|
+
│ └── <capability>/
|
|
150
|
+
│ └── <name>.feature
|
|
151
|
+
├── .grimoire/
|
|
152
|
+
│ ├── decisions/ # MADR baseline — architectural truth
|
|
153
|
+
│ │ ├── 0001-short-title.md
|
|
154
|
+
│ │ └── template.md
|
|
155
|
+
│ ├── changes/ # proposed changes (in progress)
|
|
156
|
+
│ │ └── <change-id>/
|
|
157
|
+
│ │ ├── manifest.md
|
|
158
|
+
│ │ ├── tasks.md
|
|
159
|
+
│ │ ├── features/ # proposed .feature file state
|
|
160
|
+
│ │ └── decisions/ # new/updated ADRs
|
|
161
|
+
│ └── archive/ # completed changes (manifests only)
|
|
162
|
+
│ └── YYYY-MM-DD-<change-id>/
|
|
163
|
+
│ └── manifest.md
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Conventions
|
|
167
|
+
|
|
168
|
+
### Manifest Status Lifecycle
|
|
169
|
+
Every manifest has a `status` field in YAML frontmatter:
|
|
170
|
+
- `draft` — being written, not yet reviewed
|
|
171
|
+
- `approved` — reviewed by user, ready for planning/implementation
|
|
172
|
+
- `implementing` — tasks are being worked on
|
|
173
|
+
- `complete` — all tasks done, ready to archive
|
|
174
|
+
|
|
175
|
+
Update the status as the change progresses. The CLI reads this to report change state.
|
|
176
|
+
|
|
177
|
+
### Change IDs
|
|
178
|
+
- Kebab-case, verb-led: `add-two-factor-auth`, `update-login-flow`, `remove-legacy-api`
|
|
179
|
+
- Must be unique across active changes
|
|
180
|
+
|
|
181
|
+
### Branch Naming
|
|
182
|
+
Create a feature branch before implementing a change:
|
|
183
|
+
```
|
|
184
|
+
<type>/<change-id>
|
|
185
|
+
```
|
|
186
|
+
- `feat/add-two-factor-auth` — new feature
|
|
187
|
+
- `fix/handle-null-pricing` — bug fix
|
|
188
|
+
- `refactor/migrate-to-sqlalchemy` — refactoring
|
|
189
|
+
- `chore/update-dependencies` — maintenance
|
|
190
|
+
|
|
191
|
+
The branch name links the git history to the grimoire change. Update the manifest's `branch:` field when the branch is created.
|
|
192
|
+
|
|
193
|
+
### Commit Trailers
|
|
194
|
+
Every commit during a grimoire change **MUST** include a `Change:` git trailer:
|
|
195
|
+
```
|
|
196
|
+
feat(auth): add TOTP verification
|
|
197
|
+
|
|
198
|
+
Implement TOTP code verification using pyotp.
|
|
199
|
+
|
|
200
|
+
Change: add-2fa-login
|
|
201
|
+
Scenarios: "Login with valid TOTP code", "Login with expired TOTP code"
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
This is what makes `grimoire trace` and `grimoire log` work. Without it, the commit is invisible to the audit trail. `Scenarios:` and `Decisions:` trailers are included when relevant.
|
|
205
|
+
|
|
206
|
+
### Feature Organization
|
|
207
|
+
- One capability per directory: `features/auth/`, `features/documents/`
|
|
208
|
+
- One feature per file (or closely related features grouped)
|
|
209
|
+
- Tags for cross-cutting concerns: `@smoke`, `@api`, `@slow`
|
|
210
|
+
|
|
211
|
+
### Decision Numbering
|
|
212
|
+
- Sequential, zero-padded: `0001-`, `0002-`, etc.
|
|
213
|
+
- Never reuse numbers
|
|
214
|
+
- Superseded decisions keep their number, status updated to `superseded by NNNN`
|
|
215
|
+
|
|
216
|
+
### Step Definitions
|
|
217
|
+
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.
|