@brunosps00/dev-workflow 0.15.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/README.md +99 -119
  2. package/lib/constants.js +16 -36
  3. package/lib/migrate-skills.js +11 -4
  4. package/lib/removed-commands.js +30 -0
  5. package/package.json +1 -1
  6. package/scaffold/en/agent-instructions.md +31 -16
  7. package/scaffold/en/commands/dw-adr.md +2 -2
  8. package/scaffold/en/commands/dw-analyze-project.md +7 -7
  9. package/scaffold/en/commands/dw-autopilot.md +20 -20
  10. package/scaffold/en/commands/dw-brainstorm.md +315 -21
  11. package/scaffold/en/commands/dw-bugfix.md +5 -5
  12. package/scaffold/en/commands/dw-commit.md +1 -1
  13. package/scaffold/en/commands/dw-dockerize.md +9 -9
  14. package/scaffold/en/commands/dw-find-skills.md +4 -4
  15. package/scaffold/en/commands/dw-functional-doc.md +1 -1
  16. package/scaffold/en/commands/dw-generate-pr.md +4 -4
  17. package/scaffold/en/commands/dw-help.md +95 -351
  18. package/scaffold/en/commands/dw-intel.md +76 -12
  19. package/scaffold/en/commands/dw-new-project.md +9 -9
  20. package/scaffold/en/commands/dw-plan.md +175 -0
  21. package/scaffold/en/commands/dw-qa.md +166 -0
  22. package/scaffold/en/commands/dw-redesign-ui.md +6 -6
  23. package/scaffold/en/commands/dw-review.md +198 -0
  24. package/scaffold/en/commands/dw-run.md +176 -0
  25. package/scaffold/en/commands/dw-secure-audit.md +222 -0
  26. package/scaffold/en/commands/dw-update.md +1 -1
  27. package/scaffold/en/references/playwright-patterns.md +1 -1
  28. package/scaffold/en/references/refactoring-catalog.md +1 -1
  29. package/scaffold/en/templates/brainstorm-matrix.md +1 -1
  30. package/scaffold/en/templates/idea-onepager.md +3 -3
  31. package/scaffold/en/templates/project-onepager.md +5 -5
  32. package/scaffold/pt-br/agent-instructions.md +31 -16
  33. package/scaffold/pt-br/commands/dw-adr.md +2 -2
  34. package/scaffold/pt-br/commands/dw-analyze-project.md +7 -7
  35. package/scaffold/pt-br/commands/dw-autopilot.md +20 -20
  36. package/scaffold/pt-br/commands/dw-brainstorm.md +315 -21
  37. package/scaffold/pt-br/commands/dw-bugfix.md +8 -8
  38. package/scaffold/pt-br/commands/dw-commit.md +1 -1
  39. package/scaffold/pt-br/commands/dw-dockerize.md +9 -9
  40. package/scaffold/pt-br/commands/dw-find-skills.md +4 -4
  41. package/scaffold/pt-br/commands/dw-functional-doc.md +1 -1
  42. package/scaffold/pt-br/commands/dw-generate-pr.md +4 -4
  43. package/scaffold/pt-br/commands/dw-help.md +97 -300
  44. package/scaffold/pt-br/commands/dw-intel.md +77 -13
  45. package/scaffold/pt-br/commands/dw-new-project.md +9 -9
  46. package/scaffold/pt-br/commands/dw-plan.md +175 -0
  47. package/scaffold/pt-br/commands/dw-qa.md +166 -0
  48. package/scaffold/pt-br/commands/dw-redesign-ui.md +6 -6
  49. package/scaffold/pt-br/commands/dw-review.md +198 -0
  50. package/scaffold/pt-br/commands/dw-run.md +176 -0
  51. package/scaffold/pt-br/commands/dw-secure-audit.md +222 -0
  52. package/scaffold/pt-br/commands/dw-update.md +1 -1
  53. package/scaffold/pt-br/references/playwright-patterns.md +1 -1
  54. package/scaffold/pt-br/references/refactoring-catalog.md +1 -1
  55. package/scaffold/pt-br/templates/brainstorm-matrix.md +1 -1
  56. package/scaffold/pt-br/templates/idea-onepager.md +3 -3
  57. package/scaffold/pt-br/templates/project-onepager.md +5 -5
  58. package/scaffold/pt-br/templates/tasks-template.md +1 -1
  59. package/scaffold/skills/api-testing-recipes/SKILL.md +6 -6
  60. package/scaffold/skills/api-testing-recipes/references/auth-patterns.md +1 -1
  61. package/scaffold/skills/api-testing-recipes/references/matrix-conventions.md +1 -1
  62. package/scaffold/skills/api-testing-recipes/references/openapi-driven.md +3 -3
  63. package/scaffold/skills/docker-compose-recipes/SKILL.md +1 -1
  64. package/scaffold/skills/dw-codebase-intel/SKILL.md +9 -9
  65. package/scaffold/skills/dw-codebase-intel/agents/intel-updater.md +4 -4
  66. package/scaffold/skills/dw-codebase-intel/references/api-design-discipline.md +1 -1
  67. package/scaffold/skills/dw-codebase-intel/references/incremental-update.md +5 -5
  68. package/scaffold/skills/dw-codebase-intel/references/intel-format.md +1 -1
  69. package/scaffold/skills/dw-codebase-intel/references/query-patterns.md +3 -3
  70. package/scaffold/skills/dw-council/SKILL.md +2 -2
  71. package/scaffold/skills/dw-debug-protocol/SKILL.md +5 -3
  72. package/scaffold/skills/dw-execute-phase/SKILL.md +16 -16
  73. package/scaffold/skills/dw-execute-phase/agents/executor.md +5 -5
  74. package/scaffold/skills/dw-execute-phase/agents/plan-checker.md +4 -4
  75. package/scaffold/skills/dw-execute-phase/references/atomic-commits.md +1 -1
  76. package/scaffold/skills/dw-execute-phase/references/plan-verification.md +2 -2
  77. package/scaffold/skills/dw-execute-phase/references/wave-coordination.md +1 -1
  78. package/scaffold/skills/dw-git-discipline/SKILL.md +5 -2
  79. package/scaffold/skills/dw-incident-response/SKILL.md +5 -1
  80. package/scaffold/skills/dw-llm-eval/SKILL.md +10 -8
  81. package/scaffold/skills/dw-memory/SKILL.md +2 -2
  82. package/scaffold/skills/dw-review-rigor/SKILL.md +5 -5
  83. package/scaffold/skills/dw-simplification/SKILL.md +12 -7
  84. package/scaffold/skills/dw-simplification/references/deep-modules.md +105 -0
  85. package/scaffold/skills/dw-source-grounding/SKILL.md +1 -1
  86. package/scaffold/skills/dw-testing-discipline/SKILL.md +8 -6
  87. package/scaffold/skills/dw-testing-discipline/references/agent-guardrails.md +3 -3
  88. package/scaffold/skills/dw-testing-discipline/references/anti-patterns.md +2 -2
  89. package/scaffold/skills/dw-testing-discipline/references/core-rules.md +1 -1
  90. package/scaffold/skills/dw-testing-discipline/references/flaky-discipline.md +3 -3
  91. package/scaffold/skills/dw-testing-discipline/references/patterns.md +1 -1
  92. package/scaffold/skills/dw-testing-discipline/references/playwright-recipes.md +1 -1
  93. package/scaffold/skills/dw-ui-discipline/SKILL.md +8 -6
  94. package/scaffold/skills/dw-ui-discipline/references/accessibility-floor.md +2 -2
  95. package/scaffold/skills/dw-ui-discipline/references/hard-gate.md +1 -1
  96. package/scaffold/skills/dw-ui-discipline/references/state-matrix.md +1 -1
  97. package/scaffold/skills/dw-ui-discipline/references/visual-slop.md +2 -2
  98. package/scaffold/skills/dw-verify/SKILL.md +4 -4
  99. package/scaffold/skills/humanizer/SKILL.md +1 -7
  100. package/scaffold/skills/remotion-best-practices/SKILL.md +3 -1
  101. package/scaffold/skills/security-review/SKILL.md +1 -1
  102. package/scaffold/skills/security-review/languages/csharp.md +1 -1
  103. package/scaffold/skills/security-review/languages/rust.md +1 -1
  104. package/scaffold/skills/security-review/languages/typescript.md +1 -1
  105. package/scaffold/skills/vercel-react-best-practices/SKILL.md +3 -1
  106. package/scaffold/templates-overrides-readme.md +3 -3
  107. package/scaffold/en/commands/dw-code-review.md +0 -386
  108. package/scaffold/en/commands/dw-create-prd.md +0 -148
  109. package/scaffold/en/commands/dw-create-tasks.md +0 -201
  110. package/scaffold/en/commands/dw-create-techspec.md +0 -210
  111. package/scaffold/en/commands/dw-deep-research.md +0 -418
  112. package/scaffold/en/commands/dw-deps-audit.md +0 -327
  113. package/scaffold/en/commands/dw-fix-qa.md +0 -152
  114. package/scaffold/en/commands/dw-map-codebase.md +0 -125
  115. package/scaffold/en/commands/dw-refactoring-analysis.md +0 -340
  116. package/scaffold/en/commands/dw-revert-task.md +0 -114
  117. package/scaffold/en/commands/dw-review-implementation.md +0 -349
  118. package/scaffold/en/commands/dw-run-plan.md +0 -300
  119. package/scaffold/en/commands/dw-run-qa.md +0 -497
  120. package/scaffold/en/commands/dw-run-task.md +0 -209
  121. package/scaffold/en/commands/dw-security-check.md +0 -271
  122. package/scaffold/pt-br/commands/dw-code-review.md +0 -366
  123. package/scaffold/pt-br/commands/dw-create-prd.md +0 -148
  124. package/scaffold/pt-br/commands/dw-create-tasks.md +0 -201
  125. package/scaffold/pt-br/commands/dw-create-techspec.md +0 -208
  126. package/scaffold/pt-br/commands/dw-deep-research.md +0 -172
  127. package/scaffold/pt-br/commands/dw-deps-audit.md +0 -327
  128. package/scaffold/pt-br/commands/dw-fix-qa.md +0 -152
  129. package/scaffold/pt-br/commands/dw-map-codebase.md +0 -125
  130. package/scaffold/pt-br/commands/dw-refactoring-analysis.md +0 -340
  131. package/scaffold/pt-br/commands/dw-revert-task.md +0 -114
  132. package/scaffold/pt-br/commands/dw-review-implementation.md +0 -337
  133. package/scaffold/pt-br/commands/dw-run-plan.md +0 -296
  134. package/scaffold/pt-br/commands/dw-run-qa.md +0 -495
  135. package/scaffold/pt-br/commands/dw-run-task.md +0 -208
  136. package/scaffold/pt-br/commands/dw-security-check.md +0 -271
