@brunosps00/dev-workflow 1.4.0 → 1.6.0

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.
Files changed (68) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/README.md +6 -5
  3. package/lib/constants.js +6 -4
  4. package/lib/hooks.js +53 -11
  5. package/lib/init.js +49 -1
  6. package/package.json +4 -2
  7. package/scaffold/config/stack-mappings.json +40 -0
  8. package/scaffold/en/commands/dw-adr.md +49 -11
  9. package/scaffold/en/commands/dw-analyze-project.md +10 -1
  10. package/scaffold/en/commands/dw-brainstorm.md +103 -32
  11. package/scaffold/en/commands/dw-claude-run.md +8 -5
  12. package/scaffold/en/commands/dw-context-budget.md +9 -0
  13. package/scaffold/en/commands/dw-harness-audit.md +3 -0
  14. package/scaffold/en/commands/dw-learn.md +41 -0
  15. package/scaffold/en/commands/dw-plan.md +36 -5
  16. package/scaffold/en/commands/dw-review.md +1 -0
  17. package/scaffold/en/commands/dw-run.md +1 -0
  18. package/scaffold/en/templates/adr-template.md +8 -4
  19. package/scaffold/en/templates/idea-onepager.md +44 -2
  20. package/scaffold/pt-br/commands/dw-adr.md +49 -11
  21. package/scaffold/pt-br/commands/dw-analyze-project.md +10 -1
  22. package/scaffold/pt-br/commands/dw-brainstorm.md +105 -32
  23. package/scaffold/pt-br/commands/dw-claude-run.md +8 -5
  24. package/scaffold/pt-br/commands/dw-context-budget.md +9 -0
  25. package/scaffold/pt-br/commands/dw-harness-audit.md +3 -0
  26. package/scaffold/pt-br/commands/dw-learn.md +41 -0
  27. package/scaffold/pt-br/commands/dw-plan.md +36 -5
  28. package/scaffold/pt-br/commands/dw-review.md +1 -0
  29. package/scaffold/pt-br/commands/dw-run.md +1 -0
  30. package/scaffold/pt-br/templates/adr-template.md +8 -4
  31. package/scaffold/pt-br/templates/idea-onepager.md +44 -2
  32. package/scaffold/rules/README.md +22 -0
  33. package/scaffold/rules/common.md +29 -0
  34. package/scaffold/rules/csharp.md +18 -0
  35. package/scaffold/rules/python.md +18 -0
  36. package/scaffold/rules/react.md +18 -0
  37. package/scaffold/rules/rust.md +18 -0
  38. package/scaffold/rules/typescript.md +23 -0
  39. package/scaffold/rules-readme.md +8 -0
  40. package/scaffold/scripts/hooks/session-cost.mjs +126 -0
  41. package/scaffold/scripts/hooks/statusline.mjs +31 -0
  42. package/scaffold/scripts/lib/model-prices.json +12 -0
  43. package/scaffold/skill-registry.json +25 -1
  44. package/scaffold/skills/dw-cli-run/SKILL.md +13 -9
  45. package/scaffold/skills/dw-codebase-intel/SKILL.md +3 -1
  46. package/scaffold/skills/dw-debug-protocol/SKILL.md +4 -0
  47. package/scaffold/skills/dw-debug-protocol/references/agent-degradation.md +30 -0
  48. package/scaffold/skills/dw-domain-modeling/SKILL.md +84 -0
  49. package/scaffold/skills/dw-domain-modeling/references/adr-policy.md +48 -0
  50. package/scaffold/skills/dw-domain-modeling/references/glossary-format.md +66 -0
  51. package/scaffold/skills/dw-execute-phase/SKILL.md +13 -0
  52. package/scaffold/skills/dw-git-discipline/SKILL.md +1 -0
  53. package/scaffold/skills/dw-grilling/SKILL.md +98 -0
  54. package/scaffold/skills/dw-grilling/references/decision-tree.md +56 -0
  55. package/scaffold/skills/dw-grilling/references/interview-loop.md +52 -0
  56. package/scaffold/skills/dw-llm-eval/SKILL.md +12 -0
  57. package/scaffold/skills/dw-memory/SKILL.md +12 -1
  58. package/scaffold/skills/dw-memory/references/instincts.md +45 -0
  59. package/scaffold/skills/dw-review-rigor/SKILL.md +12 -0
  60. package/scaffold/skills/dw-review-rigor/references/false-positives.md +21 -0
  61. package/scaffold/skills/dw-review-rigor/references/self-eval-rubric.md +38 -0
  62. package/scaffold/skills/dw-silent-failure/SKILL.md +4 -2
  63. package/scaffold/skills/dw-simplification/SKILL.md +13 -0
  64. package/scaffold/skills/dw-simplification/references/dead-code-tools.md +23 -0
  65. package/scaffold/skills/dw-testing-discipline/SKILL.md +17 -0
  66. package/scaffold/skills/dw-ui-discipline/SKILL.md +1 -1
  67. package/scaffold/skills/dw-verify/SKILL.md +1 -1
  68. package/scaffold/skills/dw-verify/references/pre-check-and-status.md +28 -0
@@ -20,8 +20,8 @@ Internal modes (the dispatcher picks 1+):
20
20
 
21
21
  | Mode | Auto-fires when |
22
22
  |------|-----------------|
23
- | **option-matrix** (always-on default) | Default surface: 3-7 options (conservative / balanced / bold) with `[IMPROVES] / [CONSOLIDATES] / [NEW]` tags. Always runs unless a hard override says otherwise. |
24
- | **grill** | Vocabulary feels unsettled — user terms differ from `.dw/rules/` / `.dw/constitution.md`, or two synonyms compete in the same conversation, or a contributor proposes a name that clashes with the glossary. |
23
+ | **option-matrix** (default surface) | 3-7 options (conservative / balanced / bold) with `[IMPROVES] / [CONSOLIDATES] / [NEW]` tags. Runs by default **except when Grill is the active phase** — `grill` and `option-matrix` are mutually exclusive in a turn (a hard override or an authorized Grill also skips it). |
24
+ | **grill** (native, stateful — needs explicit authorization) | The plan/PRD or its vocabulary feels unsettled. Signal Reading may **recommend** Grill, but it is a stateful alignment session that writes to `.dw/domain/**` and the one-pager; it starts only on **explicit intent** — `--mode=grill`, a direct phrase like "grill me" / "me questione", or a **yes** to the one-time offer. Mutually exclusive with `option-matrix`. |
25
25
  | **prototype** | User asks "is this state model right?" / "what should this look like?" with no clear answer; or the next sensible step is to RUN code, not write words. |
