@curdx/flow 1.1.11 → 2.0.0-beta.10

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 (96) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/.claude-plugin/plugin.json +4 -11
  3. package/CHANGELOG.md +99 -0
  4. package/README.md +74 -102
  5. package/README.zh.md +2 -2
  6. package/agent-preamble/preamble.md +81 -11
  7. package/agents/flow-adversary.md +41 -56
  8. package/agents/flow-architect.md +24 -11
  9. package/agents/flow-debugger.md +2 -2
  10. package/agents/flow-edge-hunter.md +20 -6
  11. package/agents/flow-executor.md +3 -3
  12. package/agents/flow-planner.md +51 -48
  13. package/agents/flow-product-designer.md +15 -2
  14. package/agents/flow-qa-engineer.md +4 -4
  15. package/agents/flow-researcher.md +18 -3
  16. package/agents/flow-reviewer.md +5 -1
  17. package/agents/flow-security-auditor.md +2 -2
  18. package/agents/flow-triage-analyst.md +4 -4
  19. package/agents/flow-ui-researcher.md +7 -7
  20. package/agents/flow-ux-designer.md +3 -3
  21. package/agents/flow-verifier.md +47 -14
  22. package/bin/curdx-flow.js +13 -1
  23. package/cli/doctor.js +28 -13
  24. package/cli/install.js +62 -36
  25. package/cli/protocols.js +63 -10
  26. package/cli/registry.js +73 -0
  27. package/cli/uninstall.js +9 -11
  28. package/cli/upgrade.js +6 -10
  29. package/cli/utils.js +104 -56
  30. package/commands/debug.md +10 -10
  31. package/commands/fast.md +1 -1
  32. package/commands/help.md +109 -87
  33. package/commands/implement.md +7 -7
  34. package/commands/init.md +18 -7
  35. package/commands/review.md +114 -130
  36. package/commands/spec.md +131 -89
  37. package/commands/start.md +130 -153
  38. package/commands/verify.md +110 -92
  39. package/gates/adversarial-review-gate.md +20 -20
  40. package/gates/coverage-audit-gate.md +1 -1
  41. package/gates/devex-gate.md +5 -6
  42. package/gates/edge-case-gate.md +2 -2
  43. package/gates/security-gate.md +3 -3
  44. package/hooks/hooks.json +0 -11
  45. package/hooks/scripts/quick-mode-guard.sh +12 -9
  46. package/hooks/scripts/session-start.sh +2 -2
  47. package/hooks/scripts/stop-watcher.sh +25 -15
  48. package/knowledge/epic-decomposition.md +2 -2
  49. package/knowledge/execution-strategies.md +10 -9
  50. package/knowledge/planning-reviews.md +6 -6
  51. package/knowledge/spec-driven-development.md +11 -10
  52. package/knowledge/two-stage-review.md +6 -5
  53. package/knowledge/wave-execution.md +5 -5
  54. package/package.json +4 -2
  55. package/skills/brownfield-index/SKILL.md +62 -0
  56. package/skills/browser-qa/SKILL.md +50 -0
  57. package/skills/epic/SKILL.md +68 -0
  58. package/skills/security-audit/SKILL.md +50 -0
  59. package/skills/ui-sketch/SKILL.md +49 -0
  60. package/templates/config.json.tmpl +1 -1
  61. package/templates/design.md.tmpl +32 -112
  62. package/templates/requirements.md.tmpl +25 -43
  63. package/templates/research.md.tmpl +37 -68
  64. package/templates/tasks.md.tmpl +27 -84
  65. package/agents/persona-amelia.md +0 -128
  66. package/agents/persona-david.md +0 -141
  67. package/agents/persona-emma.md +0 -179
  68. package/agents/persona-john.md +0 -105
  69. package/agents/persona-mary.md +0 -95
  70. package/agents/persona-oliver.md +0 -136
  71. package/agents/persona-rachel.md +0 -126
  72. package/agents/persona-serena.md +0 -175
  73. package/agents/persona-winston.md +0 -117
  74. package/commands/audit.md +0 -170
  75. package/commands/autoplan.md +0 -184
  76. package/commands/design.md +0 -155
  77. package/commands/discuss.md +0 -162
  78. package/commands/doctor.md +0 -124
  79. package/commands/index.md +0 -261
  80. package/commands/install-deps.md +0 -128
  81. package/commands/party.md +0 -241
  82. package/commands/plan-ceo.md +0 -117
  83. package/commands/plan-design.md +0 -107
  84. package/commands/plan-dx.md +0 -104
  85. package/commands/plan-eng.md +0 -108
  86. package/commands/qa.md +0 -118
  87. package/commands/requirements.md +0 -146
  88. package/commands/research.md +0 -141
  89. package/commands/security.md +0 -109
  90. package/commands/sketch.md +0 -118
  91. package/commands/spike.md +0 -181
  92. package/commands/status.md +0 -139
  93. package/commands/switch.md +0 -95
  94. package/commands/tasks.md +0 -189
  95. package/commands/triage.md +0 -160
  96. package/hooks/scripts/fail-tracker.sh +0 -31