@@ -15,18 +15,18 @@ A step that invokes a `/dw-xxx` command is ONLY considered complete when the art
15
15
  | Thought | Reality |
16
16
  |---------|---------|
17
17
  | "I already ran the tests manually" | The command produces structured artifacts. Run the command. |
18
- | "I validated via ad-hoc Playwright" | `/dw-run-qa` requires RF matrix, bugs.md, screenshots, scripts, logs, checklist. Run the command. |
19
- | "The implementation is obviously correct" | `/dw-review-implementation` requires a compliance matrix per RF/endpoint/task. Run the command. |
18
+ | "I validated via ad-hoc Playwright" | `/dw-qa` requires RF matrix, bugs.md, screenshots, scripts, logs, checklist. Run the command. |
19
+ | "The implementation is obviously correct" | `/dw-review --coverage-only` requires a compliance matrix per RF/endpoint/task. Run the command. |
20
20
  | "A strong manual validation is enough" | NO. Technical equivalence DOES NOT replace formal execution. |
21
21
  | "I already checked build and lint, that's enough" | Build/lint DO NOT replace review nor QA. Run the commands. |
22
- | "I wrote a summarized qa-report.md by hand" | A loose file IS NOT execution of `/dw-run-qa`. The full `QA/` tree is mandatory. |
22
+ | "I wrote a summarized qa-report.md by hand" | A loose file IS NOT execution of `/dw-qa`. The full `QA/` tree is mandatory. |
23
23
  | "The autopilot already advanced, I don't need to go back" | If the artifact doesn't exist, the step didn't run. Go back and execute. |
24
- | "I fixed bugs along the way, so QA is already ok" | Fixing bugs does not replace running formal QA. Run `/dw-run-qa`. |</critical>
24
+ | "I fixed bugs along the way, so QA is already ok" | Fixing bugs does not replace running formal QA. Run `/dw-qa`. |</critical>
25
25
 
26
26
  ## When to Use
27
27
  - Use when you want to go from an idea to a PR with minimal manual intervention
28
28
  - Use for complete features that go through the entire pipeline (research, planning, execution, quality)
