@curdx/flow 2.0.0-beta.1 → 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 (57) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +3 -10
  3. package/CHANGELOG.md +20 -0
  4. package/README.zh.md +2 -2
  5. package/agent-preamble/preamble.md +81 -11
  6. package/agents/flow-adversary.md +40 -55
  7. package/agents/flow-architect.md +23 -10
  8. package/agents/flow-debugger.md +2 -2
  9. package/agents/flow-edge-hunter.md +20 -6
  10. package/agents/flow-executor.md +3 -3
  11. package/agents/flow-planner.md +51 -48
  12. package/agents/flow-product-designer.md +14 -1
  13. package/agents/flow-qa-engineer.md +1 -1
  14. package/agents/flow-researcher.md +17 -2
  15. package/agents/flow-reviewer.md +5 -1
  16. package/agents/flow-security-auditor.md +1 -1
  17. package/agents/flow-triage-analyst.md +1 -1
  18. package/agents/flow-ui-researcher.md +2 -2
  19. package/agents/flow-ux-designer.md +1 -1
  20. package/agents/flow-verifier.md +47 -14
  21. package/bin/curdx-flow.js +13 -1
  22. package/cli/doctor.js +28 -13
  23. package/cli/install.js +62 -36
  24. package/cli/protocols.js +63 -10
  25. package/cli/registry.js +73 -0
  26. package/cli/uninstall.js +9 -11
  27. package/cli/upgrade.js +6 -10
  28. package/cli/utils.js +104 -56
  29. package/commands/fast.md +1 -1
  30. package/commands/implement.md +4 -4
  31. package/commands/init.md +14 -3
  32. package/commands/review.md +14 -5
  33. package/commands/spec.md +26 -2
  34. package/commands/start.md +47 -17
  35. package/commands/verify.md +13 -0
  36. package/gates/adversarial-review-gate.md +19 -19
  37. package/gates/devex-gate.md +4 -5
  38. package/gates/edge-case-gate.md +1 -1
  39. package/hooks/hooks.json +0 -11
  40. package/hooks/scripts/quick-mode-guard.sh +12 -9
  41. package/hooks/scripts/session-start.sh +1 -1
  42. package/hooks/scripts/stop-watcher.sh +25 -15
  43. package/knowledge/execution-strategies.md +6 -5
  44. package/knowledge/spec-driven-development.md +8 -7
  45. package/knowledge/two-stage-review.md +4 -3
  46. package/package.json +4 -2
  47. package/skills/brownfield-index/SKILL.md +62 -0
  48. package/skills/browser-qa/SKILL.md +50 -0
  49. package/skills/epic/SKILL.md +68 -0
  50. package/skills/security-audit/SKILL.md +50 -0
  51. package/skills/ui-sketch/SKILL.md +49 -0
  52. package/templates/config.json.tmpl +1 -1
  53. package/templates/design.md.tmpl +32 -112
  54. package/templates/requirements.md.tmpl +25 -43
  55. package/templates/research.md.tmpl +37 -68
  56. package/templates/tasks.md.tmpl +27 -84
  57. package/hooks/scripts/fail-tracker.sh +0 -31
@@ -5,137 +5,80 @@ created: {{CREATED_DATE}}
5
5
  version: 1.0
6
6
  status: in_progress
7
7
  depends_on: design.md
8
- task_size: fine
9
8
  ---
10
9
 
11
10
  # Task Breakdown: {{SPEC_NAME}}
12
11
 
13
- > POC-First 5 Phases: **work refactor test quality gates PR lifecycle**.
12
+ > POC-First is an **orientation, not a mandate**. Use the phases below as an organizing idea and **delete phases that don't apply to this feature**. A bug-fix may be one task. A prototype may skip Phase 2 (refactor) and Phase 5 (PR lifecycle). A library may skip the PR lifecycle entirely. Forcing all five phases for a small feature is the padding pattern this template is designed to prevent.
14
13
  >
15
- > Each task includes: `Do`, `Files`, `Done-when`, `Verify`, `Commit`. Verifiable via automation.
14
+ > Each task includes whatever of `Do`, `Files`, `Done-when`, `Verify`, `Commit` is needed for the executor to finish it in a single sub-agent dispatch. Verify must be an automated command (no "manual test").
16
15
 
17
16
  ---
18
17
 
19
18
  ## Marker Rules
20
19
 
21
20
  - `[ ]` TODO / `[x]` done
