@curdx/flow 2.2.0 → 2.2.3

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 (78) 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 +1074 -2
  24. package/cli/doctor.js +8 -0
  25. package/cli/help.js +2 -0
  26. package/cli/lib/doctor-report.js +256 -1
  27. package/cli/lib/frontmatter.js +44 -0
  28. package/cli/lib/json-schema.js +57 -0
  29. package/cli/lib/runtime.js +20 -2
  30. package/cli/utils.js +6 -1
  31. package/gates/adversarial-review-gate.md +1 -1
  32. package/gates/security-gate.md +2 -2
  33. package/gates/test-quality-gate.md +59 -0
  34. package/hooks/hooks.json +16 -2
  35. package/hooks/scripts/common.sh +4 -0
  36. package/hooks/scripts/session-start.sh +17 -2
  37. package/hooks/scripts/stop-watcher.sh +69 -18
  38. package/hooks/scripts/subagent-artifact-guard.sh +159 -0
  39. package/hooks/scripts/subagent-statusline.sh +105 -0
  40. package/knowledge/atomic-commits.md +1 -1
  41. package/knowledge/claude-code-runtime-contracts.md +203 -0
  42. package/knowledge/epic-decomposition.md +1 -1
  43. package/knowledge/execution-strategies.md +23 -1
  44. package/knowledge/planning-reviews.md +2 -2
  45. package/knowledge/poc-first-workflow.md +8 -8
  46. package/knowledge/review-feedback-intake.md +57 -0
  47. package/knowledge/two-stage-review.md +19 -6
  48. package/knowledge/wave-execution.md +16 -1
  49. package/output-styles/curdx-evidence-first.md +34 -0
  50. package/package.json +7 -1
  51. package/schemas/agent-frontmatter.schema.json +0 -7
  52. package/schemas/config.schema.json +14 -0
  53. package/schemas/hooks.schema.json +34 -2
  54. package/schemas/output-style-frontmatter.schema.json +22 -0
  55. package/schemas/plugin-manifest.schema.json +387 -17
  56. package/schemas/plugin-settings.schema.json +29 -0
  57. package/schemas/skill-frontmatter.schema.json +109 -4
  58. package/schemas/spec-state.schema.json +29 -4
  59. package/settings.json +6 -0
  60. package/skills/brownfield-index/SKILL.md +31 -35
  61. package/skills/browser-qa/SKILL.md +11 -3
  62. package/skills/cancel/SKILL.md +82 -0
  63. package/skills/debug/SKILL.md +6 -2
  64. package/skills/epic/SKILL.md +5 -3
  65. package/skills/fast/SKILL.md +1 -0
  66. package/skills/help/SKILL.md +17 -7
  67. package/skills/implement/SKILL.md +38 -7
  68. package/skills/init/SKILL.md +2 -1
  69. package/skills/review/SKILL.md +4 -1
  70. package/skills/security-audit/SKILL.md +17 -3
  71. package/skills/spec/SKILL.md +2 -1
  72. package/skills/start/SKILL.md +18 -18
  73. package/skills/status/SKILL.md +85 -0
  74. package/skills/ui-sketch/SKILL.md +11 -3
  75. package/skills/verify/SKILL.md +13 -1
  76. package/templates/config.json.tmpl +4 -1
  77. package/templates/progress.md.tmpl +19 -0
  78. package/templates/tasks.md.tmpl +26 -3
