@curdx/flow 2.2.0 → 2.2.4

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 (83) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +19 -2
  3. package/README.md +15 -8
  4. package/README.zh.md +5 -3
  5. package/agent-preamble/preamble.md +33 -0
  6. package/agents/flow-adversary.md +1 -1
  7. package/agents/flow-architect.md +2 -1
  8. package/agents/flow-brownfield-analyst.md +153 -0
  9. package/agents/flow-debugger.md +6 -11
  10. package/agents/flow-edge-hunter.md +1 -1
  11. package/agents/flow-executor.md +30 -8
  12. package/agents/flow-planner.md +38 -5
  13. package/agents/flow-product-designer.md +2 -1
  14. package/agents/flow-qa-engineer.md +9 -5
  15. package/agents/flow-researcher.md +2 -1
  16. package/agents/flow-reviewer.md +23 -5
  17. package/agents/flow-security-auditor.md +5 -3
  18. package/agents/flow-triage-analyst.md +5 -24
  19. package/agents/flow-ui-researcher.md +4 -3
  20. package/agents/flow-ux-designer.md +12 -39
  21. package/agents/flow-verifier.md +35 -3
  22. package/cli/README.md +3 -1
  23. package/cli/doctor-workflow.js +165 -2
  24. package/cli/doctor.js +8 -0
  25. package/cli/help.js +2 -0
  26. package/cli/lib/doctor-claude-settings.js +736 -0
  27. package/cli/lib/doctor-report.js +256 -1
  28. package/cli/lib/doctor-runtime-environment.js +196 -0
  29. package/cli/lib/frontmatter.js +44 -0
  30. package/cli/lib/json-schema.js +57 -0
  31. package/cli/lib/runtime.js +20 -2
  32. package/cli/lib/semver.js +14 -0
  33. package/cli/uninstall-actions.js +323 -0
  34. package/cli/uninstall.js +9 -253
  35. package/cli/utils.js +6 -1
  36. package/gates/adversarial-review-gate.md +1 -1
  37. package/gates/security-gate.md +2 -2
  38. package/gates/test-quality-gate.md +59 -0
  39. package/hooks/hooks.json +16 -2
  40. package/hooks/scripts/common.sh +4 -0
  41. package/hooks/scripts/session-start.sh +17 -2
  42. package/hooks/scripts/stop-watcher.sh +69 -18
  43. package/hooks/scripts/subagent-artifact-guard.sh +159 -0
  44. package/hooks/scripts/subagent-statusline.sh +105 -0
  45. package/knowledge/atomic-commits.md +1 -1
  46. package/knowledge/claude-code-runtime-contracts.md +203 -0
  47. package/knowledge/epic-decomposition.md +1 -1
  48. package/knowledge/execution-strategies.md +23 -1
  49. package/knowledge/planning-reviews.md +2 -2
  50. package/knowledge/poc-first-workflow.md +8 -8
  51. package/knowledge/review-feedback-intake.md +57 -0
  52. package/knowledge/two-stage-review.md +19 -6
  53. package/knowledge/wave-execution.md +16 -1
  54. package/output-styles/curdx-evidence-first.md +34 -0
  55. package/package.json +7 -1
  56. package/schemas/agent-frontmatter.schema.json +0 -7
  57. package/schemas/config.schema.json +14 -0
  58. package/schemas/hooks.schema.json +34 -2
  59. package/schemas/output-style-frontmatter.schema.json +22 -0
  60. package/schemas/plugin-manifest.schema.json +387 -17
  61. package/schemas/plugin-settings.schema.json +29 -0
  62. package/schemas/skill-frontmatter.schema.json +109 -4
  63. package/schemas/spec-state.schema.json +29 -4
  64. package/settings.json +6 -0
  65. package/skills/brownfield-index/SKILL.md +31 -35
  66. package/skills/browser-qa/SKILL.md +11 -3
  67. package/skills/cancel/SKILL.md +82 -0
  68. package/skills/debug/SKILL.md +6 -2
  69. package/skills/epic/SKILL.md +5 -3
  70. package/skills/fast/SKILL.md +1 -0
  71. package/skills/help/SKILL.md +17 -7
  72. package/skills/implement/SKILL.md +38 -7
  73. package/skills/init/SKILL.md +2 -1
  74. package/skills/review/SKILL.md +4 -1
  75. package/skills/security-audit/SKILL.md +17 -3
  76. package/skills/spec/SKILL.md +2 -1
  77. package/skills/start/SKILL.md +18 -18
  78. package/skills/status/SKILL.md +85 -0
  79. package/skills/ui-sketch/SKILL.md +11 -3
  80. package/skills/verify/SKILL.md +13 -1
  81. package/templates/config.json.tmpl +4 -1
  82. package/templates/progress.md.tmpl +19 -0
  83. package/templates/tasks.md.tmpl +26 -3
