@curdx/flow 3.0.0 → 3.1.0

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 (219) hide show
  1. package/CHANGELOG.md +21 -87
  2. package/LICENSE +1 -1
  3. package/README.md +28 -129
  4. package/dist/index.mjs +995 -0
  5. package/package.json +33 -44
  6. package/.claude-plugin/marketplace.json +0 -48
  7. package/.claude-plugin/plugin.json +0 -52
  8. package/agent-preamble/preamble.md +0 -314
  9. package/agents/flow-adversary.md +0 -203
  10. package/agents/flow-architect.md +0 -198
  11. package/agents/flow-brownfield-analyst.md +0 -143
  12. package/agents/flow-debugger.md +0 -321
  13. package/agents/flow-edge-hunter.md +0 -289
  14. package/agents/flow-executor.md +0 -269
  15. package/agents/flow-orchestrator.md +0 -145
  16. package/agents/flow-planner.md +0 -247
  17. package/agents/flow-product-designer.md +0 -159
  18. package/agents/flow-qa-engineer.md +0 -282
  19. package/agents/flow-researcher.md +0 -166
  20. package/agents/flow-reviewer.md +0 -304
  21. package/agents/flow-security-auditor.md +0 -401
  22. package/agents/flow-triage-analyst.md +0 -272
  23. package/agents/flow-ui-researcher.md +0 -230
  24. package/agents/flow-ux-designer.md +0 -221
  25. package/agents/flow-verifier.md +0 -350
  26. package/bin/curdx-flow +0 -5
  27. package/bin/curdx-flow-state +0 -104
  28. package/bin/curdx-flow.js +0 -54
  29. package/cli/README.md +0 -104
  30. package/cli/doctor-workflow.js +0 -483
  31. package/cli/doctor.js +0 -73
  32. package/cli/help.js +0 -59
  33. package/cli/install-bundled-mcps.js +0 -37
  34. package/cli/install-companions.js +0 -19
  35. package/cli/install-context7-config.js +0 -80
  36. package/cli/install-curdx-plugin.js +0 -96
  37. package/cli/install-language.js +0 -35
  38. package/cli/install-next-steps.js +0 -29
  39. package/cli/install-options.js +0 -9
  40. package/cli/install-paths.js +0 -52
  41. package/cli/install-recommended-plugins.js +0 -104
  42. package/cli/install-required-plugins.js +0 -57
  43. package/cli/install-self-update.js +0 -62
  44. package/cli/install-workflow.js +0 -209
  45. package/cli/install.js +0 -101
  46. package/cli/lib/claude-commands.js +0 -41
  47. package/cli/lib/claude-ops.js +0 -47
  48. package/cli/lib/claude.js +0 -183
  49. package/cli/lib/config.js +0 -24
  50. package/cli/lib/doctor-claude-settings.js +0 -1186
  51. package/cli/lib/doctor-report.js +0 -978
  52. package/cli/lib/doctor-runtime-environment.js +0 -196
  53. package/cli/lib/frontmatter.js +0 -44
  54. package/cli/lib/json-schema.js +0 -57
  55. package/cli/lib/logging.js +0 -25
  56. package/cli/lib/process.js +0 -60
  57. package/cli/lib/prompts.js +0 -135
  58. package/cli/lib/runtime.js +0 -107
  59. package/cli/lib/semver.js +0 -109
  60. package/cli/lib/version.js +0 -12
  61. package/cli/protocols-body.md +0 -22
  62. package/cli/protocols.js +0 -162
  63. package/cli/registry.js +0 -123
  64. package/cli/router.js +0 -49
  65. package/cli/uninstall-actions.js +0 -360
  66. package/cli/uninstall-workflow.js +0 -146
  67. package/cli/uninstall.js +0 -42
  68. package/cli/upgrade-workflow.js +0 -80
  69. package/cli/upgrade.js +0 -91
  70. package/cli/utils.js +0 -40
  71. package/gates/adversarial-review-gate.md +0 -219
  72. package/gates/coverage-audit-gate.md +0 -182
  73. package/gates/devex-gate.md +0 -254
  74. package/gates/edge-case-gate.md +0 -194
  75. package/gates/karpathy-gate.md +0 -130
  76. package/gates/security-gate.md +0 -218
  77. package/gates/tdd-gate.md +0 -182
  78. package/gates/test-quality-gate.md +0 -59
  79. package/gates/verification-gate.md +0 -179
  80. package/hooks/hooks.json +0 -130
  81. package/hooks/scripts/common.sh +0 -237
  82. package/hooks/scripts/config-change-guard.sh +0 -94
  83. package/hooks/scripts/flow-context-watch.sh +0 -94
  84. package/hooks/scripts/inject-karpathy.sh +0 -53
  85. package/hooks/scripts/quick-mode-guard.sh +0 -69
  86. package/hooks/scripts/session-start.sh +0 -94
  87. package/hooks/scripts/session-title.sh +0 -87
  88. package/hooks/scripts/stop-watcher.sh +0 -231
  89. package/hooks/scripts/subagent-artifact-guard.sh +0 -92
  90. package/hooks/scripts/subagent-statusline.sh +0 -111
  91. package/hooks/scripts/task-lifecycle-guard.sh +0 -106
  92. package/hooks/scripts/teammate-idle-guard.sh +0 -83
  93. package/knowledge/artifact-output-discipline.md +0 -24
  94. package/knowledge/artifact-summary-contracts.md +0 -50
  95. package/knowledge/atomic-commits.md +0 -262
  96. package/knowledge/claude-code-runtime-contracts.md +0 -240
  97. package/knowledge/epic-decomposition.md +0 -307
  98. package/knowledge/execution-strategies.md +0 -303
  99. package/knowledge/karpathy-guidelines.md +0 -219
  100. package/knowledge/planning-reviews.md +0 -211
  101. package/knowledge/poc-first-workflow.md +0 -223
  102. package/knowledge/review-feedback-intake.md +0 -57
  103. package/knowledge/spec-driven-development.md +0 -180
  104. package/knowledge/systematic-debugging.md +0 -378
  105. package/knowledge/two-stage-review.md +0 -249
  106. package/knowledge/wave-execution.md +0 -403
  107. package/monitors/monitors.json +0 -8
  108. package/monitors/scripts/flow-state-monitor.sh +0 -102
  109. package/output-styles/curdx-evidence-first.md +0 -34
  110. package/output-styles/curdx-fast-mode.md +0 -42
  111. package/output-styles/curdx-spec-mode.md +0 -46
  112. package/schemas/agent-frontmatter.schema.json +0 -66
  113. package/schemas/config.schema.json +0 -134
  114. package/schemas/gate-frontmatter.schema.json +0 -30
  115. package/schemas/hooks.schema.json +0 -115
  116. package/schemas/output-style-frontmatter.schema.json +0 -22
  117. package/schemas/plugin-manifest.schema.json +0 -436
  118. package/schemas/plugin-settings.schema.json +0 -29
  119. package/schemas/skill-frontmatter.schema.json +0 -177
  120. package/schemas/spec-frontmatter.schema.json +0 -42
  121. package/schemas/spec-state.schema.json +0 -165
  122. package/settings.json +0 -8
  123. package/skills/brownfield-index/SKILL.md +0 -53
  124. package/skills/brownfield-index/references/applicability.md +0 -12
  125. package/skills/brownfield-index/references/handoff.md +0 -8
  126. package/skills/brownfield-index/references/index-contract.md +0 -10
  127. package/skills/browser-qa/SKILL.md +0 -39
  128. package/skills/browser-qa/references/handoff.md +0 -6
  129. package/skills/browser-qa/references/prerequisites.md +0 -10
  130. package/skills/browser-qa/references/qa-contract.md +0 -20
  131. package/skills/cancel/SKILL.md +0 -41
  132. package/skills/cancel/references/destructive-mode.md +0 -17
  133. package/skills/cancel/references/reporting.md +0 -18
  134. package/skills/cancel/references/state-recovery.md +0 -30
  135. package/skills/cancel/references/target-resolution.md +0 -7
  136. package/skills/debug/SKILL.md +0 -45
  137. package/skills/debug/references/context-gathering.md +0 -11
  138. package/skills/debug/references/failure-guard.md +0 -25
  139. package/skills/debug/references/intake.md +0 -12
  140. package/skills/debug/references/phase-workflow.md +0 -34
  141. package/skills/debug/references/reporting.md +0 -20
  142. package/skills/epic/SKILL.md +0 -39
  143. package/skills/epic/references/epic-artifacts.md +0 -20
  144. package/skills/epic/references/epic-intake.md +0 -9
  145. package/skills/epic/references/slice-handoff.md +0 -16
  146. package/skills/fast/SKILL.md +0 -62
  147. package/skills/fast/references/applicability.md +0 -25
  148. package/skills/fast/references/clarification.md +0 -20
  149. package/skills/fast/references/execution-contract.md +0 -56
  150. package/skills/help/SKILL.md +0 -55
  151. package/skills/help/references/dispatch.md +0 -20
  152. package/skills/help/references/overview.md +0 -39
  153. package/skills/help/references/troubleshoot.md +0 -47
  154. package/skills/help/references/workflow.md +0 -37
  155. package/skills/implement/SKILL.md +0 -104
  156. package/skills/implement/references/error-recovery.md +0 -36
  157. package/skills/implement/references/linear-execution.md +0 -43
  158. package/skills/implement/references/native-task-sync.md +0 -107
  159. package/skills/implement/references/preflight.md +0 -43
  160. package/skills/implement/references/progress-contract.md +0 -36
  161. package/skills/implement/references/state-init.md +0 -36
  162. package/skills/implement/references/stop-hook-execution.md +0 -50
  163. package/skills/implement/references/strategy-router.md +0 -38
  164. package/skills/implement/references/subagent-execution.md +0 -57
  165. package/skills/implement/references/wave-execution.md +0 -180
  166. package/skills/init/SKILL.md +0 -49
  167. package/skills/init/references/gitignore-and-health.md +0 -26
  168. package/skills/init/references/next-steps.md +0 -22
  169. package/skills/init/references/preflight.md +0 -15
  170. package/skills/init/references/scaffold-contract.md +0 -27
  171. package/skills/review/SKILL.md +0 -82
  172. package/skills/review/references/optional-passes.md +0 -48
  173. package/skills/review/references/preflight.md +0 -38
  174. package/skills/review/references/report-contract.md +0 -49
  175. package/skills/review/references/reporting.md +0 -20
  176. package/skills/review/references/stage-execution.md +0 -32
  177. package/skills/security-audit/SKILL.md +0 -47
  178. package/skills/security-audit/references/audit-contract.md +0 -21
  179. package/skills/security-audit/references/gate-handoff.md +0 -8
  180. package/skills/security-audit/references/scope-and-depth.md +0 -9
  181. package/skills/spec/SKILL.md +0 -100
  182. package/skills/spec/references/artifact-landing.md +0 -31
  183. package/skills/spec/references/phase-execution.md +0 -50
  184. package/skills/spec/references/planning-review.md +0 -31
  185. package/skills/spec/references/preflight-and-routing.md +0 -46
  186. package/skills/spec/references/reporting.md +0 -21
  187. package/skills/start/SKILL.md +0 -84
  188. package/skills/start/references/branch-routing.md +0 -51
  189. package/skills/start/references/mode-semantics.md +0 -12
  190. package/skills/start/references/preflight.md +0 -13
  191. package/skills/start/references/reporting.md +0 -20
  192. package/skills/start/references/state-seeding.md +0 -44
  193. package/skills/start/references/workflow-handoff.md +0 -26
  194. package/skills/status/SKILL.md +0 -41
  195. package/skills/status/references/gather-contract.md +0 -30
  196. package/skills/status/references/health-rules.md +0 -27
  197. package/skills/status/references/output-contract.md +0 -25
  198. package/skills/status/references/preflight.md +0 -10
  199. package/skills/status/references/recovery-hints.md +0 -18
  200. package/skills/ui-sketch/SKILL.md +0 -39
  201. package/skills/ui-sketch/references/brief-intake.md +0 -10
  202. package/skills/ui-sketch/references/iteration-handoff.md +0 -5
  203. package/skills/ui-sketch/references/variant-contract.md +0 -15
  204. package/skills/verify/SKILL.md +0 -56
  205. package/skills/verify/references/evidence-workflow.md +0 -39
  206. package/skills/verify/references/output-contract.md +0 -23
  207. package/skills/verify/references/preflight.md +0 -11
  208. package/skills/verify/references/report-handoff.md +0 -35
  209. package/skills/verify/references/strict-mode.md +0 -12
  210. package/templates/CONTEXT.md.tmpl +0 -53
  211. package/templates/PROJECT.md.tmpl +0 -59
  212. package/templates/ROADMAP.md.tmpl +0 -50
  213. package/templates/STATE.md.tmpl +0 -49
  214. package/templates/config.json.tmpl +0 -51
  215. package/templates/design.md.tmpl +0 -83
  216. package/templates/progress.md.tmpl +0 -77
  217. package/templates/requirements.md.tmpl +0 -76
  218. package/templates/research.md.tmpl +0 -83
  219. package/templates/tasks.md.tmpl +0 -107