26
26
  | **council** | Two or more competing approaches surface with no obvious winner; or consensus forms too quickly (false-consensus signal). |
27
27
  | **research** | The question depends on external state-of-the-art ("what's the current best practice for X", multi-source comparisons, regulatory or framework landscape). |
@@ -68,6 +68,8 @@ When available in the project under `./.agents/skills/`, use these skills to enr
68
68
  - `dw-ui-discipline`: use when brainstorming involves frontend or UI direction — its hard-gate (scene sentence, surface job) is a generative forcing function during ideation, not just a review check. Also picked up by the **prototype** mode's UI branch.
69
69
  - `vercel-react-best-practices`: use when brainstorming React/Next.js architecture or performance trade-offs.
70
70
  - `security-review`: use when brainstorming touches auth, data handling, or security-sensitive features.
71
+ - `dw-grilling`: the interview engine of the **grill** mode — a dependency-ordered decision tree, exactly one decision per turn, each with a recommended answer. Internal, loaded by path; never exported.
72
+ - `dw-domain-modeling`: the vocabulary engine of the **grill** mode — canonical glossary in `.dw/domain/**`, fuzzy/overloaded-term challenge, code cross-checks, and the rare-ADR policy. Internal, loaded by path; never exported.
71
73
 
72
74
  ## Template Reference
73
75
 
@@ -92,9 +94,9 @@ Before producing any output, **read the situation**:
92
94
  1. Inspect `.dw/spec/prd-*/`, `.dw/rules/`, `.dw/constitution.md`, `.dw/intel/` if they exist. Note the project's current vocabulary and recent PRDs.
93
95
  2. Inspect recent git activity (`git log --oneline -20`) to detect ongoing work.
94
96
  3. Re-read the user's request against the Auto-Dispatch table at the top of this file. Match signals to modes.
95
- 4. Decide the dispatch: **option-matrix** always runs unless an explicit mode override skips it. Other modes (grill, prototype, council, research, refactor-audit, onepager) fire **additively** when their signals are present.
96
- 5. State the dispatch decision to the user in one short line: e.g., "Dispatching: option-matrix + onepager (PRD is one step away)" or "Dispatching: grill (vocabulary unsettled in current PRD)". Do not bury this — surface it before running.
97
- 6. Then proceed with the modes in this order (when chained): grill → research → option-matrix → council → refactor-audit → prototype → onepager. Skip modes not in the dispatch.
97
+ 4. Decide the dispatch: **option-matrix** runs by default unless an explicit mode override skips it OR Grill is the active phase (the two are mutually exclusive). **grill** is never auto-started — if its signals appear, **recommend** it and request one explicit authorization before starting the stateful session or writing any file (a normal brainstorm must not write Grill artifacts just because vocabulary looks unstable). The other modes (prototype, council, research, refactor-audit, onepager) fire **additively** when their signals are present.
98
+ 5. State the dispatch decision to the user in one short line: e.g., "Dispatching: option-matrix + onepager (PRD is one step away)" or, for grill, a recommendation needing consent: "Recommending: grill (vocabulary unsettled) — authorize to start the stateful session?". Do not bury this — surface it before running.
99
+ 6. Then proceed with the modes in this order (when chained): grill (only if authorized) → research → option-matrix → council → refactor-audit → prototype → onepager. Because grill and option-matrix are mutually exclusive, an authorized Grill runs to alignment first and only **offers** option-matrix as a separate, explicitly announced later phase. Skip modes not in the dispatch.
98
100
 
99
101
  ### Standard flow (option-matrix mode)
100
102
 
@@ -181,7 +183,7 @@ At the end, always leave the user in one of these situations:
181
183
  - With the one-pager at `.dw/spec/ideas/<slug>.md` (if **onepager** mode fired)
182
184
  - With the research report at `~/Documents/<Topic>_Research_<date>/` (if **research** mode fired)
183
185
  - With the refactor plan at `<target>/refactor-plan.md` (if **refactor-audit** mode fired)
184
- - With sharpened glossary entries in `.dw/rules/` (if **grill** mode fired)
186
+ - With canonical glossary entries in `.dw/domain/**` and an aligned idea one-pager (if **grill** ran with authorization)
185
187
  - With a runnable throwaway prototype + verdict template (if **prototype** mode fired)
186
188
 
187
189
  ## Mode: research (multi-source research)
@@ -331,57 +333,114 @@ Saved to `<target>/refactor-plan.md`:
331
333
  - Proposing refactors that aren't tested or testable → high risk, won't ship.
332
334
  - Ignoring documented architectural decisions in `.dw/rules/` → flagging intentional design as smell.
333
335
 
334
- ## Mode: grill (domain-grilling)
336
+ ## Mode: grill (native stateful alignment)
335
337
 
336
- Fires when vocabulary feels unsettled — user terms differ from `.dw/rules/` / `.dw/constitution.md`, two synonyms compete in the same conversation, or a contributor proposes a name that clashes with the glossary. Override: `--mode=grill`. Replaces the option-generation default with an **interview-style stress-test** of the plan/PRD against the project's domain vocabulary. Each round of questions sharpens one piece. Updates `.dw/rules/` (or `.dw/constitution.md`) inline as terms crystallize — never deferred to "after the conversation."
338
+ Grill is a **stateful alignment session** that interviews the plan/PRD to *shared understanding* and persists
339
+ canonical vocabulary to `.dw/domain/**`. It is **not** a normal brainstorm turn: it holds a decision tree across
340
+ turns and it writes files. Because it is stateful and mutating, it starts **only on explicit intent**.
337
341
 
338
- <critical>Ask ONE question at a time. Wait for the answer. Don't dump a list of 5 questions and hope for the best.</critical>
342
+ <critical>Explicit intent to Grill = `--mode=grill`, a direct phrase like "grill me" / "grill this plan", OR a **yes** to the one-time offer below. Automatic Signal Reading may **recommend** Grill, but it MUST request one explicit authorization before starting the session or writing ANY file. A normal brainstorm never writes Grill artifacts just because the vocabulary looks unstable.</critical>
339
343
 
340
- ### When to use grill mode
344
+ <critical>`grill` and `option-matrix` are **mutually exclusive** in a turn. Grill converges decisions; it does NOT generate an option matrix or a single final option-matrix verdict — but **every interview question still carries a recommended answer** (with rationale and an alternative/trade-off). "No recommendation" refers only to the option-matrix verdict, never to the per-question recommendation. After alignment, Grill may **offer** option-matrix as a separate, explicitly announced later phase.</critical>
341
345
 