@@ -14,11 +14,11 @@
14
14
  "description": {
15
15
  "type": "string",
16
16
  "minLength": 1,
17
- "description": "Concise trigger summary. Keep detailed trigger phrases in when_to_use."
17
+ "description": "Concise trigger summary. Front-load the key use case. Combined description + when_to_use text is truncated at 1536 characters in Claude Code's skill listing."
18
18
  },
19
19
  "when_to_use": {
20
20
  "type": "string",
21
- "description": "Additional trigger phrases appended to description in the skill listing."
21
+ "description": "Additional trigger phrases appended to description in the skill listing. Counts toward the same 1536-character listing cap."
22
22
  },
23
23
  "argument-hint": {
24
24
  "type": "string"
@@ -33,7 +33,8 @@
33
33
  "type": "boolean"
34
34
  },
35
35
  "user-invocable": {
36
- "type": "boolean"
36
+ "type": "boolean",
37
+ "description": "Controls whether the skill appears in the slash menu. Does not block model invocation; use disable-model-invocation for that."
37
38
  },
38
39
  "allowed-tools": {
39
40
  "oneOf": [
@@ -56,7 +57,7 @@
56
57
  "type": "string"
57
58
  },
58
59
  "hooks": {
59
- "type": "object"
60
+ "$ref": "#/definitions/skillHooks"
60
61
  },
61
62
  "paths": {
62
63
  "oneOf": [
@@ -68,5 +69,109 @@
68
69
  "type": "string",
69
70
  "enum": ["bash", "powershell"]
70
71
  }
72
+ },
73
+ "definitions": {
74
+ "skillHooks": {
75
+ "type": "object",
76
+ "propertyNames": {
77
+ "enum": [
78
+ "SessionStart",
79
+ "InstructionsLoaded",
80
+ "UserPromptSubmit",
81
+ "UserPromptExpansion",
82
+ "PreToolUse",
83
+ "PermissionRequest",
84
+ "PostToolUse",
85
+ "PostToolUseFailure",
86
+ "PostToolBatch",
87
+ "PermissionDenied",
88
+ "Notification",
89
+ "SubagentStart",
90
+ "SubagentStop",
91
+ "TaskCreated",
92
+ "TaskCompleted",
93
+ "Stop",
94
+ "StopFailure",
95
+ "TeammateIdle",
96
+ "ConfigChange",
97
+ "CwdChanged",
98
+ "FileChanged",
99
+ "WorktreeCreate",
100
+ "WorktreeRemove",
101
+ "PreCompact",
102
+ "PostCompact",
103
+ "Elicitation",
104
+ "ElicitationResult",
105
+ "SessionEnd"
106
+ ]
107
+ },
108
+ "additionalProperties": {
109
+ "type": "array",
110
+ "items": { "$ref": "#/definitions/matcherGroup" }
111
+ }
112
+ },
113
+ "matcherGroup": {
114
+ "type": "object",
115
+ "required": ["hooks"],
116
+ "additionalProperties": false,
117
+ "properties": {
118
+ "matcher": { "type": "string" },
119
+ "hooks": {
120
+ "type": "array",
121
+ "items": { "$ref": "#/definitions/hookHandler" }
122
+ }
123
+ }
124
+ },
125
+ "hookHandler": {
126
+ "type": "object",
127
+ "required": ["type"],
128
+ "additionalProperties": false,
129
+ "properties": {
130
+ "type": {
131
+ "type": "string",
132
+ "enum": ["command", "http", "mcp_tool", "prompt", "agent"]
133
+ },
134
+ "if": { "type": "string" },
135
+ "timeout": { "type": "integer", "minimum": 1 },
136
+ "statusMessage": { "type": "string" },
137
+ "async": { "type": "boolean" },
138
+ "asyncRewake": { "type": "boolean" },
139
+ "once": { "type": "boolean" },
140
+ "command": { "type": "string" },
141
+ "shell": {
142
+ "type": "string",
143
+ "enum": ["bash", "powershell"]
144
+ },
145
+ "url": { "type": "string" },
146
+ "headers": { "type": "object" },
147
+ "allowedEnvVars": {
148
+ "type": "array",
149
+ "items": { "type": "string" }
150
+ },
151
+ "server": { "type": "string" },
152
+ "tool": { "type": "string" },
153
+ "input": { "type": "object" },
154
+ "prompt": { "type": "string" },
155
+ "model": { "type": "string" }
156
+ },
157
+ "allOf": [
158
+ {
159
+ "if": { "properties": { "type": { "const": "command" } } },
160
+ "then": { "required": ["command"] }
161
+ },
162
+ {
163
+ "if": { "properties": { "type": { "const": "http" } } },
164
+ "then": { "required": ["url"] }
165
+ },
166
+ {
167
+ "if": { "properties": { "type": { "const": "mcp_tool" } } },
168
+ "then": { "required": ["server", "tool"] }
169
+ },
170
+ {
171
+ "if": { "properties": { "type": { "enum": ["prompt", "agent"] } } },
172
+ "then": { "required": ["prompt"] }
173
+ }
174
+ ]
175
+ }
71
176
  }
72
177
  }