29
- - Do NOT use for small, well-scoped one-off tasks — use `/dw-run-task` directly with a quick PRD instead
29
+ - Do NOT use for small, well-scoped one-off tasks — use `/dw-run` directly with a quick PRD instead
30
30
  - Do NOT use to fix bugs (use `/dw-bugfix`)
31
31
  - Do NOT use when you want manual control between each phase (use individual commands)
32
32
 
@@ -72,12 +72,12 @@ If this command is re-invoked on the same PRD after interruption:
72
72
 
73
73
  - Query `.dw/intel/` via `/dw-intel` to understand project context
74
74
  - Identify: tech stack, existing patterns, related features
75
- - If `.dw/intel/` is absent, suggest running `/dw-map-codebase` first for richer downstream context
75
+ - If `.dw/intel/` is absent, suggest running `/dw-intel --build` first for richer downstream context
76
76
 
77
77
  ### Step 2: Research (Conditional)
78
78
 
79
79
  Evaluate whether the topic requires deep research:
80
- - **YES** (run `/dw-deep-research`): new technology for the project, unknown domain, external API integrations, critical architectural decisions
80
+ - **YES** (run `/dw-brainstorm --research`): new technology for the project, unknown domain, external API integrations, critical architectural decisions
81
81
  - **NO** (skip to step 3): simple feature in an already mapped domain, refactoring existing code, basic CRUD
82
82
  - If skipping, DOCUMENT the reason in the progress block. E.g.: "Research skipped — domain already mapped in .dw/rules/[file].md". The user must see the justification.
83
83
 
@@ -94,7 +94,7 @@ Run `/dw-brainstorm` with accumulated context (intel + research).
94
94
 
95
95
  <critical>The PRD MUST include an interactive interview with the user. Ask AT LEAST 7 clarification questions BEFORE writing the PRD. Do NOT answer questions automatically based on context — the user MUST respond.</critical>
96
96
 
97
- Run `/dw-create-prd` using brainstorm findings.
97
+ Run `/dw-plan prd` using brainstorm findings.
98
98
  - Follow ALL command instructions, especially the clarification questions section
99
99
  - Ask at least 7 questions about: problem, target users, critical features, scope, constraints, design, integration
100
100
  - In each question, present a recommendation grounded in brainstorm and deep-research findings (if executed). E.g.: "Based on the research, I recommend X because [evidence]. Do you agree or prefer a different direction?"
@@ -115,7 +115,7 @@ Present to the user:
115
115
 
116
116
  <critical>The TechSpec MUST include an interactive interview with the user. Ask AT LEAST 7 technical clarification questions BEFORE writing the TechSpec. Do NOT answer questions automatically — the user MUST respond.</critical>
117
117
 
118
- Run `/dw-create-techspec` from the approved PRD.
118
+ Run `/dw-plan techspec` from the approved PRD.
119
119
  - Follow ALL command instructions, especially the clarification questions section
120
120
  - Ask at least 7 questions about: preferred architecture, existing vs new libs, testing strategy, integration with existing systems, infrastructure constraints, performance, security
121
121
  - In each question, present a technical recommendation grounded in brainstorm, deep-research, and approved PRD findings. E.g.: "Research indicated lib X has better performance for this case [source]. Want to use X or have another preference?"
@@ -125,7 +125,7 @@ Run `/dw-create-techspec` from the approved PRD.
125
125
 
126
126
  ### Step 6: Tasks
127
127
 
128
- Run `/dw-create-tasks` from PRD + TechSpec.
128
+ Run `/dw-plan tasks` from PRD + TechSpec.
129
129
  - Follow all command instructions
130
130
  - Generate individual tasks in `.dw/spec/prd-[name]/`
131
131
 
@@ -148,9 +148,9 @@ Evaluate whether tasks involve frontend:
148
148
 
149
149
  ### Step 8: Execution
150
150
 
151
- Run `/dw-run-plan` with the PRD path.
151
+ Run `/dw-run` with the PRD path.
152
152
  - Follow ALL command instructions, including the native plan-checker gate (PASS required) and wave-based parallel execution via the bundled `dw-execute-phase` skill agents
153
- - Each task follows `/dw-run-task` with Level 1 validation
153
+ - Each task follows `/dw-run` with Level 1 validation
154
154
 
155
155
  ### Step 9: Implementation Review (Loop)
156
156
 
@@ -164,7 +164,7 @@ Run the project's build and lint:
164
164
  5. Repeat until both build AND lint pass without errors
165
165
  6. Only then proceed to the review
166
166
 
167
- Run `/dw-review-implementation` to verify PRD compliance (Level 2).
167
+ Run `/dw-review --coverage-only` to verify PRD compliance (Level 2).
168
168
  - If gaps found: fix automatically and re-run the review
169
169
  - Maximum 3 correction cycles
170
170
  - Do NOT advance to QA until the review passes
@@ -177,7 +177,7 @@ A short text review, a "looks good", or a conclusion "implementation is correct"
177
177
 
178
178
  ### Step 10: Visual QA
179
179
 
180
- Run `/dw-run-qa` with Playwright MCP.
180
+ Run `/dw-qa` with Playwright MCP.
181
181
  - Test happy paths, edge cases, negative flows, accessibility
182
182
  - Document bugs with screenshots
183
183
 
@@ -188,12 +188,12 @@ Run `/dw-run-qa` with Playwright MCP.
188
188
  - `{{PRD_PATH}}/QA/screenshots/` — directory exists and contains at least 1 PNG per RF tested (format `RF-XX-[slug]-PASS.png` or `-FAIL.png`)
189
189
  - `{{PRD_PATH}}/QA/scripts/` — directory exists and contains Playwright `.spec.ts`/`.spec.js` scripts per RF
190
190
  - `{{PRD_PATH}}/QA/logs/` — directory exists with captured console/network logs
191
- Running Playwright ad-hoc, taking a few loose screenshots, or writing a short qa-report.md by hand DOES NOT replace this structure. If any artifact is missing or incomplete, the command did NOT run — invoke `/dw-run-qa` formally and follow its flow to completion.</critical>
191
+ Running Playwright ad-hoc, taking a few loose screenshots, or writing a short qa-report.md by hand DOES NOT replace this structure. If any artifact is missing or incomplete, the command did NOT run — invoke `/dw-qa` formally and follow its flow to completion.</critical>
192
192
 
193
193
  ### Step 11: Fix QA (Conditional)
194
194
 
195
195
  If QA found bugs:
196
- - Run `/dw-fix-qa` to fix and retest
196
+ - Run `/dw-qa --fix` to fix and retest
197
197
  - Loop until stable (maximum 5 cycles). After 5 cycles, STOP and ask the user how to proceed.
198
198
 