@@ -0,0 +1,85 @@
1
+ ---
2
+ name: status
3
+ description: Show CurdX-Flow project/spec status, active spec, phase, task progress, artifacts, and recovery hints.
4
+ when_to_use: Use when the user asks what is active, which phase a spec is in, what artifacts exist, or how to recover from interrupted execution.
5
+ argument-hint: "[--all]"
6
+ disable-model-invocation: true
7
+ allowed-tools: [Read, Bash, Glob]
8
+ ---
9
+
10
+ # CurdX-Flow Status
11
+
12
+ Show a compact, read-only status summary for the current project.
13
+
14
+ ## Preconditions
15
+
16
+ ```bash
17
+ [ ! -d ".flow" ] && { echo "✗ Not a CurdX-Flow project. Run /curdx-flow:init first."; exit 1; }
18
+ ```
19
+
20
+ ## Gather
21
+
22
+ 1. Read `.flow/.active-spec` if present.
23
+ 2. List `.flow/specs/*/` directories.
24
+ 3. For each spec, check artifacts:
25
+ - `research.md`
26
+ - `requirements.md`
27
+ - `design.md`
28
+ - `tasks.md`
29
+ - `verification-report.md`
30
+ - `review-report.md`
31
+ 4. If `.state.json` exists, read:
32
+ - `phase`
33
+ - `strategy`
34
+ - `phase_status`
35
+ - `execute_state.task_index`
36
+ - `execute_state.total_tasks`
37
+ - `execute_state.failed_attempts`
38
+ - `execute_state.global_iteration`
39
+ 5. If `tasks.md` exists, count:
40
+ - completed tasks: lines matching `- [x] **`
41
+ - open tasks: lines matching `- [ ] **`
42
+
43
+ ## Output Format
44
+
45
+ ```markdown
46
+ # CurDX-Flow Status
47
+
48
+ Project: <cwd>
49
+ Active spec: <name | none>
50
+
51
+ ## Specs
52
+
53
+ ### <spec-name> [ACTIVE]
54
+ Phase: <phase | unknown>
55
+ Strategy: <strategy | auto>
56
+ Tasks: <done>/<total from tasks.md> checked, state cursor <task_index>/<total_tasks>
57
+ Failures: <failed_attempts>, rounds: <global_iteration>
58
+ Artifacts: [x] research [x] requirements [x] design [x] tasks [ ] verify [ ] review
59
+ Health: OK | NEEDS_ATTENTION
60
+ Recovery: <one concrete next command>
61
+ ```
62
+
63
+ ## Health Rules
64
+
65
+ - `OK`: state and tasks agree, no failed attempts, no missing current-phase artifact.
66
+ - `NEEDS_ATTENTION`: any of these:
67
+ - `.state.json` says execute complete but `tasks.md` has open tasks.
68
+ - failed attempts > 0.
69
+ - active spec points to a missing directory.
70
+ - current phase's expected artifact is missing or too small.
71
+
72
+ ## Recovery Hints
73
+
74
+ - No `.flow/`: `/curdx-flow:init`
75
+ - No active spec: `/curdx-flow:start <name> "<goal>"`
76
+ - In spec phase with missing artifact: `/curdx-flow:spec --resume`
77
+ - Execute in progress: `/curdx-flow:implement --task=next`
78
+ - Stop-hook appears stuck: `/curdx-flow:cancel` then `/curdx-flow:implement --strategy=subagent`
79
+ - Verify missing after execute complete: `/curdx-flow:verify`
80
+ - Review missing after verify pass: `/curdx-flow:review`
81
+
82
+ ## Strictness
83
+
84
+ - Read-only. Do not modify files.
85
+ - Do not claim a spec is complete from `.state.json` alone; compare `tasks.md` checkboxes.
@@ -2,7 +2,15 @@
2
2
  name: ui-sketch
3
3
  description: Use when the user needs UI design drafts, layout variants, mockups, prototypes, or styling direction.
4
4
  when_to_use: Triggers on "design UI", "UI design", "component layout", "variants", "wireframe", "mockup", "prototype", "sketch", "draft layout", "visual design", "styling", "CSS", "theming", "dark mode", "responsive design", "color scheme", "build me a UI", "show several variants", "try different colors".
5
- allowed-tools: [Read, Write, Bash, WebSearch]
5
+ argument-hint: "\"<screen or component brief>\""
6
+ context: fork
7
+ agent: flow-ux-designer
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
  # UI Sketch
@@ -24,9 +32,9 @@ Confirm with the user:
24
32
  - **Must-haves** (brand colors / existing design system / responsive breakpoints)
25
33
  - **Variant count** (default: 3 variants with distinct design directions)
26
34
 
27
- ### Step 2: Dispatch `flow-ux-designer`
35
+ ### Step 2: Run via `flow-ux-designer`
28
36
 
29
- Delegate to the `flow-ux-designer` agent with the brief. It will:
37
+ This skill executes in a forked context through `flow-ux-designer`. It will:
30
38
  1. Invoke the `frontend-design` skill with the brief