@@ -44,7 +44,6 @@
44
44
  "execute",
45
45
  "verify",
46
46
  "review",
47
- "ship",
48
47
  "completed"
49
48
  ]
50
49
  },
@@ -57,8 +56,7 @@
57
56
  "tasks": { "$ref": "#/definitions/phaseStatus" },
58
57
  "execute": { "$ref": "#/definitions/phaseStatus" },
59
58
  "verify": { "$ref": "#/definitions/phaseStatus" },
60
- "review": { "$ref": "#/definitions/phaseStatus" },
61
- "ship": { "$ref": "#/definitions/phaseStatus" }
59
+ "review": { "$ref": "#/definitions/phaseStatus" }
62
60
  }
63
61
  },
64
62
  "execute_state": {
@@ -73,7 +71,34 @@
73
71
  "total_tasks": { "type": "integer", "minimum": 0 },
74
72
  "task_iteration": { "type": "integer", "minimum": 1 },
75
73
  "global_iteration": { "type": "integer", "minimum": 1 },
76
- "failed_attempts": { "type": "integer", "minimum": 0 }
74
+ "failed_attempts": { "type": "integer", "minimum": 0 },
75
+ "recovery_mode": {
76
+ "type": "string",
77
+ "enum": ["manual", "fix-task"],
78
+ "default": "manual"
79
+ },
80
+ "max_fix_tasks_per_original": {
81
+ "type": "integer",
82
+ "minimum": 1,
83
+ "maximum": 5,
84
+ "default": 2
85
+ },
86
+ "fix_task_map": {
87
+ "type": "object",
88
+ "description": "Per-original-task recovery attempts created by fix-task mode.",
89
+ "additionalProperties": {
90
+ "type": "object",
91
+ "required": ["attempts", "fix_task_ids"],
92
+ "properties": {
93
+ "attempts": { "type": "integer", "minimum": 0 },
94
+ "fix_task_ids": {
95
+ "type": "array",
96
+ "items": { "type": "string" }
97
+ },
98
+ "last_error": { "type": "string" }
99
+ }
100
+ }
101
+ }
77
102
  }
78
103
  },
79
104
  "decisions": {
package/settings.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "subagentStatusLine": {
3
+ "type": "command",
4
+ "command": "${CLAUDE_PLUGIN_ROOT}/hooks/scripts/subagent-statusline.sh"
5
+ }
6
+ }
@@ -2,7 +2,30 @@
2
2
  name: brownfield-index
3
3
  description: Use when the user needs structural understanding of an unfamiliar, inherited, legacy, or brownfield codebase.
4
4
  when_to_use: Triggers on "legacy code", "brownfield", "unfamiliar", "new to this code", "new to this project", "just joined", "inherited codebase", "explore codebase", "understand structure", "index code", "map modules", "tour", "onboard", "what is this project".
5
- allowed-tools: [Read, Grep, Glob, Bash]
5
+ argument-hint: "[path]"
6
+ context: fork
7
+ agent: flow-brownfield-analyst
8
+ paths:
9
+ - "package.json"
10
+ - "pnpm-workspace.yaml"
11
+ - "turbo.json"
12
+ - "nx.json"
13
+ - "pyproject.toml"
14
+ - "requirements*.txt"
15
+ - "go.mod"
16
+ - "Cargo.toml"
17
+ - "Gemfile"
18
+ - "composer.json"
19
+ - "pom.xml"
20
+ - "build.gradle*"
21
+ - "mix.exs"
22
+ - "deno.json*"
23
+ - "src/**"
24
+ - "lib/**"
25
+ - "app/**"
26
+ - "apps/**"
27
+ - "packages/**"
28
+ - "services/**"
6
29
  ---
7
30
 
8
31
  # Brownfield Index
@@ -16,41 +39,14 @@ You are invoked when the user needs a structural map of an existing codebase the
16
39
 
17
40
  ## Workflow
18
41
 
19
- ### Step 1: Detect project type
42
+ This skill runs in a forked context through `flow-brownfield-analyst`, which will:
20
43
 
21
- Read `package.json` / `Cargo.toml` / `pyproject.toml` / `go.mod` / `pom.xml` to classify the ecosystem and build tool. This determines which directory conventions to apply.
44
+ 1. Detect the actual stack from the repo's manifests.
45
+ 2. Scan structure, entry points, module boundaries, and developer-loop commands.
46
+ 3. Map API / CLI surfaces when they exist.
47
+ 4. Write `.flow/codebase-index.md` with concrete next actions.
22
48
 