199
199
  ### Step 12: Implementation Review (Post-QA)
@@ -205,7 +205,7 @@ Run the project's build and lint (same sequence as Step 9):
205
205
  2. Build
206
206
  3. If any fail: fix and re-run until they pass
207
207
 
208
- Run `/dw-review-implementation` again to confirm QA fixes did not break PRD compliance.
208
+ Run `/dw-review --coverage-only` again to confirm QA fixes did not break PRD compliance.
209
209
  - If gaps found: fix and re-run
210
210
  - Maximum 3 cycles
211
211
 
@@ -213,7 +213,7 @@ Run `/dw-review-implementation` again to confirm QA fixes did not break PRD comp
213
213
 
214
214
  ### Step 13: Code Review
215
215
 
216
- Run `/dw-code-review` (Level 3) for formal review.
216
+ Run `/dw-review --code-only` (Level 3) for formal review.
217
217
  - Generate persisted report
218
218
 
219
219
  ### Step 14: Commit
@@ -227,7 +227,7 @@ Run `ls` on each path below and confirm existence. If ANY is missing, DO NOT com
227
227
  - `{{PRD_PATH}}/QA/screenshots/` (non-empty)
228
228
  - `{{PRD_PATH}}/QA/scripts/` (non-empty with `.spec.*` files)
229
229
  - `{{PRD_PATH}}/QA/logs/`
230
- - Evidence of the last `/dw-review-implementation` run with RF-by-RF matrix (session output or reference in `autopilot-state.json`)
230
+ - Evidence of the last `/dw-review --coverage-only` run with RF-by-RF matrix (session output or reference in `autopilot-state.json`)
231
231
 
232
232
  Also verify `autopilot-state.json`:
233
233
  - Every step 1 through 13 that is NOT in `skipped_steps` must be in `completed_steps`
@@ -250,7 +250,7 @@ Ask the user: **"Commits completed. Do you want to generate the Pull Request?"**
250
250
 
251
251
  ## Native Engine
252
252
 
253
- The autopilot relies on dev-workflow-native infrastructure for codebase intelligence (`/dw-map-codebase` + `/dw-intel`) and bundled phase execution agents (plan-checker + executor in `.agents/skills/dw-execute-phase/agents/`). All bundled and require no external dependencies. See the `dw-codebase-intel` and `dw-execute-phase` bundled skills under `.agents/skills/` for details.
253
+ The autopilot relies on dev-workflow-native infrastructure for codebase intelligence (`/dw-intel --build` + `/dw-intel`) and bundled phase execution agents (plan-checker + executor in `.agents/skills/dw-execute-phase/agents/`). All bundled and require no external dependencies. See the `dw-codebase-intel` and `dw-execute-phase` bundled skills under `.agents/skills/` for details.
254
254
 
255
255
  ## State Persistence
256
256
 
@@ -9,14 +9,36 @@ You are a brainstorming facilitator for the current workspace. This command exis
9
9
  - Do NOT use when you already have clear requirements ready for a PRD, or when you need to implement code
10
10
 
11
11
  ## Pipeline Position
12
- **Predecessor:** (user idea) | **Successor:** `/dw-create-prd`
12
+ **Predecessor:** (user idea) | **Successor:** `/dw-plan prd`
13
13
 
14
- ## Flags
14
+ ## How this command works (auto-dispatch, not flag switchboard)
15
15
 
16
- - **(default)**: normal brainstorm with 3-7 options (conservative, balanced, bold) and trade-offs. If the product has PRDs or rules, a **Product Inventory** is produced automatically and each option carries a classification tag.
17
- - **`--onepager`**: at the end of the brainstorm, generate a durable one-pager at `.dw/spec/ideas/<slug>.md` (using `.dw/templates/idea-onepager.md`) with Feature Inventory + Classification & Rationale + MVP Scope + Not Doing + Assumptions. Use when you want a persisted product artifact before moving to `/dw-create-prd`.
18
- - **`--council`**: after the normal brainstorm, invoke the `dw-council` skill to stress-test the top 2-3 options via 3-5 archetypes (pragmatic-engineer, architect-advisor, security-advocate, product-mind, devils-advocate). Useful when the choice is high-impact and there is genuine dissent between paths.
19
- - Flags are composable: `--onepager --council` produces the one-pager after the council debate.
16
+ `/dw-brainstorm` runs **FULL** by default. It opens with a **Signal Reading** phase that inspects the user's request, the project state (PRDs, rules, intel, recent commits), and the conversation so far, then **dispatches one or more internal modes**. The user does not pick a mode the command does.
17
+
18
+ Internal modes (the dispatcher picks 1+):
19
+
20
+ | Mode | Auto-fires when |
21
+ |------|-----------------|
22
+ | **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. |
23
+ | **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. |
24
+ | **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. |
25
+ | **council** | Two or more competing approaches surface with no obvious winner; or consensus forms too quickly (false-consensus signal). |
26
+ | **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). |
27
+ | **refactor-audit** | User points at a directory or describes a code area as "messy", "needs cleanup", "tech debt"; or a quarterly health-check is requested. |
28
+ | **onepager** | The conversation has converged enough to deserve a durable product artifact (`.dw/spec/ideas/<slug>.md`); or the user signals they're about to call `/dw-plan prd` next. |
29
+
30
+ Modes can chain inside one session — grill can surface a design question that the dispatcher then sends to prototype; refactor-audit can produce findings that the dispatcher sends to council for stress-testing.
31
+
32
+ ### Optional overrides (rarely needed)
33
+
34
+ - **`--mode=<name>`** — force a specific dispatch and skip Signal Reading. Names: `option-matrix`, `grill`, `prototype`, `council`, `research`, `refactor-audit`, `onepager`. Combine with `+` to chain explicitly: `--mode=grill+onepager`.
35
+ - **`--quiet`** — skip Signal Reading entirely and run only `option-matrix` as a minimal facilitator.
36
+
37
+ Power users who already know what they want can pass `--mode=`. Everyone else gets auto-dispatch by default — the command reads the room and acts.
38
+
39
+ ### Migration note (transitional)
40
+
41
+ Old flag invocations (`--onepager`, `--council`, `--research`, `--refactor`, `--grill`, `--prototype`) remain accepted for one minor cycle and map to the equivalent `--mode=` value. New code should use `--mode=` or rely on auto-dispatch.
20
42
 
21
43
  ## Decision Flowchart: Brainstorm vs Direct PRD
22
44
 