31
39
  2. Generate N variant HTML/JSX files under `.flow/specs/<active>/sketches/`
32
40
  3. For each variant, produce a rationale: typography, color, layout decisions
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: verify
3
- description: Goal-backward verification trace from every FR / AC / AD in the active spec to the code and tests, detect stubs and fake completions. The differentiator command. Optionally adds multi-source coverage audit with --strict.
3
+ description: Prove the active spec is truly implemented by tracing every FR, AC, and AD to code and tests. Optional --strict adds multi-source coverage audit.
4
+ when_to_use: Use when implementation is done and the user wants proof that FRs, ACs, and ADs are actually satisfied rather than merely claimed complete.
4
5
  argument-hint: "[--strict]"
5
6
  disable-model-invocation: true
6
7
  context: fork
@@ -49,8 +50,17 @@ Also scan for **stub / fake-completion** patterns on FR-covered paths:
49
50
  - tests with only `it.skip(...)` or no assertions
50
51
  - code returning mocked fixtures instead of calling real collaborators
51
52
 
53
+ Apply `@${CLAUDE_PLUGIN_ROOT}/gates/test-quality-gate.md` to every test used as evidence. Mock-heavy tests are acceptable only when they mock boundaries while asserting real behavior, or when separate integration/e2e coverage exists. Mock-only tests, skipped tests, assertion-free tests, and tests without cleanup for stateful mocks cannot be the sole evidence for an FR/AC.
54
+
52
55
  Run the per-task `Verify` commands from `tasks.md` and record pass/fail.
53
56
 
57
+ For fix/debug specs, also verify reality evidence:
58
+
59
+ - `.progress.md` must contain `Reality Check (BEFORE)` with a reproduction command and observed failure.
60
+ - `.progress.md` must contain `Reality Check (AFTER)` with the same command rerun and an explicit comparison.
61
+ - `Verified: Issue resolved` is valid only if AFTER proves the original observed failure disappeared.
62
+ - If the spec has fix/debug language but no `VF` task or BEFORE/AFTER evidence, mark the verdict `PARTIAL` even if all tests pass.
63
+
54
64
  ## --strict mode
55
65
 
56
66
  When `$ARGUMENTS` contains `--strict`, also apply the multi-source coverage
@@ -84,6 +94,8 @@ Per `@${CLAUDE_PLUGIN_ROOT}/gates/verification-gate.md`:
84
94
 
85
95
  - Any `STUB` or `MISSING` finding on a non-deferred FR blocks completion.
86
96
  - Any failing Verify command blocks completion.
97
+ - Missing fix/debug BEFORE/AFTER reality verification blocks a full PASS.
98
+ - Any FR/AC supported only by mock-only/skipped/assertion-free tests blocks a full PASS.
87
99
  - Waive only with an explicit D-NN decision logged in `.flow/STATE.md`.
88
100
 
89
101
  ## Output to user (≤ 5 lines after Write succeeds)
@@ -9,7 +9,10 @@
9
9
  "_strategy_options": "auto | subagent | stop-hook | wave | linear",
10
10
  "max_parallel": 5,
11
11
  "subagent_threshold": 8,
12
- "wave_fail_policy": "continue-on-single"
12
+ "wave_fail_policy": "continue-on-single",
13
+ "recovery_mode": "manual",
14
+ "_recovery_mode_options": "manual | fix-task",
15
+ "max_fix_tasks_per_original": 2
13
16
  },
14
17
 