23
- ### Step 2: Scan directory structure
24
-
25
- Produce a top-level inventory:
26
- - **Entry points** (main / index / bin scripts)
27
- - **Module directories** (src/, lib/, internal/, pkg/ …)
28
- - **Test directories**
29
- - **Config files**
30
- - **Tooling** (CI, lint, format configs)
31
-
32
- ### Step 3: Component inventory
33
-
34
- For each module directory, list:
35
- - Files and their apparent role (inferred from names + top-of-file comments)
36
- - Public exports / exported symbols
37
- - Third-party dependencies imported
38
-
39
- ### Step 4: API surface
40
-
41
- If HTTP / RPC endpoints exist, index them: route → handler → middleware. For CLI tools, index commands → handlers.
42
-
43
- ### Step 5: Write index document
44
-
45
- Output `.flow/codebase-index.md` containing:
46
- - **Overview** (project purpose, build tool, runtime)
47
- - **Directory tree** (with per-directory one-liner descriptions)
48
- - **Entry points** (where execution starts)
49
- - **Key abstractions** (core types, interfaces, classes that everything else hangs off)
50
- - **External dependencies** (grouped: prod runtime / dev tooling / transitive)
51
- - **Known gaps / red flags** (missing tests, TODOs, suspicious patterns)
52
-
53
- ### Step 6: Hand off
49
+ ### Hand off
54
50
 
55
51
  Point the user at the next useful action:
56
52
  - "Looking to add a feature here? Run `/curdx-flow:start <name>` to begin a spec."
@@ -58,6 +54,6 @@ Point the user at the next useful action:
58
54
 
59
55
  ## Notes
60
56
 
61
- This skill uses Read + Grep + Glob + Bash with no specialized agent — general tools are enough for structural discovery. The index is meant to be quick (5–10 minutes), not exhaustive.
57
+ The index is meant to be quick and decision-useful, not exhaustive.
62
58
 
63
59
  For deep research into a specific library or framework, use `context7` MCP directly.
@@ -2,7 +2,15 @@
2
2
  name: browser-qa
3
3
  description: Use when the user needs real-browser QA for a UI or frontend flow.
4
4
  when_to_use: Triggers on "browser test", "test in browser", "UI test", "e2e test", "frontend test", "accessibility", "a11y", "WCAG", "lighthouse", "performance audit", "console error", "network request", "cross-browser", "responsive", "mobile test", "visual regression", "screenshot".
5
- allowed-tools: [Read, Write, Bash, Grep, Glob, WebFetch]
5
+ argument-hint: "\"<url or user flow>\""
6
+ context: fork
7
+ agent: flow-qa-engineer
8
+ paths:
9
+ - "**/*.{html,css,scss,sass,less,js,jsx,ts,tsx,vue,svelte,astro}"
10
+ - "app/**"
11
+ - "pages/**"
12
+ - "components/**"
13
+ - "public/**"
6
14
  ---
7
15
 
8
16
  # Browser QA
@@ -23,9 +31,9 @@ Confirm with the user:
23
31
  - **Flow to test** (e.g., "sign up → dashboard → logout")
24
32
  - **What success looks like** (accessibility / performance / zero console errors / visual match)
25
33
 
26
- ### Step 2: Dispatch `flow-qa-engineer`
34
+ ### Step 2: Run via `flow-qa-engineer`
27
35
 
28
- Delegate to the `flow-qa-engineer` agent. It will:
36
+ This skill executes in a forked context through `flow-qa-engineer`. The agent will:
29
37
  1. Open the target URL via `mcp__chrome_devtools__new_page`
30
38
  2. Drive the flow with `mcp__chrome_devtools__click` / `fill` / `navigate_page`
31
39
  3. Capture `list_console_messages`, `list_network_requests`, `take_screenshot`, optionally `lighthouse_audit`