342
- - Before `/dw-plan prd` when the domain feels unsettled or the team uses competing terms.
346
+ <critical>Ask exactly ONE unresolved decision per interaction, then wait. Never dump a list of questions.</critical>
347
+
348
+ Grill is powered by two internal skills (loaded by path from `./.agents/skills/`, never exported):
349
+ - **`dw-grilling`** — the decision-tree interview engine (dependency ordering, one decision per turn, a
350
+ recommended answer for every question, facts discovered rather than asked, the shared-understanding gate).
351
+ - **`dw-domain-modeling`** — the vocabulary engine (canonical terms, fuzzy/overloaded-term challenge, code
352
+ cross-checks, and safe lazy persistence to `.dw/domain/**`).
353
+
354
+ ### When Grill is the right move
355
+
356
+ - Before `/dw-plan prd` when the domain or the plan feels unsettled or the team uses competing terms.
343
357
  - After `/dw-plan prd` when reviewers flag ambiguous language in the PRD.
344
- - During architectural discussion when "module", "service", "component" are being used interchangeably and you need to pin the canonical term.
345
- - When a contributor proposes a name that doesn't match the project's existing glossary.
358
+ - When "module", "service", "component" (or two synonyms) are used interchangeably and the canonical term must be pinned.
359
+ - When a proposed name clashes with the existing glossary, or a plan hides unresolved decisions.
360
+
361
+ When these signals appear during auto-dispatch, **recommend** Grill in one line and offer to start it — e.g.
362
+ *"The plan leaves 4 product decisions open and `Account` is overloaded. Start a Grill session (stateful, writes to
363
+ `.dw/domain/**` and the one-pager)? [yes/no]"*. Start only on an explicit yes.
364
+
365
+ ### The session (after authorization)
346
366
 
347
- ### During-session disciplines
367
+ 1. **Build the decision tree first.** Before the first question, inspect project facts — current PRDs/TechSpecs,
368
+ `.dw/rules/`, `.dw/intel/` (via `/dw-intel`), `.dw/constitution.md`, `.dw/domain/**`, and recent git activity —
369
+ and build a decision tree **ordered by dependencies** (never ask a downstream decision before its blocker).
370
+ 2. **Ask exactly one unresolved decision per interaction and wait.** Each question includes: evidence when
371
+ available (with source), the recommended answer, a short rationale, and a meaningful alternative/trade-off.
372
+ Follow `dw-grilling` (`references/interview-loop.md`, `references/decision-tree.md`).
373
+ 3. **Facts are discovered, decisions are asked.** Look facts up in the repo/rules/intel/docs; put only genuine
374
+ decisions to the user, and leave the choice to the user.
375
+ 4. **Sharpen vocabulary with `dw-domain-modeling`.** Challenge fuzzy/overloaded terms, stress-test with concrete
376
+ edge-case scenarios, and cross-check each term against the code (surface `file:line` contradictions).
377
+ 5. **A resolved answer authorizes the matching update.** Once a decision is resolved, you may persist the
378
+ corresponding glossary/alignment change (see allowlist). ADR creation still requires a **separate explicit
379
+ approval** — never auto-create one.
348
380
 
349
- 1. **Challenge against the glossary.** Read `.dw/rules/index.md` + per-module `.dw/rules/<module>.md` + `.dw/constitution.md`. Flag terminology conflicts the instant the user uses a term that differs from (or contradicts) what's already documented.
381
+ ### Allowed stateful writes (only after authorization + the relevant decision is resolved)
350
382
 
351
- 2. **Sharpen fuzzy language.** When the user says "the user thing" or "the order stuff", propose a precise canonical term. Don't pretend you understood — push back.
383
+ - `.dw/domain/**` — the canonical glossary / context-map (via `dw-domain-modeling`).
384
+ - The active `.dw/spec/ideas/<slug>.md` one-pager (extended to schema `1.1`, below).
385
+ - An **explicitly active** PRD/TechSpec — only **after showing the proposed change** and getting agreement.
386
+ - Routed ADR paths via `/dw-adr --scope=repo|prd` (after separate ADR approval).
352
387
 
353
- 3. **Discuss concrete scenarios.** Force precision via specific edge cases: "What happens to the Order in state X when event Y arrives during retry Z?" Vague answers go back as further questions.
388
+ **Never edit source code during Grill.** If authorization is absent, keep interviewing and report what you *would*
389
+ persist.
354
390
 
355
- 4. **Cross-reference code.** When the user states a behavior, glance at the codebase to confirm it. Surface contradictions: "You said the API returns `OrderId` but `src/api/orders.ts:42` returns `{ order_id, status }`." Don't argue from generalities.
391
+ ### Native domain artifacts (not `.dw/rules/`, not root `CONTEXT.md`)
356
392
 
357
- 5. **Update `.dw/rules/` inline.** When a term crystallizes, write it into the appropriate rules file in the same conversation turn. Lazy file creation: if the file doesn't exist, create it. Format follows the glossary discipline established by the project (see `.dw/rules/index.md` for shape).
393
+ Canonical vocabulary lives in `.dw/domain/**`, created **lazily** only after a term is resolved and write
394
+ authorization exists:
358
395
 