22
- - `[P]` parallel-safe (can be dispatched in parallel within the same wave)
23
- - `[VERIFY]` quality checkpoint (run by the flow-verifier agent)
21
+ - `[P]` parallel-safe (dispatch in parallel within the same wave)
22
+ - `[VERIFY]` quality checkpoint (flow-verifier agent)
24
23
  - `[SEQUENTIAL]` must be serial (breaks the parallel group)
25
24
 
26
25
  ---
27
26
 
28
27
  ## Phase 1: Make It Work (POC)
29
28
 
30
- > Goal: get it running end-to-end. Hardcoding is acceptable; skip tests.
29
+ > Goal: end-to-end runnable. Hardcoding is acceptable; skip tests here.
31
30
 
32
- - [ ] **1.1** [P] Initialize module skeleton
33
- - **Do**: create `src/{{MODULE}}/` directory, add `index.ts`, `types.ts`
34
- - **Files**: `src/{{MODULE}}/index.ts`, `src/{{MODULE}}/types.ts`
35
- - **Done when**: directory exists, `import {} from './{{MODULE}}'` does not error
36
- - **Verify**: `npx tsc --noEmit`
37
- - **Commit**: `feat({{MODULE}}): initialize module skeleton`
38
- - _Requirements_: FR-01
31
+ <!-- Add only the tasks this feature genuinely needs. Do not invent skeleton tasks to "round out" the phase. -->
39
32
 
40
- - [ ] **1.2** [P] ...
33
+ - [ ] **1.1** ...
41
34
  - **Do**: ...
42
35
  - **Files**: ...
43
36
  - **Done when**: ...
44
37
  - **Verify**: ...
45
38
  - **Commit**: ...
46
- - _Requirements_: ...
47
- - _Design_: AD-01
39
+ - _Requirements_: FR-NN
48
40
 
49
- - [ ] **1.3** [VERIFY] End-to-end POC verification
50
- - **Do**: run the happy path manually, confirm the core scenario works
51
- - **Verify**: `curl http://localhost:3000/... | jq`
52
- - **Done when**: returns expected data (edge cases may still be wrong)
41
+ - [ ] **1.X** [VERIFY] End-to-end POC verification
42
+ - **Verify**: `<command>`
43
+ - **Done when**: happy path returns the expected result
53
44
 
54
- ## Phase 2: Refactoring
45
+ ## Phase 2: Refactoring (delete if the POC is already clean)
55
46
 
56
- > Goal: clean up the code structure. Behavior unchanged.
57
-
58
- - [ ] **2.1** Extract duplicated logic
59
- - **Do**: ...
60
- - **Verify**: `npx tsc --noEmit && git diff --stat`
61
- - **Commit**: `refactor({{MODULE}}): extract common logic`
62
-
63
- - [ ] **2.2** [VERIFY] Refactor does not break behavior
64
- - **Verify**: rerun the manual test from Phase 1
65
- - **Done when**: all outputs match
47
+ > Include only if the POC has genuine duplication or structural mud that warrants cleanup. Skip for tiny features.
66
48
 
67
49
  ## Phase 3: Testing (TDD red / green / yellow)
68
50
 
69
- > Rule: tests first. Let the test fail first (RED), then implement (GREEN), then clean up (YELLOW).
70
-
71
- - [ ] **3.1** [RED] Write failing tests — unit
72
- - **Do**: write unit tests for core functions
73
- - **Files**: `src/{{MODULE}}/*.test.ts`
74
- - **Verify**: `npm test -- src/{{MODULE}}` — expected to fail
75
- - **Commit**: `test({{MODULE}}): red - add unit tests for core logic`
76
-
77
- - [ ] **3.2** [GREEN] Make tests pass
78
- - **Do**: fix the implementation so the tests from 3.1 pass
79
- - **Verify**: `npm test -- src/{{MODULE}}` — all green
80
- - **Commit**: `feat({{MODULE}}): green - satisfy unit tests`
81
-
82
- - [ ] **3.3** [YELLOW] Refactor and clean up
83
- - **Do**: clean up the implementation, tests still pass
84
- - **Commit**: `refactor({{MODULE}}): yellow - clean implementation`
51
+ > Rule: tests first. Red → Green → Yellow. **Collapse red+green into one task when the test and implementation are trivially paired**; split only when the test genuinely precedes a nontrivial implementation.
85
52
 
86
- - [ ] **3.4** [RED GREEN YELLOW] Integration tests
87
- - <!-- Repeat the TDD cycle -->
53
+ - [ ] **3.X** [RED→GREEN→YELLOW] ...
88
54
 
89
- - [ ] **3.5** [VERIFY] Coverage check
90
- - **Verify**: `npm test -- --coverage` core logic > 80%
55
+ - [ ] **3.X+1** [VERIFY] Coverage check
56
+ - **Verify**: coverage on the changed surface project standard
91
57
 
92
58
  ## Phase 4: Quality Gates
93
59
 
94
- > Full local checks. Last gate before CI.
95
-
96
- - [ ] **4.1** TypeScript strict check
97
- - **Verify**: `npx tsc --strict --noEmit` — 0 errors
98
- - **Commit**: `chore({{MODULE}}): tsc strict passes`
99
-
100
- - [ ] **4.2** Lint
101
- - **Verify**: `npx eslint src/{{MODULE}}` — 0 errors, 0 warnings
102
-
103
- - [ ] **4.3** All tests pass
104
- - **Verify**: `npm test` — all green
105
-
106
- - [ ] **4.4** [VERIFY] Final health check
107
- - **Do**: flow-verifier agent performs goal-driven reverse verification
108
- - **Done when**: every FR-XX and AC-X.Y has a corresponding automated verification
109
-
110
- ## Phase 5: PR Lifecycle
60
+ > Include only the checks this project actually runs. `npx eslint` is dead weight if the project uses biome. `tsc --strict` is dead weight for a JS project.
111
61
 
112
- - [ ] **5.1** Generate PR
113
- - **Do**: `/flow-ship` creates the PR
114
- - **Done when**: PR URL returned, description is clear
62
+ - [ ] **4.X** [VERIFY] Final health check
63
+ - **Do**: flow-verifier performs goal-driven reverse verification
64
+ - **Done when**: every FR/AC has an automated check
115
65
 
116
- - [ ] **5.2** Respond to review feedback
117
- - **Do**: iterate until approved
118
- - **Verify**: CI all green
66
+ ## Phase 5: PR Lifecycle (delete for local-only work, scripts, internal tools without a PR flow)
119
67
 
120
- - [ ] **5.3** Merge
121
- - **Do**: `/flow-land`
122
- - **Verify**: the main branch contains all commits for this spec
68
+ - [ ] **5.X** Ship / Land
123
69
 
124
70
  ---
125
71
 
126
72
  ## Coverage Audit
127
73
 
128
- <!-- Final step for flow-planner: confirm every FR / AC / AD / D has a corresponding task -->
74
+ <!-- flow-planner fills this in. Every FR / AC / AD / D must map to a task, or explicitly defer with reason. -->
129
75
 
130
76
  | Requirement ID | Task(s) | Status |
131
77
  |--------|---------|------|
132
- | FR-01 | 1.2, 3.1 | ✓ |
133
- | FR-02 | ... | ⚠ uncovered — needs adding |
134
- | AD-01 | 1.1 | ✓ |
135
- | D-05 (STATE.md) | ... | ✓ |
78
+ | FR-01 | ... | ✓ |
136
79
 
137
- **Uncovered items must be handled**: add a task or document the deferral reason in STATE.md.
80
+ **Uncovered items must be handled**: add a task, or document the deferral reason in STATE.md.
138
81
 
139
82
  ---
140
83
 
141
- _Generated by flow-planner agent on {{CREATED_DATE}}. N tasks total, estimated X hours._
84
+ _Generated by flow-planner on {{CREATED_DATE}}._
@@ -1,31 +0,0 @@
1
- #!/usr/bin/env bash
2
- # CurDX-Flow PostToolUseFailure Hook
3
- # Tracks consecutive tool failures to enable pua integration (Phase 4+).
4
- # For now, just maintains a counter in plugin data directory.
5
- #
6
- # Future: when pua is installed and fail_count >= threshold, auto-invoke /pua:pua.
7
-
8
- set -u
9
-
10
- DATA_DIR="${CLAUDE_PLUGIN_DATA:-$HOME/.claude/plugins/data/curdx-flow}"
11
- COUNTER="$DATA_DIR/fail-count"
12
-
13
- mkdir -p "$DATA_DIR" 2>/dev/null || true
14
-
15
- # Read current count
16
- CURRENT=0
17
- [ -f "$COUNTER" ] && CURRENT="$(cat "$COUNTER" 2>/dev/null || echo 0)"
18
-
19
- # Increment
20
- NEXT=$((CURRENT + 1))
21
- echo "$NEXT" > "$COUNTER" 2>/dev/null || true
22
-
23
- # Placeholder for future pua escalation (Phase 4+):
24
- # if [ "$NEXT" -ge 2 ] && command -v claude >/dev/null 2>&1; then
25
- # if claude plugin list 2>/dev/null | grep -q 'pua'; then
26
- # # Inject escalation suggestion via hook output
27
- # ...
28
- # fi
29
- # fi
30
-
31
- exit 0