@@ -0,0 +1,82 @@
1
+ ---
2
+ name: cancel
3
+ description: Stop the active CurDX-Flow execution loop safely. Optional --delete-spec --yes removes the spec directory.
4
+ when_to_use: Use when the user wants to stop the current execution loop, abort a stuck run, or delete the active spec intentionally.
5
+ argument-hint: "[spec-name] [--delete-spec --yes]"
6
+ disable-model-invocation: true
7
+ allowed-tools: [Read, Bash]
8
+ ---
9
+
10
+ # CurdX-Flow Cancel
11
+
12
+ Safely stop an active execution loop. Default behavior is non-destructive: preserve spec files, tasks, progress, and artifacts.
13
+
14
+ ## Target Resolution
15
+
16
+ 1. If `$ARGUMENTS` includes a spec name, use `.flow/specs/<name>`.
17
+ 2. Otherwise read `.flow/.active-spec`.
18
+ 3. If no target exists, print `No active spec to cancel` and stop.
19
+
20
+ ## Default: Cancel Execution Loop Only
21
+
22
+ Default mode removes stop-hook/subagent execution state while preserving all human-readable artifacts:
23
+
24
+ 1. Read `.flow/specs/<target>/.state.json`.
25
+ 2. Use `Edit` or `Write` to set `phase` to `tasks`.
26
+ 3. Set `phase_status.execute` to `cancelled`.
27
+ 4. Remove `execute_state` and `strategy`.
28
+ 5. If the state file is missing, print `No execution state for <target>. Nothing to cancel.` and stop.
29
+
30
+ Do not rewrite `.state.json` with a Bash heredoc or ad-hoc Python writer; use checkpoint-tracked `Edit`/`Write` operations.
31
+
32
+ Append to `.progress.md`:
33
+
34
+ ```markdown
35
+ ## Execution Cancelled YYYY-MM-DD
36
+ - Cancelled by: /curdx-flow:cancel
37
+ - Preserved: research.md, requirements.md, design.md, tasks.md, progress, reports
38
+ - Resume: /curdx-flow:implement --strategy=subagent or /curdx-flow:spec --phase=tasks --regenerate
39
+ ```
40
+
41
+ ## Destructive Mode
42
+
43
+ Only delete the spec directory when both flags are present:
44
+
45
+ ```bash
46
+ /curdx-flow:cancel <spec-name> --delete-spec --yes
47
+ ```
48
+
49
+ If `--delete-spec` is present without `--yes`, do not delete. Print the exact command required.
50
+
51
+ Destructive mode:
52
+
53
+ 1. Print target path and files that will be removed.
54
+ 2. Delete `.flow/specs/<target>`.
55
+ 3. If it was active, remove `.flow/.active-spec`.
56
+ 4. Do not delete `.flow/PROJECT.md`, `.flow/CONTEXT.md`, `.flow/STATE.md`, or other specs.
57
+
58
+ ## Output
59
+
60
+ Default mode:
61
+
62
+ ```markdown
63
+ ✓ Cancelled execution loop: <spec-name>
64
+ State: execute → cancelled, phase → tasks
65
+ Preserved: spec artifacts and progress
66
+ Resume: /curdx-flow:implement --strategy=subagent
67
+ ```
68
+
69
+ Destructive mode:
70
+
71
+ ```markdown
72
+ ✓ Deleted spec: <spec-name>
73
+ Removed: .flow/specs/<spec-name>
74
+ Active spec cleared: yes|no
75
+ ```
76
+
77
+ ## Safety Rules
78
+
79
+ - Never delete a spec unless `--delete-spec --yes` is present.
80
+ - Never delete project-level `.flow` files.
81
+ - If state JSON is corrupt, rename it to `.state.json.corrupt.<timestamp>` instead of deleting it.
82
+ - Prefer `/curdx-flow:status` after cancel to confirm recovery state.
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: debug
3
- description: Systematic debugging 4-phase methodology (root cause pattern hypothesis → fix); three failures trigger architectural questioning. Routes to flow-debugger.
3
+ description: Debug bugs, test failures, and flaky behavior with a 4-phase root-cause workflow. Routes to flow-debugger.
4
+ when_to_use: Use when the user reports a bug, failing test, regression, stack trace, flaky behavior, or wants root-cause analysis instead of trial-and-error edits.
4
5
  argument-hint: "\"<bug description>\""
5
6
  disable-model-invocation: true
6
7
  context: fork
@@ -28,6 +29,7 @@ If `$ARGUMENTS` is empty, print `Usage: /curdx-flow:debug "<bug description>"` a
28
29
 
29
30
  - Read the error carefully (stack trace + message + location).
30
31
  - Build a minimal reproduction.
32
+ - Append `## Reality Check (BEFORE)` to `.flow/specs/<active>/.progress.md` with the exact reproduction command, observed failure output, and timestamp before changing code.
31
33
  - Check recent changes that could have introduced the bug.
32
34
  - Trace the data flow from cause to symptom.
33
35
  - **Exit condition**: state the root cause in **one sentence**.
@@ -54,7 +56,8 @@ If `$ARGUMENTS` is empty, print `Usage: /curdx-flow:debug "<bug description>"` a
54
56
  2. Fix the root cause (not the symptom). Confirm the failing test now
55
57
  passes. Commit `fix(<scope>): green - ...`.
56
58
  3. Run the full regression suite; no regressions allowed.
57
- 4. If Phase 2 classified as systemic, sweep for sibling occurrences and
59
+ 4. Re-run the original reproduction command and append `## Reality Check (AFTER)` to `.progress.md`; write `Verified: Issue resolved` only when BEFORE failed and AFTER passes or no longer shows the original failure.
60
+ 5. If Phase 2 classified as systemic, sweep for sibling occurrences and
58
61
  fix them in the same stage. Optional third commit
59
62
  `fix(<scope>): sweep - N similar cases`.
60
63
 
@@ -82,6 +85,7 @@ Recommended next step: <user action — review architecture, ship a
82
85
  - Prayer-driven programming (retry without a new hypothesis each round)
83
86
  - "Maybe it's ..." as a Phase 1 conclusion
84
87
  - A fix commit without a corresponding failing-test commit