@@ -1,160 +0,0 @@
1
- ---
2
- name: triage
3
- description: Epic decomposition — slice a big goal vertically by user value, generate dependency graph + multiple sub-specs. Dispatches flow-triage-analyst.
4
- argument-hint: "\"<epic goal>\" [--specs=<N>]"
5
- allowed-tools: [Read, Write, Bash, Task, WebSearch]
6
- ---
7
-
8
- # Flow Triage — Epic Decomposition
9
-
10
- @${CLAUDE_PLUGIN_ROOT}/knowledge/epic-decomposition.md
11
-
12
- Break down a big goal (needs 4+ sub-specs to complete) into an Epic of vertical slices.
13
-
14
- ## When to Use
15
-
16
- - Goal is clearly more than 2 weeks of work
17
- - Involves multiple "independently usable" features
18
- - At `/curdx-flow:start`, you realize the goal is too big — switch to `/curdx-flow:triage`
19
-
20
- ## When Not to Use
21
-
22
- - Goal fits in 1-2 weeks → use `/curdx-flow:start`
23
- - Emergency fix → use `/curdx-flow:fast`
24
- - Exploratory validation → use `/curdx-flow:spike`
25
-
26
- ## Step 1: Preflight Check
27
-
28
- ```bash
29
- [ ! -d ".flow" ] && { echo "❌ Not a CurDX-Flow project"; exit 1; }
30
-
31
- GOAL="$ARGUMENTS"
32
- # Extract --specs argument
33
- TARGET_SPECS=""
34
- case "$GOAL" in
35
- *--specs=*)
36
- TARGET_SPECS=$(echo "$GOAL" | grep -oE -- '--specs=[0-9]+' | cut -d= -f2)
37
- GOAL=$(echo "$GOAL" | sed 's/--specs=[0-9]*//g' | xargs)
38
- ;;
39
- esac
40
-
41
- [ -z "$GOAL" ] && { echo "Usage: /curdx-flow:triage \"<epic goal>\""; exit 1; }
42
- ```
43
-
44
- ## Step 2: Generate Epic Name
45
-
46
- Derive a kebab-case name from the goal, or ask the user:
47
-
48
- ```python
49
- # Rough inference
50
- slug = re.sub(r'\s+', '-', goal.lower())
51
- slug = re.sub(r'[^a-z0-9-]', '', slug)[:40]
52
- # e.g.: "add payment system" → "payment-system"
53
- # May need AskUserQuestion to confirm
54
- ```
55
-
56
- ## Step 3: Create Epic Directory
57
-
58
- ```bash
59
- EPIC_DIR=".flow/_epics/$EPIC_NAME"
60
- mkdir -p "$EPIC_DIR"
61
- ```
62
-
63
- ## Step 4: Dispatch flow-triage-analyst
64
-
65
- ```
66
- Task:
67
- subagent_type: general-purpose
68
- description: "Epic decomposition: $EPIC_NAME"
69
- prompt: |
70
- You are the flow-triage-analyst agent. Full definition:
71
- ${CLAUDE_PLUGIN_ROOT}/agents/flow-triage-analyst.md
72
-
73
- Knowledge base (must read):
74
- ${CLAUDE_PLUGIN_ROOT}/knowledge/epic-decomposition.md
75
-
76
- Input:
77
- - Epic goal: "$GOAL"
78
- - Epic name: $EPIC_NAME
79
- - Suggested sub-spec count: ${TARGET_SPECS:-auto (4-8)}
80
- - Project context: .flow/PROJECT.md + .flow/CONTEXT.md + .flow/STATE.md
81
-
82
- Mandatory workflow:
83
- 1. sequential-thinking >= 5 rounds to understand the goal
84
- 2. context7 to validate the key technologies involved
85
- 3. claude-mem to retrieve history
86
- 4. sequential-thinking 5+ rounds to brainstorm decomposition
87
- 5. Vertical slice by user value (not by technical layer)
88
- 6. Define shared interfaces (freeze)
89
- 7. Identify dependencies (hard/soft/parallel)
90
- 8. Generate epic.md + sub-spec skeletons
91
-
92
- Output files:
93
- - .flow/_epics/$EPIC_NAME/epic.md (Epic master document)
94
- - .flow/_epics/$EPIC_NAME/.epic-state.json
95
- - .flow/specs/<sub-1>/.state.json
96
- - .flow/specs/<sub-2>/.state.json
97
- - ...(skeleton for each sub-spec)
98
-
99
- Success criteria:
100
- - Sub-spec count: 4-8
101
- - Each sub-spec has independent user value
102
- - Dependency graph is clear (mermaid)
103
- - Shared interfaces frozen (TypeScript types)
104
- - Out of Scope is explicit
105
-
106
- When done, return a brief:
107
- - Sub-spec list (name + one-sentence description)
108
- - Dependency graph
109
- - Recommended execution order
110
- - Estimated total duration
111
- ```
112
-
113
- ## Step 5: Validate Output
114
-
115
- ```bash
116
- EPIC_FILE="$EPIC_DIR/epic.md"
117
- [ ! -f "$EPIC_FILE" ] && { echo "❌ Epic document not generated"; exit 1; }
118
-
119
- # Count sub-specs
120
- SUB_COUNT=$(grep -c "^### Spec [0-9]" "$EPIC_FILE" || echo 0)
121
- [ $SUB_COUNT -lt 3 ] && echo "⚠ Fewer than 3 sub-specs; may not be decomposed enough"
122
- [ $SUB_COUNT -gt 10 ] && echo "⚠ More than 10 sub-specs; granularity may be too fine"
123
-
124
- # Check mermaid graph
125
- grep -q "mermaid" "$EPIC_FILE" || echo "✗ No mermaid dependency graph found"
126
-
127
- # Check shared interfaces
128
- grep -q "shared interface" "$EPIC_FILE" || echo "✗ Shared interfaces not defined"
129
- ```
130
-
131
- ## Step 6: Show Results to User
132
-
133
- ```
134
- ✓ Epic decomposition complete: $EPIC_NAME
135
-
136
- Files:
137
- .flow/_epics/$EPIC_NAME/epic.md
138
- .flow/_epics/$EPIC_NAME/.epic-state.json
139
-
140
- Sub-specs: $SUB_COUNT (skeletons created)
141
-
142
- Dependency graph: see epic.md
143
-
144
- Recommended execution order:
145
- Week 1: /curdx-flow:switch <sub-1> → /curdx-flow:spec → /curdx-flow:implement
146
- Week 2: /curdx-flow:switch <sub-2> (parallel with sub-3 if independent)
147
- Week 3: /curdx-flow:switch <sub-4> (depends on sub-1 being done)
148
- ...
149
-
150
- Next steps:
151
- 1. Review .flow/_epics/$EPIC_NAME/epic.md to confirm the decomposition is reasonable
152
- 2. First sub-spec: /curdx-flow:switch <sub-1-name>
153
- 3. Then proceed with the normal /curdx-flow:spec → /curdx-flow:implement flow
154
- ```
155
-
156
- ## Error Recovery
157
-
158
- - triage-analyst fails → the goal may be too abstract; refine the description manually and rerun
159
- - Too many/too few sub-specs → use `--specs=N` to force a count
160
- - Incomplete interface definitions → go back to epic.md and add interfaces manually, or rerun the agent to fill them in
@@ -1,31 +0,0 @@
1
- #!/usr/bin/env bash
2
- # CurDX-Flow PostToolUseFailure Hook
3
- # Tracks consecutive tool failures to enable pua integration (Phase 4+).
4
- # For now, just maintains a counter in plugin data directory.
5
- #
6
- # Future: when pua is installed and fail_count >= threshold, auto-invoke /pua:pua.
7
-
8
- set -u
9
-
10
- DATA_DIR="${CLAUDE_PLUGIN_DATA:-$HOME/.claude/plugins/data/curdx-flow}"
11
- COUNTER="$DATA_DIR/fail-count"
12
-
13
- mkdir -p "$DATA_DIR" 2>/dev/null || true
14
-
15
- # Read current count
16
- CURRENT=0
17
- [ -f "$COUNTER" ] && CURRENT="$(cat "$COUNTER" 2>/dev/null || echo 0)"
18
-
19
- # Increment
20
- NEXT=$((CURRENT + 1))
21
- echo "$NEXT" > "$COUNTER" 2>/dev/null || true
22
-
23
- # Placeholder for future pua escalation (Phase 4+):
24
- # if [ "$NEXT" -ge 2 ] && command -v claude >/dev/null 2>&1; then
25
- # if claude plugin list 2>/dev/null | grep -q 'pua'; then
26
- # # Inject escalation suggestion via hook output
27
- # ...
28
- # fi
29
- # fi
30
-
31
- exit 0