@@ -27,7 +49,7 @@ digraph brainstorm_decision {
27
49
  Q1 [label="Are requirements\nclear and specific?"];
28
50
  Q2 [label="Are there multiple\nviable approaches?"];
29
51
  node [shape=box];
30
- PRD [label="Go directly to\n/dw-create-prd"];
52
+ PRD [label="Go directly to\n/dw-plan prd"];
31
53
  BS [label="Start with\n/dw-brainstorm"];
32
54
  Q1 -> PRD [label="Yes"];
33
55
  Q1 -> Q2 [label="No"];
@@ -40,15 +62,16 @@ digraph brainstorm_decision {
40
62
 
41
63
  When available in the project under `./.agents/skills/`, use these skills to enrich ideation:
42
64
 
43
- - `dw-council` (opt-in via `--council`): multi-advisor stress-test of the most promising options with mandatory steel-manning and concession tracking. **DO NOT invoke by default** — only when the flag is present or when consensus forms too quickly (false-consensus signal).
44
- - `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
45
- - `vercel-react-best-practices`: use when brainstorming React/Next.js architecture or performance trade-offs
46
- - `security-review`: use when brainstorming touches auth, data handling, or security-sensitive features
65
+ - `dw-council`: invoked by the dispatcher's **council** mode — multi-advisor stress-test of the most promising options with mandatory steel-manning and concession tracking. The dispatcher fires it when 2+ paths tie OR consensus forms too quickly (false-consensus signal). Not invoked on every brainstorm — only when signals justify it.
66
+ - `dw-simplification`: invoked by the dispatcher's **refactor-audit** mode applies Chesterton's Fence + complexity metrics + the new **deep-modules** reference (deletion test, locality, leverage, interface depth) to every flagged smell.
67
+ - `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.
68
+ - `vercel-react-best-practices`: use when brainstorming React/Next.js architecture or performance trade-offs.
69
+ - `security-review`: use when brainstorming touches auth, data handling, or security-sensitive features.
47
70
 
48
71
  ## Template Reference
49
72
 
50
73
  - Brainstorm matrix template: `.dw/templates/brainstorm-matrix.md` (relative to workspace root)
51
- - Durable one-pager template: `.dw/templates/idea-onepager.md` (used with `--onepager` flag)
74
+ - Durable one-pager template: `.dw/templates/idea-onepager.md` (used by the **onepager** mode)
52
75
 
53
76
  Use this command when the user wants to:
54
77
  - Generate ideas for product, UX, architecture, or automation
@@ -61,6 +84,19 @@ Use this command when the user wants to:
61
84
 
62
85
  <critical>The brainstorm is a **product-level** phase, not technical. DO NOT dive into architecture, stack, endpoints, schemas. That's the techspec's job. Here we work user journeys, value, features, and boundaries.</critical>
63
86
 
87
+ ### 0. Signal Reading (always first, unless `--quiet` or explicit `--mode=`)
88
+
89
+ Before producing any output, **read the situation**:
90
+
91
+ 1. Inspect `.dw/spec/prd-*/`, `.dw/rules/`, `.dw/constitution.md`, `.dw/intel/` if they exist. Note the project's current vocabulary and recent PRDs.
92
+ 2. Inspect recent git activity (`git log --oneline -20`) to detect ongoing work.
93
+ 3. Re-read the user's request against the Auto-Dispatch table at the top of this file. Match signals to modes.
94
+ 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.
95
+ 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.
96
+ 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
+
98
+ ### Standard flow (option-matrix mode)
99
+
64
100
  1. Start by summarizing the problem in 1 to 3 sentences.
65
101
  2. **Reframe as "How Might We"**: turn the raw idea into `How might we [verb] for [user] so that [outcome]?`. This pulls the team out of premature "solution mode".
66
102
  3. **Product Inventory (required if the product exists)**:
@@ -78,7 +114,7 @@ Use this command when the user wants to:
78
114
  - Approximate effort level
79
115
  7. Whenever it makes sense, include conservative, balanced, and bold alternatives.
80
116
  8. Close with a pragmatic recommendation and clear next steps.
81
- 9. **If the `--onepager` flag is present**: at the end, generate `.dw/spec/ideas/<slug>.md` using `.dw/templates/idea-onepager.md`, filling Feature Inventory, Classification & Rationale, Recommended Direction (product language), MVP Scope (user stories), Not Doing, Key Assumptions, and Open Questions. Report the path to the user.
117
+ 9. **If the dispatcher selected `onepager` mode** (auto-fires when conversation has converged enough, or user signals they're heading to `/dw-plan prd` next): at the end, generate `.dw/spec/ideas/<slug>.md` using `.dw/templates/idea-onepager.md`, filling Feature Inventory, Classification & Rationale, Recommended Direction (product language), MVP Scope (user stories), Not Doing, Key Assumptions, and Open Questions. Report the path to the user.
82
118
 
83
119
  ## Preferred Response Format
84
120
 
@@ -102,16 +138,16 @@ Use this command when the user wants to:
102
138
  - Recommend 1 or 2 paths
103
139
  - Explain why they win in the current context
104
140
 
105
- ### 6. One-pager (if `--onepager`)
141
+ ### 6. One-pager (if `onepager` mode fired)
106
142
  - Path of the created file at `.dw/spec/ideas/<slug>.md`
107
143
 
108
144
  ### 7. Next Steps
109
145
  - Short and actionable list
110
146
  - If appropriate, suggest which command to use next:
111
- - `/dw-create-prd` (main successor; accepts the one-pager as input, reducing clarification questions)
112
- - `/dw-run-task` (if it's a small IMPROVES that fits in a single task with a quick PRD)
113
- - `/dw-create-techspec`
114
- - `/dw-create-tasks`
147
+ - `/dw-plan prd` (main successor; accepts the one-pager as input, reducing clarification questions)
148
+ - `/dw-run` (if it's a small IMPROVES that fits in a single task with a quick PRD)
149
+ - `/dw-plan techspec`
150
+ - `/dw-plan tasks`
115
151
  - `/dw-bugfix`
116
152
 
117
153
  ## Heuristics
@@ -139,7 +175,263 @@ At the end, always leave the user in one of these situations:
139
175
  - With a clear recommendation (including an IMPROVES/CONSOLIDATES/NEW classification)
140
176
  - With better questions to decide
141
177
  - With a next workspace command to follow
142
- - With the one-pager at `.dw/spec/ideas/<slug>.md` (if `--onepager` was used)
178
+ - With the one-pager at `.dw/spec/ideas/<slug>.md` (if **onepager** mode fired)
179
+ - With the research report at `~/Documents/<Topic>_Research_<date>/` (if **research** mode fired)
180
+ - With the refactor plan at `<target>/refactor-plan.md` (if **refactor-audit** mode fired)
181
+ - With sharpened glossary entries in `.dw/rules/` (if **grill** mode fired)
182
+ - With a runnable throwaway prototype + verdict template (if **prototype** mode fired)
183
+
184
+ ## Mode: research (multi-source research)
185
+
186
+ Fires when the question depends on external state-of-the-art (multi-source comparisons, framework / regulatory landscape, decisions needing cited evidence). Override: `--mode=research`. Replaces the default option-matrix with a structured research pipeline that produces a cited document with verified claims.
187
+
188
+ <critical>Every factual claim MUST be cited immediately with [N] in the same sentence</critical>
189
+ <critical>NEVER fabricate citations — if no source is found, say so explicitly</critical>
190
+ <critical>The bibliography MUST contain EVERY citation used in the body, no abbreviations or ranges</critical>
191
+
192
+ ### When to use research mode
193
+ - Multi-source comparisons (e.g., "compare React Server Components vs Astro Islands").
194
+ - State-of-the-art reviews of a topic.
195
+ - Regulatory or industry context mapping.
196
+ - Decisions needing cited evidence (not just an opinion).
197
+ - Do NOT use research mode for simple lookups, debugging, or questions answerable in 1-2 web searches.
198
+
199
+ ### Sub-modes (research depth)
200
+
201
+ ```
202
+ Selection
203
+ ├── Initial exploration → quick (3 phases, 2-5 min)
204
+ ├── Standard research → standard (6 phases, 5-10 min) [DEFAULT for research]
205
+ ├── Critical decision → deep (8 phases, 10-20 min)
206
+ └── Comprehensive review → ultradeep (8+ phases, 20-45 min)
207
+ ```
208
+
209
+ ### Required reading
210
+
211
+ Complementary skill **`dw-source-grounding`**: **ALWAYS** — apply Detect → Fetch → Implement → Cite protocol with strict source hierarchy (official versioned docs > changelogs > web standards > compat tables; Stack Overflow / blogs / training data are discovery only). Every finding ends with `[source: <url>, version: X.Y, retrieved: YYYY-MM-DD]`; bibliography built from these citations.
212
+
213
+ ### Pipeline phases
214
+
215
+ **Phase 1 — SCOPE** | Frame the question. Decompose into core components. Identify stakeholder perspectives. Define scope boundaries. List key assumptions to validate.
216
+
217
+ **Phase 2 — PLAN** | Identify primary + secondary sources. Map knowledge dependencies. Create search strategy with variants. Plan triangulation approach. Define quality gates.
218
+
219
+ **Phase 3 — RETRIEVE** | Parallel information gathering. Decompose into 5-10 independent search angles (semantic, keyword, date-filtered, academic, alternative perspectives, statistics, industry analysis, critical analysis). Execute ALL searches in parallel via multiple tool calls in a single message. First Finish Search pattern: proceed when first threshold reached (quick: 10+ sources avg credibility >60/100; standard: 15+ >60; deep: 25+ >70; ultradeep: 30+ >75).
220
+
221
+ **Phase 4 — TRIANGULATE** | Identify claims requiring verification. Cross-check facts across 3+ independent sources. Flag contradictions. Document verification status per claim.
222
+
223
+ **Phase 5 — OUTLINE REFINEMENT** | Compare initial scope to actual findings. Adapt structure based on evidence. Targeted searches to fill gaps.
224
+
225
+ **Phase 6 — SYNTHESIZE** | Identify cross-source patterns. Map concept relationships. Generate insights beyond source material. Build evidence hierarchies.
226
+
227
+ **Phase 7 — CRITIQUE** (deep/ultradeep only) | Review logical consistency. Verify citation completeness. Identify gaps or weaknesses. Simulate 2-3 critic personas.
228
+
229
+ **Phase 8 — REFINE** (deep/ultradeep) | Strengthen weak arguments. Add missing perspectives. Resolve contradictions.
230
+
231
+ **Phase 9 — PACKAGE** | Generate report progressively, section by section.
232
+
233
+ ### Output
234
+
235
+ Saved to `~/Documents/<Topic>_Research_<YYYYMMDD>/`. Mandatory sections:
236
+ 1. Executive Summary (200-400 words)
237
+ 2. Introduction (scope, methodology, assumptions)
238
+ 3. Main Analysis (4-8 findings, 600-2000 words each, all cited)
239
+ 4. Synthesis and Insights
240
+ 5. Limitations and Caveats
241
+ 6. Recommendations
242
+ 7. Bibliography (COMPLETE — every citation, no placeholders)
243
+ 8. Methodological Appendix
244
+
245
+ Target lengths: quick 2-4k words; standard 4-8k; deep 8-15k; ultradeep 15-20k+.
246
+
247
+ ### Quality standards
248
+ - Narrative: flowing prose, beginning/middle/end. Min 80% prose, max 20% bullets.
249
+ - Each factual statement cited immediately with [N].
250
+ - Distinguish fact from synthesis.
251
+ - No vague attributions ("studies show...", "experts believe..." without citation).
252
+ - Label speculation explicitly.
253
+ - Admit uncertainty: "No sources found for X."
254
+
255
+ ## Mode: refactor-audit (code-smell catalog + deep-modules)
256
+
257
+ Fires when the user points at a directory or describes a code area as "messy" / "needs cleanup" / "tech debt", or when a quarterly health-check is requested. Override: `--mode=refactor-audit`. Audits the target area for refactoring opportunities using Martin Fowler's smell taxonomy combined with the deep-modules analysis (deletion test, locality, leverage, interface depth) bundled in the `dw-simplification` skill.
258
+
259
+ <critical>ASK EXACTLY 3 CLARIFICATION QUESTIONS BEFORE STARTING THE ANALYSIS</critical>
260
+
261
+ ### When to use refactor mode
262
+ - Pre-implementation audit of tech debt in the area you're about to touch.
263
+ - Quarterly code-health review.
264
+ - Pre-migration scoping (e.g., before a framework upgrade).
265
+ - Do NOT use refactor mode if `/dw-review` already flagged the same area (avoid duplicate findings).
266
+
267
+ ### Required reading
268
+
269
+ Complementary skills:
270
+ - **`dw-review-rigor`**: **ALWAYS** — applies de-duplication (same smell in N files = 1 entry with affected list), severity ordering P0-P3, signal-over-volume (max ~20 findings; keep criticals, prune marginal ones). Smells with a justifying ADR drop to `low` at most.
271
+ - **`dw-simplification`**: **ALWAYS** — every flagged smell is filtered through Chesterton's Fence (what does the construct DO, why was it added, what breaks if removed). Smells with no clear "why-was-it-there" answer get downgraded to `info` with a research note instead of a refactor proposal. Complexity metrics (cognitive complexity ≥16 or nesting depth ≥4 = `high` candidate; <10 = `low` at most) anchor severity.
272
+ - **`security-review`**: defer security concerns to this skill — do not duplicate.
273
+ - **`vercel-react-best-practices`** + its `perf-discipline.md`: defer React/Next.js performance patterns to this skill.
274
+
275
+ ### Pipeline
276
+
277
+ 1. Three clarification questions (scope, priorities, constraints).
278
+ 2. Identify the target area (PRD-scoped directory, specific module, or whole codebase).
279
+ 3. Scan for smells using Fowler's taxonomy:
280
+ - **Bloaters** — Long Method, Large Class, Long Parameter List, Data Clumps, Primitive Obsession.
281
+ - **Object-Orientation Abusers** — Switch Statements, Refused Bequest, Alternative Classes with Different Interfaces, Temporary Field.
282
+ - **Change Preventers** — Divergent Change, Shotgun Surgery, Parallel Inheritance Hierarchies.
283
+ - **Dispensables** — Comments, Duplicate Code, Lazy Class, Data Class, Dead Code, Speculative Generality.
284
+ - **Couplers** — Feature Envy, Inappropriate Intimacy, Message Chains, Middle Man.
285
+ - **Conditional complexity** — high cyclomatic/cognitive, deep nesting.
286
+ 4. Apply `dw-review-rigor` de-duplication + `dw-simplification` Chesterton filter.
287
+ 5. For each surviving smell, map to a refactoring technique with before/after sketches.
288
+ 6. Severity-order P0-P3 (impact × likelihood × maintenance cost).
289
+ 7. Plus: coupling/cohesion metrics, SOLID analysis.
290
+
291
+ ### Output
292
+
293
+ Saved to `<target>/refactor-plan.md`:
294
+
295
+ ```markdown
296
+ # Refactoring Opportunities — <target>
297
+
298
+ ## Summary
299
+ - Smells found: N (after de-dup)
300
+ - P0 (do this sprint): N
301
+ - P1 (this quarter): N
302
+ - P2 (when convenient): N
303
+ - P3 (informational): N
304
+
305
+ ## Findings (severity-ordered)
306
+
307
+ ### P0 — <smell name>
308
+ **Files:** <list> (de-duplicated)
309
+ **Symptom:** <description>
310
+ **Why fix:** <impact analysis>
311
+ **Suggested refactor:** <Fowler technique>
312
+ **Before:** <code sketch>
313
+ **After:** <code sketch>
314
+ **Effort:** S / M / L
315
+ **Risk:** Low / Medium / High
316
+ **Tests required:** <list>
317
+
318
+ ...
319
+ ```
320
+
321
+ ### Analysis tools
322
+ - React projects: `npx react-doctor@latest --verbose` for health score.
323
+ - Angular projects: `ng lint` for static issues.
324
+
325
+ ### Anti-patterns
326
+ - Listing every cyclomatic complexity hit > threshold without context → noise.
327
+ - Suggesting "extract method" everywhere a function is over N lines → mechanical, not insight.
328
+ - Proposing refactors that aren't tested or testable → high risk, won't ship.
329
+ - Ignoring documented architectural decisions in `.dw/rules/` → flagging intentional design as smell.
330
+
331
+ ## Mode: grill (domain-grilling)
332
+
333
+ 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."
334
+
335
+ <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>
336
+
337
+ ### When to use grill mode
338
+
339
+ - Before `/dw-plan prd` when the domain feels unsettled or the team uses competing terms.
340
+ - After `/dw-plan prd` when reviewers flag ambiguous language in the PRD.
341
+ - During architectural discussion when "module", "service", "component" are being used interchangeably and you need to pin the canonical term.
342
+ - When a contributor proposes a name that doesn't match the project's existing glossary.
343
+
344
+ ### During-session disciplines
345
+
346
+ 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.
347
+
348
+ 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.
349
+
350
+ 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.
351
+
352
+ 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.
353
+
354
+ 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).
355
+
356
+ 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.
357
+
358
+ ### ADR creation discipline
359
+
360
+ Only propose an ADR via `/dw-adr` when **all three** hold:
361
+
362
+ | Criterion | Test |
363
+ |-----------|------|
364
+ | **Hard to reverse** | If we change this in 6 months, does it cost >1 week of work? |
365
+ | **Surprising without context** | Would a new contributor reasonably reach a different decision? |
366
+ | **Genuine trade-off** | Was there a real alternative we considered and chose against? |
367
+
368
+ If any is missing, skip the ADR. Don't ADR every casual decision — that turns the ADR folder into noise.
369
+
370
+ ### Output
371
+
372
+ grill mode produces:
373
+ - **Updated `.dw/rules/<module>.md`** or `.dw/constitution.md` with crystallized terms.
374
+ - **Updated PRD / TechSpec** if grilling happens mid-plan (terms in the artifact are aligned with the glossary).
375
+ - **Optional `.dw/spec/<prd>/adrs/adr-NNN.md`** if criteria above hold.
376
+ - **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.
377
+
378
+ ### When the discipline bends
379
+
380
+ - **Greenfield project with no `.dw/rules/`**: grill anyway; the conversation produces the FIRST entries in `.dw/rules/index.md`. That's the value.
381
+ - **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.
382
+
383
+ ## Mode: prototype (throwaway prototype)
384
+
385
+ Fires when the user asks "is this state model right?" / "what should this look like?" with no clear answer — i.e., the next sensible step is to RUN code, not write words. Override: `--mode=prototype`. Builds a **throwaway prototype that answers a single question**. The question decides the shape — pick a branch.
386
+
387
+ <critical>The prototype is throwaway from day one. Don't polish. Don't add tests. Don't extract abstractions. The point is to LEARN something fast and then DELETE or absorb.</critical>
388
+
389
+ ### Pick a branch
390
+
391
+ | User's question | Branch |
392
+ |-----------------|--------|
393
+ | "Does this state/logic model feel right?" | **LOGIC** — interactive terminal app that pushes the state machine through edge cases that are hard to reason about on paper. |
394
+ | "What should this look like?" | **UI** — several radically different UI variations on a single route, switchable via a URL search param and a floating bottom bar. |
395
+
396
+ If the question is ambiguous, ask the user. If user not reachable: default by surrounding code (backend module → LOGIC; page/component → UI) and state the assumption at the top of the prototype.
397
+
398
+ ### Rules (apply to both branches)
399
+
400
+ 1. **Throwaway from day one, clearly marked.** Place the prototype next to the module/page it's prototyping for (so context is obvious) but name it so a casual reader can see it's a prototype (`prototype-<slug>.ts`, `prototype-route.tsx`, etc.).
401
+
402
+ 2. **One command to run.** Whatever the project's task runner supports — `pnpm <name>`, `python <path>`, `bun <path>`, etc. The user must start it without thinking.
403
+
404
+ 3. **No persistence by default.** State lives in memory. Persistence is what the prototype is CHECKING, not what it depends on. If the question explicitly involves a database, hit a scratch DB or a local file with a clear `PROTOTYPE — wipe me` name.
405
+
406
+ 4. **Skip the polish.** No tests, no error handling beyond what makes the prototype runnable, no abstractions.
407
+
408
+ 5. **Surface the state.** After every action (LOGIC) or on every variant switch (UI), print or render the full relevant state so the user can see what changed.
409
+
410
+ 6. **Delete or absorb when done.** When the prototype has answered its question, either delete it or fold the validated decision into real code. Don't leave it rotting in the repo.
411
+
412
+ ### When done
413
+
414
+ The **answer** is the only thing worth keeping. Capture it durably:
415
+ - Commit message that closes the prototype: "removed prototype X; decided <answer> based on <observation>"
416
+ - Or an ADR (if the criteria from grill mode hold)
417
+ - Or `.dw/spec/<prd>/NOTES.md` if mid-PRD
418
+ - Or an issue comment if user-driven
419
+
420
+ If the user isn't around, leave a `PROTOTYPE VERDICT: <pending>` placeholder so the next pass can fill it in before deletion.
421
+
422
+ ### Output
423
+
424
+ prototype mode produces:
425
+ - **Throwaway code file(s)** in the appropriate location.
426
+ - A `NOTES.md` next to the prototype with the QUESTION it's answering.
427
+ - After the user runs it and answers the question, instructions to remove the prototype + capture the verdict.
428
+
429
+ ### Anti-patterns
430
+
431
+ - Building a prototype that's actually a feature in disguise — production-quality code, tests, deployment config. That's not a prototype; it's a first draft.
432
+ - Leaving the prototype in the repo "in case we need it later" — six months later it's load-bearing.
433
+ - Not capturing the verdict — the prototype answered the question and the answer evaporated.
434
+ - Multiple prototypes stacked up at once — pick one question, answer it, move.
143
435
 
144
436
  ## Inspired by
145
437
 
@@ -148,8 +440,10 @@ The codebase-grounded idea refinement pattern is inspired by [`addyosmani/agent-
148
440
  - **Product level, not code level**: while `idea-refine` uses Glob/Grep/Read over `src/*`, here we read **PRDs + rules + intel** to map the **feature inventory** of the product. The brainstorm stays product-focused.
149
441
  - **Explicit classification** (IMPROVES / CONSOLIDATES / NEW) as dev-workflow-native discipline — forces the team to decide whether the idea is new, consolidates existing features, or improves one, before opening a PRD.
150
442
  - Output at `.dw/spec/ideas/<slug>.md` (sibling of `prd-<slug>/`) instead of `docs/ideas/` — preserves dev-workflow path conventions.
151
- - Integration with the existing pipeline: `/dw-create-prd` accepts the one-pager as input, reducing clarification questions.
443
+ - Integration with the existing pipeline: `/dw-plan prd` accepts the one-pager as input, reducing clarification questions.
444
+
445
+ 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).
152
446
 
153
- Credit: Addy Osmani and the `idea-refine` pattern.
447
+ Credit: Addy Osmani (idea-refine) and Matt Pocock (grill-with-docs, prototype).
154
448
 
155
449
  </system_instructions>
@@ -5,8 +5,8 @@
5
5
 
6
6
  ## When to Use
7
7
  - Use when fixing a reported bug with automatic triage to distinguish bug vs feature vs excessive scope
8
- - Do NOT use when implementing a new feature (use `/dw-create-prd` instead)
9
- - Do NOT use when fixing bugs found during QA testing (use `/dw-fix-qa` instead)
8
+ - Do NOT use when implementing a new feature (use `/dw-plan prd` instead)
9
+ - Do NOT use when fixing bugs found during QA testing (use `/dw-qa --fix` instead)
10
10
 
11
11
  ## Pipeline Position
12
12
  **Predecessor:** (bug report) | **Successor:** `/dw-commit` then `/dw-generate-pr`
@@ -48,7 +48,7 @@
48
48
  In this mode:
49
49
  1. Follow the normal question and analysis flow
50
50
  2. Instead of executing, generate a document at `.dw/spec/dw-bugfix-[name]/prd.md`
51
- 3. The file is named `prd.md` to maintain compatibility with the create-techspec/dw-create-tasks pipeline
51
+ 3. The file is named `prd.md` to maintain compatibility with the create-techspec/dw-plan tasks pipeline
52
52
  4. Then the user can run `create-techspec .dw/spec/dw-bugfix-[name]`
53
53
  5. And then `create-tasks .dw/spec/dw-bugfix-[name]`
54
54
 
@@ -109,7 +109,7 @@
109
109
  ---
110
110
 
111
111
  **Do you want me to start the PRD creation flow?**
112
- - `yes` - I will follow `.dw/commands/dw-create-prd.md` for this feature
112
+ - `yes` - I will follow `.dw/commands/dw-plan prd.md` for this feature
113
113
  - `no, it's a bug` - Explain further why you consider it a bug
114
114
  - `no, cancel` - End
115
115
 
@@ -361,7 +361,7 @@
361
361
  q2 [label="Does it require\nnew functionality?", shape=diamond];
362
362
  q3 [label="Scope <= 5 files\nand no migration?", shape=diamond];
363
363
  bug [label="BUG\n(continue bugfix flow)"];
364
- feature [label="FEATURE\n(redirect to /dw-create-prd)"];
364
+ feature [label="FEATURE\n(redirect to /dw-plan prd)"];
365
365
  excessive [label="EXCESSIVE SCOPE\n(redirect to PRD or\nuse --analysis mode)"];
366
366
 
367
367
  start -> q1;
@@ -7,7 +7,7 @@
7
7
  - Do NOT use when creating a PR (use `/dw-generate-pr` instead)
8
8
 
9
9
  ## Pipeline Position
10
- **Predecessor:** `/dw-run-task` or `/dw-bugfix` | **Successor:** `/dw-generate-pr`
10
+ **Predecessor:** `/dw-run` or `/dw-bugfix` | **Successor:** `/dw-generate-pr`
11
11
 
12
12
  ## Complementary Skills
13
13