88
+ - A fix claim without BEFORE/AFTER reality verification in `.progress.md`
85
89
  - Masking the root cause with null checks / try-catch
86
90
  - Fixing multiple unrelated things in one commit (one task = one commit)
87
91
 
@@ -2,7 +2,9 @@
2
2
  name: epic
3
3
  description: Use when the user needs to decompose a large feature into smaller vertical-slice specs with dependencies.
4
4
  when_to_use: Triggers on "epic", "big feature", "too big", "decompose", "break down", "break into", "split into", "multi-spec", "multiple features", "sub-features", "vertical slice", "parent feature", "large scope", "won't fit in one sprint", "needs splitting".
5
- allowed-tools: [Read, Write, Grep, Glob, Bash]
5
+ argument-hint: "\"<epic goal>\""
6
+ context: fork
7
+ agent: flow-triage-analyst
6
8
  ---
7
9
 
8
10
  # Epic Decomposition
@@ -23,9 +25,9 @@ Ask the user (or infer from context) for:
23
25
  - **One-sentence goal** of the whole epic
24
26
  - **Hard boundary**: what is explicitly out of scope for this epic
25
27
 
26
- ### Step 2: Dispatch `flow-triage-analyst`
28
+ ### Step 2: Run via `flow-triage-analyst`
27
29
 
28
- Delegate to the `flow-triage-analyst` agent with the epic name + goal + boundary. The agent returns:
30
+ This skill executes in a forked context through `flow-triage-analyst`. The agent returns:
29
31
  - A vertical-slice decomposition (not horizontal by layer)
30
32
  - Dependency graph between slices
31
33
  - Shared interfaces that must be frozen before parallel work begins
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: fast
3
3
  description: Ultra-fast execution — skip all spec phases and implement directly per the description. Suited for one-shot small tasks.
4
+ when_to_use: Use when the task is small, surgical, low-ambiguity, and not worth a full spec workflow.
4
5
  argument-hint: "\"<task description>\""
5
6
  disable-model-invocation: true
6
7
  allowed-tools: [Read, Write, Edit, Bash, Grep, Glob, Agent]
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: help
3
3
  description: Show CurdX-Flow command list, workflow overview, or troubleshooting guide. With a command name, show that command's detail.
4
+ when_to_use: Use when the user asks how CurdX-Flow works, which command to run, what a workflow does, or how to troubleshoot common issues.
4
5
  argument-hint: "[<command-name> | workflow | troubleshoot]"
5
6
  disable-model-invocation: true
6
7
  allowed-tools: [Read, Bash]
@@ -10,17 +11,19 @@ allowed-tools: [Read, Bash]
10
11
 
11
12
  ## No argument — quick overview
12
13
 
13
- Show the 9 core slash commands + 5 auto-invoked skills. Keep the table compact, use tabs for alignment.
14
+ Show the 11 core slash commands + 5 auto-invoked skills. Keep the table compact, use tabs for alignment.
14
15
 
15
16
  ```
16
17
  🚀 CurdX-Flow v2 — Claude Code Discipline Layer
17
18
 
18
- 9 slash commands (explicit control)
19
+ 11 slash commands (explicit control)
19
20
  ────────────────────────────────────
20
21
  /curdx-flow:init Initialize .flow/ in the current project
21
22
  /curdx-flow:start Create / resume / switch a feature spec
23
+ /curdx-flow:status Show active spec, phase, task progress, recovery hints
22
24
  /curdx-flow:spec Write or refresh the spec (--phase, --review, --regenerate)
23
25
  /curdx-flow:implement Execute the tasks (auto-routed strategy)
26
+ /curdx-flow:cancel Cancel execution loop safely; optional spec deletion
24
27
  /curdx-flow:verify Goal-backward verification — the differentiator
25
28
  /curdx-flow:review Two-stage code review (+ --adversarial, --edge-case)
26
29
  /curdx-flow:fast Skip the spec — one-shot small task
@@ -49,7 +52,7 @@ Show the 9 core slash commands + 5 auto-invoked skills. Keep the table compact,
49
52
 
50
53
  ## `<command-name>` — command detail
51
54
 
52
- When the argument matches a slash name — one of the 9 primary workflows or one of the 5 auto-invoked skills — read the corresponding body and present it cleanly. The lookup tries the `skills/` layout first and falls back to the legacy `commands/` layout, which keeps help correct throughout the Phase 3 migration window:
55
+ When the argument matches a slash name — one of the 11 slash commands or one of the 5 auto-invoked skills — read the corresponding body and present it cleanly. The lookup tries the `skills/` layout first and falls back to the legacy `commands/` layout for older installed bundles:
53
56
 
54
57
  ```bash
55
58
  CMD="$ARGUMENTS"
@@ -60,13 +63,13 @@ elif [ -f "${CLAUDE_PLUGIN_ROOT}/commands/${CMD}.md" ]; then
60
63
  cat "${CLAUDE_PLUGIN_ROOT}/commands/${CMD}.md"