359
- 6. **Skip implementation details in the glossary.** `.dw/rules/` and `.dw/constitution.md` describe vocabulary and principles — not implementation. "Order: a customer's request to purchase one or more items, in one of these states: pending, paid, shipped, delivered, refunded" is fine. "Order: a TypeScript class in `src/orders/`" is implementation leak.
396
+ - Single context → `.dw/domain/glossary.md`.
397
+ - Multiple contexts → `.dw/domain/context-map.md` + `.dw/domain/contexts/<slug>.md`.
398
+
399
+ A glossary definition is one or two sentences that say what the domain term **is**, lists discouraged synonyms
400
+ (`_Avoid:_`), and excludes implementation details, requirements, scratch notes, and general programming concepts.
401
+ Do **not** store human-curated vocabulary in the auto-generated `.dw/rules/` module files. `/dw-analyze-project`
402
+ reads and links `.dw/domain/**` and must preserve it, never regenerate it.
403
+
404
+ ### Aligned handoff — the idea one-pager (schema `1.1`)
405
+
406
+ Grill extends `.dw/spec/ideas/<slug>.md` to schema `1.1`, adding: **Resolved Decisions** (each with the recommended
407
+ answer, the user's choice, and the alternative rejected), **Evidence** (facts discovered with sources),
408
+ **Canonical Vocabulary** (links into `.dw/domain/**`), **Remaining Decisions**, and **Alignment State**.
409
+
410
+ Set `status: aligned` **only when all** of these hold: every dependency branch is resolved, glossary/code
411
+ contradictions are closed, no blocking open decision remains, AND the user **explicitly confirms** shared
412
+ understanding. Otherwise persist a `draft`/`paused` state (with the decision tree and open nodes) and **stop**.
413
+ `/dw-plan` consumes an aligned handoff without re-asking the resolved product decisions.
360
414
 
361
415
  ### ADR creation discipline
362
416
 
363
- Only propose an ADR via `/dw-adr` when **all three** hold:
417
+ Only offer an ADR (via `/dw-adr --scope=repo|prd`) when **all three** hold — and creation always needs a separate
418
+ explicit user approval (`dw-domain-modeling/references/adr-policy.md`):
364
419
 
365
420
  | Criterion | Test |
366
421
  |-----------|------|
367
- | **Hard to reverse** | If we change this in 6 months, does it cost >1 week of work? |
422
+ | **Hard to reverse** | If we change this in 6 months, does it cost meaningfully more than a day? |
368
423
  | **Surprising without context** | Would a new contributor reasonably reach a different decision? |
369
424
  | **Genuine trade-off** | Was there a real alternative we considered and chose against? |
370
425
 
371
- If any is missing, skip the ADR. Don't ADR every casual decision — that turns the ADR folder into noise.
426
+ Scope routing: `repo` → `.dw/adrs/adr-NNN.md` (works before any PRD); `prd` → `.dw/spec/<prd>/adrs/adr-NNN.md`.
427
+ If any criterion is missing, skip the ADR — don't turn the ADR log into noise.
372
428
 
373
429
  ### Output
374
430
 
375
431
  grill mode produces:
376
- - **Updated `.dw/rules/<module>.md`** or `.dw/constitution.md` with crystallized terms.
377
- - **Updated PRD / TechSpec** if grilling happens mid-plan (terms in the artifact are aligned with the glossary).
378
- - **Optional `.dw/spec/<prd>/adrs/adr-NNN.md`** if criteria above hold.
379
- - **NO** option matrix or recommendation (that's option-matrix mode; grill is purely about sharpening). If the dispatcher chained grill+option-matrix, the option matrix runs in a separate phase.
432
+ - **Canonical vocabulary in `.dw/domain/**`** (glossary, or context-map + per-context files) for resolved terms.
433
+ - **An extended one-pager** at `.dw/spec/ideas/<slug>.md` (schema `1.1`) — `aligned` only after explicit confirmation, otherwise `draft`/`paused`.
434
+ - **Updated PRD / TechSpec** only if explicitly active and the change was shown first.
435
+ - **Optional routed ADR** via `/dw-adr --scope=…` if the three criteria hold and the user approves.
436
+ - **NO** option matrix and no single final option-matrix verdict — but every interview question still carries a recommended answer (option-matrix is a separate later phase if offered and accepted).
380
437
 
381
438
  ### When the discipline bends
382
439
 
383
- - **Greenfield project with no `.dw/rules/`**: grill anyway; the conversation produces the FIRST entries in `.dw/rules/index.md`. That's the value.
384
- - **Cosmetic terminology disagreements** ("should we call it `userId` or `user_id`?"): skip grill mode; use a coding-conventions ADR or `.dw/rules/index.md` Naming section.
440
+ - **Greenfield project with no `.dw/domain/`**: grill anyway (once authorized); the session produces the FIRST
441
+ entries in `.dw/domain/glossary.md`. That's the value. ADRs before any PRD route to `--scope=repo`.
442
+ - **Cosmetic terminology disagreements** ("should we call it `userId` or `user_id`?"): skip grill; use a
443
+ coding-conventions note in `.dw/rules/index.md` Naming — a naming style is not a domain term.
385
444
 
386
445
  ## Mode: prototype (throwaway prototype)
387
446
 
@@ -445,8 +504,20 @@ The codebase-grounded idea refinement pattern is inspired by [`addyosmani/agent-
445
504
  - Output at `.dw/spec/ideas/<slug>.md` (sibling of `prd-<slug>/`) instead of `docs/ideas/` — preserves dev-workflow path conventions.
446
505
  - Integration with the existing pipeline: `/dw-plan prd` accepts the one-pager as input, reducing clarification questions.
447
506
 
448
- The **grill** and **prototype** modes are adapted from [`mattpocock/skills/grill-with-docs`](https://github.com/mattpocock/skills/tree/main/grill-with-docs) and [`mattpocock/skills/prototype`](https://github.com/mattpocock/skills/tree/main/prototype) (Matt Pocock, MIT). dev-workflow adaptation: integrated as INTERNAL auto-dispatched modes rather than separate skills, paths rebased on `.dw/rules/` + `.dw/spec/<prd>/`, ADR creation gated on the 3-criteria test (hard-to-reverse + surprising + genuine trade-off).
449
-
450
- Credit: Addy Osmani (idea-refine) and Matt Pocock (grill-with-docs, prototype).
507
+ The **grill** mode is a native reimplementation of Matt Pocock's grilling discipline (MIT), drawing on three
508
+ upstream skills: [`skills/engineering/grill-with-docs`](https://github.com/mattpocock/skills/blob/main/skills/engineering/grill-with-docs/SKILL.md)
509
+ (interview that produces docs as it goes), [`skills/productivity/grilling`](https://github.com/mattpocock/skills/blob/main/skills/productivity/grilling/SKILL.md)
510
+ (one-decision-at-a-time interview with a recommended answer, facts looked up not asked, shared-understanding gate),
511
+ and [`skills/engineering/domain-modeling`](https://github.com/mattpocock/skills/blob/main/skills/engineering/domain-modeling/SKILL.md)
512
+ (canonical glossary, fuzzy-term challenge, rare ADRs). dev-workflow adaptations: behavior is reimplemented in this
513
+ repo's voice (no upstream prose copied) and extracted into two **internal, non-exported** skills — `dw-grilling`
514
+ and `dw-domain-modeling` — invoked by this mode; the glossary lives in **`.dw/domain/**`** (not upstream's root
515
+ `CONTEXT.md` and not our auto-generated `.dw/rules/`); Grill is a **stateful session that requires one explicit
516
+ authorization** before writing; alignment produces an idea one-pager at schema `1.1` consumed by `/dw-plan`; and
517
+ ADR creation is gated on the 3-criteria test and routed via `/dw-adr --scope=repo|prd`. The **prototype** mode is
518
+ adapted from [`mattpocock/skills/prototype`](https://github.com/mattpocock/skills) (MIT) as an internal
519
+ auto-dispatched mode.
520
+
521
+ Credit: Addy Osmani (idea-refine) and Matt Pocock (grill-with-docs, grilling, domain-modeling, prototype).
451
522
 
452
523
  </system_instructions>
@@ -11,18 +11,19 @@ session**, score the delivery 0–10, escalate on failure, and **STOP for the ga
11
11
 
12
12
  | Slot | Claude value |
13
13
  |---|---|
14
- | `DISPATCH` | `UUID=$(cat /proc/sys/kernel/random/uuid); cd <WORKTREE> && claude -p --session-id "$UUID" --model <MODEL> --output-format stream-json --include-partial-messages --verbose --dangerously-skip-permissions "$(cat <PROMPT>)" </dev/null > <AUDIT>/<slug>.log 2>&1` |
14
+ | `DISPATCH` | `UUID=$(cat /proc/sys/kernel/random/uuid); cd <WORKTREE> && claude -p --session-id "$UUID" --model <MODEL> --effort <EFFORT> --output-format stream-json --include-partial-messages --verbose --dangerously-skip-permissions "$(cat <PROMPT>)" </dev/null > <AUDIT>/<slug>.log 2>&1` |
15
15
  | `STREAM` | `--output-format stream-json --include-partial-messages --verbose` (`--verbose` is **required** with `stream-json` in `-p` mode) |
16
16
  | `AUTO` | `--dangerously-skip-permissions` (headless auto-approve; justified because the worktree is isolated). Read-only/analysis: drop it and pass `--permission-mode plan` (or restrict `--allowedTools`). |
17
- | `RESUME <id>` | `cd <WORKTREE> && claude --resume "$UUID" -p --output-format stream-json --include-partial-messages --verbose --dangerously-skip-permissions "$(cat <FOLLOWUP_PROMPT>)" </dev/null >> <AUDIT>/<slug>.log 2>&1` |
17
+ | `RESUME <id>` | `cd <WORKTREE> && claude --resume "$UUID" -p --effort <EFFORT> --output-format stream-json --include-partial-messages --verbose --dangerously-skip-permissions "$(cat <FOLLOWUP_PROMPT>)" </dev/null >> <AUDIT>/<slug>.log 2>&1` |
18
18
  | `RESUME_LAST` | `claude -c -p …` (continue the most recent conversation in this cwd) |
19
19
  | `SESSION_ID` | **FIXED by you** — you pass `--session-id "$UUID"` on the first run, so the id is known up front. Generate it (`cat /proc/sys/kernel/random/uuid` or `uuidgen`) and write it to `<AUDIT>/<slug>.session` BEFORE/at dispatch. No stream-scraping needed — Claude is the easy case. |
20
20
  | `DONE_SIGNAL` | the final `{"type":"result"}` message in the stream (carries `subtype`, `usage`, `total_cost_usd`, `num_turns`) |
21
21
  | `USAGE` | the `result` message `usage` → `input_tokens` / `cache_read_input_tokens` / `cache_creation_input_tokens` / `output_tokens`, plus `total_cost_usd`. Extract: `grep -oE '"usage":\{[^}]*\}' <AUDIT>/<slug>.log \| tail -1` |
22
22
 
23
- **Model + effort:** `--model` selects the tier (`opus` · `sonnet` · `haiku`, or a full id). Claude has no numeric
24
- effort flag; map "escalation" to model tier (and, when needed, ask for extended thinking in the prompt). Start one
25
- tier below the ceiling; escalate per `dw-cli-run`.
23
+ **Model + effort:** `--model` selects the tier (`opus` · `sonnet` · `haiku`, or a full id). `--effort` selects the
24
+ reasoning budget: `low` · `medium` · `high` · `xhigh` · `max` (supported by the Claude CLI ≥ 2.1.206). Escalate per
25
+ `dw-cli-run`: raise `--effort` first (low→medium→high→xhigh→max), then bump `--model` one tier and reset effort.
26
+ Start one notch below the ceiling.
26
27
 
27
28
  ## Session resume (the heart)
28
29
  Because you pass `--session-id "$UUID"`, the id is **fixed and known** at dispatch — write it to
@@ -38,6 +39,8 @@ Because you pass `--session-id "$UUID"`, the id is **fixed and known** at dispat
38
39
  | `<PROMPT>` | prepared prompt/spec path | `.dw/spec/prd-billing-integrador/codex-prompt.md` |
39
40
  | `<slug>` | task key for audit/session files | `prd-billing-integrador` |
40
41
  | `<AUDIT>` | durable audit dir OUTSIDE the worktree | `~/code/vizzita/.dw/cli-run` |
42
+ | `<MODEL>` | Claude tier or full model id | `opus` / `sonnet` / `haiku` |
43
+ | `<EFFORT>` | reasoning budget (Claude CLI ≥ 2.1.206) | `low` / `medium` / `high` / `xhigh` / `max` |
41
44
 
42
45
  Return via the `dw-cli-run` **Structured Return** (Status/Score/Scope/Evidence/Artifacts/Decisions/Risks/Telemetry/
43
46
  Next Step), including the fixed `session-id` (UUID), its sidecar path, and the exact `RESUME` command to continue.
@@ -21,6 +21,15 @@ You are the context budget auditor for dev-workflow.
21
21
  - Claude/OpenCode agent files with provider-incompatible tool or permission fields.
22
22
  4. Recommend the top 5 savings with concrete paths.
23
23
 
24
+ ## Part B — Runtime spend (actual token cost)
25
+
26
+ Static overhead (above) is what the harness *loads*; this part is what sessions actually *cost*. Report from `.dw/metrics/costs.jsonl` (appended by the `session-cost` SessionEnd hook — one row per session with per-model token usage + estimated USD):
27
+
28
+ 1. Read `.dw/metrics/costs.jsonl` if present. If absent, note "no runtime cost data yet (hook disabled or no session has ended)" and skip this part — never fail.
29
+ 2. Dedupe by `session_id` (latest row per session wins).
30
+ 3. Report: estimated spend today and over the last 7 days; the 3 most expensive sessions; and the per-model split (which model burned the most).
31
+ 4. USD is a best-effort estimate from `.dw/scripts/lib/model-prices.json` — token counts are exact, prices may drift. Flag any model that resolved to `_default`/`_unknown` (missing price entry to add).
32
+
24
33
  ## Output
25
34
  Write a concise report in chat. If `.dw/reports/` exists, also write `.dw/reports/context-budget.md`.
26
35
 
@@ -26,6 +26,9 @@ You are the dev-workflow harness auditor.
26
26
  4. Cite missing paths, broken references, stale managed files, and skills without a structured return.
27
27
  5. Recommend the top 3 fixes.
28
28
 
29
+ ## Runtime degradation triage (on-demand)
30
+ The scorecard above is deterministic **install** health. If instead the *agent* is misbehaving at runtime (loops, objective drift, hallucinated edits, degraded reasoning), that is a different diagnosis: point the user to `.agents/skills/dw-debug-protocol/references/agent-degradation.md` (symptom→cause table + ordered recovery). Advisory only — it does not affect the scorecard.
31
+
29
32
  ## Output
30
33
  Return a scorecard and do not mutate files. Tell the user to run `dev-workflow repair` for managed-file drift.
31
34
 
@@ -0,0 +1,41 @@
1
+ <system_instructions>
2
+ You are the learning synthesizer for dev-workflow. You turn what this project's work has ALREADY recorded into atomic, confidence-weighted **instincts** the team can reuse — and you NEVER write anything without explicit approval.
3
+
4
+ ## When to Use
5
+ - After a run of related work (a few tasks, a bugfix batch) to capture what was learned.
6
+ - When the user says "learn from this", "what patterns emerged", or "promote what we learned".
7
+ - Periodically, to propose constitution principles grounded in real, repeated practice.
8
+
9
+ Do NOT invent best practices from nothing — every instinct must be grounded in this project's records.
10
+
11
+ ## Sources (read-only; there is NO always-on observer)
12
+ Gather signals only from what is already persisted:
13
+ 1. `.dw/spec/*/MEMORY.md` — durable decisions, especially those tagged `[confidence: …]` (see the `dw-memory` skill).
14
+ 2. `.dw/bugfixes/*/SUMMARY.md` — recurring root causes and the guards added.
15
+ 3. `.dw/spec/*/deviations.md` — where the plan met reality.
16
+ 4. Recent git history — `git log --oneline -50` and commit-message patterns.
17
+ 5. Existing `.dw/memory/instincts/*.md` — to UPDATE confidence, not duplicate.
18
+
19
+ ## Process
20
+ 1. **Cluster** repeated signals into candidate instincts. A candidate needs **≥2 independent confirmations** (two tasks, a decision + a bugfix, a repeated commit pattern). A one-off is NOT an instinct.
21
+ 2. **Score** each candidate's confidence (0.3–0.9) using the `dw-memory` confidence rule; name the evidence.
22
+ 3. **Classify** `domain` (code-style / testing / error-handling / git / workflow / security) and `scope` (project by default).
23
+ 4. **Present** candidates in chat as a markdown list — id, trigger, action, confidence, evidence. Do NOT write yet.
24
+ 5. **Ask**: "Approve which to store? (ids, or 'all', or 'none'). Any to promote to a constitution principle?"
25
+ 6. On approval:
26
+ - Write each approved instinct to `.dw/memory/instincts/<slug>.md` in the format from `.agents/skills/dw-memory/references/instincts.md` (create or update; never duplicate an existing id).
27
+ - For any the user chooses to promote, hand off to the constitution flow — propose a `P-NNN` principle at `severity: info` for `/dw-analyze-project` Step 8. Do NOT edit `.dw/constitution.md` directly without the user re-confirming.
28
+ 7. Update confidence on existing instincts that new evidence reconfirms or contradicts.
29
+
30
+ ## Rules
31
+ - Never write an instinct or a constitution change without explicit approval (mirrors constitution + STATE handling).
32
+ - Ground every instinct in cited evidence; drop candidates you cannot ground in ≥2 confirmations.
33
+ - Keep instincts atomic — one trigger, one action. Split compound learnings.
34
+ - Project scope by default; mark `global` only when the pattern is seen across projects.
35
+ - This command reads and proposes; it NEVER modifies source code.
36
+
37
+ ## Output
38
+ A list of proposed/updated instincts (id, trigger, action, confidence, evidence); then, after approval, the files written under `.dw/memory/instincts/` and any constitution proposals handed off.
39
+
40
+ Final marker: `## LEARN COMPLETE`
41
+ </system_instructions>
@@ -55,7 +55,36 @@ Claude Code and OpenCode can use native project agents. Codex and Copilot use `.
55
55
 
56
56
  <critical>When a structured interview/user-input tool is available, `/dw-plan` MUST use it for PRD and TechSpec clarification questions. Do not downgrade to plain chat merely for convenience. If no such tool exists in the runtime, ask the same questions in chat and explicitly record: `Structured interview tool unavailable; using chat fallback.`</critical>
57
57
 
58
- The tool is mandatory for planning because it preserves explicit user choices and prevents the agent from answering its own questions. Each stage keeps its own quota: PRD requires 7+ product questions; TechSpec requires 7+ technical questions.
58
+ The tool is mandatory for planning because it preserves explicit user choices and prevents the agent from answering its own questions.
59
+
60
+ ## Coverage-driven interview (no fixed question quotas)
61
+
62
+ <critical>`/dw-plan` does NOT ask a fixed number of questions. Each stage builds a **coverage matrix** over its required dimensions, discovers facts from the repo/rules/intel/domain artifacts, **credits evidence already resolved in an aligned Grill handoff**, and then asks — one decision at a time — ONLY the dimensions that remain uncovered. Never re-ask a product decision the user already resolved during Grill.</critical>
63
+
64
+ ### Aligned handoff (from `/dw-brainstorm` grill)
65
+
66
+ Before Stage 1, check for an idea one-pager at `.dw/spec/ideas/<slug>.md` and the canonical vocabulary in `.dw/domain/**`.
67
+
68
+ <critical>Validate the handoff and FAIL CLOSED. Credit an aligned handoff — i.e. suppress the product questions its decisions cover — ONLY when EVERY one of these holds:
69
+ - `schema_version: "1.1"`;
70
+ - `status: aligned`;
71
+ - `alignment.confirmed_by_user: true`;
72
+ - every dependency branch is resolved (no open decision node);
73
+ - glossary/code contradictions are closed;
74
+ - no **blocking** entry remains under Remaining Decisions.
75
+ If ANY check fails — or the file is malformed, internally inconsistent, `draft`, or `paused` — the one-pager is **input, not a trusted handoff**: read it for context, but treat all its decisions as **uncovered** and ask them normally. Never suppress a product question on the strength of `status: aligned` alone; `alignment.confirmed_by_user: true` and a resolved, non-blocking, contradiction-free tree are required too.</critical>
76
+
77
+ When (and only when) the handoff is fully valid:
78
+ - Load its **Resolved Decisions**, **Evidence**, and **Canonical Vocabulary** links.
79
+ - Mark every PRD dimension those decisions cover as **already covered** (cite the one-pager as the evidence) — do NOT re-ask them.
80
+ - Only uncovered dimensions become questions, asked one at a time.
81
+
82
+ ### Coverage matrices
83
+
84
+ - **PRD dimensions:** goals, target users, scope boundaries, success metrics, rollout strategy, integration points, edge cases.
85
+ - **TechSpec dimensions:** domain placement, data flow, dependencies, core interfaces, test strategy, reuse-vs-build, multi-project integration (when applicable).
86
+
87
+ For each stage: build the matrix, mark each dimension `covered` (fact discovered or aligned evidence credited) or `uncovered`, then ask only the `uncovered` ones — one decision per turn, each with a recommended answer. **Technical decisions a product Grill did not cover may still be asked during TechSpec** — Grill aligns product vocabulary and product decisions, not the full technical design.
59
88
 
60
89
  ## Constitution Gate
61
90
 
@@ -70,17 +99,19 @@ The tool is mandatory for planning because it preserves explicit user choices an
70
99
 
71
100
  If `.dw/intel/` doesn't exist, fall back to `.dw/rules/` and direct grep. Suggest `/dw-intel --build` to populate intel for richer downstream context.
72
101
 
102
+ If `.dw/memory/instincts/` has entries, load any with confidence ≥0.7 whose `trigger` matches the feature (lazy, by trigger only) — they encode learned project conventions from `/dw-learn` worth respecting in the spec.
103
+
73
104
  ## Stage 1 — PRD generation
74
105
 
75
106
  Runs when default mode OR `plan prd`.
76
107
 
77
108
  ### Prerequisites for this stage
78
109
  - Idea or topic from the user.
79
- - (Optional) brainstorm one-pager from `/dw-brainstorm --onepager` at `.dw/spec/ideas/<slug>.md`.
110
+ - (Optional) an idea one-pager from `/dw-brainstorm` at `.dw/spec/ideas/<slug>.md`. If it is `status: aligned` (schema `1.1`, from a Grill session), consume it as a handoff — its Resolved Decisions are credited, not re-asked (see Coverage-driven interview).
80
111
 
81
112
  ### Required behavior
82
113
 
83
- 1. **Clarification questions (MINIMUM 7).** Before writing anything, use the structured interview tool when available to ask 7+ focused questions covering: goals, target users, scope boundaries, success metrics, rollout strategy, integration points, edge cases. If the tool is unavailable, use chat fallback and record that fallback.
114
+ 1. **Coverage matrix over the PRD dimensions** (goals, target users, scope boundaries, success metrics, rollout strategy, integration points, edge cases). Build the matrix, credit any aligned-handoff evidence and facts discovered from the repo, then ask ONLY the uncovered dimensions — one decision at a time, each with a recommended answer — using the structured interview tool when available (record the chat fallback otherwise). No fixed question count; never re-ask a decision resolved in an aligned one-pager.
84
115
  2. **Web search MINIMUM 3 queries** for market patterns, regulatory context, competitor approaches when relevant.
85
116
  3. **Constitution alignment.** Each functional requirement (FR-N.M) includes a `Constitution Alignment: respects P-NNN, P-MMM` line OR `no applicable principle: <reason>`.
86
117
  4. **Multi-project awareness.** If the feature spans multiple projects in the workspace, consult `.dw/rules/integrations.md` and document scope in the PRD's "Impacted Projects" section.
@@ -104,7 +135,7 @@ Runs when default mode (after PRD approval) OR `plan techspec` OR `plan --from t
104
135
  ### Required behavior
105
136
 
106
137
  1. **Hard gate: PRD open questions.** If `.dw/spec/prd-<feature>/prd.md` has an "Open Questions" section with unresolved items, STOP and ask the user to resolve them first.
107
- 2. **Clarification questions (MINIMUM 7).** Use the structured interview tool when available to ask technical questions covering: domain placement, data flow, dependencies, core interfaces, test strategy, reuse-vs-build, multi-project integration if applicable. If the tool is unavailable, use chat fallback and record that fallback.
138
+ 2. **Coverage matrix over the TechSpec dimensions** (domain placement, data flow, dependencies, core interfaces, test strategy, reuse-vs-build, multi-project integration when applicable). Credit aligned-handoff evidence and discovered facts, then ask ONLY uncovered dimensions — one decision at a time — using the structured interview tool when available (record the chat fallback otherwise). Technical decisions not covered by a product Grill may still be asked here. No fixed question count.
108
139
  3. **Web search MINIMUM 3 queries** for technical patterns + Context7 MCP for framework/library specifics.
109
140
  4. **Source grounding (`dw-source-grounding`).** Every framework/library decision ships with `[source: <url>, version: X.Y, retrieved: YYYY-MM-DD]`.
110
141
  5. **Constitution gate.** Each architectural decision lists `Respects: P-NNN` or `Deviates: P-NNN — justification: <ADR slug or rationale>`. Deviations from `severity: high/critical` principles without ADR → STOP.
@@ -185,7 +216,7 @@ After full plan run, the PRD directory contains:
185
216
 
186
217
  ## Final Guidelines
187
218
 
188
- - Each stage has its own clarification question quota — don't recycle. Different stages need different framing. Use the structured interview tool whenever available.
219
+ - Each stage runs a coverage matrix over its own dimensions — no fixed question quota. Credit aligned-handoff evidence and discovered facts; ask only uncovered decisions, one at a time. Different stages need different framing. Use the structured interview tool whenever available.
189
220
  - Web search is mandatory; Context7 MCP for libraries. No skipping for "I think I know the latest version."
190
221
  - Constitution gate runs at every stage entry; defaults are auto-installed when missing (never blocks).
191
222
  - All three stages produce committed Markdown — these are the canonical planning artifacts. They evolve with the feature.
@@ -139,6 +139,7 @@ If MISSING > 0, the verdict suggests revisiting `/dw-plan tasks` to scope or `/d
139
139
  - General patterns: no `any` types in TS, no `console.log` in prod, error handling, multi-tenancy.
140
140
  - Backend patterns from `.dw/rules/<backend>.md`: Clean Architecture, use-case return types, DTOs, parameterized queries.
141
141
  - Frontend patterns from `.dw/rules/<frontend>.md`: Server Components default, forms patterns, design system.
142
+ - Curated baseline: check the diff against the active stack's `.dw/rules-library/<stack>.md` (+ `common.md`) as the declarative bar. The project's own `.dw/rules/` and `.dw/constitution.md` override it where they differ.
142
143
 
143
144
  3. **Constitution compliance** (against `.dw/constitution.md`):
144
145
  - For each principle, check diff for violations per the principle's Enforcement line.
@@ -31,6 +31,7 @@ When available under `./.agents/skills/`, these skills are invoked per task:
31
31
 
32
32
  - `dw-verify`: **ALWAYS** — before each task's commit, produces a Verification Report (test + lint + build all GREEN). Without PASS, no commit. The Iron Law of verification.
33
33
  - `dw-memory`: **ALWAYS** — reads workflow memory at task start; updates at task end with the promotion test (lessons that apply to next task get promoted to shared MEMORY.md).
34
+ - Instincts (lazy): at task start, also load any high-confidence instinct (`.dw/memory/instincts/`, confidence ≥0.7) whose `trigger` matches the task — learned project conventions promoted by `/dw-learn`. Match by trigger only; never bulk-load the set.
34
35
  - `dw-execute-phase`: provides `plan-checker` (6-dimension goal-backward verification before any code is touched in plan mode) and `executor` (atomic commit + deviation handling) agents.
35
36
  - `dw-testing-discipline`: applies the placement doctrine, 6 agent guardrails, and 25 anti-patterns when adding tests during the task.
36
37
  - `dw-ui-discipline`: when the task touches UI, the 4 grounding questions must be answered before any visual decision lands.
@@ -3,8 +3,9 @@ id: NNN
3
3
  status: Proposed
4
4
  title: [Short imperative title of the decision]
5
5
  date: YYYY-MM-DD
6
- prd: [PRD slug, e.g. prd-user-auth]
7
- schema_version: "1.0"
6
+ scope: repo | prd
7
+ prd: [PRD slug for scope=prd, e.g. prd-user-auth; "n/a" for scope=repo]
8
+ schema_version: "1.1"
8
9
  supersedes: null
9
10
  superseded_by: null
10
11
  ---
@@ -46,8 +47,11 @@ Proposed | Accepted | Deprecated | Superseded by ADR-XXX
46
47
 
47
48
  ## Related
48
49
 
49
- - PRD: `.dw/spec/[prd-slug]/prd.md`
50
- - TechSpec: `.dw/spec/[prd-slug]/techspec.md` (if applicable)
50
+ <!-- scope=prd: link the owning PRD/TechSpec. scope=repo: no owning PRD — omit the PRD/TechSpec lines
51
+ (or write "n/a") and link `.dw/constitution.md` / `.dw/rules/` only when they genuinely apply. -->
52
+
53
+ - PRD: `.dw/spec/[prd-slug]/prd.md` (scope=prd only; "n/a" for scope=repo)
54
+ - TechSpec: `.dw/spec/[prd-slug]/techspec.md` (if applicable; scope=prd only)
51
55
  - Affected tasks: [task list, if applicable]
52
56
  - Related ADRs: [list, if applicable]
53
57
 
@@ -1,11 +1,19 @@
1
1
  ---
2
2
  type: idea-onepager
3
- schema_version: "1.0"
4
- status: draft
3
+ schema_version: "1.1"
4
+ status: draft | paused | aligned
5
5
  date: YYYY-MM-DD
6
6
  classification: improves | consolidates | new
7
+ alignment:
8
+ confirmed_by_user: false # set true ONLY when the user explicitly confirms shared understanding
9
+ confirmed_on: null # ISO date of that confirmation
7
10
  ---
8
11
 
12
+ > **Schema 1.1.** The `## Grill Alignment` block below is populated by a `/dw-brainstorm` grill session. Without a
13
+ > Grill, leave that block empty and keep `status: draft`. `status: aligned` is allowed ONLY when every dependency
14
+ > branch is resolved, glossary/code contradictions are closed, no blocking decision remains, and the user has
15
+ > explicitly confirmed shared understanding — otherwise use `draft` or `paused`.
16
+
9
17
  # Idea: [Short, imperative title]
10
18
 
11
19
  ## Problem Statement
@@ -81,6 +89,40 @@ Ideally 2-4 stories. If it's more than 5, it's probably not MVP.]
81
89
  - [Question 1 affecting scope]
82
90
  - [Question 2 affecting priority]
83
91
 
92
+ ## Grill Alignment
93
+
94
+ _(schema 1.1 — filled by a `/dw-brainstorm` grill session; consumed by `/dw-plan`, which does NOT re-ask resolved decisions. Leave empty for a non-grilled one-pager.)_
95
+
96
+ ### Resolved Decisions
97
+
98
+ | Decision | Recommended | Chosen | Alternative rejected | Evidence |
99
+ |----------|-------------|--------|----------------------|----------|
100
+ | [the decision] | [what Grill recommended] | [what the user chose] | [the rejected option + its trade-off] | [one-pager/repo source] |
101
+
102
+ ### Evidence
103
+
104
+ [Facts discovered during Grill from the repo/rules/intel/docs — each with its source (`path:line`, doc, or intel query) — that were used instead of asking the user.]
105
+
106
+ - **[fact]** — source: `[path:line or doc]`
107
+
108
+ ### Canonical Vocabulary
109
+
110
+ [Links into `.dw/domain/**` for the terms this idea depends on. Do not restate definitions here — point to the glossary.]
111
+
112
+ - **[Term]** → `.dw/domain/glossary.md#term` (or `.dw/domain/contexts/<slug>.md#term` for a multi-context project)
113
+
114
+ ### Remaining Decisions
115
+
116
+ [Non-blocking decisions still open after alignment, with their owner. A blocking decision means the one-pager is NOT `aligned`.]
117
+
118
+ - **[open decision]** — owner: [who] — blocking? [no]
119
+
120
+ ### Alignment State
121
+
122
+ - **State:** `draft` | `paused` | `aligned`
123
+ - **Shared understanding confirmed by user:** [yes/no — `aligned` requires an explicit yes]
124
+ - **Why not aligned (if draft/paused):** [the blocking node or unclosed contradiction that stopped alignment]
125
+
84
126
  ## Next Step
85
127
 
86
128
  Pick ONE: