@curdx/flow 1.1.4 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/.claude-plugin/marketplace.json +25 -0
  2. package/.claude-plugin/plugin.json +43 -0
  3. package/CHANGELOG.md +279 -0
  4. package/agent-preamble/preamble.md +214 -0
  5. package/agents/flow-adversary.md +216 -0
  6. package/agents/flow-architect.md +190 -0
  7. package/agents/flow-debugger.md +325 -0
  8. package/agents/flow-edge-hunter.md +273 -0
  9. package/agents/flow-executor.md +246 -0
  10. package/agents/flow-planner.md +204 -0
  11. package/agents/flow-product-designer.md +146 -0
  12. package/agents/flow-qa-engineer.md +276 -0
  13. package/agents/flow-researcher.md +155 -0
  14. package/agents/flow-reviewer.md +280 -0
  15. package/agents/flow-security-auditor.md +398 -0
  16. package/agents/flow-triage-analyst.md +290 -0
  17. package/agents/flow-ui-researcher.md +227 -0
  18. package/agents/flow-ux-designer.md +247 -0
  19. package/agents/flow-verifier.md +283 -0
  20. package/agents/persona-amelia.md +128 -0
  21. package/agents/persona-david.md +141 -0
  22. package/agents/persona-emma.md +179 -0
  23. package/agents/persona-john.md +105 -0
  24. package/agents/persona-mary.md +95 -0
  25. package/agents/persona-oliver.md +136 -0
  26. package/agents/persona-rachel.md +126 -0
  27. package/agents/persona-serena.md +175 -0
  28. package/agents/persona-winston.md +117 -0
  29. package/bin/curdx-flow.js +5 -2
  30. package/cli/install.js +44 -5
  31. package/commands/audit.md +170 -0
  32. package/commands/autoplan.md +184 -0
  33. package/commands/debug.md +199 -0
  34. package/commands/design.md +155 -0
  35. package/commands/discuss.md +162 -0
  36. package/commands/doctor.md +124 -0
  37. package/commands/fast.md +128 -0
  38. package/commands/help.md +119 -0
  39. package/commands/implement.md +381 -0
  40. package/commands/index.md +261 -0
  41. package/commands/init.md +105 -0
  42. package/commands/install-deps.md +128 -0
  43. package/commands/party.md +241 -0
  44. package/commands/plan-ceo.md +117 -0
  45. package/commands/plan-design.md +107 -0
  46. package/commands/plan-dx.md +104 -0
  47. package/commands/plan-eng.md +108 -0
  48. package/commands/qa.md +118 -0
  49. package/commands/requirements.md +146 -0
  50. package/commands/research.md +141 -0
  51. package/commands/review.md +168 -0
  52. package/commands/security.md +109 -0
  53. package/commands/sketch.md +118 -0
  54. package/commands/spec.md +135 -0
  55. package/commands/spike.md +181 -0
  56. package/commands/start.md +189 -0
  57. package/commands/status.md +139 -0
  58. package/commands/switch.md +95 -0
  59. package/commands/tasks.md +189 -0
  60. package/commands/triage.md +160 -0
  61. package/commands/verify.md +124 -0
  62. package/gates/adversarial-review-gate.md +219 -0
  63. package/gates/coverage-audit-gate.md +184 -0
  64. package/gates/devex-gate.md +255 -0
  65. package/gates/edge-case-gate.md +194 -0
  66. package/gates/karpathy-gate.md +130 -0
  67. package/gates/security-gate.md +218 -0
  68. package/gates/tdd-gate.md +188 -0
  69. package/gates/verification-gate.md +183 -0
  70. package/hooks/hooks.json +56 -0
  71. package/hooks/scripts/fail-tracker.sh +31 -0
  72. package/hooks/scripts/inject-karpathy.sh +52 -0
  73. package/hooks/scripts/quick-mode-guard.sh +64 -0
  74. package/hooks/scripts/session-start.sh +76 -0
  75. package/hooks/scripts/stop-watcher.sh +166 -0
  76. package/knowledge/atomic-commits.md +262 -0
  77. package/knowledge/epic-decomposition.md +307 -0
  78. package/knowledge/execution-strategies.md +278 -0
  79. package/knowledge/karpathy-guidelines.md +219 -0
  80. package/knowledge/planning-reviews.md +211 -0
  81. package/knowledge/poc-first-workflow.md +227 -0
  82. package/knowledge/spec-driven-development.md +183 -0
  83. package/knowledge/systematic-debugging.md +384 -0
  84. package/knowledge/two-stage-review.md +233 -0
  85. package/knowledge/wave-execution.md +387 -0
  86. package/package.json +12 -2
  87. package/schemas/config.schema.json +100 -0
  88. package/schemas/spec-frontmatter.schema.json +42 -0
  89. package/schemas/spec-state.schema.json +117 -0
@@ -0,0 +1,105 @@
1
+ ---
2
+ name: init
3
+ description: Initialize the CurDX-Flow project structure (create the .flow/ directory and core files)
4
+ argument-hint: "[--force]"
5
+ allowed-tools: [Read, Write, Bash, AskUserQuestion]
6
+ ---
7
+
8
+ # Initialize CurDX-Flow Project
9
+
10
+ Create the `.flow/` directory structure in the current directory so CurDX-Flow can operate in this project.
11
+
12
+ ## Execution Steps
13
+
14
+ ### Step 1: Check Environment
15
+
16
+ ```bash
17
+ # Confirm a reasonable project root
18
+ pwd
19
+ ls -la
20
+ ```
21
+
22
+ - If the current directory is a dangerous location such as the home directory or a system directory, stop and ask the user to switch
23
+ - If `.flow/` already exists:
24
+ - With `--force` → continue but warn about overwriting
25
+ - Without `--force` → stop and prompt the user to run `/curdx-flow:status` to inspect the existing state
26
+
27
+ ### Step 2: Create Directory Skeleton
28
+
29
+ ```bash
30
+ mkdir -p .flow/specs
31
+ mkdir -p .flow/_epics
32
+ mkdir -p .flow/checkpoints
33
+ mkdir -p .flow/threads
34
+ mkdir -p .flow/seeds
35
+ ```
36
+
37
+ ### Step 3: Generate Core Files from Templates
38
+
39
+ Read the files under `${CLAUDE_PLUGIN_ROOT}/templates/`, replace placeholders, and write to `.flow/`:
40
+
41
+ | Source template | Target file | Description |
42
+ |-----------------|-------------|-------------|
43
+ | `templates/PROJECT.md.tmpl` | `.flow/PROJECT.md` | Project vision (user fills in later) |
44
+ | `templates/CONTEXT.md.tmpl` | `.flow/CONTEXT.md` | User preferences |
45
+ | `templates/STATE.md.tmpl` | `.flow/STATE.md` | Cross-session state (empty) |
46
+ | `templates/ROADMAP.md.tmpl` | `.flow/ROADMAP.md` | Roadmap |
47
+ | `templates/config.json.tmpl` | `.flow/config.json` | Configuration (default standard mode) |
48
+
49
+ Placeholders:
50
+ - `{{PROJECT_NAME}}` — inferred from the current directory name (user may be asked)
51
+ - `{{CREATED_DATE}}` — `$(date +%Y-%m-%d)`
52
+ - `{{USER_NAME}}` — from git config
53
+
54
+ ### Step 4: Update `.gitignore`
55
+
56
+ Append (if not already present):
57
+
58
+ ```
59
+ # CurDX-Flow runtime files
60
+ .flow/checkpoints/
61
+ .flow/threads/
62
+ .flow/seeds/
63
+ .flow/.active-spec
64
+ .flow/specs/*/.state.json
65
+ .flow/specs/*/.progress.md
66
+ .flow/_epics/*/.epic-state.json
67
+ ```
68
+
69
+ **Note**: the primary state files (PROJECT.md / CONTEXT.md / STATE.md / ROADMAP.md / config.json)
70
+ **should be committed to version control** so team members share the same view.
71
+
72
+ ### Step 5: Health Check
73
+
74
+ Run `/curdx-flow:doctor` (or inline its checks) to verify:
75
+ - 3 MCPs started (context7 / sequential-thinking / chrome-devtools)
76
+ - Recommended plugins status (pua / claude-mem / frontend-design)
77
+
78
+ ### Step 6: Prompt Next Steps
79
+
80
+ Output:
81
+
82
+ ```
83
+ ✓ CurDX-Flow project initialized
84
+ .flow/
85
+ ├── PROJECT.md ← fill in your project vision
86
+ ├── CONTEXT.md ← fill in your preferences
87
+ ├── STATE.md
88
+ ├── ROADMAP.md
89
+ └── config.json (mode: standard)
90
+
91
+ Next steps (in order):
92
+ 1. Edit .flow/PROJECT.md to add the project goal
93
+ 2. /curdx-flow:install-deps — install recommended plugins (if not installed)
94
+ 3. /curdx-flow:doctor — verify health
95
+ 4. /curdx-flow:status — view project status
96
+
97
+ Start development (after Phase 1 ships):
98
+ 5. /curdx-flow:start <name> "<goal>" — kick off the first spec
99
+ ```
100
+
101
+ ## Error Handling
102
+
103
+ - Directory creation failure → report the specific error (permissions/disk/path issue)
104
+ - Missing template file → check whether `${CLAUDE_PLUGIN_ROOT}/templates/` is complete
105
+ - User interrupts with Ctrl+C → leave no partial state, prompt that re-running is safe
@@ -0,0 +1,128 @@
1
+ ---
2
+ name: install-deps
3
+ description: Interactively install CurDX-Flow's recommended plugin dependencies (pua / claude-mem / frontend-design)
4
+ argument-hint: "[--all | --skip-prompt]"
5
+ allowed-tools: [Bash, AskUserQuestion]
6
+ ---
7
+
8
+ # One-Shot Install of Recommended Plugins
9
+
10
+ CurDX-Flow auto-installs 3 MCPs via `plugin.json.mcpServers`:
11
+ - ✓ context7 — docs lookup
12
+ - ✓ sequential-thinking — structured thinking
13
+ - ✓ chrome-devtools — browser QA
14
+
15
+ This command interactively installs 3 recommended **plugins** (they are not MCPs and must be installed separately):
16
+
17
+ | Plugin | Purpose | Official/Community |
18
+ |--------|---------|--------------------|
19
+ | **pua** (tanweai/pua) | Prevent AI from giving up; enforces the three red lines | Community |
20
+ | **claude-mem** (thedotmack/claude-mem) | Automatic cross-session memory | Community |
21
+ | **frontend-design** | UI design skill | Anthropic official |
22
+
23
+ ## Execution Steps
24
+
25
+ ### Step 1: Network Check
26
+
27
+ ```bash
28
+ if ! ping -c 1 -W 2 github.com >/dev/null 2>&1; then
29
+ echo "⚠️ Network unreachable, cannot install plugins from the marketplace."
30
+ echo "CurDX-Flow will run in degraded mode (MCPs remain available)."
31
+ exit 0
32
+ fi
33
+ ```
34
+
35
+ ### Step 2: Detect Current Installation Status
36
+
37
+ ```bash
38
+ INSTALLED=$(claude plugin list 2>/dev/null || echo "")
39
+ ```
40
+
41
+ Parse out which are installed and which are not.
42
+
43
+ ### Step 3: Ask the User
44
+
45
+ If the `--all` argument is present, skip asking and install everything. Otherwise use AskUserQuestion:
46
+
47
+ **Question**: Which recommended plugins to install?
48
+
49
+ **Options** (list only those not installed):
50
+ - **all** — Install all (recommended)
51
+ - **recommended** — Install pua + claude-mem + frontend-design
52
+ - **custom** — Pick manually (follow up with a multi-select question)
53
+ - **skip** — Skip (the core MCPs are already enough)
54
+
55
+ If the user picks `custom`, use a second AskUserQuestion to let them multi-select which to install.
56
+
57
+ ### Step 4: Run Installation
58
+
59
+ Based on the selection (install only those not yet installed):
60
+
61
+ #### pua
62
+
63
+ ```bash
64
+ claude plugin marketplace add tanweai/pua
65
+ claude plugin install pua@pua-skills --scope user
66
+ ```
67
+
68
+ #### claude-mem
69
+
70
+ ```bash
71
+ claude plugin marketplace add thedotmack/claude-mem
72
+ claude plugin install claude-mem --scope user
73
+ ```
74
+
75
+ #### frontend-design
76
+
77
+ Anthropic's official plugin is typically in the default marketplace:
78
+
79
+ ```bash
80
+ # If the default marketplace is enabled
81
+ claude plugin install frontend-design --scope user
82
+ ```
83
+
84
+ On failure, tell the user:
85
+ > frontend-design must be installed from the official marketplace. Inside Claude Code run:
86
+ > `/plugin`, then search for "frontend-design" in the Discover panel.
87
+
88
+ ### Step 5: Update Marker
89
+
90
+ ```bash
91
+ DATA_DIR="${CLAUDE_PLUGIN_DATA:-$HOME/.claude/plugins/data/curdx-flow}"
92
+ mkdir -p "$DATA_DIR"
93
+ echo "$(date +%Y-%m-%d)" > "$DATA_DIR/.deps-checked"
94
+ ```
95
+
96
+ Prevents the SessionStart hook from continuing to remind.
97
+
98
+ ### Step 6: Verify and Report
99
+
100
+ ```bash
101
+ claude plugin list 2>/dev/null | grep -E "pua|claude-mem|frontend-design"
102
+ ```
103
+
104
+ Print the installation summary:
105
+
106
+ ```
107
+ Install report:
108
+ ✓ pua (v3.2.1)
109
+ ✓ claude-mem (v12.3.0)
110
+ ⚠ frontend-design (requires manual install via /plugin)
111
+
112
+ Next steps:
113
+ /curdx-flow:doctor — full health check
114
+ /curdx-flow:init — initialize project (if not yet initialized)
115
+ ```
116
+
117
+ ## Error Handling
118
+
119
+ - `claude plugin marketplace add` failure → report the specific error (usually network/permissions)
120
+ - `claude plugin install` failure → ask the user to run the command manually
121
+ - User interruption → keep what is already installed, resume on the next run
122
+ - Installed but needs updating → suggest `claude plugin update <name>`
123
+
124
+ ## Notes
125
+
126
+ - This command only **installs**, it does not **configure**. See each plugin's own docs for configuration.
127
+ - Installation is **global** (scope=user), shared across all projects.
128
+ - Uninstall: `claude plugin uninstall <name>`
@@ -0,0 +1,241 @@
1
+ ---
2
+ name: party
3
+ description: Party Mode — multiple persona agents independently think about one question at the same time. BMAD-style true multi-agent collaboration.
4
+ argument-hint: "<persona-1> <persona-2> ... \"<question>\""
5
+ allowed-tools: [Read, Task, AskUserQuestion]
6
+ ---
7
+
8
+ # Flow Party — Multi-Agent Independent Thinking
9
+
10
+ Have multiple **persona agents** (Mary/John/Winston, etc.) independently think about the same question at the same time. This is BMAD's true innovation: **not one LLM playing multiple roles, but multiple Task subprocesses each thinking on their own, avoiding opinion convergence**.
11
+
12
+ ## When to use
13
+
14
+ - Hard decisions needing multiple perspectives (e.g., architecture selection)
15
+ - Spec review (separately reviewed from product / arch / qa)
16
+ - Brainstorming / divergent thinking
17
+ - Finding blind spots (one perspective may see what others cannot)
18
+
19
+ ## When not to use
20
+
21
+ - Simple questions (overhead is high)
22
+ - Questions with a clear answer (agents will only echo)
23
+ - Execution tasks (use a dedicated executor)
24
+
25
+ ## Step 1: Parse arguments
26
+
27
+ ```bash
28
+ ARGS="$ARGUMENTS"
29
+
30
+ # Recognize personas (known list)
31
+ PERSONAS=()
32
+ QUESTION=""
33
+
34
+ # Simple parsing: persona names + a question wrapped in quotes at the end
35
+ # Example: /curdx-flow:party mary john winston "JWT or session?"
36
+
37
+ # Parsing logic: iterate words, add known persona names to PERSONAS, rest is the question
38
+ KNOWN_PERSONAS="mary john winston amelia rachel oliver serena david emma"
39
+
40
+ REMAINING=""
41
+ for word in $ARGS; do
42
+ if echo "$KNOWN_PERSONAS" | grep -qw "$word"; then
43
+ PERSONAS+=("$word")
44
+ else
45
+ REMAINING="$REMAINING $word"
46
+ fi
47
+ done
48
+
49
+ # REMAINING is the question (possibly with quotes)
50
+ QUESTION=$(echo "$REMAINING" | sed 's/^[[:space:]]*//;s/^["\x27]//;s/["\x27]$//')
51
+ ```
52
+
53
+ ## Step 2: Validate arguments
54
+
55
+ ```bash
56
+ if [ ${#PERSONAS[@]} -lt 2 ]; then
57
+ echo "✗ Party Mode requires ≥ 2 personas"
58
+ echo "Available: mary john winston amelia rachel oliver serena david emma"
59
+ exit 1
60
+ fi
61
+
62
+ if [ ${#PERSONAS[@]} -gt 5 ]; then
63
+ echo "⚠ More than 5 personas will make output hard to read. Recommend ≤ 5"
64
+ fi
65
+
66
+ if [ -z "$QUESTION" ]; then
67
+ echo "✗ Please provide a question"
68
+ exit 1
69
+ fi
70
+ ```
71
+
72
+ ## Step 3: Build shared context
73
+
74
+ All personas read the same background:
75
+
76
+ ```bash
77
+ CONTEXT_FILES=()
78
+ [ -f "CLAUDE.md" ] && CONTEXT_FILES+=("CLAUDE.md")
79
+ [ -f ".flow/PROJECT.md" ] && CONTEXT_FILES+=(".flow/PROJECT.md")
80
+ [ -f ".flow/CONTEXT.md" ] && CONTEXT_FILES+=(".flow/CONTEXT.md")
81
+
82
+ # If there is an active spec, append
83
+ ACTIVE=$(cat .flow/.active-spec 2>/dev/null)
84
+ if [ -n "$ACTIVE" ]; then
85
+ for f in research.md requirements.md design.md; do
86
+ [ -f ".flow/specs/$ACTIVE/$f" ] && CONTEXT_FILES+=(".flow/specs/$ACTIVE/$f")
87
+ done
88
+ fi
89
+ ```
90
+
91
+ ## Step 4: Dispatch each persona in parallel
92
+
93
+ **Key**: call multiple Task tools **in a single message** at the same time (parallel execution).
94
+ This way each persona thinks in an independent context without influencing the others.
95
+
96
+ ```
97
+ # Parallel invocation (in a single message):
98
+ Task(mary):
99
+ subagent_type: general-purpose
100
+ description: "Mary thinking about $QUESTION"
101
+ prompt: |
102
+ You are Mary (Senior Analyst). Full definition:
103
+ ${CLAUDE_PLUGIN_ROOT}/agents/persona-mary.md
104
+
105
+ Shared context:
106
+ $(cat ${CONTEXT_FILES[@]} 2>/dev/null)
107
+
108
+ Question: $QUESTION
109
+
110
+ Answer from Mary's perspective:
111
+ - First list explicit assumptions
112
+ - Give 2-3 interpretations from a research / analysis perspective
113
+ - Clearly state open questions
114
+ - Provide an initial recommendation (if any)
115
+
116
+ **Forbidden**:
117
+ - Speaking on behalf of other personas
118
+ - Claiming "synthesizing John's and Winston's opinions" (you don't know what they said)
119
+ - Echoing / converging
120
+
121
+ Output a concise view of <200 words.
122
+
123
+ Task(john):
124
+ ... [john's prompt]
125
+
126
+ Task(winston):
127
+ ... [winston's prompt]
128
+ ```
129
+
130
+ **Parallel execution**: Claude Code's Task tool supports multiple invocations in a single message running in parallel.
131
+
132
+ ## Step 5: Collect results
133
+
134
+ Each Task returns an independent answer. The main agent (you) aggregates:
135
+
136
+ ```markdown
137
+ ## Party Mode Results: <QUESTION>
138
+
139
+ ### Mary (Senior Analyst)
140
+ <Mary's answer>
141
+
142
+ ### John (Product Manager)
143
+ <John's answer>
144
+
145
+ ### Winston (Architect)
146
+ <Winston's answer>
147
+
148
+ ## Perspective comparison
149
+
150
+ | Dimension | Mary | John | Winston |
151
+ |-----------|------|------|---------|
152
+ | Main concern | ... | ... | ... |
153
+ | Recommended direction | ... | ... | ... |
154
+ | Open questions | ... | ... | ... |
155
+
156
+ ## Points of disagreement
157
+
158
+ 1. Mary and Winston disagree on X: <specifics>
159
+ 2. Y raised by John that neither of the others considered: <specifics>
160
+
161
+ ## Consensus
162
+
163
+ 1. Everyone agrees on Z
164
+
165
+ ## Recommendation
166
+
167
+ Based on multi-perspective synthesis:
168
+ - If you care about A → follow Mary
169
+ - If you care about B → follow Winston
170
+ - Middle-ground option: Y proposed by John
171
+ ```
172
+
173
+ ## Step 6: Let the user decide
174
+
175
+ ```
176
+ AskUserQuestion:
177
+ question: "Having seen the multi-perspective analysis, which direction do you lean toward?"
178
+ options:
179
+ - Follow Mary's direction
180
+ - Follow John's direction
181
+ - Follow Winston's direction
182
+ - Synthesis: <specific compromise>
183
+ - Other (user input)
184
+ ```
185
+
186
+ After the user chooses, write the decision to STATE.md (as D-NN, via /curdx-flow:discuss or manually).
187
+
188
+ ## Typical usage
189
+
190
+ ### Architecture selection
191
+
192
+ ```
193
+ /curdx-flow:party winston mary "JWT vs Session — which is more suitable in this project"
194
+ ```
195
+
196
+ ### Spec review
197
+
198
+ ```
199
+ /curdx-flow:party john rachel oliver "are the ACs in requirements.md sufficient"
200
+ ```
201
+
202
+ ### Bug approach discussion
203
+
204
+ ```
205
+ /curdx-flow:party david winston "should this crash be fixed at the root cause or wrapped in try-catch"
206
+ ```
207
+
208
+ ### UX decision
209
+
210
+ ```
211
+ /curdx-flow:party emma john oliver "how to present login failure error messages"
212
+ ```
213
+
214
+ ## Forbidden
215
+
216
+ - ✗ Dispatching only 1 agent (that's not a Party — just use Task directly)
217
+ - ✗ Agents referencing each other (the point of independent thinking is isolation)
218
+ - ✗ Sequential dispatch (must be parallel Task invocations)
219
+ - ✗ Overly long agent output (each <300 words)
220
+
221
+ ## Why Party Mode has value
222
+
223
+ ### Single LLM playing multiple roles vs. true multi-agent
224
+
225
+ Single LLM: "As Mary I think X... As Winston I think Y... Synthesizing the two views, Z"
226
+
227
+ Problems:
228
+ - Opinions have already converged in advance (the LLM generates in one pass; later parts are influenced by earlier ones)
229
+ - "Synthesis" is done by the LLM itself, without real collision
230
+ - Easily becomes "one voice imitating multiple people"
231
+
232
+ True multi-agent (Party Mode):
233
+ - Mary's context contains only "I am Mary" and the question
234
+ - Winston's context contains only "I am Winston" and the question
235
+ - The two have no idea what the other said
236
+ - The output is truly independent thinking
237
+ - The differences are real differences, not acted out
238
+
239
+ ---
240
+
241
+ _Source: BMAD's Party Mode, implemented in CurDX-Flow via parallel dispatch of Claude Code's Task tool._
@@ -0,0 +1,117 @@
1
+ ---
2
+ name: plan-ceo
3
+ description: CEO-level planning review — strategic / scope / ROI / opportunity cost. A business-layer review of design.md.
4
+ argument-hint: "[spec-name]"
5
+ allowed-tools: [Read, Write, Bash, Task]
6
+ ---
7
+
8
+ # Flow Plan CEO — Strategic-Layer Review
9
+
10
+ @${CLAUDE_PLUGIN_ROOT}/knowledge/planning-reviews.md
11
+
12
+ Review design.md from the **CEO perspective**: is this worth doing? Is the scope right?
13
+
14
+ ## Step 1: Preflight
15
+
16
+ ```bash
17
+ SPEC_NAME="${ARGUMENTS:-$(cat .flow/.active-spec 2>/dev/null)}"
18
+ [ -z "$SPEC_NAME" ] && { echo "✗ No active spec"; exit 1; }
19
+
20
+ DIR=".flow/specs/$SPEC_NAME"
21
+ [ ! -f "$DIR/design.md" ] && { echo "✗ Missing design.md. Run /curdx-flow:design first"; exit 1; }
22
+ ```
23
+
24
+ ## Step 2: Dispatch CEO-perspective review
25
+
26
+ Reuse the `flow-architect` agent but switch the perspective:
27
+
28
+ ```
29
+ Task:
30
+ subagent_type: general-purpose
31
+ description: "CEO Review: $SPEC_NAME"
32
+ prompt: |
33
+ **CEO Review Mode**
34
+
35
+ You are not an architect, not a developer. You are a reviewer from the CEO / PM perspective.
36
+
37
+ Full methodology: ${CLAUDE_PLUGIN_ROOT}/knowledge/planning-reviews.md (Review 1)
38
+
39
+ Review targets:
40
+ - .flow/specs/$SPEC_NAME/requirements.md (business goals)
41
+ - .flow/specs/$SPEC_NAME/design.md (technical solution)
42
+ - .flow/PROJECT.md (project vision)
43
+ - .flow/ROADMAP.md (roadmap)
44
+
45
+ Review checklist (answer each):
46
+
47
+ 1. Scope appropriateness
48
+ - Solution scope vs. business value vs. timeline
49
+ - Over-engineered? (doing more than currently necessary)
50
+ - Insufficient? (users still unsatisfied after completion)
51
+
52
+ 2. Timeline reasonableness
53
+ - Refer to the priorities in ROADMAP.md
54
+ - Is the urgency reasonable relative to other work in progress / pending?
55
+
56
+ 3. Quantifiable ROI
57
+ - User value: N users benefit / N scenarios unlocked
58
+ - Business value: revenue / retention / brand
59
+ - Engineering cost: estimated person-days
60
+
61
+ 4. Opportunity cost
62
+ - What does doing this mean we won't do?
63
+ - Is what's being deferred more important?
64
+
65
+ 5. Strategic alignment
66
+ - Does it support company OKRs / quarterly goals
67
+ - Does it lock in future choices (is this risky)
68
+
69
+ 6. Stakeholders
70
+ - Who benefits? How many?
71
+ - Who is affected (possibly negatively)?
72
+
73
+ Use sequential-thinking ≥ 5 rounds for derivation.
74
+
75
+ Output:
76
+ .flow/specs/$SPEC_NAME/plan-review-ceo.md
77
+
78
+ Format:
79
+ # CEO Plan Review: $SPEC_NAME
80
+
81
+ ## Verdict
82
+ - APPROVED / APPROVED_WITH_CONCERNS / NEEDS_REVISION / REJECTED
83
+
84
+ ## Findings
85
+
86
+ ### [Scope] Scope analysis
87
+ ...
88
+
89
+ ### [Timeline] Timeline analysis
90
+ ...
91
+
92
+ ### [ROI] Business value
93
+ ...
94
+
95
+ ## Recommendations
96
+ - Concrete change recommendations (not abstract "increase value")
97
+
98
+ Return a briefing to me.
99
+ ```
100
+
101
+ ## Step 3: Output
102
+
103
+ ```
104
+ ✓ CEO Review complete
105
+
106
+ Verdict: <APPROVED / APPROVED_WITH_CONCERNS / NEEDS_REVISION>
107
+
108
+ Key concerns:
109
+ - <concern 1>
110
+ - <concern 2>
111
+
112
+ Report: .flow/specs/$SPEC_NAME/plan-review-ceo.md
113
+
114
+ Next steps:
115
+ - If NEEDS_REVISION → /curdx-flow:design to fix + rerun
116
+ - If APPROVED → /curdx-flow:plan-eng (engineering layer) or /curdx-flow:tasks
117
+ ```
@@ -0,0 +1,107 @@
1
+ ---
2
+ name: plan-design
3
+ description: Design planning review — UI/UX, design system, accessibility review. Dispatches flow-ux-designer (Emma).
4
+ argument-hint: "[spec-name]"
5
+ allowed-tools: [Read, Write, Bash, Task]
6
+ ---
7
+
8
+ # Flow Plan Design — Design-Layer Review
9
+
10
+ @${CLAUDE_PLUGIN_ROOT}/knowledge/planning-reviews.md
11
+
12
+ Review design.md and existing sketches (if any) from the **UX perspective**: can users use it? Is the visuals consistent?
13
+
14
+ ## Step 1: Preflight
15
+
16
+ ```bash
17
+ SPEC_NAME="${ARGUMENTS:-$(cat .flow/.active-spec 2>/dev/null)}"
18
+ [ -z "$SPEC_NAME" ] && { echo "✗ No active spec"; exit 1; }
19
+
20
+ # If no UI-related content (pure backend spec) → skip
21
+ DIR=".flow/specs/$SPEC_NAME"
22
+ if ! grep -qE "(UI|UX|interface|user interface|frontend)" "$DIR"/*.md 2>/dev/null; then
23
+ echo "ℹ This spec does not involve UI; skipping Design Review"
24
+ exit 0
25
+ fi
26
+ ```
27
+
28
+ ## Step 2: Dispatch Emma (Design Review mode)
29
+
30
+ ```
31
+ Task:
32
+ subagent_type: general-purpose
33
+ description: "Design Review: $SPEC_NAME"
34
+ prompt: |
35
+ **Design Review Mode** (you are Emma, flow-ux-designer)
36
+
37
+ Your full definition: ${CLAUDE_PLUGIN_ROOT}/agents/flow-ux-designer.md
38
+ Review methodology: ${CLAUDE_PLUGIN_ROOT}/knowledge/planning-reviews.md (Review 3)
39
+
40
+ Review targets:
41
+ - .flow/specs/$SPEC_NAME/design.md (UI-related sections)
42
+ - .flow/specs/$SPEC_NAME/ui-sketch/ (if /curdx-flow:sketch has been run)
43
+ - .flow/CONTEXT.md (user preferences)
44
+ - Existing UI patterns in the project (.flow/codebase-index.md, if present)
45
+
46
+ Review checklist:
47
+
48
+ 1. User flow
49
+ - Main scenario ≤ 3 steps?
50
+ - Multiple entry points?
51
+ - Keyboard flow?
52
+
53
+ 2. Error states
54
+ - Are failure messages user-friendly?
55
+ - Does the user know how to recover?
56
+
57
+ 3. Loading states
58
+ - Visual feedback for long-running operations?
59
+ - Skeleton / spinner?
60
+
61
+ 4. Empty states
62
+ - Guidance when no data (CTA / illustration)?
63
+ - Not a blank page
64
+
65
+ 5. Accessibility
66
+ - Color contrast WCAG AA+?
67
+ - Fully keyboard operable?
68
+ - Semantic HTML + ARIA?
69
+ - Screen-reader friendly?
70
+
71
+ 6. Design system consistency
72
+ - Using project tokens (colors / fonts / spacing)?
73
+ - Using existing components, not reinventing?
74
+ - New components within the theme?
75
+
76
+ 7. Mobile adaptation
77
+ - Usable at narrowest viewport (375px)?
78
+ - Touch targets ≥ 44pt?
79
+ - Both portrait and landscape unbroken?
80
+
81
+ 8. Internationalization
82
+ - Copy replaceable?
83
+ - RTL compatible?
84
+ - Space adapts to different lengths (e.g., German is ~30% longer than English)?
85
+
86
+ Output: .flow/specs/$SPEC_NAME/plan-review-design.md
87
+
88
+ Return a briefing.
89
+ ```
90
+
91
+ ## Step 3: Output
92
+
93
+ ```
94
+ 🎨 Design Review complete
95
+
96
+ Verdict: <APPROVED / NEEDS_REVISION>
97
+
98
+ Key findings:
99
+ - <top 3>
100
+
101
+ Report: .flow/specs/$SPEC_NAME/plan-review-design.md
102
+
103
+ Next steps:
104
+ - UI/UX issues → /curdx-flow:sketch to iterate again
105
+ - Or /curdx-flow:design to update UI-related sections
106
+ - Pass → /curdx-flow:plan-dx or /curdx-flow:tasks
107
+ ```