61
64
  else
62
65
  echo "Unknown: ${CMD}"
63
- echo "Workflows: init start spec implement verify review fast debug help"
66
+ echo "Workflows: init start status spec implement cancel verify review fast debug help"
64
67
  echo "Skills: epic browser-qa ui-sketch security-audit brownfield-index"
65
68
  exit 1
66
69
  fi
67
70
  ```
68
71
 
69
- If the argument isn't a known slash name, the block above prints the 14 candidates.
72
+ If the argument isn't a known slash name, the block above prints the 16 candidates.
70
73
 
71
74
  ## `workflow` — standard workflow
72
75
 
@@ -81,6 +84,7 @@ If the argument isn't a known slash name, the block above prints the 14 candidat
81
84
 
82
85
  3. Per feature — the main loop
83
86
  ├─ /curdx-flow:start my-feature "one-line goal"
87
+ ├─ /curdx-flow:status ← optional: see active spec + recovery hints
84
88
  ├─ /curdx-flow:spec ← research → requirements → design → tasks
85
89
  ├─ (optional) /curdx-flow:spec --review ← add multi-dim planning review
86
90
  ├─ /curdx-flow:implement ← execute tasks
@@ -121,13 +125,15 @@ A: v1.1.5+ defaults to offline install (bundled plugin body).
121
125
  Force-online: npx @curdx/flow install --online
122
126
 
123
127
  Q: claude-mem MCP keeps failing?
124
- A: It needs bun. Run: npx @curdx/flow doctor — it auto-symlinks bun if installed.
128
+ A: It needs bun. Run: npx @curdx/flow doctor
129
+ If doctor reports bun/uv is installed but not on PATH, run:
130
+ npx @curdx/flow doctor --fix
125
131
 
126
132
  Q: /curdx-flow:init says .flow/ already exists?
127
133
  A: Use --force, or run /curdx-flow:start directly to begin a new spec in the existing .flow/.
128
134
 
129
135
  Q: Skills don't auto-invoke reliably?
130
- A: Invoke explicitly — every skill also has a /skill-name slash. E.g., /curdx-flow:security-audit.
136
+ A: Invoke explicitly — plugin skills are namespaced. E.g., /curdx-flow:security-audit.
131
137
 
132
138
  Q: I want the old v1 commands (research, plan-ceo, party…).
133
139
  A: They're removed in v2. See MIGRATION.md for mappings, or stay on 1.x:
@@ -140,6 +146,10 @@ A: Your spec mode decides gate strictness. Lower via:
140
146
  Q: Where are decisions logged?
141
147
  A: .flow/STATE.md (D-NN entries). Edit directly — no slash command needed.
142
148
 
149
+ Q: Stop-hook or execution loop seems stuck?
150
+ A: Run /curdx-flow:status. If state/tasks disagree, run /curdx-flow:cancel, then resume with:
151
+ /curdx-flow:implement --strategy=subagent
152
+
143
153
  Q: File a bug / request feature
144
154
  A: https://github.com/curdx/curdx-flow/issues
145
155
  ```
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: implement
3
3
  description: Execute spec tasks — the Strategy Router picks linear/subagent/stop-hook/wave based on task characteristics. Atomic commit per task.
4
+ when_to_use: Use when the active spec already has tasks and the user wants execution, optionally with a chosen strategy or a single task id.
4
5
  argument-hint: "[spec-name] [--strategy=auto|linear|subagent|stop-hook|wave] [--task=<id>] [--quick]"
5
6
  disable-model-invocation: true
6
7
  allowed-tools: [Read, Write, Edit, Bash, Agent, Grep, Glob]
@@ -45,9 +46,9 @@ DIR=".flow/specs/$SPEC_NAME"
45
46
  ## Step 2: Parse Task Characteristics from tasks.md
46
47
 