@@ -1,107 +0,0 @@
1
- # Native Task Sync — Mirror `.flow` Execution Into Claude's Task List
2
-
3
- Use this layer only as an interactive UX mirror. `.flow/specs/<name>/tasks.md`
4
- and `.state.json` remain the source of truth.
5
-
6
- ## Availability Rule
7
-
8
- If the current session exposes `TaskCreate`, `TaskList`, and `TaskUpdate`, keep
9
- Claude's native task list aligned with the active spec. If those tools are not
10
- available (for example in headless or bare flows), skip all native sync work
11
- silently and continue with the disk-backed protocol.
12
-
13
- ## State Fields
14
-
15
- Track best-effort sync state under `.state.json` `execute_state`:
16
-
17
- - `native_task_map`: `{ "<task-id>": "<claude-task-id>" }`
18
- - `native_sync_enabled`: `true | false`
19
- - `native_sync_failure_count`: integer
20
-
21
- Default behavior:
22
-
23
- - missing fields -> treat as first-run and initialize them
24
- - `native_sync_enabled = false` -> never attempt native task sync again in this
25
- execution run unless the user explicitly resets state
26
-
27
- ## First Sync
28
-
29
- After preflight and execute-state initialization:
30
-
31
- 1. If native sync is available and `native_task_map` is empty, parse every task
32
- row from `tasks.md`.
33
- 2. Create one Claude native task per CurDX task.
34
- 3. Use the CurDX task id in the subject:
35
- - regular: `1.2 Add retry guard`
36
- - parallel: `[P] 2.1 Build auth DTOs`
37
- - verification: `[VERIFY] 3.VF Re-run original repro`
38
- 4. Use a compact description built from:
39
- - `Done when`
40
- - `Verify`
41
- 5. Immediately mark already-checked `[x]` tasks as `completed`.
42
- 6. Persist the returned Claude task ids in `native_task_map`.
43
-
44
- When interactive hook support is available, CurDX also uses `TaskCreated` as a
45
- guardrail:
46
-
47
- - reject CurDX-shaped native tasks whose subject does not map to a real
48
- `tasks.md` id
49
- - reject CurDX-shaped native tasks that omit the compact description derived
50
- from `Done when` + `Verify`
51
-
52
- Do not block execution if task creation fails. Increment
53
- `native_sync_failure_count`, log one short note in `.progress.md`, and continue.
54
-
55
- ## Rebuild Rule
56
-
57
- If a stored Claude task id no longer updates cleanly, assume the current
58
- session is attached to a different native task list:
59
-
60
- 1. clear `native_task_map`
61
- 2. recreate the native tasks from the current `tasks.md`
62
- 3. keep `.flow` execution state unchanged
63
-
64
- This recovers from session changes without corrupting the real spec ledger.
65
-
66
- ## Per-Task Sync
67
-
68
- Before dispatching the current task:
69
-
70
- 1. reconcile `tasks.md` `[x]` rows against native task state when obvious drift
71
- exists
72
- 2. mark the current native task `in_progress`
73
- 3. set `activeForm` to `Executing <task-id>`
74
-
75
- After `TASK_COMPLETE` and after disk-backed verification/state updates pass:
76
-
77
- 1. mark that native task `completed`
78
- 2. reset `native_sync_failure_count` toward zero on success
79
-
80
- When interactive hook support is available, `TaskCompleted` should also reject
81
- any CurDX-shaped native task completion that happens before `tasks.md` marks the
82
- same task id as checked.
83
-
84
- After `TASK_FAILED`:
85
-
86
- 1. leave the current task visible
87
- 2. update `activeForm` to `Retrying <task-id>` when the tool call is available
88
- 3. never advance the native task to `completed`
89
-
90
- ## Completion Rule
91
-
92
- When execute finishes:
93
-
94
- 1. ensure every checked task in `tasks.md` is `completed` in the native list
95
- 2. do not invent native tasks for verify/review phases here
96
- 3. keep the final chat summary short; the native task list is only a progress
97
- surface, not the evidence surface
98
-
99
- ## Guardrails
100
-
101
- - Native sync is best-effort UX, not correctness.
102
- - Never trust the native task list over `tasks.md`.
103
- - Never stop a CurDX run solely because `TaskCreate` or `TaskUpdate` failed.
104
- - Native task lifecycle guards are allowed to reject malformed CurDX-native
105
- tasks, but they must not interfere with unrelated non-CurDX task-list usage.
106
- - Do not use `TodoWrite` here; interactive Claude sessions should prefer the
107
- current Task tool family.
@@ -1,43 +0,0 @@
1
- # Implement Preflight — Resolve Scope and Task Stats
2
-
3
- Before selecting a strategy:
4
-
5
- ```bash
6
- [ ! -d ".flow" ] && { echo "✗ Not a CurdX-Flow project. Run /curdx-flow:init first"; exit 1; }
7
-
8
- ARGS="$ARGUMENTS"
9
- SPEC_NAME=""
10
- STRATEGY="auto"
11
- TASK_ID=""
12
- QUICK=0
13
-
14
- for arg in $ARGS; do
15
- case "$arg" in
16
- --strategy=*) STRATEGY="${arg#--strategy=}" ;;
17
- --task=*) TASK_ID="${arg#--task=}" ;;
18
- --quick) QUICK=1 ;;
19
- --*) ;;
20
- *) SPEC_NAME="$arg" ;;
21
- esac
22
- done
23
-
24
- [ -z "$SPEC_NAME" ] && SPEC_NAME=$(cat .flow/.active-spec 2>/dev/null)
25
- [ -z "$SPEC_NAME" ] && { echo "✗ No active spec. Run /curdx-flow:start first"; exit 1; }
26
-
27
- DIR=".flow/specs/$SPEC_NAME"
28
- [ ! -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; }
29
-
30
- TOTAL=$(grep -Ec "^- \[[ xX]\] \*\*" "$DIR/tasks.md")
31
- DONE=$(grep -Ec "^- \[[xX]\] \*\*" "$DIR/tasks.md")
32
- REMAINING=$((TOTAL - DONE))
33
- PARALLEL=$(grep -c "^- \[ \] \*\*.*\[P\]" "$DIR/tasks.md")
34
- SEQUENTIAL=$(grep -c "^- \[ \] \*\*.*\[SEQUENTIAL\]" "$DIR/tasks.md")
35
- ```
36
-
37
- These counters are part of the runtime contract:
38
-
39
- - `TOTAL` = all declared task rows
40
- - `DONE` = checked task rows
41
- - `REMAINING` = `TOTAL - DONE`
42
- - `PARALLEL` = unchecked `[P]` tasks
43
- - `SEQUENTIAL` = unchecked `[SEQUENTIAL]` tasks
@@ -1,36 +0,0 @@
1
- # Implement Progress Contract — Mid-Run and Completion Output
2
-
3
- At each wave boundary, retry, or long linear stretch, print:
4
-
5
- ```text
6
- ═════ Progress ═════
7
- Spec: $SPEC_NAME
8
- Strategy: $STRATEGY
9
- Done: X / $TOTAL
10
- Recent commits:
11
- - abc123f feat(auth): ...
12
- - def456g test(auth): ...
13
- ════════════════════
14
- ```
15
-
16
- If native task sync is active, the Claude task list should mirror this same
17
- progress state. Do not duplicate long task inventories in chat just because the
18
- task list UI exists.
19
-
20
- When all tasks are complete:
21
-
22
- ```text
23
- ✓ execute phase complete: $SPEC_NAME
24
-
25
- Strategy: $STRATEGY
26
- Tasks done: N / N
27
- Commits: M atomic commits
28
- Verify passed: K / K
29
-
30
- Next steps:
31
- - /curdx-flow:verify — goal-driven reverse verification
32
- - /curdx-flow:review — two-stage code review after verification
33
- ```
34
-
35
- Do not claim the feature is shipped from execute alone. Execute completes
36
- tasks; verify proves user-visible goals; review checks implementation quality.
@@ -1,36 +0,0 @@
1
- # Implement State Init — Seed execute_state Before Running
2
-
3
- After strategy selection and before execution begins:
4
-
5
- ```python
6
- import json
7
- p = f'.flow/specs/{SPEC_NAME}/.state.json'
8
- s = json.load(open(p))
9
- try:
10
- cfg = json.load(open('.flow/config.json'))
11
- except Exception:
12
- cfg = {}
13
- execution_cfg = cfg.get('execution', {}) if isinstance(cfg, dict) else {}
14
- recovery_mode = execution_cfg.get('recovery_mode', 'manual')
15
- max_fix_tasks = execution_cfg.get('max_fix_tasks_per_original', 2)
16
- s['phase'] = 'execute'
17
- s['strategy'] = STRATEGY
18
- s.setdefault('phase_status', {})['execute'] = 'in_progress'
19
- s.setdefault('execute_state', {})
20
- s['execute_state'].setdefault('task_index', DONE)
21
- s['execute_state']['total_tasks'] = TOTAL
22
- s['execute_state'].setdefault('failed_attempts', 0)
23
- s['execute_state'].setdefault('global_iteration', 1)
24
- s['execute_state'].setdefault('recovery_mode', recovery_mode)
25
- s['execute_state'].setdefault('max_fix_tasks_per_original', max_fix_tasks)
26
- s['execute_state'].setdefault('fix_task_map', {})
27
- s['execute_state'].setdefault('native_task_map', {})
28
- s['execute_state'].setdefault('native_sync_enabled', True)
29
- s['execute_state'].setdefault('native_sync_failure_count', 0)
30
- if QUICK:
31
- s['quickMode'] = True
32
- json.dump(s, open(p, 'w'), indent=2, ensure_ascii=False)
33
- ```
34
-
35
- The execute-state ledger must be initialized before any task dispatch so hooks,
36
- recovery, and status views observe the same state transition.
@@ -1,50 +0,0 @@
1
- # Stop-Hook Execution — Hook-Driven Continuation
2
-
3
- Use this mode for long unattended runs where each execution round should end
4
- naturally and the hook layer decides whether Claude continues.
5
-
6
- ## Protocol
7
-
8
- ```text
9
- 1. Initialize execute_state, including native sync fields
10
- 2. Rebuild native_task_map if the current session cannot update stored task ids
11
- 3. Execute 1 task (inline or via flow-executor, then wait for completion)
12
- 4. End the response naturally
13
- 5. stop-watcher.sh evaluates transcript markers, .state.json, and tasks.md
14
- 6. If unchecked tasks remain, the hook blocks stop and injects continuation
15
- 7. Repeat until ALL_TASKS_COMPLETE or recovery forces a halt
16
- ```
17
-
18
- ## Completion Invariant
19
-
20
- Stop-hook completion is double-checked:
21
-
22
- - `.state.json` must say execute is complete
23
- - `tasks.md` must have zero unchecked tasks
24
-
25
- If either side disagrees, the hook resumes the first unchecked task instead of
26
- allowing the session to stop cleanly.
27
-
28
- If native task sync is active during a continuation round:
29
-
30
- - `.flow/specs/<name>/tasks.md` stays the source of truth
31
- - checked rows should be mirrored back to the native task list before the next
32
- task starts
33
- - a stale `native_task_map` should trigger the rebuild rule from
34
- `references/native-task-sync.md`, not a run failure
35
-
36
- ## Prerequisites
37
-
38
- - `--quick` should be set; otherwise `AskUserQuestion` can stall the loop
39
- - `.flow/config.json` or `.state.json` should pin `strategy=stop-hook`
40
- - The hook layer must remain the final authority for continuation
41
-
42
- ## Context Signal
43
-
44
- During a stop-hook continuation, `stop_hook_active=true` is only a hint. The
45
- hook still checks transcript signals, `.state.json`, and `tasks.md` parity
46
- before deciding whether to continue or stop.
47
-
48
- Native task sync is session-local UX. Continuations may resume into a different
49
- Claude-native task list, so recovery must prefer rebuilding the UI mirror over
50
- mutating `.flow` state.
@@ -1,38 +0,0 @@
1
- # Strategy Router — Selection Rules
2
-
3
- `/curdx-flow:implement` defaults to `--strategy=auto`. The router converts task
4
- shape into one of four concrete execution modes.
5
-
6
- ## Runtime Decision Tree
7
-
8
- ```bash
9
- if [ "$STRATEGY" != "auto" ]; then
10
- use the explicit value
11
- elif [ $REMAINING -lt 5 ] || [ $SEQUENTIAL -gt $((REMAINING / 2)) ]; then
12
- STRATEGY="linear"
13
- elif [ $PARALLEL -ge $((REMAINING * 4 / 10)) ]; then
14
- STRATEGY="wave"
15
- elif [ $REMAINING -ge 20 ] && [ $QUICK -eq 1 ]; then
16
- STRATEGY="stop-hook"
17
- elif [ $REMAINING -ge 8 ]; then
18
- STRATEGY="subagent"
19
- else
20
- STRATEGY="linear"
21
- fi
22
- ```
23
-
24
- ## Routing Signals
25
-
26
- - Few tasks or dependency-heavy work: `linear`
27
- - Meaningful `[P]` coverage and disjoint file sets: `wave`
28
- - Long unattended run with `--quick`: `stop-hook`
29
- - Mid-sized backlog without safe parallelism: `subagent`
30
-
31
- ## Guardrails
32
-
33
- - `--strategy=<mode>` always wins over auto-routing
34
- - Unknown strategy values are fatal; do not silently fall back
35
- - `--task=<id>` narrows execution scope, but does not change the selected
36
- strategy by itself
37
- - `--quick` is a routing hint only; it does not relax verification or commit
38
- rules
@@ -1,57 +0,0 @@
1
- # Subagent Execution — Serial Isolated Executors
2
-
3
- Use this mode when tasks are moderately sized and benefit from fresh context per
4
- task, but the backlog is not parallel-safe enough for waves.
5
-
6
- ## Dispatch Contract
7
-
8
- Before each dispatch, if native task sync is active:
9
-
10
- - reconcile obvious `tasks.md` vs native-task drift
11
- - mark the outgoing task `in_progress`
12
- - set the native active form to `Executing <task-id>` when available
13
-
14
- Dispatch one `flow-executor` at a time with a uniform prompt:
15
-
16
- ```text
17
- You are the flow-executor agent. Full definition at:
18
- ${CLAUDE_PLUGIN_ROOT}/agents/flow-executor.md
19
-
20
- Execute task:
21
- spec_name: $SPEC_NAME
22
- task_id: next (or a specific ID)
23
- quick_mode: $QUICK
24
-
25
- Required reading:
26
- - .flow/specs/$SPEC_NAME/tasks.md
27
- - .flow/specs/$SPEC_NAME/.state.json
28
- - .flow/specs/$SPEC_NAME/.progress.md
29
- - .flow/specs/$SPEC_NAME/design.md (if task references AD-NN)
30
- - .flow/specs/$SPEC_NAME/requirements.md (if task references FR/AC)
31
-
32
- On success output: TASK_COMPLETE: <task_id>
33
- On failure output: TASK_FAILED: <task_id> + Reason
34
- When all tasks are done output: ALL_TASKS_COMPLETE
35
- ```
36
-
37
- ## Aggregation Rules
38
-
39
- After the agent completes, read the output marker:
40
-
41
- - `TASK_COMPLETE` -> mark progress, mark the native task `completed`, and
42
- dispatch the next task
43
- - `TASK_FAILED` -> increment failure tracking, keep the native task open, and
44
- enter recovery
45
- - `ALL_TASKS_COMPLETE` -> mark execute complete and move to verify
46
-
47
- If a stored Claude task id no longer updates, rebuild `native_task_map` from
48
- the current `tasks.md`, then continue serial dispatch. Do not rewrite
49
- `.state.json` task cursor or `tasks.md` just because the UI task list changed.
50
-
51
- ## Guardrails
52
-
53
- - This strategy is serial; a single Agent dispatch is not parallel execution
54
- - Do not batch multiple independent tasks into one `flow-executor` prompt
55
- - Do not trust narrative summaries over the end marker
56
- - Native task sync belongs to the coordinator around the dispatch loop, not to
57
- the `flow-executor` subagent itself
@@ -1,180 +0,0 @@
1
- # Wave Execution Strategy — Detailed Walkthrough
2
-
3
- Skill-scoped reference for `skills/implement/SKILL.md`. Loaded only when the
4
- implement skill routes to the `wave` strategy. The knowledge-layer canonical
5
- algorithm lives in `@${CLAUDE_PLUGIN_ROOT}/knowledge/wave-execution.md`;
6
- this file is the walkthrough the skill itself embeds for implementers.
7
-
8
- **Core**: consecutive `[P]` tasks form a wave, dispatch multiple Agent calls in
9
- parallel within a single message, serial across waves.
10
-
11
- ## Step 1: DAG Analysis
12
-
13
- Read remaining `[ ]` tasks from tasks.md and group per the rules:
14
-
15
- ```
16
- for task in remaining tasks:
17
- if task has [SEQUENTIAL] or [VERIFY]:
18
- → own wave (breaks parallelism)
19
- elif task has [P]:
20
- → check whether Files conflict with current_wave
21
- conflict → start a new wave
22
- no conflict → add to current_wave
23
- else:
24
- → own wave (no [P] = serial)
25
- ```
26
-
27
- Output wave list:
28
- ```
29
- Wave 1 [P×3]: 1.1 1.2 1.3
30
- Wave 2 [VERIFY]: 1.4
31
- Wave 3: 1.5
32
- Wave 4 [P×2]: 1.6 1.7
33
- ```
34
-
35
- ## Step 2: Pre-Conflict Detection
36
-
37
- For each wave, verify that Files across all tasks are **disjoint**:
38
-
39
- ```python
40
- for wave in waves:
41
- all_files = []
42
- for task in wave:
43
- if set(task.files) & set(all_files):
44
- warn(f"Within wave, {task.id} modifies the same file as a prior task")
45
- # split into the next wave
46
- all_files.extend(task.files)
47
- ```
48
-
49
- If the planner mis-tagged `[P]` (modifies the same file), split the wave automatically at execution time rather than failing outright.
50
-
51
- ## Step 3: Dispatch a Single Wave (key: within a single response)
52
-
53
- Before dispatching the wave, if native task sync is active:
54
-
55
- - reconcile obvious `tasks.md` vs native-task drift
56
- - mark every task in the upcoming wave `in_progress`
57
- - set the active form to `Executing Wave <n>: <task ids>` when available
58
-
59
- ```
60
- # List multiple Agent tool calls in one response of the main agent:
61
- Agent(description="Execute 1.1", prompt=<...flow-executor + task_id=1.1...>)
62
- Agent(description="Execute 1.2", prompt=<...flow-executor + task_id=1.2...>)
63
- Agent(description="Execute 1.3", prompt=<...flow-executor + task_id=1.3...>)
64
- ```
65
-
66
- Each Agent prompt follows a uniform format (similar to subagent strategy):
67
-
68
- ```
69
- You are the flow-executor agent. Full definition:
70
- ${CLAUDE_PLUGIN_ROOT}/agents/flow-executor.md
71
-
72
- Execute a single task:
73
- spec_name: $SPEC_NAME
74
- task_id: <specific ID, e.g., 1.2>
75
- quick_mode: $QUICK
76
-
77
- **You may only modify the following files** (touching anything else is disallowed):
78
- <task.files>
79
-
80
- Required reading:
81
- - .flow/specs/$SPEC_NAME/tasks.md
82
- - .flow/specs/$SPEC_NAME/.state.json
83
- - .flow/specs/$SPEC_NAME/design.md (if referencing AD-NN)
84
-
85
- Output:
86
- - TASK_COMPLETE: <task_id> or
87
- - TASK_FAILED: <task_id> + reason
88
- ```
89
-
90
- **Not allowed**:
91
- - Splitting multiple Agent calls across multiple responses (that is serial degradation)
92
- - Nesting another Agent dispatch inside an Agent
93
-
94
- ## Step 4: Aggregate Wave Results
95
-
96
- Wait for all Agent calls to return:
97
-
98
- ```python
99
- completed = []; failed = []
100
- for task, result in zip(wave, results):
101
- if "TASK_COMPLETE" in result:
102
- completed.append(task)
103
- elif "TASK_FAILED" in result:
104
- failed.append(task)
105
-
106
- # Post-hoc conflict detection (verify executors did not touch out-of-scope files)
107
- for task in completed:
108
- actual_files = git_diff_files_touched_by(task)
109
- declared = set(task.files)
110
- unexpected = actual_files - declared
111
- if unexpected:
112
- warn(f"Task {task.id} modified undeclared files: {unexpected}")
113
- ```
114
-
115
- After aggregation, if native task sync is active:
116
-
117
- - mark each `completed` task `completed`
118
- - leave each `failed` task open for retry/recovery
119
- - if any `TaskUpdate` call reports a stale or missing Claude task id, rebuild
120
- `native_task_map` from `tasks.md` and continue with `.flow` as source of
121
- truth
122
-
123
- ## Step 5: Wave Failure Handling
124
-
125
- ```
126
- len(failed) == 0:
127
- → continue to the next wave
128
-
129
- len(failed) == 1:
130
- → failed_attempts += 1
131
- → based on config.wave_fail_policy:
132
- "continue-on-single": continue to the next wave, report failure at the end
133
- "stop-on-any": stop immediately
134
-
135
- len(failed) >= 2:
136
- → likely environment issue (missing deps/tsc error/permissions)
137
- → stop immediately, suggest npx @curdx/flow doctor
138
-
139
- failed_attempts >= 3 (cumulative):
140
- → stop, user intervention required
141
- ```
142
-
143
- ## Step 6: Progress Feedback
144
-
145
- ```
146
- ▶ Wave 2/5 complete
147
- ✓ 1.1 feat(auth): create module skeleton (abc123)
148
- ✓ 1.2 feat(user): create user types (def456)
149
- ✓ 1.3 feat(session): init token module (ghi789)
150
-
151
- ▶ Wave 3/5 starting (VERIFY)...
152
- ```
153
-
154
- When native task sync is active, the Claude task list is the short-form UI
155
- surface for the same wave progress. Keep chat feedback compact instead of
156
- relisting the whole backlog after every wave.
157
-
158
- ## Configuration
159
-
160
- `.flow/config.json`:
161
- ```json
162
- {
163
- "execution": {
164
- "strategy": "wave",
165
- "max_parallel": 5,
166
- "wave_fail_policy": "continue-on-single"
167
- }
168
- }
169
- ```
170
-
171
- - `max_parallel`: max N parallel within a wave (to avoid API rate limits, default 5)
172
- - `wave_fail_policy`: single-task failure behavior
173
-
174
- ## Pitfalls
175
-
176
- See `@${CLAUDE_PLUGIN_ROOT}/knowledge/wave-execution.md` for the detailed version.
177
-
178
- - Stray `[P]` → conflict detection as a safety net
179
- - Wave too large → max_parallel auto-splits
180
- - Implicit read-write dependencies → planner should avoid this kind of `[P]`
@@ -1,49 +0,0 @@
1
- ---
2
- name: init
3
- description: Initialize the .flow scaffold for the current repository.
4
- when_to_use: Use when the current repository is not yet a CurdX-Flow project and needs the initial .flow scaffold.
5
- argument-hint: "[--force]"
6
- disable-model-invocation: true
7
- allowed-tools: [Read, Write, Bash, AskUserQuestion]
8
- ---
9
-
10
- # Initialize CurdX-Flow Project
11
-
12
- Bootstrap `.flow/` for the current repository. Keep the entrypoint focused on
13
- safe preflight checks, scaffold contracts, and next-step routing. Detailed init
14
- rules live in:
15
-
16
- - `references/preflight.md`
17
- - `references/scaffold-contract.md`
18
- - `references/gitignore-and-health.md`
19
- - `references/next-steps.md`
20
-
21
- ## Arguments
22
-
23
- `$ARGUMENTS` may include `--force`.
24
-
25
- Use `references/preflight.md` for:
26
-
27
- - dangerous-root rejection
28
- - existing `.flow/` handling
29
- - `--force` repair semantics
30
-
31
- `--force` is for scaffold repair, not blind overwrites.
32
-
33
- ## Scaffold Contract
34
-
35
- Use `references/scaffold-contract.md` for the required directory skeleton,
36
- template rendering, and placeholder substitution contract.
37
-
38
- ## Gitignore and Health
39
-
40
- Use `references/gitignore-and-health.md` for:
41
-
42
- - runtime ignore entries
43
- - committed-vs-runtime file boundaries
44
- - doctor / dependency health guidance
45
-
46
- ## Output and Handoff
47
-
48
- The user-facing success output and route to `/curdx-flow:start` live in
49
- `references/next-steps.md`.
@@ -1,26 +0,0 @@
1
- # Init Gitignore and Health — Runtime Hygiene
2
-
3
- Append these runtime-only entries to `.gitignore` if they are missing:
4
-
5
- ```gitignore
6
- # CurdX-Flow runtime files
7
- .flow/checkpoints/
8
- .flow/threads/
9
- .flow/seeds/
10
- .flow/.active-spec
11
- .flow/specs/*/.state.json
12
- .flow/specs/*/.progress.md
13
- .flow/_epics/*/.epic-state.json
14
- ```
15
-
16
- The canonical shared files should stay committed:
17
-
18
- - `.flow/PROJECT.md`
19
- - `.flow/CONTEXT.md`
20
- - `.flow/STATE.md`
21
- - `.flow/ROADMAP.md`
22
- - `.flow/config.json`
23
-
24
- Do not spawn a separate CLI subprocess from inside the skill just to show the
25
- doctor output. If the user wants the full environment report, route them to
26
- run `npx @curdx/flow doctor` in a terminal.
@@ -1,22 +0,0 @@
1
- # Init Handoff — What to Tell the User Next
2
-
3
- Success output should confirm the scaffold exists and route the user into the
4
- main workflow:
5
-
6
- ```text
7
- ✓ CurdX-Flow project initialized
8
- .flow/
9
- ├── PROJECT.md
10
- ├── CONTEXT.md
11
- ├── STATE.md
12
- ├── ROADMAP.md
13
- └── config.json
14
-
15
- Next:
16
- 1. Fill in .flow/PROJECT.md with the project goal
17
- 2. Run npx @curdx/flow doctor if environment health needs verification
18
- 3. Start the first spec with /curdx-flow:start <name> "<goal>"
19
- ```
20
-
21
- If `--force` repaired a partial scaffold, say that the existing project context
22
- was preserved and only missing runtime pieces were backfilled.
@@ -1,15 +0,0 @@
1
- # Init Preflight — Safe Bootstrap Rules
2
-
3
- Before writing `.flow/`:
4
-
5
- - confirm the current directory is the intended repository root
6
- - reject dangerous locations such as `/`, the home directory, or other obvious
7
- non-project folders
8
- - if `.flow/` already exists and `--force` is absent, stop and route the user
9
- to inspect it or run `/curdx-flow:start --list`
10
-
11
- `--force` means "repair or complete the scaffold" rather than "overwrite user
12
- content". Existing committed files such as `.flow/PROJECT.md`,
13
- `.flow/CONTEXT.md`, `.flow/STATE.md`, `.flow/ROADMAP.md`, and
14
- `.flow/config.json` should be preserved unless the user explicitly asks to
15
- replace them.