@kiwidata/grimoire 0.1.3 → 0.1.4
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 +28 -1
- package/dist/cli/index.js +2 -0
- 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/commands/map.d.ts.map +1 -1
- package/dist/commands/map.js +10 -11
- package/dist/commands/map.js.map +1 -1
- package/dist/core/archive.d.ts.map +1 -1
- package/dist/core/archive.js +32 -43
- package/dist/core/archive.js.map +1 -1
- package/dist/core/check.d.ts.map +1 -1
- package/dist/core/check.js +115 -104
- 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 +28 -23
- package/dist/core/doc-style.js.map +1 -1
- package/dist/core/docs.js +106 -100
- package/dist/core/docs.js.map +1 -1
- package/dist/core/health.js +55 -77
- 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 +0 -11
- 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/log.d.ts.map +1 -1
- package/dist/core/log.js +23 -33
- package/dist/core/log.js.map +1 -1
- package/dist/core/map.d.ts +15 -2
- package/dist/core/map.d.ts.map +1 -1
- package/dist/core/map.js +257 -194
- package/dist/core/map.js.map +1 -1
- 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 +87 -52
- 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 +31 -41
- 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/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 +84 -16
- package/skills/grimoire-audit/SKILL.md +21 -1
- package/skills/grimoire-bug/SKILL.md +48 -9
- package/skills/grimoire-commit/SKILL.md +2 -1
- package/skills/grimoire-design/SKILL.md +259 -0
- package/skills/grimoire-design-consult/SKILL.md +200 -0
- package/skills/grimoire-discover/SKILL.md +65 -2
- package/skills/grimoire-draft/SKILL.md +85 -2
- package/skills/grimoire-plan/SKILL.md +61 -18
- package/skills/grimoire-pr/SKILL.md +4 -6
- package/skills/grimoire-pr-review/SKILL.md +45 -114
- package/skills/grimoire-precommit-review/SKILL.md +205 -0
- package/skills/grimoire-refactor/SKILL.md +5 -5
- package/skills/grimoire-review/SKILL.md +74 -147
- package/skills/grimoire-verify/SKILL.md +33 -0
- package/skills/references/adversarial-personas.md +225 -0
- package/skills/references/brand-tokens-format.md +186 -0
- package/skills/references/code-quality.md +140 -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/refactor-scan-categories.md +152 -0
- package/skills/references/review-personas.md +405 -0
- package/skills/references/security-compliance.md +22 -1
- package/skills/references/visual-fidelity.md +206 -0
- package/templates/brand-tokens-example.json +13 -0
- package/templates/brand-voice-example.md +22 -0
- package/templates/design-tool-setup-stub.md +59 -0
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
|
@@ -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
|
|
|
@@ -157,6 +157,18 @@ For each task:
|
|
|
157
157
|
|
|
158
158
|
`grimoire archive` syncs features to baseline, accepts decisions, updates data schema, and archives the manifest.
|
|
159
159
|
|
|
160
|
+
## For UI/UX designers
|
|
161
|
+
|
|
162
|
+
Grimoire treats design as a first-class spec input, not an afterthought.
|
|
163
|
+
|
|
164
|
+
- **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`.
|
|
165
|
+
- **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.
|
|
166
|
+
- **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).
|
|
167
|
+
- **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).
|
|
168
|
+
- **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.
|
|
169
|
+
|
|
170
|
+
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.
|
|
171
|
+
|
|
160
172
|
## Walkthrough
|
|
161
173
|
|
|
162
174
|
Full grimoire cycle end-to-end — adding two-factor authentication to an existing login feature.
|
|
@@ -453,6 +465,8 @@ Grimoire's security capabilities are **AI-mediated at design time**, not static
|
|
|
453
465
|
|
|
454
466
|
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
467
|
|
|
468
|
+
**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
|
+
|
|
456
470
|
Grimoire does not provide compliance framework enforcement (OWASP ASVS checklists, CWE mapping), SBOM generation, artifact signing, or DAST. These require dedicated security tooling.
|
|
457
471
|
|
|
458
472
|
## Features
|
|
@@ -642,6 +656,9 @@ grimoire init --agent copilot # .github/copilot-instructions.m
|
|
|
642
656
|
| `/grimoire:commit` | Contextual commit messages with change trailers |
|
|
643
657
|
| `/grimoire:pr` | Generate PR description + optional diff review |
|
|
644
658
|
| `/grimoire:pr-review` | Review a teammate's PR with the multi-persona lens |
|
|
659
|
+
| `/grimoire:precommit-review` | Multi-persona review of your own staged/unstaged diff before commit |
|
|
660
|
+
| `/grimoire:design` | Generate UI/UX designs — problem → variants → states → derived Gherkin |
|
|
661
|
+
| `/grimoire:design-consult` | Pre-design Q&A with security and data personas before any artifacts exist |
|
|
645
662
|
|
|
646
663
|
</details>
|
|
647
664
|
|
|
@@ -793,6 +810,16 @@ testing_tools:
|
|
|
793
810
|
|
|
794
811
|
## Contributing
|
|
795
812
|
|
|
813
|
+
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.
|
|
814
|
+
|
|
815
|
+
**Before opening a PR:**
|
|
816
|
+
|
|
817
|
+
- `npm run build && npm test && npm run lint` — all green
|
|
818
|
+
- `grimoire check` — pre-commit pipeline green
|
|
819
|
+
- New behavior has a Gherkin scenario in `features/` (or a decision record under `.grimoire/decisions/` if it's an architectural choice)
|
|
820
|
+
- Commit messages include a `Change:` trailer when the work is part of a tracked change
|
|
821
|
+
- For dependency adds/upgrades: lockfile committed, no floating version ranges in `package.json` (see Security model above)
|
|
822
|
+
|
|
796
823
|
<details>
|
|
797
824
|
<summary>Development setup and project structure</summary>
|
|
798
825
|
|
package/dist/cli/index.js
CHANGED
|
@@ -16,6 +16,7 @@ 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";
|
|
19
20
|
const program = new Command();
|
|
20
21
|
program
|
|
21
22
|
.name("grimoire")
|
|
@@ -38,5 +39,6 @@ program.addCommand(testQualityCommand);
|
|
|
38
39
|
program.addCommand(diffCommand);
|
|
39
40
|
program.addCommand(ciCommand);
|
|
40
41
|
program.addCommand(branchCheckCommand);
|
|
42
|
+
program.addCommand(configureCommand);
|
|
41
43
|
program.parse();
|
|
42
44
|
//# 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,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,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AAC,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,CAAC,kCAAkC,CAAC;KA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KACjD,MAAM,CAAC,eAAe,EAAE,wCAAwC,CAAC;KACjE,MAAM,CAAC,eAAe,EAAE,4CAA4C,CAAC;KACrE,MAAM,CAAC,aAAa,EAAE,sCAAsC,CAAC;KAC7D,MAAM,CAAC,gBAAgB,EAAE,6EAA6E,EAAE,OAAO,EAAE,EAAE,CAAC;KACpH,MAAM,CAAC,+BAA+B,EAAE,uFAAuF,CAAC;KAChI,MAAM,CAAC,0BAA0B,EAAE,wFAAwF,CAAC;KAC5H,MAAM,CAAC,QAAQ,EAAE,wGAAwG,CAAC;KAC1H,MAAM,CAAC,KAAK,EAAE,IAAY,EAAE,OAAO,EAAE,EAAE;IACtC,MAAM,WAAW,CAAC,IAAI,EAAE;QACtB,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,KAAK;QACvC,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,KAAK;QACvC,QAAQ,EAAE,OAAO,CAAC,MAAM,KAAK,KAAK;QAClC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,EAAE;QAC3B,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,KAAK;QAC3B,wBAAwB,EAAE,OAAO,CAAC,wBAAwB;QAC1D,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;KACnD,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEL,SAAS,OAAO,CAAC,KAAa,EAAE,QAAkB;IAChD,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../src/commands/map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../src/commands/map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,eAAO,MAAM,UAAU,SAUnB,CAAC"}
|
package/dist/commands/map.js
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
-
import {
|
|
2
|
+
import { runMap, McpRequiredError } from "../core/map.js";
|
|
3
3
|
export const mapCommand = new Command("map")
|
|
4
|
-
.description("
|
|
5
|
-
.option("--json", "Output as JSON")
|
|
6
|
-
.option("--refresh", "Compare against existing docs and show gaps")
|
|
4
|
+
.description("Detect drift between conventions files and the current codebase")
|
|
7
5
|
.option("--duplicates", "Run jscpd to detect code duplication")
|
|
8
|
-
.option("--depth <n>", "Max directory depth to scan", "4")
|
|
9
6
|
.action(async (options) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
try {
|
|
8
|
+
await runMap({ duplicates: options.duplicates ?? false });
|
|
9
|
+
}
|
|
10
|
+
catch (e) {
|
|
11
|
+
if (e instanceof McpRequiredError)
|
|
12
|
+
process.exit(1);
|
|
13
|
+
throw e;
|
|
14
|
+
}
|
|
16
15
|
});
|
|
17
16
|
//# sourceMappingURL=map.js.map
|
package/dist/commands/map.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.js","sourceRoot":"","sources":["../../src/commands/map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"map.js","sourceRoot":"","sources":["../../src/commands/map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAE1D,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,OAAO,CAAC,KAAK,CAAC;KACzC,WAAW,CAAC,iEAAiE,CAAC;KAC9E,MAAM,CAAC,cAAc,EAAE,sCAAsC,CAAC;KAC9D,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IACxB,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,KAAK,EAAE,CAAC,CAAC;IAC5D,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,YAAY,gBAAgB;YAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACnD,MAAM,CAAC,CAAC;IACV,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"archive.d.ts","sourceRoot":"","sources":["../../src/core/archive.ts"],"names":[],"mappings":"AAKA,UAAU,cAAc;IACtB,GAAG,EAAE,OAAO,CAAC;CACd;AAED,qBAAa,YAAa,SAAQ,KAAK;gBACzB,OAAO,EAAE,MAAM;CAI5B;
|
|
1
|
+
{"version":3,"file":"archive.d.ts","sourceRoot":"","sources":["../../src/core/archive.ts"],"names":[],"mappings":"AAKA,UAAU,cAAc;IACtB,GAAG,EAAE,OAAO,CAAC;CACd;AAED,qBAAa,YAAa,SAAQ,KAAK;gBACzB,OAAO,EAAE,MAAM;CAI5B;AAwCD,wBAAsB,aAAa,CACjC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,IAAI,CAAC,CAiCf"}
|
package/dist/core/archive.js
CHANGED
|
@@ -8,84 +8,73 @@ export class ArchiveError extends Error {
|
|
|
8
8
|
this.name = "ArchiveError";
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
const root = await findProjectRoot();
|
|
13
|
-
const changePath = resolveChangePath(root, changeId);
|
|
14
|
-
// Check change exists
|
|
15
|
-
try {
|
|
16
|
-
await readFile(join(changePath, "manifest.md"), "utf-8");
|
|
17
|
-
}
|
|
18
|
-
catch {
|
|
19
|
-
throw new ArchiveError(`Change "${changeId}" not found or missing manifest.`);
|
|
20
|
-
}
|
|
21
|
-
// Check tasks are complete
|
|
11
|
+
async function checkPendingTasks(changePath, yes) {
|
|
22
12
|
try {
|
|
23
13
|
const tasksContent = await readFile(join(changePath, "tasks.md"), "utf-8");
|
|
24
14
|
const pending = tasksContent.match(/^- \[ \] .+$/gm) || [];
|
|
25
15
|
if (pending.length > 0) {
|
|
26
16
|
console.log(chalk.yellow(`Warning: ${pending.length} task(s) still pending.`));
|
|
27
|
-
if (!
|
|
17
|
+
if (!yes)
|
|
28
18
|
throw new ArchiveError("Use --yes to archive anyway, or complete tasks first.");
|
|
29
|
-
}
|
|
30
19
|
}
|
|
31
20
|
}
|
|
32
21
|
catch (err) {
|
|
33
22
|
if (err instanceof ArchiveError)
|
|
34
23
|
throw err;
|
|
35
|
-
// No tasks file —
|
|
36
|
-
}
|
|
37
|
-
// Confirmation
|
|
38
|
-
if (!options.yes) {
|
|
39
|
-
const readline = await import("node:readline/promises");
|
|
40
|
-
const rl = readline.createInterface({
|
|
41
|
-
input: process.stdin,
|
|
42
|
-
output: process.stdout,
|
|
43
|
-
});
|
|
44
|
-
const answer = await rl.question(`Archive change "${changeId}"? (y/N) `);
|
|
45
|
-
rl.close();
|
|
46
|
-
if (answer.toLowerCase() !== "y") {
|
|
47
|
-
console.log("Cancelled.");
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
24
|
+
// No tasks file — ok
|
|
50
25
|
}
|
|
51
|
-
|
|
52
|
-
|
|
26
|
+
}
|
|
27
|
+
async function getUserConfirmation(changeId) {
|
|
28
|
+
const readline = await import("node:readline/promises");
|
|
29
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
30
|
+
const answer = await rl.question(`Archive change "${changeId}"? (y/N) `);
|
|
31
|
+
rl.close();
|
|
32
|
+
return answer.toLowerCase() === "y";
|
|
33
|
+
}
|
|
34
|
+
async function syncArtifactsToBaseline(changePath, root) {
|
|
53
35
|
try {
|
|
54
|
-
await cp(
|
|
55
|
-
recursive: true,
|
|
56
|
-
force: true,
|
|
57
|
-
});
|
|
36
|
+
await cp(join(changePath, "features"), join(root, "features"), { recursive: true, force: true });
|
|
58
37
|
console.log(` ${chalk.green("synced")} features to baseline`);
|
|
59
38
|
}
|
|
60
39
|
catch {
|
|
61
40
|
// No proposed features
|
|
62
41
|
}
|
|
63
|
-
// Copy proposed decisions to baseline
|
|
64
|
-
const proposedDecisions = join(changePath, "decisions");
|
|
65
42
|
try {
|
|
66
43
|
// TODO: handle sequential numbering for new decisions
|
|
67
|
-
await cp(
|
|
68
|
-
recursive: true,
|
|
69
|
-
force: true,
|
|
70
|
-
});
|
|
44
|
+
await cp(join(changePath, "decisions"), join(root, ".grimoire", "decisions"), { recursive: true, force: true });
|
|
71
45
|
console.log(` ${chalk.green("synced")} decisions to baseline`);
|
|
72
46
|
}
|
|
73
47
|
catch {
|
|
74
48
|
// No proposed decisions
|
|
75
49
|
}
|
|
76
|
-
|
|
50
|
+
}
|
|
51
|
+
export async function archiveChange(changeId, options) {
|
|
52
|
+
const root = await findProjectRoot();
|
|
53
|
+
const changePath = resolveChangePath(root, changeId);
|
|
54
|
+
try {
|
|
55
|
+
await readFile(join(changePath, "manifest.md"), "utf-8");
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
throw new ArchiveError(`Change "${changeId}" not found or missing manifest.`);
|
|
59
|
+
}
|
|
60
|
+
await checkPendingTasks(changePath, options.yes);
|
|
61
|
+
if (!options.yes) {
|
|
62
|
+
if (!(await getUserConfirmation(changeId))) {
|
|
63
|
+
console.log("Cancelled.");
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
await syncArtifactsToBaseline(changePath, root);
|
|
77
68
|
const date = new Date().toISOString().split("T")[0];
|
|
78
69
|
const archiveDir = join(root, ".grimoire", "archive", `${date}-${changeId}`);
|
|
79
70
|
await mkdir(archiveDir, { recursive: true });
|
|
80
71
|
await cp(join(changePath, "manifest.md"), join(archiveDir, "manifest.md"));
|
|
81
|
-
// Copy tasks.md to archive if it exists
|
|
82
72
|
try {
|
|
83
73
|
await cp(join(changePath, "tasks.md"), join(archiveDir, "tasks.md"));
|
|
84
74
|
}
|
|
85
75
|
catch {
|
|
86
76
|
// no tasks
|
|
87
77
|
}
|
|
88
|
-
// Remove change directory
|
|
89
78
|
await rm(changePath, { recursive: true });
|
|
90
79
|
console.log(`\n${chalk.green("Archived")} ${changeId} → .grimoire/archive/${date}-${changeId}/`);
|
|
91
80
|
}
|
package/dist/core/archive.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"archive.js","sourceRoot":"","sources":["../../src/core/archive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAMvE,MAAM,OAAO,YAAa,SAAQ,KAAK;IACrC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;IAC7B,CAAC;CACF;AAED,
|
|
1
|
+
{"version":3,"file":"archive.js","sourceRoot":"","sources":["../../src/core/archive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAMvE,MAAM,OAAO,YAAa,SAAQ,KAAK;IACrC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,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E,CAAC;YAC3C,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;YAC1B,OAAO;QACT,CAAC;IACH,CAAC;IAED,MAAM,uBAAuB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAEhD,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACpD,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,IAAI,IAAI,QAAQ,EAAE,CAAC,CAAC;IAC7E,MAAM,KAAK,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7C,MAAM,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC;IAC3E,IAAI,CAAC;QACH,MAAM,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC;IACvE,CAAC;IAAC,MAAM,CAAC;QACP,WAAW;IACb,CAAC;IAED,MAAM,EAAE,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1C,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,QAAQ,wBAAwB,IAAI,IAAI,QAAQ,GAAG,CAAC,CAAC;AACnG,CAAC"}
|
package/dist/core/check.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/core/check.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/core/check.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;CACf;AAED,UAAU,UAAU;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAqCD,wBAAsB,QAAQ,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAsB1E"}
|