@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
package/cli/uninstall.js CHANGED
@@ -4,6 +4,7 @@
4
4
 
5
5
  import { existsSync, lstatSync, unlinkSync, rmSync, readlinkSync } from "node:fs";
6
6
  import { join } from "node:path";
7
+ import { homedir } from "node:os";
7
8
 
8
9
  import {
9
10
  color,
@@ -15,18 +16,15 @@ import {
15
16
  listPlugins,
16
17
  } from "./utils.js";
17
18
  import { removeGlobalProtocols, GLOBAL_CLAUDE_MD } from "./protocols.js";
19
+ import { RECOMMENDED_PLUGINS } from "./registry.js";
18
20
 
19
- const HOME = process.env.HOME || "";
21
+ const HOME = homedir();
20
22
 
21
- // Keep aligned with install.js
22
- const RECOMMENDED = [
23
- { name: "pua", uninstallSpec: "pua@pua-skills" },
24
- { name: "claude-mem", uninstallSpec: "claude-mem@thedotmack" },
25
- {
26
- name: "frontend-design",
27
- uninstallSpec: "frontend-design@claude-plugins-official",
28
- },
29
- ];
23
+ // Pull uninstall-relevant subset from the single registry. See registry.js.
24
+ const RECOMMENDED = RECOMMENDED_PLUGINS.map(({ name, uninstallSpec }) => ({
25
+ name,
26
+ uninstallSpec,
27
+ }));
30
28
 
31
29
  // Symlinks created by install.js (only cleaned with --purge)
32
30
  const MANAGED_SYMLINKS = [
@@ -116,7 +114,7 @@ export async function uninstall(args = []) {
116
114
  for (const name of toRemove) {
117
115
  const rec = presentRecs.find((r) => r.name === name);
118
116
  log.blank();
119
- console.log(` ${color.cyan("")} Uninstalling ${color.bold(rec.name)}...`);
117
+ console.log(` ${color.cyan("")} Uninstalling ${color.bold(rec.name)}...`);
120
118
  const r = await run(
121
119
  "claude",
122
120
  ["plugin", "uninstall", rec.uninstallSpec],
package/cli/upgrade.js CHANGED
@@ -3,13 +3,10 @@
3
3
  */
4
4
 
5
5
  import { color, log, run, listPlugins, claudeVersion } from "./utils.js";
6
-
7
- const PLUGINS_TO_UPDATE = [
8
- "curdx-flow@curdx-flow-marketplace",
9
- "pua@pua-skills",
10
- "claude-mem@thedotmack",
11
- "frontend-design@claude-plugins-official",
12
- ];
6
+ import {
7
+ PLUGINS_TO_UPDATE,
8
+ MARKETPLACES_TO_REFRESH,
9
+ } from "./registry.js";
13
10
 
14
11
  export async function upgrade(args = []) {
15
12
  log.title("⬆️ CurDX-Flow upgrade");
@@ -19,10 +16,9 @@ export async function upgrade(args = []) {
19
16
  process.exit(1);
20
17
  }
21
18
 
22
- // Refresh marketplaces first
19
+ // Refresh marketplaces first (derived from cli/registry.js)
23
20
  log.step(1, 2, "Refreshing marketplaces...");
24
- const marketplaces = ["curdx-flow-marketplace", "pua", "thedotmack"];
25
- for (const mp of marketplaces) {
21
+ for (const mp of MARKETPLACES_TO_REFRESH) {
26
22
  const r = await run(
27
23
  "claude",
28
24
  ["plugin", "marketplace", "update", mp],
package/cli/utils.js CHANGED
@@ -108,39 +108,6 @@ export function confirm(message, defaultYes = true) {
108
108
  });
109
109
  }
110
110
 
111
- /**
112
- * Ask user to pick from a list. Returns selected value or null if aborted.
113
- */
114
- export function select(message, choices, defaultIndex = 0) {
115
- return new Promise((resolve) => {
116
- console.log(`${color.cyan("?")} ${message}`);
117
- choices.forEach((ch, i) => {
118
- const marker = i === defaultIndex ? color.green("▸") : " ";
119
- console.log(` ${marker} ${color.bold(String(i + 1))}. ${ch.label}`);
120
- });
121
-
122
- const rl = createInterface({
123
- input: process.stdin,
124
- output: process.stdout,
125
- });
126
- rl.question(
127
- ` ${color.dim(`(default: ${defaultIndex + 1}, q to abort) `)}`,
128
- (ans) => {
129
- rl.close();
130
- const v = ans.trim().toLowerCase();
131
- if (v === "q") return resolve(null);
132
- if (v === "") return resolve(choices[defaultIndex].value);
133
- const n = parseInt(v, 10);
134
- if (Number.isInteger(n) && n >= 1 && n <= choices.length) {
135
- return resolve(choices[n - 1].value);
136
- }
137
- console.log(color.yellow(" (invalid, using default)"));
138
- resolve(choices[defaultIndex].value);
139
- }
140
- );
141
- });
142
- }
143
-
144
111
  /**
145
112
  * Multi-select (checkbox-style via comma-separated input).
146
113
  * Returns array of selected values.
@@ -199,47 +166,124 @@ export function claudeVersion() {
199
166
  return m ? m[1] : res.stdout.trim().split("\n")[0];
200
167
  }
201
168
 
202
- /** List installed plugins via `claude plugin list`. Returns array of { name, version, status }. */
169
+ /**
170
+ * List installed plugins. Prefers the structured `claude plugin list --json`
171
+ * output (stable machine-readable format; confirmed present in claude
172
+ * 2.1.117+). Falls back to parsing the human-readable stream-text output
173
+ * for older CLI versions, but warns that parser is brittle.
174
+ *
175
+ * Returns array of { name, version, status }.
176
+ */
203
177
  export function listPlugins() {
204
- const res = runSync("claude", ["plugin", "list"]);
205
- if (res.code !== 0) return [];
206
- const out = res.stdout;
207
- const plugins = [];
208
- // Parse format like:
178
+ // Preferred: structured JSON output.
179
+ const j = runSync("claude", ["plugin", "list", "--json"]);
180
+ if (j.code === 0 && j.stdout.trim().startsWith("[")) {
181
+ try {
182
+ const arr = JSON.parse(j.stdout);
183
+ return arr.map((p) => ({
184
+ // id has form "name@marketplace" — name is stable for dedup/lookup.
185
+ name: String(p.id || "").split("@")[0],
186
+ version: p.version,
187
+ status: p.enabled === false ? "disabled" : "enabled",
188
+ raw: JSON.stringify(p),
189
+ }));
190
+ } catch {
191
+ // JSON parse failed — fall through to legacy text parser.
192
+ }
193
+ }
194
+
195
+ // Legacy fallback: parse the human-readable format.
209
196
  // ❯ curdx-flow@curdx-flow-marketplace
210
197
  // Version: 1.1.1
211
- // Scope: user
212
198
  // Status: ✔ enabled
213
- const blocks = out.split(/\n\s*❯\s*/).slice(1);
199
+ // Fragile matches unicode markers. Kept only for older claude CLIs.
200
+ const res = runSync("claude", ["plugin", "list"]);
201
+ if (res.code !== 0) return [];
202
+ const plugins = [];
203
+ const blocks = res.stdout.split(/\n\s*❯\s*/).slice(1);
214
204
  for (const block of blocks) {
215
205
  const lines = block.split("\n");
216
206
  const name = lines[0].trim().split("@")[0];
217
207
  const version = (block.match(/Version:\s*(\S+)/) || [])[1];
218
- const status = block.includes("✔") ? "enabled" : block.includes("✘") ? "failed" : "unknown";
208
+ const status = block.includes("✔")
209
+ ? "enabled"
210
+ : block.includes("✘")
211
+ ? "failed"
212
+ : "unknown";
219
213
  plugins.push({ name, version, status, raw: block });
220
214
  }
221
215
  return plugins;
222
216
  }
223
217
 
224
- /** List MCPs via `claude mcp list`. Returns array of { name, status }. */
218
+ /**
219
+ * List MCP servers registered with the `claude` CLI. Returns array of
220
+ * { name, plugin, fullName, status, command }
221
+ * where `plugin` is set when the MCP came from a plugin (real name is
222
+ * `plugin:<plugin>:<mcp>`), `name` is the trailing segment, and `fullName`
223
+ * is the original as reported by claude.
224
+ *
225
+ * Fixture captured from `claude mcp list` (2.1.117):
226
+ * Checking MCP server health…
227
+ *
228
+ * plugin:curdx-flow:context7: npx -y @upstash/context7-mcp@latest - ✓ Connected
229
+ * context7: npx -y @upstash/context7-mcp --api-key ... - ✓ Connected
230
+ * claude.ai Gmail: https://gmailmcp... - ✓ Connected
231
+ *
232
+ * `claude mcp list --json` does not exist on 2.1.117 (verified), so this
233
+ * parser is the primary path. It is fixture-tested in test/utils.test.js
234
+ * so format regressions get caught in CI.
235
+ */
225
236
  export function listMcps() {
226
237
  const res = runSync("claude", ["mcp", "list"]);
227
238
  if (res.code !== 0) return [];
228
- const lines = res.stdout.split("\n");
239
+ return parseMcpList(res.stdout);
240
+ }
241
+
242
+ /** Exported for testing against a fixed input. */
243
+ export function parseMcpList(output) {
229
244
  const mcps = [];
230
- for (const line of lines) {
231
- // Rough parse — adjust if format differs
232
- const m = line.match(/^\s*([a-z0-9-]+)\s*[:\-]/i);
233
- if (m) mcps.push({ name: m[1], status: "registered" });
245
+ for (const raw of output.split("\n")) {
246
+ const line = raw.trimEnd();
247
+ if (!line) continue;
248
+ // skip the health-check header line
249
+ if (line.startsWith("Checking") || line.startsWith("checking")) continue;
250
+ // Expected format: "<fullName>: <command-or-url> - <status>"
251
+ // fullName may itself contain colons when prefixed with "plugin:<p>:<m>".
252
+ // Match from the end to find the status sentinel " - ", then split off
253
+ // the name at the first ": " after the identifier prefix.
254
+ const statusSplit = line.lastIndexOf(" - ");
255
+ if (statusSplit === -1) continue;
256
+ const statusRaw = line.slice(statusSplit + 3).trim();
257
+ const beforeStatus = line.slice(0, statusSplit);
258
+ // Find the first ": " that separates name from command. Note the space
259
+ // after the colon — this disambiguates from the colons inside
260
+ // "plugin:foo:bar".
261
+ const nameSplit = beforeStatus.indexOf(": ");
262
+ if (nameSplit === -1) continue;
263
+ const fullName = beforeStatus.slice(0, nameSplit).trim();
264
+ const command = beforeStatus.slice(nameSplit + 2).trim();
265
+
266
+ let plugin = null;
267
+ let name = fullName;
268
+ if (fullName.startsWith("plugin:")) {
269
+ const parts = fullName.split(":");
270
+ if (parts.length >= 3) {
271
+ plugin = parts[1];
272
+ name = parts.slice(2).join(":");
273
+ }
274
+ }
275
+
276
+ const status = /Connected|✓/.test(statusRaw)
277
+ ? "connected"
278
+ : /Failed|✗/.test(statusRaw)
279
+ ? "failed"
280
+ : "unknown";
281
+
282
+ mcps.push({ name, plugin, fullName, status, command });
234
283
  }
235
284
  return mcps;
236
285
  }
237
286
 
238
- // ---------- Paths ----------
239
- export function pluginCacheDir(pluginName = "curdx-flow", marketplace = "curdx-flow-marketplace") {
240
- return `${process.env.HOME}/.claude/plugins/cache/${marketplace}/${pluginName}`;
241
- }
242
-
243
287
  // ---------- Runtime PATH guards (bun / uv) ----------
244
288
  // claude-mem hard-codes `command: "bun"` in its .mcp.json, but bun installs to
245
289
  // ~/.bun/bin which is not on PATH when Claude Code spawns MCP servers
@@ -247,10 +291,14 @@ export function pluginCacheDir(pluginName = "curdx-flow", marketplace = "curdx-f
247
291
  // detection + self-healing: create a symlink to the user-level bun install
248
292
  // in a PATH-visible directory.
249
293
 
250
- import { mkdirSync, symlinkSync, lstatSync, unlinkSync, readlinkSync } from "node:fs";
251
- // `existsSync` and `join` already imported at the top of this file.
294
+ import { existsSync, mkdirSync, symlinkSync, lstatSync, unlinkSync, readlinkSync } from "node:fs";
295
+ import { homedir } from "node:os";
296
+ // `join` already imported at the top of this file.
252
297
 
253
- const HOME = process.env.HOME || "";
298
+ // os.homedir() is sourced from the OS-level user record and works even
299
+ // when $HOME is empty (non-login shells, some CI containers). See the
300
+ // same rationale in cli/protocols.js.
301
+ const HOME = homedir();
254
302
 
255
303
  /** Candidate bun install locations (priority order) */
256
304
  const BUN_CANDIDATES = [
package/commands/debug.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: debug
3
- description: Systematic debugging — 4-phase methodology (root cause → pattern → hypothesis → fix); ≥3 failures triggers architectural questioning. Dispatches flow-debugger (David).
3
+ description: Systematic debugging — 4-phase methodology (root cause → pattern → hypothesis → fix); ≥3 failures triggers architectural questioning. Dispatches flow-debugger.
4
4
  argument-hint: "\"<bug description>\""
5
5
  allowed-tools: [Read, Write, Edit, Bash, Task, Grep, Glob]
6
6
  ---
@@ -9,7 +9,7 @@ allowed-tools: [Read, Write, Edit, Bash, Task, Grep, Glob]
9
9
 
10
10
  @${CLAUDE_PLUGIN_ROOT}/knowledge/systematic-debugging.md
11
11
 
12
- Dispatches the `flow-debugger` (David) agent to perform systematic 4-phase debugging.
12
+ Dispatches the `flow-debugger` agent to perform systematic 4-phase debugging.
13
13
 
14
14
  ## When to use
15
15
 
@@ -21,7 +21,7 @@ Dispatches the `flow-debugger` (David) agent to perform systematic 4-phase debug
21
21
  ## When not to use
22
22
 
23
23
  - Still in coding phase → use the normal flow-executor flow
24
- - Question needs investigation → use /curdx-flow:spike
24
+ - Question needs investigation → use `/curdx-flow:fast` with a prompt like "spike: verify X with minimal tests"
25
25
  - Performance issue needing benchmarks → performance tuning is not debug
26
26
 
27
27
  ## Step 1: Parse bug description
@@ -33,7 +33,7 @@ BUG_DESC="$ARGUMENTS"
33
33
 
34
34
  ## Step 2: Collect prerequisites (main agent, no dispatch)
35
35
 
36
- Before dispatching David, the main agent (you) collects first:
36
+ Before dispatching the debugger, the main agent (you) collects first:
37
37
 
38
38
  ```bash
39
39
  # 1. Recent commit history (bug may be introduced by a new commit)
@@ -47,14 +47,14 @@ git diff --stat
47
47
  ACTIVE=$(cat .flow/.active-spec 2>/dev/null)
48
48
  ```
49
49
 
50
- ## Step 3: Dispatch flow-debugger (David)
50
+ ## Step 3: Dispatch flow-debugger
51
51
 
52
52
  ```
53
53
  Task:
54
54
  subagent_type: general-purpose
55
55
  description: "Debug: $BUG_DESC"
56
56
  prompt: |
57
- You are the flow-debugger agent (David). Full definition:
57
+ You are the flow-debugger agent. Full definition:
58
58
  ${CLAUDE_PLUGIN_ROOT}/agents/flow-debugger.md
59
59
 
60
60
  Methodology knowledge base:
@@ -150,7 +150,7 @@ Next steps:
150
150
 
151
151
  ## Special case: 3 failures
152
152
 
153
- If David reports 3 failures:
153
+ If the debugger reports 3 failures:
154
154
 
155
155
  ```
156
156
  ⚠ Systematic debugging failed (3 attempts)
@@ -166,8 +166,8 @@ Possible root issues:
166
166
  - Data-layer issue
167
167
 
168
168
  Suggestions:
169
- - Review David's detailed report analysis
170
- - /curdx-flow:party winston david "what architectural issue does this bug hint at?"
169
+ - Review the debugger's detailed report analysis
170
+ - Ask Claude directly: "from an architect's and debugger's perspective, what architectural issue does this bug hint at?"
171
171
  - Or temporarily @ts-ignore / skip test and record as tech debt in STATE.md
172
172
  ```
173
173
 
@@ -175,7 +175,7 @@ Suggestions:
175
175
 
176
176
  - ✗ Omitting the bug description
177
177
  - ✗ Expecting "one-shot fix" (debug is a process, not an event)
178
- - ✗ Skipping David and editing code yourself (loses the systematic methodology)
178
+ - ✗ Skipping the debugger and editing code yourself (loses the systematic methodology)
179
179
  - ✗ Accepting "maybe it's..." as a root cause
180
180
 
181
181
  ## Relationship to other commands
package/commands/fast.md CHANGED
@@ -123,6 +123,6 @@ Choosing the right scenario matters more than forcing the flow.
123
123
  ## Forbidden
124
124
 
125
125
  - ✗ Committing without running verification
126
- - ✗ Changes touching more than 5 files (means it is no longer fast — run the full flow)
126
+ - ✗ Changes touching many unrelated files or modules (means it is no longer fast — run the full flow)
127
127
  - ✗ Writing library APIs from memory
128
128
  - ✗ Skipping the Step 2 5-question clarification (even when "obvious," explicit statement still has value)
package/commands/help.md CHANGED
@@ -1,119 +1,141 @@
1
1
  ---
2
2
  name: help
3
- description: CurDX-Flow help (command list, workflow overview, troubleshooting)
3
+ description: Show CurDX-Flow command list, workflow overview, or troubleshooting guide. With a command name, show that command's detail.
4
4
  argument-hint: "[<command-name> | workflow | troubleshoot]"
5
- allowed-tools: [Read]
5
+ allowed-tools: [Read, Bash]
6
6
  ---
7
7
 
8
8
  # CurDX-Flow Help
9
9
 
10
- ## No ArgumentsQuick Overview
10
+ ## No argumentquick overview
11
+
12
+ Show the 9 core slash commands + 5 auto-invoked skills. Keep the table compact, use tabs for alignment.
11
13
 
12
14
  ```
13
- 🚀 CurDX-Flow — AI Engineering Workflow Meta-Framework
14
-
15
- Current version: 0.1.0 (Phase 0 — Foundation)
16
-
17
- ╔══════════════════════════════════════════════════════════════╗
18
- Command overview (Phase 0 implemented) ║
19
- ╠══════════════════════════════════════════════════════════════╣
20
- /curdx-flow:init Initialize .flow/ project structure ║
21
- /curdx-flow:install-deps One-shot install of recommended plugins ║
22
- /curdx-flow:doctor Health check (deps + project config)
23
- /curdx-flow:status View spec and phase status ║
24
- /curdx-flow:help This help ║
25
- ╚══════════════════════════════════════════════════════════════╝
26
-
27
- Coming soon (Phase 1+):
28
- /curdx-flow:start / /curdx-flow:research / /curdx-flow:requirements / /curdx-flow:design
29
- /curdx-flow:tasks / /curdx-flow:implement / /curdx-flow:verify / /curdx-flow:review
30
- /curdx-flow:triage / /curdx-flow:party / /curdx-flow:debug / /curdx-flow:qa / /curdx-flow:sketch
31
- /curdx-flow:ship / /curdx-flow:land / /curdx-flow:canary / /curdx-flow:retro ...
32
-
33
- Usage:
34
- /curdx-flow:help <command> View detailed usage for a command
35
- /curdx-flow:help workflow Introduce the full workflow
36
- /curdx-flow:help troubleshoot Common troubleshooting
15
+ 🚀 CurDX-Flow v2 Claude Code Discipline Layer
16
+
17
+ 9 slash commands (explicit control)
18
+ ────────────────────────────────────
19
+ /curdx-flow:init Initialize .flow/ in the current project
20
+ /curdx-flow:start Create / resume / switch a feature spec
21
+ /curdx-flow:spec Write or refresh the spec (--phase, --review, --regenerate)
22
+ /curdx-flow:implement Execute the tasks (auto-routed strategy)
23
+ /curdx-flow:verify Goal-backward verification the differentiator
24
+ /curdx-flow:review Two-stage code review (+ --adversarial, --edge-case)
25
+ /curdx-flow:fast Skip the spec one-shot small task
26
+ /curdx-flow:debug Systematic 4-stage debugging
27
+ /curdx-flow:help This help
28
+
29
+ 5 skills (auto-invoked by Claude based on context)
30
+ ────────────────────────────────────
31
+ epic Decompose a large feature into vertical-slice sub-specs
32
+ browser-qa Real-browser test via chrome-devtools MCP
33
+ ui-sketch Generate UI design variants (via frontend-design skill)
34
+ security-audit OWASP + STRIDE + CVE scan
35
+ brownfield-index Map an unfamiliar / legacy codebase
36
+
37
+ 3 MCP servers auto-installed
38
+ ────────────────────────────────────
39
+ context7 Latest library docs
40
+ sequential-thinking Structured reasoning
41
+ chrome-devtools Browser automation
42
+
43
+ Usage:
44
+ /curdx-flow:help <command> Detail for one command
45
+ /curdx-flow:help workflow Standard workflow walkthrough
46
+ /curdx-flow:help troubleshoot Common problems
37
47
  ```
38
48
 
39
- ## `<command-name>` — Command Details
49
+ ## `<command-name>` — command detail
40
50
 
41
- Based on the argument, read and display the corresponding command file (in a user-friendly format):
51
+ When the argument matches one of the 9 commands, read the corresponding `commands/<name>.md` from the plugin cache and present it cleanly:
42
52
 
43
53
  ```bash
44
- cat "${CLAUDE_PLUGIN_ROOT}/commands/${COMMAND}.md"
54
+ PLUGIN=$(ls -dt "$HOME/.claude/plugins/cache/curdx-flow-marketplace/curdx-flow/"*/ 2>/dev/null | head -1)
55
+ CMD="$1"
56
+ cat "$PLUGIN/commands/$CMD.md"
45
57
  ```
46
58
 
47
- ## `workflow` Workflow Overview
59
+ If the argument isn't a known command, list the 9 candidates and the 5 skill names.
60
+
61
+ ## `workflow` — standard workflow
48
62
 
49
63
  ```
50
- 📐 CurDX-Flow Standard Workflow
51
-
52
- 1. Foundation (one-time)
53
- └─ /curdx-flow:install-deps → /curdx-flow:init /curdx-flow:doctor
54
-
55
- 2. Per feature (Feature Workflow)
56
- ├─ Research /curdx-flow:research (optional)
57
- ├─ Requirements /curdx-flow:requirements (required)
58
- ├─ Design /curdx-flow:design (required)
59
- ├─ Tasks /curdx-flow:tasks (required)
60
- ├─ Execute /curdx-flow:implement (required)
61
- ├─ Verify /curdx-flow:verify (required)
62
- ├─ Review /curdx-flow:review (recommended)
63
- └─ Ship /curdx-flow:ship (recommended)
64
-
65
- 3. Large feature (Epic Workflow)
66
- └─ /curdx-flow:triage split into multiple specs advanced in parallel
67
-
68
- 4. Ultra-fast path (Fast Path)
69
- └─ /curdx-flow:fast "description" — skip specs and execute directly
70
-
71
- 5. Prototype exploration (Sketch Path)
72
- └─ /curdx-flow:sketch "description" UI design drafts
73
-
74
- Five modes (configured via .flow/config.json):
75
- sketch — Rapid prototyping
76
- fast One-shot tasks
77
- standard — Regular features (default)
78
- enterprise Full SDLC + multi-agent collaboration
79
- autonomous — Overnight automation
64
+ 📐 CurDX-Flow v2 Standard Workflow
65
+
66
+ 1. One-time setup (outside Claude Code)
67
+ └─ npx @curdx/flow install --all
68
+
69
+ 2. Per project (in Claude Code)
70
+ └─ /curdx-flow:init
71
+
72
+ 3. Per feature — the main loop
73
+ ├─ /curdx-flow:start my-feature "one-line goal"
74
+ ├─ /curdx-flow:spec ← research → requirements → design → tasks
75
+ ├─ (optional) /curdx-flow:spec --review ← add multi-dim planning review
76
+ ├─ /curdx-flow:implement ← execute tasks
77
+ ├─ /curdx-flow:verify ← goal-backward check
78
+ └─ /curdx-flow:review ← code review
79
+
80
+ 4. Big feature (breaks into multiple specs)
81
+ └─ Say "this feature is too big, break it down" → epic skill auto-invokes
82
+
83
+ 5. One-off task (skip the spec)
84
+ └─ /curdx-flow:fast "rename foo to bar in src/"
85
+
86
+ 6. Stuck on a bug
87
+ └─ /curdx-flow:debug "tests fail intermittently after 3rd run"
88
+
89
+ Modes (set via /curdx-flow:start --mode=...)
90
+ fast One-off task paths
91
+ standard Default spec + gates + review
92
+ enterprise Standard + adversarial + edge-case + security-audit
80
93
  ```
81
94
 
82
- ## `troubleshoot` — Common Issues
95
+ ## `troubleshoot` — common issues
83
96
 
84
97
  ```
85
- 🛠️ Common Troubleshooting
98
+ 🛠️ Common issues
99
+
100
+ Q: After install, /curdx-flow:* commands are not found.
101
+ A: Restart Claude Code. The plugin needs a fresh session to register.
102
+
103
+ Q: MCP servers not starting?
104
+ A: Check Node >= 18: node --version
105
+ Check MCPs: claude mcp list
106
+ Health overall: npx @curdx/flow doctor
107
+
108
+ Q: GitHub slow / blocked during install?
109
+ A: v1.1.5+ defaults to offline install (bundled plugin body).
110
+ Force-offline: npx @curdx/flow install --no-deps
111
+ Force-online: npx @curdx/flow install --online
86
112
 
87
- Q: 3 MCPs did not start?
88
- A: Check Node.js >= 18: `node --version`
89
- View MCP status: `claude mcp list`
90
- Restart Claude Code
113
+ Q: claude-mem MCP keeps failing?
114
+ A: It needs bun. Run: npx @curdx/flow doctor — it auto-symlinks bun if installed.
91
115
 
92
- Q: Recommended-plugins prompt keeps appearing?
93
- A: Run /curdx-flow:install-deps to install, or create the marker file manually:
94
- touch "${CLAUDE_PLUGIN_DATA}/.deps-checked"
116
+ Q: /curdx-flow:init says .flow/ already exists?
117
+ A: Use --force, or run /curdx-flow:start directly to begin a new spec in the existing .flow/.
95
118
 
96
- Q: /curdx-flow:init reports "directory already exists"?
97
- A: An existing .flow/ is already initialized. Run /curdx-flow:status to view, or use --force to overwrite.
119
+ Q: Skills don't auto-invoke reliably?
120
+ A: Invoke explicitly every skill also has a /skill-name slash. E.g., /curdx-flow:security-audit.
98
121
 
99
- Q: Agents do not call context7 / sequential-thinking?
100
- A: Make sure preamble.md is loaded (InstructionsLoaded hook).
101
- Run /curdx-flow:doctor to check MCP status.
122
+ Q: I want the old v1 commands (research, plan-ceo, party…).
123
+ A: They're removed in v2. See MIGRATION.md for mappings, or stay on 1.x:
124
+ npm i -g @curdx/flow@^1.1
102
125
 
103
- Q: Do claude-mem and .flow/STATE.md conflict?
104
- A: No. claude-mem lives at ~/.claude-mem/ (SQLite), curdx-flow lives at .flow/ (JSON+MD).
105
- Division of duties: claude-mem for automatic implicit memory, STATE.md for explicit decisions.
126
+ Q: Too many gates blocking progress?
127
+ A: Your spec mode decides gate strictness. Lower via:
128
+ /curdx-flow:start <name> "<goal>" --mode=fast
106
129
 
107
- Q: pua is too aggressive, can it be turned off?
108
- A: pua is an independent plugin, you can /plugin disable pua.
109
- Enabling pua does not affect curdx-flow's core features (the three red lines are built into preamble).
130
+ Q: Where are decisions logged?
131
+ A: .flow/STATE.md (D-NN entries). Edit directly no slash command needed.
110
132
 
111
- Q: Want to contribute / report a bug?
112
- A: https://github.com/wdx/curdx-flow/issues
133
+ Q: File a bug / request feature
134
+ A: https://github.com/curdx/curdx-flow/issues
113
135
  ```
114
136
 
115
- ## Output Principles
137
+ ## Output principles
116
138
 
117
- - Stay concise; use tables and lists instead of long prose
118
- - Every answer points to a specific command; avoid filler like "please consult the docs"
119
- - Prioritize showing the user's next actionable step
139
+ - Keep it compact. Use tables and lists, not prose.
140
+ - Always point at a concrete next action, not "see the docs".
141
+ - Version number should come from `cli/utils.js` dynamic read, not hard-coded.
@@ -15,7 +15,7 @@ Execute spec tasks per tasks.md. Select the best execution strategy based on arg
15
15
  ## Step 1: Preflight Checks
16
16
 
17
17
  ```bash
18
- [ ! -d ".flow" ] && { echo " Not a CurDX-Flow project. Run /curdx-flow:init first"; exit 1; }
18
+ [ ! -d ".flow" ] && { echo " Not a CurDX-Flow project. Run /curdx-flow:init first"; exit 1; }
19
19
 
20
20
  ARGS="$ARGUMENTS"
21
21
  SPEC_NAME=""
@@ -35,10 +35,10 @@ for arg in $ARGS; do
35
35
  done
36
36
 
37
37
  [ -z "$SPEC_NAME" ] && SPEC_NAME=$(cat .flow/.active-spec 2>/dev/null)
38
- [ -z "$SPEC_NAME" ] && { echo " No active spec. Run /curdx-flow:start first"; exit 1; }
38
+ [ -z "$SPEC_NAME" ] && { echo " No active spec. Run /curdx-flow:start first"; exit 1; }
39
39
 
40
40
  DIR=".flow/specs/$SPEC_NAME"
41
- [ ! -f "$DIR/tasks.md" ] && { echo " Missing tasks.md. Run /curdx-flow:tasks first"; exit 1; }
41
+ [ ! -f "$DIR/tasks.md" ] && { echo " Missing tasks.md. Run /curdx-flow:spec first (or /curdx-flow:spec --phase=tasks to rebuild just the tasks phase)"; exit 1; }
42
42
  ```
43
43
 
44
44
  ## Step 2: Parse Task Characteristics from tasks.md
@@ -275,7 +275,7 @@ len(failed) == 1:
275
275
 
276
276
  len(failed) >= 2:
277
277
  → likely environment issue (missing deps/tsc error/permissions)
278
- → stop immediately, suggest /curdx-flow:doctor
278
+ → stop immediately, suggest npx @curdx/flow doctor
279
279
 
280
280
  failed_attempts >= 3 (cumulative):
281
281
  → stop, user intervention required
@@ -330,7 +330,7 @@ Prerequisites:
330
330
 
331
331
  ## Step 6: Progress Feedback
332
332
 
333
- Every 5 tasks or every wave, print status:
333
+ At each wave boundary (or periodically during long linear runs), print status:
334
334
 
335
335
  ```
336
336
  ═════ Progress ═════
@@ -357,10 +357,10 @@ if all tasks done:
357
357
 
358
358
  ## Error Recovery
359
359
 
360
- - Verify field in tasks.md is "manual" → stop, suggest re-running /curdx-flow:tasks to fix
360
+ - Verify field in tasks.md is "manual" → stop, suggest re-running `/curdx-flow:spec --phase=tasks --regenerate` to fix
361
361
  - 3 consecutive TASK_FAILED → stop, prompt for user intervention
362
362
  - git operation failure → stop immediately, do not continue (avoid state corruption)
363
- - Test framework not found (npm test not found) → stop, suggest running /curdx-flow:doctor
363
+ - Test framework not found (npm test not found) → stop, suggest running npx @curdx/flow doctor
364
364
 
365
365
  ## Output to User
366
366