47
48
  ```bash
48
- TOTAL=$(grep -c "^- \[ \] \*\*" "$DIR/tasks.md")
49
- DONE=$(grep -c "^- \[x\] \*\*" "$DIR/tasks.md")
50
- REMAINING=$((TOTAL))
49
+ TOTAL=$(grep -Ec "^- \[[ xX]\] \*\*" "$DIR/tasks.md")
50
+ DONE=$(grep -Ec "^- \[[xX]\] \*\*" "$DIR/tasks.md")
51
+ REMAINING=$((TOTAL - DONE))
51
52
  PARALLEL=$(grep -c "^- \[ \] \*\*.*\[P\]" "$DIR/tasks.md")
52
53
  SEQUENTIAL=$(grep -c "^- \[ \] \*\*.*\[SEQUENTIAL\]" "$DIR/tasks.md")
53
54
 
@@ -88,6 +89,13 @@ echo "✓ Selected strategy: $STRATEGY"
88
89
  import json
89
90
  p = f'.flow/specs/{SPEC_NAME}/.state.json'
90
91
  s = json.load(open(p))
92
+ try:
93
+ cfg = json.load(open('.flow/config.json'))
94
+ except Exception:
95
+ cfg = {}
96
+ execution_cfg = cfg.get('execution', {}) if isinstance(cfg, dict) else {}
97
+ recovery_mode = execution_cfg.get('recovery_mode', 'manual')
98
+ max_fix_tasks = execution_cfg.get('max_fix_tasks_per_original', 2)
91
99
  s['phase'] = 'execute'
92
100
  s['strategy'] = STRATEGY
93
101
  s.setdefault('phase_status', {})['execute'] = 'in_progress'
@@ -96,6 +104,9 @@ s['execute_state'].setdefault('task_index', DONE)
96
104
  s['execute_state']['total_tasks'] = TOTAL
97
105
  s['execute_state'].setdefault('failed_attempts', 0)
98
106
  s['execute_state'].setdefault('global_iteration', 1)
107
+ s['execute_state'].setdefault('recovery_mode', recovery_mode)
108
+ s['execute_state'].setdefault('max_fix_tasks_per_original', max_fix_tasks)
109
+ s['execute_state'].setdefault('fix_task_map', {})
99
110
  if QUICK:
100
111
  s['quickMode'] = True
101
112
  json.dump(s, open(p, 'w'), indent=2, ensure_ascii=False)
@@ -184,6 +195,8 @@ Configuration under `.flow/config.json.execution`: `strategy: "wave"`, `max_para
184
195
  5. Repeat until ALL_TASKS_COMPLETE or 3 failures
185
196
  ```
186
197
 
198
+ Stop-hook completion is double-checked: `.state.json` must say execute is complete AND `tasks.md` must have zero unchecked tasks. If either disagrees, the hook blocks and resumes the first unchecked task. During a stop-hook continuation, `stop_hook_active=true` is only a context signal; the hook still evaluates transcript signals, `.state.json`, and `tasks.md` parity before deciding whether to continue or stop.
199
+
187
200
  Prerequisites:
188
201
  - `--quick` must be set (otherwise AskUserQuestion will block the loop)
189
202
  - `.flow/config.json` or `.state.json` must have strategy=stop-hook
@@ -218,9 +231,27 @@ if all tasks done:
218
231
  ## Error Recovery
219
232
 
220
233
  - Verify field in tasks.md is "manual" → stop, suggest re-running `/curdx-flow:spec --phase=tasks --regenerate` to fix
234
+ - `TASK_FAILED` default (`recovery_mode: manual`) → do not skip the task; root-cause, retry the first unchecked task, stop at 3 failures
235
+ - `TASK_FAILED` with `recovery_mode: fix-task` → insert one targeted `[FIX <task_id>]` task immediately after the failed task, update `execute_state.fix_task_map`, execute that fix task, then retry the original task; never exceed `max_fix_tasks_per_original`
221
236
  - 3 consecutive TASK_FAILED → stop, prompt for user intervention
222
237
  - git operation failure → stop immediately, do not continue (avoid state corruption)
223
238
  - Test framework not found (npm test not found) → stop, suggest running npx @curdx/flow doctor
239
+ - State says complete but tasks.md still has unchecked tasks → trust tasks.md, continue remaining unchecked tasks only
240
+
241
+ ### Fix-Task Recovery Format
242
+
243
+ When enabled, generated recovery tasks must be narrowly scoped and traceable:
244
+
245
+ ```markdown
246
+ - [ ] **<task_id>.<n>** [FIX <task_id>] Fix: <short root cause>
247
+ - **Do**: <specific repair steps>
248
+ - **Files**: <same declared files or narrower>
249
+ - **Done when**: Original failure no longer reproduces
250
+ - **Verify**: <original verify command or tighter reproduction>
251
+ - **Commit**: `fix(<scope>): address <failure>`
252
+ ```
253
+
254
+ Do not execute a newly generated fix task in the same breath that creates it unless the task is already written to `tasks.md` and `fix_task_map` has been updated. The ledger stays ahead of execution.
224
255
 
225
256
  ## Output to User
226
257
 
@@ -233,9 +264,9 @@ Commits: M atomic commits
233
264
  Verify passed: K / K
234
265
 
235
266
  Next steps:
236
- - /curdx-flow:verify — goal-driven reverse verification (after Phase 3 ships)
237
- - If verify is not needed, go directly to /curdx-flow:ship (after Phase 6 ships)
267
+ - /curdx-flow:verify — goal-driven reverse verification
268
+ - /curdx-flow:review — two-stage code review after verification
238
269
 
239
- Phase 3 (Gates & Review) has not yet shipped.
240
- You may manually review .flow/specs/$SPEC_NAME/ and git log to confirm quality.
270
+ Do not claim the feature is shipped from execute alone. Execute completes tasks;
271
+ verify proves user-visible goals; review checks implementation quality.
241
272
  ```