@kiwidata/grimoire 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +56 -4
- package/README.md +107 -59
- package/dist/cli/index.js +7 -7
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/check.js +1 -1
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/configure.d.ts +3 -0
- package/dist/commands/configure.d.ts.map +1 -0
- package/dist/commands/configure.js +19 -0
- package/dist/commands/configure.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +2 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/core/check.d.ts.map +1 -1
- package/dist/core/check.js +165 -111
- package/dist/core/check.js.map +1 -1
- package/dist/core/ci.d.ts.map +1 -1
- package/dist/core/ci.js +50 -69
- package/dist/core/ci.js.map +1 -1
- package/dist/core/configure.d.ts +14 -0
- package/dist/core/configure.d.ts.map +1 -0
- package/dist/core/configure.js +434 -0
- package/dist/core/configure.js.map +1 -0
- package/dist/core/detect.d.ts.map +1 -1
- package/dist/core/detect.js +153 -26
- package/dist/core/detect.js.map +1 -1
- package/dist/core/diff.d.ts.map +1 -1
- package/dist/core/diff.js +62 -93
- package/dist/core/diff.js.map +1 -1
- package/dist/core/doc-style.d.ts +0 -4
- package/dist/core/doc-style.d.ts.map +1 -1
- package/dist/core/doc-style.js +103 -22
- package/dist/core/doc-style.js.map +1 -1
- package/dist/core/docs.js +202 -170
- package/dist/core/docs.js.map +1 -1
- package/dist/core/health.d.ts +6 -0
- package/dist/core/health.d.ts.map +1 -1
- package/dist/core/health.js +133 -96
- package/dist/core/health.js.map +1 -1
- package/dist/core/hooks.d.ts +0 -3
- package/dist/core/hooks.d.ts.map +1 -1
- package/dist/core/hooks.js +11 -16
- package/dist/core/hooks.js.map +1 -1
- package/dist/core/init.d.ts +2 -0
- package/dist/core/init.d.ts.map +1 -1
- package/dist/core/init.js +230 -406
- package/dist/core/init.js.map +1 -1
- package/dist/core/list.d.ts.map +1 -1
- package/dist/core/list.js +55 -65
- package/dist/core/list.js.map +1 -1
- package/dist/core/risk-register.d.ts +17 -0
- package/dist/core/risk-register.d.ts.map +1 -0
- package/dist/core/risk-register.js +73 -0
- package/dist/core/risk-register.js.map +1 -0
- package/dist/core/shared-setup.d.ts +0 -40
- package/dist/core/shared-setup.d.ts.map +1 -1
- package/dist/core/shared-setup.js +92 -56
- package/dist/core/shared-setup.js.map +1 -1
- package/dist/core/status.d.ts.map +1 -1
- package/dist/core/status.js +42 -52
- package/dist/core/status.js.map +1 -1
- package/dist/core/test-quality.d.ts +0 -8
- package/dist/core/test-quality.d.ts.map +1 -1
- package/dist/core/test-quality.js +24 -30
- package/dist/core/test-quality.js.map +1 -1
- package/dist/core/trace.d.ts.map +1 -1
- package/dist/core/trace.js +67 -75
- package/dist/core/trace.js.map +1 -1
- package/dist/core/update.d.ts.map +1 -1
- package/dist/core/update.js +61 -11
- package/dist/core/update.js.map +1 -1
- package/dist/core/validate.d.ts +1 -4
- package/dist/core/validate.d.ts.map +1 -1
- package/dist/core/validate.js +126 -148
- package/dist/core/validate.js.map +1 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -3
- package/dist/index.js.map +1 -1
- package/dist/utils/config.d.ts +15 -5
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +63 -42
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/fs.d.ts +0 -12
- package/dist/utils/fs.d.ts.map +1 -1
- package/dist/utils/fs.js +0 -12
- package/dist/utils/fs.js.map +1 -1
- package/dist/utils/paths.d.ts +0 -6
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +0 -6
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/spawn.d.ts +0 -3
- package/dist/utils/spawn.d.ts.map +1 -1
- package/dist/utils/spawn.js +0 -3
- package/dist/utils/spawn.js.map +1 -1
- package/package.json +1 -1
- package/skills/grimoire-apply/SKILL.md +89 -25
- package/skills/grimoire-audit/SKILL.md +21 -1
- package/skills/grimoire-bug/SKILL.md +48 -9
- package/skills/grimoire-commit/SKILL.md +3 -2
- package/skills/grimoire-design/SKILL.md +259 -0
- package/skills/grimoire-design-consult/SKILL.md +200 -0
- package/skills/grimoire-discover/SKILL.md +139 -109
- package/skills/grimoire-draft/SKILL.md +131 -15
- package/skills/grimoire-plan/SKILL.md +119 -46
- package/skills/grimoire-pr/SKILL.md +7 -10
- package/skills/grimoire-pr-review/SKILL.md +46 -115
- package/skills/grimoire-precommit-review/SKILL.md +205 -0
- package/skills/grimoire-refactor/SKILL.md +6 -6
- package/skills/grimoire-review/SKILL.md +95 -156
- package/skills/grimoire-verify/SKILL.md +40 -7
- package/skills/grimoire-vuln-remediate/SKILL.md +107 -0
- package/skills/grimoire-vuln-triage/SKILL.md +109 -0
- package/skills/references/adversarial-personas.md +225 -0
- package/skills/references/brand-tokens-format.md +186 -0
- package/skills/references/code-quality.md +172 -0
- package/skills/references/container-scan-triage.md +102 -0
- package/skills/references/dependency-vuln-triage.md +236 -0
- package/skills/references/design-heuristics.md +138 -0
- package/skills/references/design-input-formats.md +190 -0
- package/skills/references/pattern-guard.md +180 -0
- package/skills/references/principles.md +82 -0
- package/skills/references/refactor-scan-categories.md +154 -2
- package/skills/references/review-personas.md +406 -0
- package/skills/references/security-compliance.md +22 -1
- package/skills/references/testing-contracts.md +1 -1
- package/skills/references/visual-fidelity.md +206 -0
- package/templates/accepted-risks.yml +47 -0
- package/templates/brand-tokens-example.json +13 -0
- package/templates/brand-voice-example.md +22 -0
- package/templates/constraints.md +25 -0
- package/templates/design-tool-setup-stub.md +59 -0
- package/dist/commands/archive.d.ts +0 -3
- package/dist/commands/archive.d.ts.map +0 -1
- package/dist/commands/archive.js +0 -22
- package/dist/commands/archive.js.map +0 -1
- package/dist/commands/log.d.ts +0 -3
- package/dist/commands/log.d.ts.map +0 -1
- package/dist/commands/log.js +0 -15
- package/dist/commands/log.js.map +0 -1
- package/dist/commands/map.d.ts +0 -3
- package/dist/commands/map.d.ts.map +0 -1
- package/dist/commands/map.js +0 -17
- package/dist/commands/map.js.map +0 -1
- package/dist/core/archive.d.ts +0 -9
- package/dist/core/archive.d.ts.map +0 -1
- package/dist/core/archive.js +0 -92
- package/dist/core/archive.js.map +0 -1
- package/dist/core/log.d.ts +0 -8
- package/dist/core/log.d.ts.map +0 -1
- package/dist/core/log.js +0 -150
- package/dist/core/log.js.map +0 -1
- package/dist/core/map.d.ts +0 -9
- package/dist/core/map.d.ts.map +0 -1
- package/dist/core/map.js +0 -302
- package/dist/core/map.js.map +0 -1
- package/templates/dupignore +0 -93
- package/templates/mapignore +0 -58
- package/templates/mapkeys +0 -65
|
@@ -83,20 +83,52 @@ generation, causing user lookup to fail on the reset page.
|
|
|
83
83
|
Added scenario: "Password reset with plus-sign email"
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
-
### 5.
|
|
87
|
-
|
|
86
|
+
### 5. Decide the Branch
|
|
87
|
+
|
|
88
|
+
Default bias: **stay on the current branch if the bug is related to in-flight work.** Only create a new branch when the bug is clearly a separate concern from whatever the current branch is doing.
|
|
89
|
+
|
|
90
|
+
Snapshot state first:
|
|
91
|
+
|
|
88
92
|
```
|
|
89
|
-
|
|
93
|
+
git branch --show-current
|
|
94
|
+
git status --porcelain
|
|
95
|
+
grimoire list --changes --json
|
|
90
96
|
```
|
|
91
|
-
|
|
97
|
+
|
|
98
|
+
Find any active change whose `manifest.md` `branch:` matches the current branch.
|
|
99
|
+
|
|
100
|
+
| Current state | Bug relation | Action |
|
|
101
|
+
|---------------|--------------|--------|
|
|
102
|
+
| Protected branch (`main`/`master`/`develop`/`trunk`), clean tree | any | Create `fix/<short-description>` and switch |
|
|
103
|
+
| Feature branch + active change on it | Bug is in the same feature/code path the change touches | **Stay on the branch.** Fix in place. The repro test and fix become part of that change |
|
|
104
|
+
| Feature branch + active change on it | Bug is unrelated to that change | Ask the user. Default: stash/commit, switch to default branch, create `fix/...` off it |
|
|
105
|
+
| Feature branch + no matching active change | any | Create `fix/<short-description>` off the default branch |
|
|
106
|
+
| Dirty tree, no clear owner | any | Block. Commit, stash, or discard before proceeding |
|
|
107
|
+
|
|
108
|
+
How to judge "related vs separate":
|
|
109
|
+
- **Related** — the bug lives in files the in-flight change is modifying, or the bug is a direct consequence of the in-flight work (e.g. tests added by the change reveal it, the new code path crashes on an edge case). Fixing it on the same branch keeps the change coherent and the PR self-contained.
|
|
110
|
+
- **Separate** — the bug exists on `main` independent of the in-flight change, touches unrelated code, or would still need to ship if the in-flight change were abandoned. Mixing it in pollutes the diff and the `Change:` trailer.
|
|
111
|
+
|
|
112
|
+
When in doubt, ask the user one question: "This bug looks like it's [in / outside] the scope of the current `<branch>` work — fix it here, or branch off main?"
|
|
113
|
+
|
|
114
|
+
Branch name format when creating new: `fix/<short-description>` (e.g. `fix/special-chars-password-reset`, `fix/null-pricing-response`).
|
|
92
115
|
|
|
93
116
|
### 6. Fix the Bug
|
|
94
|
-
Now — and only now — modify production code:
|
|
117
|
+
Now — and only now — modify production code. **Apply `../references/code-quality.md` while writing the fix, not after.** Inline rules:
|
|
118
|
+
- Reuse existing utilities — grep / check the area doc before adding new helpers.
|
|
119
|
+
- No new defensive guards inside the trust boundary — fix the real bug, don't paper over it with `if x is None` / `try-except`.
|
|
120
|
+
- Specific names — no `data` / `result` / `temp` when a concrete name fits.
|
|
121
|
+
- No new abstraction layer for a one-line bug fix.
|
|
122
|
+
- Comments only for non-obvious *why* — one short note linking the bug + reproduction test is enough.
|
|
123
|
+
|
|
124
|
+
Then:
|
|
95
125
|
|
|
96
126
|
1. Make the smallest change that fixes the failing test
|
|
97
|
-
2.
|
|
98
|
-
3. Run
|
|
99
|
-
4.
|
|
127
|
+
2. **Hallucination check:** Before running tests, verify every external function/method the fix calls actually exists: `search_graph(name_pattern="<name>")` for each new call. If not found: locate the correct function or stop and flag to user. (Full instructions in `../references/pattern-guard.md` Step 6. Skip if graph not indexed.)
|
|
128
|
+
3. Run the reproduction test — it should pass
|
|
129
|
+
4. Run ALL existing tests — no regressions
|
|
130
|
+
5. If the fix is more than a few lines, pause and consider whether the approach is the simplest one
|
|
131
|
+
6. **Code quality check:** Walk the seven-point checklist in `../references/code-quality.md` against every file you changed. Any fail → fix and re-run tests.
|
|
100
132
|
|
|
101
133
|
**Escalation guard:** If the fix requires changes to more than 3 files, introduces new abstractions, modifies data models, or crosses service boundaries — STOP. This is not a bug fix, it's a change that needs design. Tell the user: "This fix is larger than a typical bug fix. I recommend routing to `grimoire-draft` to handle this as a proper change with specs and a plan." The user can override.
|
|
102
134
|
|
|
@@ -120,7 +152,7 @@ After the fix, generate a checklist for testers to verify the fix and check for
|
|
|
120
152
|
3. **Generate the checklist:**
|
|
121
153
|
```markdown
|
|
122
154
|
## Verification Checklist: <bug-id>
|
|
123
|
-
|
|
155
|
+
Branch: `<current-branch>` (new `fix/...` branch, or the in-flight feature branch if fixed in place)
|
|
124
156
|
|
|
125
157
|
### Original Bug
|
|
126
158
|
- [ ] Reproduce the original steps: <steps>
|
|
@@ -149,12 +181,19 @@ Report to the user:
|
|
|
149
181
|
- **Performance issues** — these usually need profiling, not a repro test. Handle directly.
|
|
150
182
|
- **Configuration errors** — wrong env vars, missing dependencies, bad setup. Just fix the config.
|
|
151
183
|
|
|
184
|
+
## References
|
|
185
|
+
|
|
186
|
+
**Before writing the fix**, read both:
|
|
187
|
+
- `../references/code-quality.md` — anti-slop rules to apply *while writing*: reuse before write, trust callers, names reveal intent, branching budget, function size, no premature abstraction, comments only for non-obvious why. Includes a seven-point quality gate to run before declaring the fix done.
|
|
188
|
+
- `../references/pattern-guard.md` Step 6 only — after writing the fix, verify every new external function call exists in the graph via `search_graph`. Skip the full pattern brief (over-constrains bug fixes). Skip entirely if graph not indexed.
|
|
189
|
+
|
|
152
190
|
## Important
|
|
153
191
|
- **Reproduce before you fix.** No exceptions. If you can't reproduce it, you don't understand it, and your fix is a guess.
|
|
154
192
|
- **Small fixes only.** If the bug fix requires significant architectural changes, it's not a bug fix — route to `grimoire-draft` for a proper change.
|
|
155
193
|
- **Don't over-document.** The test is the documentation. A one-line comment in the test explaining the bug is enough. Don't create tracking files, bug reports, or manifests for a bug fix.
|
|
156
194
|
- **The feature file is truth.** If a scenario describes behavior the user now says is wrong, that's a spec change, not a bug. Handle it through `grimoire-draft`.
|
|
157
195
|
- **One bug, one fix.** Don't bundle "while I'm in here" improvements with a bug fix. Fix the bug, nothing more.
|
|
196
|
+
- **Don't reflexively branch.** A bug related to in-flight work belongs on the in-flight branch — splitting it into a separate PR fragments the change and breaks the `Change:` trailer audit trail. Branch only when the bug is genuinely a separate concern. See step 5.
|
|
158
197
|
|
|
159
198
|
## Done
|
|
160
199
|
When the bug is fixed, tests pass (reproduction + regression), and the summary is presented, the workflow is complete. Suggest `grimoire-commit` for the fix commit.
|
|
@@ -19,7 +19,8 @@ Write a commit message from staged changes and active grimoire context. Never au
|
|
|
19
19
|
## Routing
|
|
20
20
|
- No changes to commit → nothing to do
|
|
21
21
|
- Want to create a PR → `grimoire-pr` (commit first, then PR)
|
|
22
|
-
- Want
|
|
22
|
+
- Want a multi-persona review of the staged diff before committing → `grimoire-precommit-review`
|
|
23
|
+
- Just want to eyeball the diff → show the diff first
|
|
23
24
|
|
|
24
25
|
## Workflow
|
|
25
26
|
|
|
@@ -65,7 +66,7 @@ If `commit_style` in config is anything else, read it as a format hint and adapt
|
|
|
65
66
|
- If multiple logical changes are staged, suggest splitting into separate commits
|
|
66
67
|
|
|
67
68
|
### 5. Git Trailers (mandatory for audit trail)
|
|
68
|
-
When a grimoire change is active, the commit **MUST** include `Change:` as a git trailer. This
|
|
69
|
+
When a grimoire change is active, the commit **MUST** include `Change:` as a git trailer. This git-native anchor links the commit to its change — `grimoire trace` and `git log --grep "Change: <id>"` both rely on it. Without it, the commit is invisible to the audit trail.
|
|
69
70
|
|
|
70
71
|
```
|
|
71
72
|
Change: add-2fa-login
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: grimoire-design
|
|
3
|
+
description: Generate UI/UX designs grounded in a stated user problem — variants, component states, brand-token compliance, and derived Gherkin scenarios. Use when the user wants to design, wireframe, mock up, or rethink a UI surface.
|
|
4
|
+
compatibility: Designed for Claude Code (or similar products)
|
|
5
|
+
metadata:
|
|
6
|
+
author: kiwi-data
|
|
7
|
+
version: "0.1"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# grimoire-design
|
|
11
|
+
|
|
12
|
+
Generate UI/UX designs grounded in a stated user problem. Produces variants, enumerates component states, lints for brand drift, and derives Gherkin scenarios that hand off cleanly to `grimoire-draft` and `grimoire-plan`.
|
|
13
|
+
|
|
14
|
+
This is one skill, not three (see ADR-0017). Brand-drift lint is a *mode* of this skill, not a separate skill — same artifact (`tokens.json`), same skill, different verb.
|
|
15
|
+
|
|
16
|
+
## Triggers
|
|
17
|
+
- User describes UI/UX work: a new screen, a redesign, a flow, a component
|
|
18
|
+
- User mentions a design tool by name (Figma) in the context of producing work
|
|
19
|
+
- Loose match: contains "design", "wireframe", "ui", "ux", "mockup", "layout", "figma" combined with "new", "draft", "explore", "redesign", or "rethink"
|
|
20
|
+
|
|
21
|
+
## Routing
|
|
22
|
+
- Non-UI behavior change (API, data model, business logic) → `grimoire-draft` directly
|
|
23
|
+
- Brand-only updates (new logo, new color, capture missing tokens) → stay here; use `--capture-brand` or `--lint`
|
|
24
|
+
- Tech-check before designing ("should I worry about anything?") → `grimoire-design-consult`
|
|
25
|
+
- Bug in an existing UI → `grimoire-bug`
|
|
26
|
+
- Pure refactor of UI code (no behavior change) → no grimoire artifact; just do it
|
|
27
|
+
|
|
28
|
+
## Workflow
|
|
29
|
+
|
|
30
|
+
### 1. Qualify
|
|
31
|
+
Is this actually UI/UX work? If the user is asking for an API contract, a data model change, or backend logic with no user-facing surface, route to `grimoire-draft` and stop.
|
|
32
|
+
|
|
33
|
+
If a `.grimoire/changes/<change-id>/consult.md` exists for this change-id (from a prior `grimoire-design-consult` run), read it now. Parse the `## Inferred assumptions` and `## Inferred givens` sections verbatim — these exact H2 headers are written by `grimoire-design-consult` and must not be paraphrased or fuzzy-matched. Propagate both lists into every subsequent prompt in this workflow. Specifically:
|
|
34
|
+
|
|
35
|
+
- **Step 6 (Variant Generation)**: exclude patterns that violate any given. For example, if a given says "no JS-heavy patterns due to perf budget", do not produce a variant that relies on client-side state machines. State the exclusion in the affected variant's tradeoff line so reviewers see why the pattern was avoided.
|
|
36
|
+
- **Step 9 (Derive Gherkin)**: reference inferred assumptions in scenario preconditions where applicable (e.g., a Given line that mirrors the assumption "user is authenticated before reaching this surface"). Cite givens by their consult.md bullet when a scenario's expected outcome depends on the given.
|
|
37
|
+
|
|
38
|
+
Carry the open-questions list (also in `consult.md`) forward as warnings — surface unresolved items to the user when they affect a variant choice or scenario, but do not block on them. Open questions are flags, not gates.
|
|
39
|
+
|
|
40
|
+
### 2. Problem Statement (soft gate)
|
|
41
|
+
Ask for the user problem this design addresses. If the user provides one up-front, write it to `.grimoire/changes/<change-id>/designs/problem.md` and continue.
|
|
42
|
+
|
|
43
|
+
If the user skips or describes the design without a problem (e.g., "make a settings page"), emit the soft-gate warning verbatim:
|
|
44
|
+
|
|
45
|
+
> No user problem articulated. Generic designs ≈ wasted iteration.
|
|
46
|
+
> The most common cause of redesigns is missing problem context.
|
|
47
|
+
> Strongly recommend stating the problem first.
|
|
48
|
+
|
|
49
|
+
Then ask: "Proceed without problem statement? (y/N)". On `y`, log `problem_statement: skipped (user override)` in `problem.md` and continue. On `N` or no answer, offer the framework menu:
|
|
50
|
+
|
|
51
|
+
| option | format |
|
|
52
|
+
|---|---|
|
|
53
|
+
| jtbd | When [situation], I want to [motivation], so I can [outcome] |
|
|
54
|
+
| lean-ux | Business problem / users / outcomes / solutions / hypotheses |
|
|
55
|
+
| hmw | How might we [verb] [user] [outcome]? |
|
|
56
|
+
| pr-faq | Press release + FAQ working-backwards |
|
|
57
|
+
| freeform | (user writes their own) |
|
|
58
|
+
|
|
59
|
+
Render the chosen template for the user to fill in. Write the result to `problem.md`.
|
|
60
|
+
|
|
61
|
+
### 3. User Flow & Success Metrics
|
|
62
|
+
Ask for a **friction-log narrative** as the default minimum-viable level — a short prose description of the current user journey and where it hurts. Offer (but never force) two upgrades: Mermaid journey diagram, then service blueprint.
|
|
63
|
+
|
|
64
|
+
Separately — not bundled — ask "What are the user's current pain points?" Accept a bulleted list, free text, or "none known". Capture pain points in `problem.md` under a dedicated `## Pain Points` section. Variants generated in step 6 must each state which pain points they address (or explicitly mark "deferred").
|
|
65
|
+
|
|
66
|
+
Ask for at least one measurable success metric (e.g., "reduce support tickets about lockouts by 50%"). If the user cannot articulate one, note `no success metric — design effectiveness will be hard to evaluate` as an assumption in `problem.md`.
|
|
67
|
+
|
|
68
|
+
### 4. Lazy Component Inventory
|
|
69
|
+
If `.grimoire/docs/components.md` is absent AND the project has UI code, ask the user before scanning. On approval, scan for:
|
|
70
|
+
|
|
71
|
+
- `components.json` (shadcn-ui marker)
|
|
72
|
+
- `tailwind.config.{js,ts}` (Tailwind setup)
|
|
73
|
+
- MUI / Chakra / Mantine / Radix imports in `package.json`
|
|
74
|
+
- `*.stories.{ts,tsx,jsx,js}` (Storybook stories)
|
|
75
|
+
|
|
76
|
+
Write findings to `.grimoire/docs/components.md` listing detected components with file paths and known variants. Skip the scan entirely if no UI signals are present (greenfield or non-UI surface). Subsequent variants prefer existing components over net-new designs and flag net-new explicitly.
|
|
77
|
+
|
|
78
|
+
### 5. Brand Grounding
|
|
79
|
+
Read `.grimoire/brand/tokens.json` and `.grimoire/brand/voice.md` if they exist. Use the format documented in `../references/brand-tokens-format.md`. Required groups: `color.*`, `font.family.*`, `font.size.*`, `spacing.*`.
|
|
80
|
+
|
|
81
|
+
**Malformed `tokens.json`**: if JSON parse fails or required `$value` fields are missing, emit a one-line error:
|
|
82
|
+
|
|
83
|
+
> tokens.json malformed at `<path>` — `<parse-error-description>`. Continuing without brand grounding.
|
|
84
|
+
|
|
85
|
+
Continue the workflow without brand grounding rather than crashing. Variants will use neutral defaults and the user can fix the file and re-run. Anchor: pre-mortem failure mode #6 — undetected brand drift produces low-quality output, but a crashed skill produces zero output.
|
|
86
|
+
|
|
87
|
+
**Absent `tokens.json`**: continue silently with neutral defaults. Note in the generated HTML that no tokens were found.
|
|
88
|
+
|
|
89
|
+
### 6. Variant Generation
|
|
90
|
+
Produce **3 variants by default**. Each variant explicitly states the tradeoff it optimizes for (e.g., "minimal clicks", "maximum information density", "progressive disclosure") and lists which pain points from step 3 it addresses.
|
|
91
|
+
|
|
92
|
+
Output target by precedence — pick the highest-fidelity option available:
|
|
93
|
+
|
|
94
|
+
1. **Figma MCP** configured (`project.design_tool.mcp` present) → query Figma; reference variants by node ID in `.grimoire/changes/<change-id>/designs/variants.md`
|
|
95
|
+
2. **Static HTML** → write `.grimoire/changes/<change-id>/designs/variant-{n}.html` per variant. Self-contained, no CDN. Brand tokens injected as CSS custom properties in `:root` per `../references/design-input-formats.md` §5
|
|
96
|
+
3. **ASCII** → inline in `variants.md` for trivial scope (copy change, single-field form, TUI surface) per `../references/design-input-formats.md` §6
|
|
97
|
+
|
|
98
|
+
If Figma MCP is configured but unreachable, emit one-line "Figma MCP unreachable — `<error>`. Falling back to static HTML." and continue with HTML. Never crash.
|
|
99
|
+
|
|
100
|
+
Each variant must reference brand tokens from `tokens.json` (if present) and consult `../references/design-heuristics.md` to avoid common omissions (missing feedback, no escape hatch, contrast too low, novel pattern where a standard exists).
|
|
101
|
+
|
|
102
|
+
When the user requests a revision of a specific variant ("redo variant 2 with a wizard pattern"), regenerate only that variant; leave the others unchanged.
|
|
103
|
+
|
|
104
|
+
### 7. State Enumeration
|
|
105
|
+
For each interactive component in the selected variant, walk the state checklist from `../references/design-heuristics.md` §5:
|
|
106
|
+
|
|
107
|
+
| state | required? |
|
|
108
|
+
|---|---|
|
|
109
|
+
| default | yes |
|
|
110
|
+
| loading | yes |
|
|
111
|
+
| empty | yes |
|
|
112
|
+
| error | yes |
|
|
113
|
+
| success | conditional (forms, async actions) |
|
|
114
|
+
| disabled | conditional (inputs, buttons) |
|
|
115
|
+
| readonly | conditional (inputs) |
|
|
116
|
+
| over-limit | conditional (rate-limited / quota'd actions) |
|
|
117
|
+
|
|
118
|
+
If the user attempts to mark the design complete with a required state missing, emit the soft gate:
|
|
119
|
+
|
|
120
|
+
> Missing `<state>` state. Most "the design didn't work in production"
|
|
121
|
+
> complaints trace to missing error / loading / empty handling.
|
|
122
|
+
|
|
123
|
+
Ask "Skip `<state>` state? (y/N)". On confirm, log the skip as an unvalidated assumption in `problem.md` under a `## Skipped States` section (created if absent). Infer conditional state upgrades from change context — a form submission upgrades `success` to required; a rate-limited action upgrades `over-limit` to required.
|
|
124
|
+
|
|
125
|
+
### 8. Render Preview
|
|
126
|
+
For HTML output, write a single `.grimoire/changes/<change-id>/designs/preview.html` showing each component in each state, side-by-side. Each state is labeled and visually distinct (loading shimmer, error banner, empty placeholder, etc.). Designer opens the file directly in a browser — no `grimoire preview` CLI command exists in v1.
|
|
127
|
+
|
|
128
|
+
Skip preview rendering when output is Figma (the Figma file IS the preview) or ASCII (the markdown table IS the preview).
|
|
129
|
+
|
|
130
|
+
### 9. Derive Gherkin
|
|
131
|
+
Propose draft scenarios as a **design artifact** at `.grimoire/changes/<change-id>/designs/scenarios.feature` (a proposal, not the live baseline). One Scenario per (component × state), Given / When / Then grounded in the design. `grimoire-draft` writes the user-approved scenarios live into `features/` — design does not edit the live baseline directly. Every proposed scenario must still pass draft's feature admission test (external actor, observable, domain language).
|
|
132
|
+
|
|
133
|
+
Apply surface-conditional adversarial scenarios per `../references/adversarial-personas.md`:
|
|
134
|
+
|
|
135
|
+
- `project.surface: web` → keyboard-navigation, screen-reader-announcement, color-contrast scenarios
|
|
136
|
+
- `project.surface: mobile` → touch-target-size, gesture-conflict scenarios
|
|
137
|
+
- `project.surface: tui` → keyboard-navigation only (no screen-reader, no contrast)
|
|
138
|
+
|
|
139
|
+
Apply security tags per `../references/security-compliance.md`. Components handling user input get `@input-validation` and at least one negative scenario.
|
|
140
|
+
|
|
141
|
+
Present the proposed scenarios for review: "Review proposed scenarios — accept, edit, or reject each." Accept all / accept some / edit / reject any. Rejected scenarios do not get written.
|
|
142
|
+
|
|
143
|
+
### 10. Handoff
|
|
144
|
+
When the user accepts proposed scenarios, the change folder is populated. Suggest the next step:
|
|
145
|
+
|
|
146
|
+
> Run `grimoire-draft` to refine the manifest and ADRs, or `grimoire-plan` to break into tasks.
|
|
147
|
+
|
|
148
|
+
Skill is done.
|
|
149
|
+
|
|
150
|
+
## Revision Mode
|
|
151
|
+
|
|
152
|
+
Triggers: user says "revise", "iterate", "refine", "update variant", "change the design", "I want to try again with variant N", "add a state", "update the scenarios", or `--revise`.
|
|
153
|
+
|
|
154
|
+
Revision mode re-enters an **existing** change without restarting the full workflow. Steps 1–5 (problem statement, user flow, component inventory, brand grounding) are already done — skip them unless the user says the problem itself has changed.
|
|
155
|
+
|
|
156
|
+
**Revision workflow:**
|
|
157
|
+
|
|
158
|
+
1. Read the existing artifacts for the change-id: `problem.md`, `designs/variants.md` or `variant-*.html`, `features/`. Show a brief summary of what exists:
|
|
159
|
+
> Current design: 3 variants (wizard, inline, progressive). Accepted variant: 2. 8 Gherkin scenarios. 4 component states documented.
|
|
160
|
+
|
|
161
|
+
2. Ask one question: "What would you like to change?"
|
|
162
|
+
|
|
163
|
+
3. Based on the answer, identify the minimum affected steps and run only those:
|
|
164
|
+
|
|
165
|
+
| User says | Re-run |
|
|
166
|
+
|---|---|
|
|
167
|
+
| "redo variant 2 with a different pattern" | Step 6 — single variant only |
|
|
168
|
+
| "add empty state to the search field" | Step 7 — state enumeration for that component |
|
|
169
|
+
| "the problem is actually X not Y" | Update `problem.md`, re-run step 3 (user flow + pain points), then step 6 for all variants |
|
|
170
|
+
| "make it more accessible" | Step 9 — re-derive adversarial Gherkin scenarios |
|
|
171
|
+
| "show me 2 more variants" | Step 6 — additive, do not overwrite existing variants |
|
|
172
|
+
| "the preview looks wrong" | Step 8 — regenerate preview only |
|
|
173
|
+
|
|
174
|
+
4. Leave all other artifacts unchanged.
|
|
175
|
+
|
|
176
|
+
5. If Gherkin scenarios from a prior pass were already accepted, ask before overwriting:
|
|
177
|
+
> These scenarios were previously accepted — overwrite with revised versions? (y/N)
|
|
178
|
+
|
|
179
|
+
6. On completion, suggest `grimoire-draft` or `grimoire-plan` if not yet run, or `grimoire-verify` if implementation is already in progress.
|
|
180
|
+
|
|
181
|
+
**Revision is not a full restart.** If the design direction has fundamentally changed (different surface, new user, different problem), start a new change-id via `grimoire-design` fresh rather than revising.
|
|
182
|
+
|
|
183
|
+
## Modes
|
|
184
|
+
|
|
185
|
+
The flags below are **conversational invocations** the AI interprets, not real CLI subcommands of the `grimoire` binary. Per ADR-0010, skills are pure markdown — there is no executable code behind `--lint`, `--variants=N`, or `--capture-brand`. The AI reads these as user intent and runs the corresponding flow.
|
|
186
|
+
|
|
187
|
+
### `--capture-brand` / "capture brand" / "capture brand guidelines"
|
|
188
|
+
When the user says "capture brand" or invokes `--capture-brand`, run the brand-capture flow using the same prompts as `grimoire init` onboarding (see `src/core/init.ts` `askPreferences()` brand-capture block):
|
|
189
|
+
|
|
190
|
+
- Ask for primary / secondary / accent color (hex, validated against `/^#([0-9a-f]{3}|[0-9a-f]{6})$/i`; re-prompt on invalid)
|
|
191
|
+
- Ask for font family, base font size, base spacing unit
|
|
192
|
+
- Optional: logo path, favicon path
|
|
193
|
+
- Ask for one Do-example and one Don't-example for voice/tone
|
|
194
|
+
- Write `.grimoire/brand/tokens.json` in DTCG format (see `../references/brand-tokens-format.md`)
|
|
195
|
+
- Write `.grimoire/brand/voice.md` from the captured do/don't pair
|
|
196
|
+
|
|
197
|
+
Before writing, glob the repo root for existing `tokens.json` or `design-tokens.json`. If found, ask "Use existing `<path>`? (Y/n)" — on yes, copy it to `.grimoire/brand/tokens.json` instead of prompting from scratch.
|
|
198
|
+
|
|
199
|
+
Do **not** create `.grimoire/brand/` unless the user has explicitly opted in via this mode or the onboarding flow.
|
|
200
|
+
|
|
201
|
+
### `--lint` / "lint brand" / "lint brand drift"
|
|
202
|
+
When the user says "lint brand" or invokes `--lint`, run the brand-drift lint flow described in the Lint Mode section below.
|
|
203
|
+
|
|
204
|
+
### `--variants=N` / "give me N variants" / "N variants"
|
|
205
|
+
When the user invokes `--variants=N` or says "give me 5 variants", override the default count of 3 in step 6. Accept any positive integer up to 10. Above 10, ask the user to confirm — variants become noise beyond that count.
|
|
206
|
+
|
|
207
|
+
## Lint Mode
|
|
208
|
+
|
|
209
|
+
Brand-drift lint cross-references hardcoded values in code against `.grimoire/brand/tokens.json` and suggests token replacements.
|
|
210
|
+
|
|
211
|
+
### Scope
|
|
212
|
+
- Default: scan **staged files** (`git diff --cached --name-only`) — fast, dev-loop-friendly
|
|
213
|
+
- `--all` / "scan all" → scan all tracked files (slower; honor `.gitignore`)
|
|
214
|
+
- File types: `.css`, `.scss`, `.less`, `.html`, `.jsx`, `.tsx`, `.vue`, `.svelte` (configurable per project conventions)
|
|
215
|
+
|
|
216
|
+
### What it looks for
|
|
217
|
+
- Hardcoded color hex values (`#0066ff`, `#06f`, `rgb(...)`)
|
|
218
|
+
- Hardcoded `px` / `rem` / `em` values
|
|
219
|
+
- Hardcoded `font-family` strings
|
|
220
|
+
|
|
221
|
+
Each hit is cross-referenced against `tokens.json`. If a near-match exists, emit a suggestion:
|
|
222
|
+
|
|
223
|
+
> `src/components/Button.css:14` — `#0066ff` matches `color.primary`. Replace with `var(--color-primary)`.
|
|
224
|
+
|
|
225
|
+
### Clean state
|
|
226
|
+
If zero drift is found, emit exactly:
|
|
227
|
+
|
|
228
|
+
> No brand drift detected across N files scanned.
|
|
229
|
+
|
|
230
|
+
And exit 0. Do **not** print a long "everything passed" report — clean state is a one-liner. False positives erode trust faster than missed findings.
|
|
231
|
+
|
|
232
|
+
### Malformed `tokens.json`
|
|
233
|
+
Catch JSON parse errors and missing `$value` fields. Emit a one-line error with the parse description and exit non-zero — this is a misconfiguration, not a lint finding:
|
|
234
|
+
|
|
235
|
+
> tokens.json malformed at `<path>` — `<parse-error>`. Fix or remove.
|
|
236
|
+
|
|
237
|
+
Do not attempt partial lint with a half-parsed token file.
|
|
238
|
+
|
|
239
|
+
### Absent `tokens.json`
|
|
240
|
+
Clean exit. Emit:
|
|
241
|
+
|
|
242
|
+
> No brand tokens to lint against. Run `grimoire init` or `grimoire-design --capture-brand` first.
|
|
243
|
+
|
|
244
|
+
Do not error — absence is a valid state for projects that haven't onboarded brand capture yet.
|
|
245
|
+
|
|
246
|
+
### Integration
|
|
247
|
+
`grimoire-precommit-review` invokes this lint automatically when `.grimoire/brand/tokens.json` exists. The lint logic is also referenced from `../references/visual-fidelity.md` (the shared reference used by `grimoire-review`, `grimoire-precommit-review`, and `grimoire-pr-review` for the visual-fidelity tier).
|
|
248
|
+
|
|
249
|
+
## Important
|
|
250
|
+
- **Pure markdown.** This skill is interpreted by an LLM per ADR-0010. Do not generate executable code or shell scripts to satisfy any step. The variant HTML files are output artifacts; the workflow itself is prose the AI follows.
|
|
251
|
+
- **Ask before scanning large codebases.** Component-inventory scans (step 4) and `--lint --all` scans can be expensive on monorepos. Confirm with the user before scanning more than ~500 files.
|
|
252
|
+
- **Honor `.gitignore`.** Any scan (component inventory, brand lint) must skip vendored, generated, and version-control-ignored paths.
|
|
253
|
+
- **Do not create `.grimoire/brand/` unprompted.** The directory only appears when the user opts in via onboarding or `--capture-brand`. Reading from a missing brand directory is a valid state — fall back to neutral defaults.
|
|
254
|
+
- **Never log Figma access tokens.** The token lives in `FIGMA_ACCESS_TOKEN` env var, read by the MCP server. Never write it to config, never echo it in transcripts, never include it in artifacts.
|
|
255
|
+
- **Soft gates are warnings, not blockers.** The problem-statement gate (step 2) and the state-enumeration gate (step 7) warn aggressively but accept user override. Record overrides as assumptions so they surface in review.
|
|
256
|
+
- **Brand drift findings are suggestions, not blockers.** Lint mode proposes token replacements; it does not auto-rewrite code. The user decides whether to apply.
|
|
257
|
+
|
|
258
|
+
## Done
|
|
259
|
+
When the user accepts proposed Gherkin scenarios and the change folder contains `problem.md`, `designs/`, and `features/`, the workflow is complete. Suggest `grimoire-draft` (manifest + ADRs) or `grimoire-plan` (task breakdown) next.
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: grimoire-design-consult
|
|
3
|
+
description: Pre-design technical consult. Security and data personas interview the designer (or engineer) about a proposed change before any artifacts exist, surfacing assumptions and constraints early. Use before grimoire-design or grimoire-draft when the change might touch sensitive data, compliance, or risky surfaces.
|
|
4
|
+
compatibility: Designed for Claude Code (or similar products)
|
|
5
|
+
metadata:
|
|
6
|
+
author: kiwi-data
|
|
7
|
+
version: "0.1"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# grimoire-design-consult
|
|
11
|
+
|
|
12
|
+
A **pre-design Q&A** with security and data personas. The designer brings a problem statement; the personas ask clarifying questions; the skill distills the transcript into assumptions, givens, and open questions that downstream `grimoire-design` and `grimoire-draft` consume.
|
|
13
|
+
|
|
14
|
+
This is **not** a review. No artifacts are required to exist. No blocker/suggestion findings are produced. The output is a conversation transcript plus inferred constraints.
|
|
15
|
+
|
|
16
|
+
## Triggers
|
|
17
|
+
- User says "consult", "tech check", "tech check this idea", "should I ...", "what should I worry about", or "before designing"
|
|
18
|
+
- User wants security or data sign-off on an idea before investing in design work
|
|
19
|
+
- Loose match: "talk through", "sanity check", "pre-design", "thinking about" combined with concerns about data, auth, compliance, or PII
|
|
20
|
+
|
|
21
|
+
## Routing
|
|
22
|
+
- User already has a clear design direction and just wants to produce variants → `grimoire-design`
|
|
23
|
+
- A full design with artifacts (problem.md, variants, scenarios) already exists and the user wants critical feedback → `grimoire-review`
|
|
24
|
+
- User describes a bug rather than a new design → `grimoire-bug` or `grimoire-bug-report`
|
|
25
|
+
- Change is purely behavioral / non-UI and the user is ready to spec it → `grimoire-draft`
|
|
26
|
+
|
|
27
|
+
## Prerequisites
|
|
28
|
+
- A `change-id` (existing or new). If no change exists yet, create the directory `.grimoire/changes/<change-id>/` with just a placeholder so `consult.md` has a home — no manifest, features, decisions, or tasks needed.
|
|
29
|
+
- `.grimoire/config.yaml` exists (for surface, compliance, brand context). If absent, the consult still runs but skips the briefing axes that would require it.
|
|
30
|
+
|
|
31
|
+
## Skipping
|
|
32
|
+
This skill is optional. Engineers and designers can skip straight to `grimoire-draft` or `grimoire-design`. When the user skips and the change touches PII / payments / auth / compliance tags, downstream skills emit a one-line soft suggestion ("Consider `grimoire-design-consult` first — this change touches PII") but do not block.
|
|
33
|
+
|
|
34
|
+
## Modes
|
|
35
|
+
|
|
36
|
+
These are **conversational invocations** the AI interprets, not commander.js subcommands of the `grimoire` binary. Per ADR-0010, skills are pure markdown — the AI decides how to behave based on what the user said.
|
|
37
|
+
|
|
38
|
+
- `--personas=security,data,qa` or "add QA persona" / "include the product manager" — adds personas beyond the default Security + Data pair. Allowed names match `../references/review-personas.md` §4 (product, senior, security, qa, data, adversarial-user). Do not load Code Style Reviewer or Contrarian — they are diff-time personas.
|
|
39
|
+
- "shorter consult" / "quick consult" — cap each persona at 3 questions instead of the usual 5-8
|
|
40
|
+
- "skip security" / "skip data" — drop a default persona for a single run (rare; warn the user once if their problem statement mentions PII / payments / auth and they skip security)
|
|
41
|
+
|
|
42
|
+
## Workflow
|
|
43
|
+
|
|
44
|
+
### 1. Collect Minimal Input
|
|
45
|
+
Open with a brief orientation so the designer knows what to expect — display this verbatim before asking anything:
|
|
46
|
+
|
|
47
|
+
> **Design consult** — two expert personas (Security Engineer + Data Engineer) will ask you questions about your idea before any design work begins. Their goal is to surface constraints and assumptions early, not find problems with a finished design.
|
|
48
|
+
>
|
|
49
|
+
> We'll start with your problem statement, then the personas take turns. Each asks **one question at a time** — you'll see `[Persona — Q N/total]` so you always know where you are.
|
|
50
|
+
|
|
51
|
+
Collect inputs in three sequential turns — not a combined prompt:
|
|
52
|
+
|
|
53
|
+
**Turn 1:** Ask only for the problem statement.
|
|
54
|
+
> What user problem or business need does this design address? (One paragraph is enough.)
|
|
55
|
+
|
|
56
|
+
If the user provides a clear problem statement, proceed. Do not gate on optional inputs.
|
|
57
|
+
|
|
58
|
+
**Turn 2:** Derive a change-id slug from the problem statement and confirm in one line.
|
|
59
|
+
> I'll track this change as `<slug>` — OK, or would you prefer a different name? (A "change ID" is just a short folder name we use to group your design artifacts.)
|
|
60
|
+
|
|
61
|
+
On confirm or no reply, use the slug. On correction, use the user's name.
|
|
62
|
+
|
|
63
|
+
**Turn 3 (optional context):** Ask for user flow and data together — these are supplementary and the personas will cover what's missing.
|
|
64
|
+
> Two optional questions — type "none" or skip with Enter for either:
|
|
65
|
+
> 1. Proposed user flow (1–2 sentences — e.g. "user taps X → sees Y → confirms Z"). Note: this should describe an existing journey or rough idea, not a solution — the design will derive the flow.
|
|
66
|
+
> 2. What data will this design touch? (e.g. "user profiles", "payment methods", "none")
|
|
67
|
+
|
|
68
|
+
### 2. Build the Mini-Briefing
|
|
69
|
+
Follow the briefing pattern in `../references/review-personas.md` §1, but **pared down** for pre-design context. Skip the feature inventory (the change has no features yet) and focus on the axes that matter for security / data Q&A:
|
|
70
|
+
|
|
71
|
+
**Sources** (subset of review-personas.md §1):
|
|
72
|
+
- `.grimoire/config.yaml` → `project.surface`, `project.compliance`, `project.language`
|
|
73
|
+
- `.grimoire/docs/context.yml` if present → deployment environment, related services, trust boundaries
|
|
74
|
+
- All `.grimoire/decisions/*.md` with `status: accepted` — extract ID, title, top driver
|
|
75
|
+
- Tag histogram across `.grimoire/changes/**/*.feature` for data-sensitivity signals (pii, payment, auth, phi)
|
|
76
|
+
- `.grimoire/brand/tokens.json` existence (one bit — not needed for security/data questions but informs surface context)
|
|
77
|
+
|
|
78
|
+
**Briefing block** (inject as preface to every persona, mirror review-personas.md §1 format):
|
|
79
|
+
|
|
80
|
+
```markdown
|
|
81
|
+
## Project Briefing (consult)
|
|
82
|
+
|
|
83
|
+
**Surface:** <tui | web | mobile | api | mixed | unknown>
|
|
84
|
+
**Stage:** <prototype | internal | customer-facing | regulated — from compliance + README>
|
|
85
|
+
**Data sensitivity:** <none | pii | financial | phi — from tag histogram + compliance>
|
|
86
|
+
**Compliance:** <list configured frameworks, or "none">
|
|
87
|
+
**Threat surface signals:** <tags with count >0 — auth=N, pii=N, payment=N>
|
|
88
|
+
**Active constraints (accepted ADRs):**
|
|
89
|
+
- ADR-XXXX — <title>
|
|
90
|
+
- ...
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Skip the Feature Inventory and Linked-change Non-goals sections — there are no features yet and the consult precedes the manifest.
|
|
94
|
+
|
|
95
|
+
### 3. Engage Personas in Q&A Mode
|
|
96
|
+
**This is the core difference from `grimoire-review`.** Personas ASK questions; the designer ANSWERS. No blocker/suggestion grading. No materiality gate (the gate exists to keep reviewers from manufacturing findings — Q&A doesn't have findings).
|
|
97
|
+
|
|
98
|
+
Default personas: **Security Engineer** + **Data Engineer**. Add others only when the user invokes a mode flag (e.g., `--personas=security,data,qa`).
|
|
99
|
+
|
|
100
|
+
For each engaged persona:
|
|
101
|
+
- Read the persona's section in `../references/review-personas.md` §4 to understand its concerns (what it cares about, what it would flag in a review).
|
|
102
|
+
- Translate those concerns into clarifying questions for the designer, using the interview patterns in `../references/elicitation-personas.md` for that persona.
|
|
103
|
+
- Determine a question count for this persona: 5 by default; 3 in "quick consult" mode; fewer if the problem statement or briefing already answers likely questions. Announce the count once before the first question: e.g. `Security Engineer — 5 questions.`
|
|
104
|
+
- Ask **one question per turn**. Never list multiple questions in a single message. Prefix every question with its progress marker: `[Security — Q 1/5]`, `[Security — Q 2/5]`, etc.
|
|
105
|
+
- Wait for the answer before asking the next question. Do not hint at or pre-list upcoming questions.
|
|
106
|
+
- Skip questions whose answers are already obvious from the problem statement, briefing, or a prior answer — decrement the count and note it inline: `[Security — Q 3/5 skipped — covered above]`.
|
|
107
|
+
- Questions are conversational. Examples:
|
|
108
|
+
- Security: "What user data flows through this screen?", "Does any of it leave the boundary of our service?", "Is this surface authenticated, or public?", "Are there compliance frameworks (GDPR, HIPAA) that apply to this data?"
|
|
109
|
+
- Data: "What entities does this design touch?", "Are you reading from existing tables or creating new ones?", "If new fields are needed, what's the cardinality and nullability?", "Are there migrations implied?"
|
|
110
|
+
- Do **not** dump a checklist.
|
|
111
|
+
- Do **not** produce blocker/suggestion findings. If a persona spots a real risk, frame it as a question ("Have you considered what happens if X?") not a verdict ("[blocker] X is wrong").
|
|
112
|
+
|
|
113
|
+
Record the transcript verbatim for `consult.md` — questions asked, designer's answers, follow-up questions.
|
|
114
|
+
|
|
115
|
+
### 4. Distill Assumptions, Givens, and Open Questions
|
|
116
|
+
Once each persona has finished its Q&A pass, summarize the transcript into three distinct lists:
|
|
117
|
+
|
|
118
|
+
- **Inferred assumptions** — things the design must hold true to be valid. Examples: "All write operations happen behind authentication." / "PII is only displayed to the owning user, never logged." Phrase as positive declarations the design will need to honor.
|
|
119
|
+
- **Inferred givens** — constraints from existing systems, compliance, or accepted ADRs that the design cannot change. Examples: "User auth flows through the existing `auth-service` (ADR-0007)." / "PII storage must encrypt at rest per project.compliance: gdpr."
|
|
120
|
+
- **Open questions** — items the designer could not answer in this consult. These are flags for follow-up, not blockers. Examples: "Unknown: retention window for payment audit logs — needs product input." / "Unknown: whether mobile clients will consume this surface in phase 1."
|
|
121
|
+
|
|
122
|
+
Be honest about the boundary between assumption and given: a *given* is something the world imposes (compliance, an ADR, an existing service contract); an *assumption* is something the designer commits to upholding.
|
|
123
|
+
|
|
124
|
+
### 5. Write `.grimoire/changes/<id>/consult.md`
|
|
125
|
+
Compose the file with explicit, implementable sections in this order:
|
|
126
|
+
|
|
127
|
+
```markdown
|
|
128
|
+
# Pre-design consult: <change-id>
|
|
129
|
+
|
|
130
|
+
## Problem statement
|
|
131
|
+
<user's problem statement, verbatim>
|
|
132
|
+
|
|
133
|
+
## Proposed user flow
|
|
134
|
+
<user's input, or "Not provided">
|
|
135
|
+
|
|
136
|
+
## Data the design will touch
|
|
137
|
+
<user's input, or "Not provided">
|
|
138
|
+
|
|
139
|
+
## Project Briefing (consult)
|
|
140
|
+
<briefing block from step 2>
|
|
141
|
+
|
|
142
|
+
## Security Q&A
|
|
143
|
+
**Q:** <question 1>
|
|
144
|
+
**A:** <designer's answer>
|
|
145
|
+
|
|
146
|
+
**Q:** <question 2>
|
|
147
|
+
**A:** <designer's answer>
|
|
148
|
+
...
|
|
149
|
+
|
|
150
|
+
## Data Q&A
|
|
151
|
+
**Q:** <question 1>
|
|
152
|
+
**A:** <designer's answer>
|
|
153
|
+
...
|
|
154
|
+
|
|
155
|
+
## <Any other engaged personas> Q&A
|
|
156
|
+
<same Q/A format>
|
|
157
|
+
|
|
158
|
+
## Inferred assumptions
|
|
159
|
+
- <assumption 1>
|
|
160
|
+
- <assumption 2>
|
|
161
|
+
...
|
|
162
|
+
|
|
163
|
+
## Inferred givens
|
|
164
|
+
- <given 1, with ADR / compliance citation where applicable>
|
|
165
|
+
- <given 2>
|
|
166
|
+
...
|
|
167
|
+
|
|
168
|
+
## Open questions
|
|
169
|
+
- <unanswered item 1 — flagged for follow-up>
|
|
170
|
+
- <unanswered item 2>
|
|
171
|
+
...
|
|
172
|
+
|
|
173
|
+
## Personas engaged
|
|
174
|
+
- Security Engineer
|
|
175
|
+
- Data Engineer
|
|
176
|
+
<- ... other personas if added via mode flag>
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Do not invent content for empty sections. If the designer skipped "Proposed user flow", write "Not provided" — do not synthesize one. If a Q&A turn produced no actionable assumption, the assumptions list can be short.
|
|
180
|
+
|
|
181
|
+
### 6. Handoff
|
|
182
|
+
Tell the user what runs next and what those skills will do with `consult.md`:
|
|
183
|
+
|
|
184
|
+
- **`grimoire-design`** on the same `change-id` will read `consult.md` first, propagate assumptions and givens into prompts for variant generation (e.g., "exclude patterns that violate givens"), and copy the lists into `manifest.md` when the designer accepts a direction.
|
|
185
|
+
- **`grimoire-draft`** on the same `change-id` will read `consult.md` and copy "Inferred assumptions" + "Inferred givens" into `manifest.md` (Assumptions section, plus a new Givens section) at level 3-4 complexity.
|
|
186
|
+
- **Open questions** travel into `manifest.md` as unvalidated assumptions for the designer/PM to resolve before plan.
|
|
187
|
+
|
|
188
|
+
Do not invoke the next skill automatically. Confirm with the user, then suggest the next command.
|
|
189
|
+
|
|
190
|
+
## Important
|
|
191
|
+
- **This is Q&A, not findings.** Personas ASK questions of the designer; they do not produce blocker/suggestion verdicts. If you catch yourself writing `[blocker]` or `[suggestion]` in `consult.md`, stop — that is `grimoire-review`'s job, not this skill's.
|
|
192
|
+
- **No materiality gate.** The review-personas materiality gate exists to prevent manufactured findings. Q&A doesn't produce findings, so the gate does not apply — but the *intent* still holds: ask questions whose answers will change the design, not questions whose answers are already obvious from the briefing.
|
|
193
|
+
- **Minimal input bar.** Problem statement only is enough to start. Do not interrogate the user before engaging personas — the personas exist to ask the missing questions.
|
|
194
|
+
- **Available to engineers too.** This skill is not designer-exclusive. An engineer who says "I'm thinking about adding X, what should I worry about?" is invoking the same workflow. The output flows into `grimoire-draft` the same way it flows into `grimoire-design`.
|
|
195
|
+
- **Do not load Contrarian or Code Style personas.** Contrarian challenges other personas' findings; Code Style reviews diffs. Neither has a role in pre-design Q&A.
|
|
196
|
+
- **Honor the briefing pare-down.** Do not include the full review-personas.md §1 briefing — skip Feature Inventory and Linked-change Non-goals. They add noise without informing the questions a consult needs to ask.
|
|
197
|
+
- **Pure markdown skill.** Do not generate executable code. The `--personas=` and "quick consult" mode markers in this file describe how the AI interprets user phrasing — they are not CLI flags of the `grimoire` binary.
|
|
198
|
+
|
|
199
|
+
## Done
|
|
200
|
+
When `consult.md` is written and the user has acknowledged the handoff path, the consult is complete. Suggest `grimoire-design` (visual surface work) or `grimoire-draft` (behavioral specs) as the next step on the same `change-id`.
|