@curdx/flow 1.1.4 → 1.1.6

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 +14 -3
  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,168 @@
1
+ ---
2
+ name: review
3
+ description: Two-Stage Review — Stage 1 spec compliance + Stage 2 code quality. Applies enabled Gates. Dispatches flow-reviewer.
4
+ argument-hint: "[spec-name] [--adversarial | --edge-case | --both]"
5
+ allowed-tools: [Read, Bash, Task, Grep, Glob]
6
+ ---
7
+
8
+ # Flow Review — Two-Stage Code Review
9
+
10
+ @${CLAUDE_PLUGIN_ROOT}/knowledge/two-stage-review.md
11
+
12
+ Dispatches the `flow-reviewer` agent to perform a Two-Stage Review: Stage 1 compliance + Stage 2 quality.
13
+ Optionally layer on deep reviews from `flow-adversary` and `flow-edge-hunter`.
14
+
15
+ ## When to use
16
+
17
+ - After `/curdx-flow:verify` passes
18
+ - Before PR
19
+ - When the user explicitly requests a deep review (add --adversarial / --edge-case / --both)
20
+
21
+ ## Step 1: Parse arguments
22
+
23
+ ```bash
24
+ ARGS="$ARGUMENTS"
25
+ ADV=0; EDGE=0
26
+ case "$ARGS" in
27
+ *--both*) ADV=1; EDGE=1 ;;
28
+ *--adversarial*) ADV=1 ;;
29
+ *--edge-case*) EDGE=1 ;;
30
+ esac
31
+
32
+ SPEC_NAME=$(echo "$ARGS" | sed 's/--[a-z-]*//g' | xargs)
33
+ [ -z "$SPEC_NAME" ] && SPEC_NAME=$(cat .flow/.active-spec 2>/dev/null)
34
+ [ -z "$SPEC_NAME" ] && { echo "❌ No active spec"; exit 1; }
35
+ ```
36
+
37
+ ## Step 2: Preflight checks
38
+
39
+ ```bash
40
+ DIR=".flow/specs/$SPEC_NAME"
41
+
42
+ # If /curdx-flow:verify hasn't been run, prompt to run it first
43
+ if [ ! -f "$DIR/verification-report.md" ]; then
44
+ echo "⚠ /curdx-flow:verify not run. Recommend running goal-reverse verification first."
45
+ echo "Continue? (y/N)"
46
+ # AskUserQuestion
47
+ fi
48
+ ```
49
+
50
+ ## Step 3: Dispatch flow-reviewer (core)
51
+
52
+ ```
53
+ Task:
54
+ subagent_type: general-purpose
55
+ description: "Review $SPEC_NAME"
56
+ prompt: |
57
+ You are the flow-reviewer agent. Full definition:
58
+ ${CLAUDE_PLUGIN_ROOT}/agents/flow-reviewer.md
59
+
60
+ Spec files to read:
61
+ - .flow/specs/$SPEC_NAME/requirements.md
62
+ - .flow/specs/$SPEC_NAME/design.md
63
+ - .flow/specs/$SPEC_NAME/tasks.md
64
+ - .flow/specs/$SPEC_NAME/.state.json
65
+ - .flow/specs/$SPEC_NAME/verification-report.md (if exists)
66
+
67
+ Enabled Gates (from .flow/config.json):
68
+ - karpathy-gate (always)
69
+ - verification-gate (always)
70
+ - tdd-gate (standard+)
71
+ - coverage-audit-gate (standard+)
72
+
73
+ Tasks:
74
+ Stage 1: Spec compliance review
75
+ - Judge each FR / AC / AD / error path as ✓/⚠/✗
76
+ - Check Out of Scope adherence
77
+
78
+ Stage 2: Code quality review
79
+ - Apply all enabled Gates
80
+ - Emit per-Gate check results
81
+
82
+ Combined verdict:
83
+ - APPROVED / APPROVED_WITH_WARNINGS / NEEDS_FIXES / BLOCKED
84
+
85
+ Output:
86
+ .flow/specs/$SPEC_NAME/review-report.md
87
+
88
+ Return a brief to me: Stage 1/2 verdicts, blocking/warning counts, and the top 3 fix suggestions
89
+ ```
90
+
91
+ ## Step 4 (optional): Dispatch flow-adversary
92
+
93
+ If `--adversarial`:
94
+
95
+ ```
96
+ Task:
97
+ subagent_type: general-purpose
98
+ description: "Adversarial review $SPEC_NAME"
99
+ prompt: |
100
+ You are the flow-adversary agent. Full definition:
101
+ ${CLAUDE_PLUGIN_ROOT}/agents/flow-adversary.md
102
+
103
+ Core rule: zero findings are forbidden — must find ≥ 3 categories of issues
104
+
105
+ Scan:
106
+ - .flow/specs/$SPEC_NAME/*.md
107
+ - Related code (git diff)
108
+ - Recent commits
109
+
110
+ Use sequential-thinking ≥ 12 rounds (2 rounds × 6 dimensions)
111
+
112
+ Output: .flow/specs/$SPEC_NAME/adversarial-review.md
113
+ ```
114
+
115
+ ## Step 5 (optional): Dispatch flow-edge-hunter
116
+
117
+ If `--edge-case`:
118
+
119
+ ```
120
+ Task:
121
+ subagent_type: general-purpose
122
+ description: "Edge-case scan $SPEC_NAME"
123
+ prompt: |
124
+ You are the flow-edge-hunter agent. Full definition:
125
+ ${CLAUDE_PLUGIN_ROOT}/agents/flow-edge-hunter.md
126
+
127
+ Scan the subject's coverage across 7 categories:
128
+ - Boundary values / nulls / concurrency / error recovery / security / i18n / performance
129
+
130
+ Use sequential-thinking ≥ 3 rounds per category
131
+
132
+ Output: .flow/specs/$SPEC_NAME/edge-cases.md
133
+ ```
134
+
135
+ ## Step 6: Read reports + aggregate verdict
136
+
137
+ ```bash
138
+ MAIN_REPORT="$DIR/review-report.md"
139
+ ADV_REPORT="$DIR/adversarial-review.md"
140
+ EDGE_REPORT="$DIR/edge-cases.md"
141
+
142
+ # Parse the verdict from review-report.md
143
+ VERDICT=$(grep -E "^## Verdict:" "$MAIN_REPORT" | head -1 | sed 's/## Verdict: //')
144
+ ```
145
+
146
+ ## Step 7: Output to user
147
+
148
+ ```
149
+ ✓ Review complete: $SPEC_NAME
150
+
151
+ Main report: .flow/specs/$SPEC_NAME/review-report.md
152
+ Verdict: $VERDICT
153
+
154
+ $([ "$ADV" = "1" ] && echo "Adversarial review: $ADV_REPORT")
155
+ $([ "$EDGE" = "1" ] && echo "Edge-case scan: $EDGE_REPORT")
156
+
157
+ Next steps:
158
+ $([ "$VERDICT" = "APPROVED" ] && echo " ✓ Proceed to /curdx-flow:ship (Phase 6+)")
159
+ $([ "$VERDICT" = "APPROVED_WITH_WARNINGS" ] && echo " ⚠ Recommend fixing warnings first, then /curdx-flow:ship")
160
+ $([ "$VERDICT" = "NEEDS_FIXES" ] && echo " ❌ Fix blockers → /curdx-flow:implement --task=... → /curdx-flow:review re-review")
161
+ $([ "$VERDICT" = "BLOCKED_BY_SPEC" ] && echo " ❌ Back to /curdx-flow:implement to fill missing FR/AD")
162
+ ```
163
+
164
+ ## Error recovery
165
+
166
+ - review-report.md generation fails → check agent turn limit, reduce spec scope
167
+ - Agent returns no findings (violates adversarial zero-tolerance) → agent auto-triggers Round 2
168
+ - Multiple concurrent agents produce conflicting files → run sequentially, not in parallel
@@ -0,0 +1,109 @@
1
+ ---
2
+ name: security
3
+ description: Security audit — OWASP Top 10 + STRIDE + dependency CVEs. Dispatches flow-security-auditor (Serena).
4
+ argument-hint: "[spec-name]"
5
+ allowed-tools: [Read, Write, Bash, Task, Grep, Glob, WebSearch]
6
+ ---
7
+
8
+ # Flow Security — Security Audit
9
+
10
+ @${CLAUDE_PLUGIN_ROOT}/gates/security-gate.md
11
+
12
+ Dispatches `flow-security-auditor` (Serena) to perform a full security audit.
13
+
14
+ ## When to use
15
+
16
+ - Specs touching authentication / authorization / payments / PII
17
+ - Pre-release gate
18
+ - After adding new API endpoints
19
+ - After dependency upgrades
20
+
21
+ ## Step 1: Preflight
22
+
23
+ ```bash
24
+ SPEC_NAME="${ARGUMENTS:-$(cat .flow/.active-spec 2>/dev/null)}"
25
+
26
+ # Can still run without an active spec (global security scan)
27
+ if [ -z "$SPEC_NAME" ]; then
28
+ echo "ℹ No active spec; running a security scan across the entire codebase"
29
+ SPEC_NAME="_global"
30
+ fi
31
+ ```
32
+
33
+ ## Step 2: Dispatch Serena
34
+
35
+ ```
36
+ Task:
37
+ subagent_type: general-purpose
38
+ description: "Security Audit: $SPEC_NAME"
39
+ prompt: |
40
+ You are the flow-security-auditor agent (Serena). Full definition:
41
+ ${CLAUDE_PLUGIN_ROOT}/agents/flow-security-auditor.md
42
+
43
+ Audit scope:
44
+ $([ "$SPEC_NAME" = "_global" ] && echo "Entire codebase" || echo ".flow/specs/$SPEC_NAME/ + related code")
45
+
46
+ Prerequisites:
47
+ - OWASP Top 10 (2021) checklist
48
+ - STRIDE threat modeling
49
+ - package.json (npm audit)
50
+ - Project auth / data-layer code
51
+
52
+ Workflow:
53
+ 1. Scan OWASP 10 categories in parallel
54
+ - A01: Broken access control
55
+ - A02: Cryptography
56
+ - A03: Injection
57
+ - A04: Insecure Design
58
+ - A05: Misconfiguration
59
+ - A06: CVE (npm audit)
60
+ - A07: Auth failures
61
+ - A08: Integrity
62
+ - A09: Logging
63
+ - A10: SSRF
64
+ 2. STRIDE threat modeling (≥6 rounds of sequential-thinking)
65
+ 3. context7 to check CVEs for critical dependencies
66
+ 4. Manual review of suspicious areas
67
+ 5. Generate security-audit.md
68
+
69
+ Output:
70
+ - .flow/specs/$SPEC_NAME/security-audit.md (or .flow/security-audit-global.md)
71
+
72
+ Return to me:
73
+ - Findings classified by risk (high/medium/low)
74
+ - Number of must-fix items
75
+ - Recommended order
76
+ ```
77
+
78
+ ## Step 3: Output
79
+
80
+ ```bash
81
+ REPORT=".flow/specs/$SPEC_NAME/security-audit.md"
82
+ [ "$SPEC_NAME" = "_global" ] && REPORT=".flow/security-audit-global.md"
83
+
84
+ HIGH=$(grep -c "\[High\]" "$REPORT" || echo 0)
85
+ MED=$(grep -c "\[Medium\]" "$REPORT" || echo 0)
86
+ LOW=$(grep -c "\[Low\]" "$REPORT" || echo 0)
87
+ ```
88
+
89
+ ```
90
+ 🔒 Security Audit complete
91
+
92
+ Risk distribution:
93
+ High: $HIGH (must fix, blocks release)
94
+ Medium: $MED (recommended to fix)
95
+ Low: $LOW (as needed)
96
+
97
+ Report: $REPORT
98
+
99
+ Next steps:
100
+ - High risk → /curdx-flow:implement adds fix tasks
101
+ - Or STATE.md explicitly waives + commits to a fix timeline
102
+ - After fixing → /curdx-flow:security to re-audit
103
+ ```
104
+
105
+ ## Error recovery
106
+
107
+ - npm audit requires package.json → non-Node projects skip this class
108
+ - context7 unavailable → use WebSearch to supplement CVE queries
109
+ - No active spec → global scan mode
@@ -0,0 +1,118 @@
1
+ ---
2
+ name: sketch
3
+ description: UI design sketch — invokes the frontend-design skill to generate multiple HTML variants. Dispatches flow-ux-designer (Emma).
4
+ argument-hint: "[spec-name] [\"<description>\"]"
5
+ allowed-tools: [Read, Write, Bash, Task, WebSearch, AskUserQuestion]
6
+ ---
7
+
8
+ # Flow Sketch — UI Sketch
9
+
10
+ Dispatches `flow-ux-designer` (Emma) to use the **frontend-design skill** to generate tasteful UI variants.
11
+
12
+ ## Step 1: Parse arguments
13
+
14
+ ```bash
15
+ ARGS="$ARGUMENTS"
16
+ # The first word may be spec-name (if such a spec exists); otherwise it is the description
17
+
18
+ SPEC_NAME=""
19
+ DESCRIPTION=""
20
+
21
+ FIRST_WORD=$(echo "$ARGS" | awk '{print $1}')
22
+ if [ -d ".flow/specs/$FIRST_WORD" ]; then
23
+ SPEC_NAME="$FIRST_WORD"
24
+ DESCRIPTION=$(echo "$ARGS" | sed "s/^$FIRST_WORD//" | sed 's/^["\x27]//;s/["\x27]$//' | xargs)
25
+ else
26
+ DESCRIPTION=$(echo "$ARGS" | sed 's/^["\x27]//;s/["\x27]$//')
27
+ fi
28
+
29
+ [ -z "$SPEC_NAME" ] && SPEC_NAME=$(cat .flow/.active-spec 2>/dev/null)
30
+ ```
31
+
32
+ ## Step 2: Preflight checks
33
+
34
+ ```bash
35
+ # Requires at least an active spec (to read CONTEXT.md)
36
+ if [ -z "$SPEC_NAME" ] && [ -z "$DESCRIPTION" ]; then
37
+ echo "Usage: /curdx-flow:sketch [spec] \"<description of what to sketch>\""
38
+ echo "Example: /curdx-flow:sketch \"login form\""
39
+ exit 1
40
+ fi
41
+
42
+ # Check frontend-design skill (if unavailable, fall back)
43
+ ```
44
+
45
+ ## Step 3: Ask for the variant count
46
+
47
+ ```
48
+ AskUserQuestion:
49
+ Question: "How many variants to generate?"
50
+ Options:
51
+ - 2 (compare minimalist vs distinctive)
52
+ - 3 (recommended — adds a dense variant)
53
+ - Custom
54
+ ```
55
+
56
+ ## Step 4: Dispatch Emma
57
+
58
+ ```
59
+ Task:
60
+ subagent_type: general-purpose
61
+ description: "UI Sketch: $DESCRIPTION"
62
+ prompt: |
63
+ You are the flow-ux-designer agent (Emma). Full definition:
64
+ ${CLAUDE_PLUGIN_ROOT}/agents/flow-ux-designer.md
65
+
66
+ Task:
67
+ - Description: $DESCRIPTION
68
+ - Spec: $SPEC_NAME (optional)
69
+ - Variant count: $VARIANT_COUNT
70
+
71
+ Prerequisites:
72
+ - .flow/CONTEXT.md (user UI preferences)
73
+ - .flow/specs/$SPEC_NAME/requirements.md (if present)
74
+ - .flow/specs/$SPEC_NAME/design.md (if present)
75
+ - .flow/specs/$SPEC_NAME/ui-research.md (if /curdx-flow:ui-research has been run)
76
+
77
+ Workflow:
78
+ 1. Detect the frontend-design skill
79
+ - Available: activate it to guide design choices
80
+ - Unavailable: use Tailwind + shadcn defaults and explicitly announce the fallback
81
+ 2. Read user preferences (CONTEXT.md)
82
+ 3. Generate N variant HTMLs (each a single file, zero dependencies, CDN Tailwind)
83
+ 4. Generate an index.html comparison page (iframes side by side)
84
+ 5. Generate decisions.md explaining the rationale for each variant
85
+
86
+ Output directory:
87
+ .flow/specs/$SPEC_NAME/ui-sketch/ (or .flow/sketches/<slug>/)
88
+
89
+ Return to me:
90
+ - The list of generated variants + what distinguishes each
91
+ - Recommended direction (based on CONTEXT.md)
92
+ - Preview command (how to open index.html)
93
+ ```
94
+
95
+ ## Step 5: Output
96
+
97
+ ```
98
+ 🎨 Sketch complete
99
+
100
+ Variants:
101
+ variant-a-minimalist.html (system font + whitespace)
102
+ variant-b-distinctive.html (custom font + micro animations)
103
+ variant-c-dense.html (information-dense — suited for admin)
104
+
105
+ Decisions: .flow/specs/<name>/ui-sketch/decisions.md
106
+ Comparison page: open .flow/specs/<name>/ui-sketch/index.html
107
+
108
+ Next steps:
109
+ - Pick a variant → tell me → I'll convert the HTML into production components
110
+ - Or /curdx-flow:qa to verify interactions in the browser
111
+ - Clone another reference → /curdx-flow:ui-research <feature>
112
+ ```
113
+
114
+ ## Error recovery
115
+
116
+ - frontend-design skill not installed → Emma falls back and announces it
117
+ - Variants are too similar → ask the user to re-run with more specific guidance
118
+ - No spec and no description → at least one must be supplied
@@ -0,0 +1,135 @@
1
+ ---
2
+ name: spec
3
+ description: One-shot sequential run of research → requirements → design → tasks across all four stages
4
+ argument-hint: "[spec-name] [--skip-research | --skip-requirements]"
5
+ allowed-tools: [Read, Write, Bash, Task, AskUserQuestion]
6
+ ---
7
+
8
+ # One-Shot Full Spec Generation
9
+
10
+ Runs the 4 spec stages sequentially, prompting the user between stages to decide whether to continue. Suitable for generating a full spec in one go.
11
+
12
+ ## Step 1: Preflight + confirmation
13
+
14
+ ```bash
15
+ [ ! -d ".flow" ] && { echo "❌ Not a CurDX-Flow project"; exit 1; }
16
+
17
+ SPEC_NAME="$(echo "$ARGUMENTS" | awk '{print $1}')"
18
+ [ -z "$SPEC_NAME" ] && SPEC_NAME=$(cat .flow/.active-spec 2>/dev/null)
19
+
20
+ if [ -z "$SPEC_NAME" ]; then
21
+ echo "❌ No active spec. Run /curdx-flow:start <name> \"<goal>\" first"
22
+ exit 1
23
+ fi
24
+ ```
25
+
26
+ ## Step 2: Parse skip options
27
+
28
+ ```bash
29
+ SKIP_RESEARCH=0
30
+ SKIP_REQUIREMENTS=0
31
+ case "$ARGUMENTS" in
32
+ *--skip-research*) SKIP_RESEARCH=1 ;;
33
+ esac
34
+ case "$ARGUMENTS" in
35
+ *--skip-requirements*) SKIP_REQUIREMENTS=1 ;;
36
+ esac
37
+ ```
38
+
39
+ ## Step 3: Execute the 4 stages in sequence
40
+
41
+ ### Phase 1: Research
42
+
43
+ ```bash
44
+ if [ "$SKIP_RESEARCH" = "1" ]; then
45
+ echo "⊘ Skipping research"
46
+ elif [ -f ".flow/specs/$SPEC_NAME/research.md" ]; then
47
+ echo "ℹ research.md already exists; asking the user..."
48
+ # AskUserQuestion: re-run research? (skip / rerun / abort)
49
+ else
50
+ echo "▶ Running research stage..."
51
+ # Via SlashCommand or directly dispatch the agent
52
+ # Recommended: directly invoke the /curdx-flow:research logic (inline or via the SlashCommand tool)
53
+ fi
54
+ ```
55
+
56
+ **Implementation 1** (recommended): Dispatch the agent directly, skipping SlashCommand:
57
+
58
+ Call the Task tool with the same content as the Task call in `/curdx-flow:research` (reading flow-researcher.md).
59
+
60
+ **Implementation 2**: If Claude Code supports the SlashCommand tool chain:
61
+ ```
62
+ SlashCommand: /curdx-flow:research $SPEC_NAME
63
+ ```
64
+
65
+ ### Intermediate confirmation after each stage
66
+
67
+ ```
68
+ ✓ research stage complete
69
+
70
+ Key findings:
71
+ - ...
72
+ - ...
73
+
74
+ ⚠ The following open questions were found; recommend answering first:
75
+ Q1: ...
76
+
77
+ Choose:
78
+ [continue] Continue to requirements (agent will answer open questions with reasonable assumptions)
79
+ [pause] Pause — I'll review research.md myself, then manually run /curdx-flow:requirements
80
+ [abort] Abort the entire /curdx-flow:spec
81
+ ```
82
+
83
+ Use AskUserQuestion for the choice.
84
+
85
+ ### Phase 2: Requirements
86
+
87
+ If continue, dispatch flow-product-designer (mirroring the Task call in `/curdx-flow:requirements`).
88
+
89
+ Confirm again after completion.
90
+
91
+ ### Phase 3: Design
92
+
93
+ If continue, dispatch flow-architect (mirroring the Task call in `/curdx-flow:design`).
94
+
95
+ Confirm again after completion. **This step is especially important** because design freezes the technology choices — recommend that the user review the AD-NN entries before entering tasks.
96
+
97
+ ### Phase 4: Tasks
98
+
99
+ If continue, dispatch flow-planner (mirroring the Task call in `/curdx-flow:tasks`).
100
+
101
+ ## Step 4: Final summary
102
+
103
+ ```
104
+ ═══════════════════════════════════════════════
105
+ ✓ Full spec generated: $SPEC_NAME
106
+
107
+ Output files:
108
+ .flow/specs/$SPEC_NAME/research.md (N lines)
109
+ .flow/specs/$SPEC_NAME/requirements.md (M lines)
110
+ .flow/specs/$SPEC_NAME/design.md (K lines)
111
+ .flow/specs/$SPEC_NAME/tasks.md (L lines)
112
+
113
+ Stats:
114
+ Research: 2-3 technical options, context7 queried X libraries
115
+ Requirements: P US, Q FR, R AC
116
+ Design: S AD, T components
117
+ Tasks: U tasks (fine / coarse)
118
+
119
+ Next steps:
120
+ - Review all 4 files
121
+ - To modify, run /curdx-flow:research / /curdx-flow:requirements / ... individually
122
+ - After Phase 2 ships: /curdx-flow:implement
123
+ ```
124
+
125
+ ## Auto mode (/curdx-flow:spec --yolo)
126
+
127
+ If the user passes `--yolo`, all intermediate confirmations default to `continue`, running through in one pass.
128
+
129
+ **Warning**: yolo mode may run to completion but not necessarily match the user's intent. Recommend using it only on sketch / fast projects.
130
+
131
+ ## Error recovery
132
+
133
+ - A stage fails → stop without advancing; after manual fixes the user can re-run /curdx-flow:<phase>
134
+ - User chooses abort → preserve generated files, but do not advance phase_status
135
+ - sequential-thinking / context7 requirements at every stage match the per-command definitions
@@ -0,0 +1,181 @@
1
+ ---
2
+ name: spike
3
+ description: feasibility experiment — validate an idea with 2-5 small tests, no production code. Output conclusions to STATE.md
4
+ argument-hint: "\"<hypothesis to validate>\""
5
+ allowed-tools: [Read, Write, Edit, Bash, WebSearch, Grep, Glob]
6
+ ---
7
+
8
+ # Flow Spike — Feasibility Experiment
9
+
10
+ @${CLAUDE_PLUGIN_ROOT}/agent-preamble/preamble.md
11
+
12
+ **A spike is a short-duration experiment**, aimed at answering one technical question: "Can this approach work?" It is not about delivering a feature.
13
+
14
+ ## Typical Scenarios
15
+
16
+ - "Can Redis Streams replace Kafka?"
17
+ - "How much faster is Bun than Node? Is our scenario a good fit?"
18
+ - "Is this API's rate limit 10 qps?"
19
+ - "Can the new TypeScript const generic solve problem X?"
20
+
21
+ ## Step 1: Clarify the Hypothesis
22
+
23
+ ```bash
24
+ HYPOTHESIS="$ARGUMENTS"
25
+ [ -z "$HYPOTHESIS" ] && { echo "Usage: /curdx-flow:spike \"<hypothesis>\""; exit 1; }
26
+ ```
27
+
28
+ Confirm with the user:
29
+ ```
30
+ Hypothesis to validate: <HYPOTHESIS>
31
+
32
+ My understanding:
33
+ - What to validate: <...>
34
+ - Pass criteria: <...>
35
+ - What if it fails: <...>
36
+ - Time budget: recommend 30-60 minutes
37
+
38
+ Continue? (yes / correct me)
39
+ ```
40
+
41
+ Use AskUserQuestion (unless quickMode).
42
+
43
+ ## Step 2: Design 2-5 Small Tests
44
+
45
+ **Rules**:
46
+ - Each test is independent
47
+ - Minimal code (50 lines max)
48
+ - Explicit pass/fail criteria
49
+ - Do not touch production code
50
+
51
+ Example (validating Redis Streams performance):
52
+
53
+ ```
54
+ Test 1: Throughput of writing 1000 messages
55
+ Code: spike/redis-streams-write.ts
56
+ Expected: >= 10K msg/sec
57
+
58
+ Test 2: Consumer group latency
59
+ Code: spike/redis-streams-consume.ts
60
+ Expected: P99 < 10ms
61
+
62
+ Test 3: Persistence overhead
63
+ Code: compare AOF vs RDB
64
+ Expected: AOF write latency increase < 20%
65
+ ```
66
+
67
+ ## Step 3: Create the spike directory
68
+
69
+ ```bash
70
+ mkdir -p spike/$(date +%Y-%m-%d)-${HYPOTHESIS_SLUG}
71
+ ```
72
+
73
+ All experimental code lives here. **Absolutely do not touch production code**.
74
+
75
+ ## Step 4: Run the Tests
76
+
77
+ ```bash
78
+ for test in Test 1 2 3:
79
+ write code
80
+ run
81
+ record results
82
+ if blocked:
83
+ not "fix bug and continue", but record "blocker X, cannot test"
84
+ ```
85
+
86
+ **context7 is mandatory**: look up all library APIs via context7, do not rely on memory.
87
+
88
+ ## Step 5: Record Results
89
+
90
+ Create `spike/<date>-<slug>/RESULTS.md`:
91
+
92
+ ```markdown
93
+ # Spike Results: <hypothesis>
94
+
95
+ Date: YYYY-MM-DD
96
+ Time: actually took N minutes
97
+
98
+ ## Test Matrix
99
+
100
+ | Test | Expected | Actual | Conclusion |
101
+ |------|-----|------|------|
102
+ | 1 | >=10K msg/sec | 12K msg/sec | ✓ |
103
+ | 2 | P99 < 10ms | P99 = 15ms | ✗ |
104
+ | 3 | < 20% | 8% | ✓ |
105
+
106
+ ## Conclusion
107
+
108
+ Hypothesis <HYPOTHESIS> is:
109
+ ☐ Fully correct — recommended for adoption
110
+ ☑ Partially correct — P99 latency exceeds expectations, needs deeper optimization
111
+ ☐ Fully incorrect — not recommended
112
+
113
+ ## Key Findings
114
+
115
+ - <finding 1>
116
+ - <finding 2>
117
+
118
+ ## Recommendation
119
+
120
+ <how to handle this hypothesis if used in a real spec>
121
+
122
+ ## Open Questions
123
+
124
+ <edges not yet tested>
125
+ ```
126
+
127
+ ## Step 6: Sync to STATE.md (if in a flow project)
128
+
129
+ ```bash
130
+ if [ -f ".flow/STATE.md" ]; then
131
+ append to STATE.md:
132
+ ## Spike: <hypothesis> (YYYY-MM-DD)
133
+ Conclusion: partially correct
134
+ Details: spike/<date>-<slug>/RESULTS.md
135
+ fi
136
+ ```
137
+
138
+ This way, subsequent spec discussions can reference it.
139
+
140
+ ## Step 7: Cleanup Decision
141
+
142
+ Ask the user:
143
+ ```
144
+ Spike complete. Code is in spike/<date>-<slug>/
145
+ Keep it?
146
+ [keep] may reference later
147
+ [delete] conclusion recorded, code no longer valuable
148
+ [commit] commit into git as a historical reference
149
+ ```
150
+
151
+ ## Output
152
+
153
+ ```
154
+ ✓ Spike complete: <hypothesis>
155
+
156
+ Conclusion: partially correct (see RESULTS.md)
157
+ Tests: 3 / 3 executed
158
+ Actual time: 47 minutes
159
+
160
+ Next step suggestions:
161
+ - Go deeper: /curdx-flow:start <name> "do <specific feature> based on spike results"
162
+ - Abandon: recorded to STATE.md, do not adopt this direction
163
+
164
+ Artifacts:
165
+ spike/<date>-<slug>/RESULTS.md
166
+ spike/<date>-<slug>/*.ts (test code)
167
+ ```
168
+
169
+ ## Forbidden
170
+
171
+ - ✗ Mixing spike code into production code (src/)
172
+ - ✗ Spikes exceeding 2 hours (that's not a spike, that's a mini project)
173
+ - ✗ Claiming validation complete without recording results
174
+ - ✗ Using a spike to replace the real spec workflow
175
+
176
+ ## spike vs research phase
177
+
178
+ - **spike** is **actually running code** to validate a hypothesis
179
+ - **research phase** is **reading docs / thinking** to determine direction
180
+
181
+ Research thinks approach A is feasible but has concerns → use a spike to verify → write the conclusion back into the "feasibility" section of research.md.