15
18
  "gates": {
@@ -16,6 +16,25 @@
16
16
  - Current task: N/A (tasks phase not yet entered)
17
17
  - Blockers: none
18
18
 
19
+ ## Reality Check (BEFORE)
20
+
21
+ <!-- For fix/debug specs only: capture the original failure before changing code. -->
22
+
23
+ **Goal type**: N/A
24
+ **Reproduction command**: N/A
25
+ **Failure observed**: N/A
26
+ **Output**: N/A
27
+ **Timestamp**: N/A
28
+
29
+ ## Reality Check (AFTER)
30
+
31
+ <!-- For fix/debug specs only: rerun the same command after the fix and compare. -->
32
+
33
+ **Command**: N/A
34
+ **Result**: N/A
35
+ **Comparison**: N/A
36
+ **Verified**: N/A
37
+
19
38
  ## Completed Tasks
20
39
 
21
40
  <!-- List of completed tasks -->
@@ -9,7 +9,7 @@ depends_on: design.md
9
9
 
10
10
  # Task Breakdown: {{SPEC_NAME}}
11
11
 
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.
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 (evidence handoff). A library may skip the handoff phase entirely. Forcing all five phases for a small feature is the padding pattern this template is designed to prevent.
13
13
  >
14
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").
15
15
 
@@ -21,6 +21,13 @@ depends_on: design.md
21
21
  - `[P]` parallel-safe (dispatch in parallel within the same wave)
22
22
  - `[VERIFY]` quality checkpoint (flow-verifier agent)
23
23
  - `[SEQUENTIAL]` must be serial (breaks the parallel group)
24
+ - `VF` reality verification task for fix/debug specs (BEFORE failure → AFTER pass)
25
+
26
+ ---
27
+
28
+ ## Split Rule
29
+
30
+ If a task proves too broad or unsafe during execution, the executor must stop with `TASK_FAILED` and propose up to 3 smaller replacement tasks. The coordinator updates this file; executors do not invent and execute new tasks in the same turn.
24
31
 
25
32
  ---
26
33
 
@@ -49,23 +56,39 @@ depends_on: design.md
49
56
  ## Phase 3: Testing (TDD red / green / yellow)
50
57
 
51
58
  > 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.
59
+ > Test quality: primary FR/AC evidence must exercise real behavior. Mock-only, skipped, or assertion-free tests do not count unless backed by integration/e2e coverage or an explicit D-NN waiver.
52
60
 
53
61
  - [ ] **3.X** [RED→GREEN→YELLOW] ...
54
62
 
55
63
  - [ ] **3.X+1** [VERIFY] Coverage check
56
64
  - **Verify**: coverage on the changed surface ≥ project standard
57
65
 
66
+ - [ ] **3.X+2** [VERIFY] Test quality check
67
+ - **Do**: apply `test-quality-gate` to tests used as FR/AC evidence
68
+ - **Done when**: no FR/AC depends solely on mock-only/skipped/assertion-free tests
69
+ - **Verify**: `<test command>` plus grep scan for skipped tests / mock-only evidence
70
+
58
71
  ## Phase 4: Quality Gates
59
72
 
60
73
  > 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.
61
74
 
75
+ - [ ] **4.VF** [VERIFY] VF: Verify original issue resolved (fix/debug specs only)
76
+ - **Do**: 1. Read `Reality Check (BEFORE)` in `.progress.md`; 2. Re-run the same reproduction command; 3. Append `Reality Check (AFTER)` with output and comparison
77
+ - **Files**: `.flow/specs/{{SPEC_NAME}}/.progress.md`
78
+ - **Done when**: AFTER proves the original observed failure is gone
79
+ - **Verify**: `grep -q "Verified: Issue resolved" .flow/specs/{{SPEC_NAME}}/.progress.md`
80
+ - **Commit**: `chore({{SPEC_NAME}}): verify original issue resolved`
81
+
62
82
  - [ ] **4.X** [VERIFY] Final health check
63
83
  - **Do**: flow-verifier performs goal-driven reverse verification
64
84
  - **Done when**: every FR/AC has an automated check
65
85
 
66
- ## Phase 5: PR Lifecycle (delete for local-only work, scripts, internal tools without a PR flow)
86
+ ## Phase 5: Evidence Handoff (delete for local-only work, scripts, internal tools without a PR flow)
67
87
 
68
- - [ ] **5.X** Ship / Land
88
+ - [ ] **5.X** Prepare verification/review handoff
89
+ - **Do**: collect atomic commits, verification report, review report, and residual risk notes
90
+ - **Done when**: a human can open or release with clear evidence and no hidden blockers
91
+ - **Verify**: `test -f .flow/specs/{{SPEC_NAME}}/verification-report.md && test -f .flow/specs/{{SPEC_NAME}}/review-report.md`
69
92
 
70
93
  ---
71
94