@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
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: init
3
3
  description: Initialize the CurdX-Flow project structure (create the .flow/ directory and core files)
4
+ when_to_use: Use when the current repository is not yet a CurdX-Flow project and needs the initial .flow scaffold.
4
5
  argument-hint: "[--force]"
5
6
  disable-model-invocation: true
6
7
  allowed-tools: [Read, Write, Bash, AskUserQuestion]
@@ -106,7 +107,7 @@ Next steps (in order):
106
107
  3. npx @curdx/flow doctor — verify health
107
108
  4. /curdx-flow:start <name> "<goal>" — begin your first feature spec
108
109
 
109
- Start development (after Phase 1 ships):
110
+ Start development:
110
111
  5. /curdx-flow:start <name> "<goal>" — kick off the first spec
111
112
  ```
112
113
 
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: review
3
- description: Two-stage code review — Stage 1 spec compliance, Stage 2 code quality. Optional flags add adversarial review, edge-case hunting, or developer-experience audit.
3
+ description: "Run two-stage review: spec compliance first, code quality second. Optional flags add adversarial, edge-case, and DevEx passes."
4
+ when_to_use: Use when implementation exists and the user wants review findings, spec-compliance checks, adversarial review, edge-case hunting, or a DevEx audit.
4
5
  argument-hint: "[--stage=<1|2|both>] [--adversarial] [--edge-case] [--devex]"
5
6
  disable-model-invocation: true
6
7
  allowed-tools: [Read, Bash, Agent, Grep, Glob]
@@ -12,6 +13,8 @@ Distinct from `/curdx-flow:verify`:
12
13
  - **verify** checks that the spec's stated goals actually work (goal-backward).
13
14
  - **review** checks that the code is good (spec compliance + craftsmanship).
14
15
 
16
+ When this command is used to review follow-up work after prior review comments, apply `@${CLAUDE_PLUGIN_ROOT}/knowledge/review-feedback-intake.md` first: classify each feedback item before changing code, verify it against the current code/spec, and record accepted fixes or technical pushback in `.progress.md`.
17
+
15
18
  ## Flags
16
19
 
17
20
  | Flag | Default | Purpose |
@@ -2,7 +2,21 @@
2
2
  name: security-audit
3
3
  description: Use when the user needs security review of code, specs, credentials, sensitive data, or dependency risk.
4
4
  when_to_use: Triggers on "security", "auth", "authentication", "credential", "password", "secret", "API key", "token", "OWASP", "STRIDE", "CVE", "vulnerability", "injection", "XSS", "CSRF", "SSRF", "SQL injection", "hardcoded secret", "sensitive data", "leak", "will my API key leak", "is this safe".
5
- allowed-tools: [Read, Grep, Glob, Bash, WebSearch]
5
+ argument-hint: "[scope] [--depth=<owasp|stride|full>]"
6
+ context: fork
7
+ agent: flow-security-auditor
8
+ paths:
9
+ - "**/*.{js,jsx,ts,tsx,py,rb,go,java,kt,php,cs,rs,swift,sql,sh}"
10
+ - "**/*.{json,yml,yaml,toml,tf,hcl,conf,ini}"
11
+ - "**/.env*"
12
+ - "**/Dockerfile*"
13
+ - ".github/workflows/**"
14
+ - ".gitlab-ci.yml"
15
+ - "docker-compose*.yml"
16
+ - "k8s/**"
17
+ - "helm/**"
18
+ - "infra/**"
19
+ - "terraform/**"
6
20
  ---
7
21
 
8
22
  # Security Audit
@@ -23,9 +37,9 @@ Confirm:
23
37
  - **Depth** (OWASP-only / OWASP + STRIDE / + dependency CVE scan)
24
38
  - **Risk tolerance** (block on any SR / only block on SR with POC / advisory only)
25
39
 
26
- ### Step 2: Dispatch `flow-security-auditor`
40
+ ### Step 2: Run via `flow-security-auditor`
27
41
 
28
- Delegate to the `flow-security-auditor` agent. It will:
42
+ This skill executes in a forked context through `flow-security-auditor`. It will:
29
43
  1. Scan for hardcoded secrets, weak crypto, unsanitized inputs
30
44
  2. Apply OWASP Top 10 (A01 Broken Access Control → A10 SSRF)
31
45
  3. Apply STRIDE threat modeling (Spoofing, Tampering, Repudiation, Information disclosure, DoS, Elevation)
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: spec
3
- description: Generate or refresh a feature specification. By default runs research requirements design tasks in sequence. Flags let you target a single phase, stop early, regenerate, or tack on a multi-dimensional planning review.
3
+ description: Generate or refresh the active spec across research, requirements, design, and tasks. Flags target phases, regeneration, and planning review.
4
+ when_to_use: Use when the user wants to generate, resume, regenerate, or review a feature spec across research, requirements, design, and task planning.
4
5
  argument-hint: "[--phase=<X[,Y,...]>] [--until=<X>] [--review[=<dim[,dim]>]] [--regenerate] [--resume]"
5
6
  disable-model-invocation: true
6
7
  allowed-tools: [Read, Write, Bash, Agent, AskUserQuestion]
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: start
3
3
  description: Smart entry point — create a new spec, resume an existing one, or switch between specs. Replaces v1's /start + /switch.
4
+ when_to_use: Use when the user wants to create a spec, switch active work, resume a prior spec, list specs, or set the workflow mode for a feature.
4
5
  argument-hint: "[<spec-name>] [\"<one-line goal>\"] [--resume] [--list] [--mode=<fast|standard|enterprise>]"
5
6
  disable-model-invocation: true
6
7
  allowed-tools: [Read, Write, Bash, AskUserQuestion, Agent]
@@ -82,16 +83,17 @@ Switch `.flow/.active-spec` to `SPEC_NAME`. Confirm with the user if they intend
82
83
  ### Branch D: `SPEC_NAME` provided, spec does NOT exist
83
84
  Create a new spec:
84
85
 
85
- ```bash
86
- mkdir -p ".flow/specs/$SPEC_NAME"
87
- # NOTE: field names MUST match schemas/spec-state.schema.json:
88
- # - spec_name (not "spec")
89
- # - created (date, not "created_at")
90
- # - updated (date-time, not "updated_at")
91
- # - phase must be one of the enum values; the initial phase is "research"
92
- # (there is no "created" phase — that was schema drift pre-beta.9)
93
- # - version is required
94
- cat > ".flow/specs/$SPEC_NAME/.state.json" <<JSON
86
+ Use the `Write` tool for `.flow/specs/$SPEC_NAME/.state.json` and `.flow/.active-spec` so Claude Code checkpoints can rewind the new spec. The state file must match `schemas/spec-state.schema.json`:
87
+
88
+ - `spec_name`, not `spec`
89
+ - `created` as date, not `created_at`
90
+ - `updated` as date-time, not `updated_at`
91
+ - `phase` starts as `research`; there is no `created` phase
92
+ - `version` is required
93
+
94
+ Initial state JSON shape:
95
+
96
+ ```json
95
97
  {
96
98
  "version": "1.0",
97
99
  "spec_name": "$SPEC_NAME",
@@ -101,31 +103,29 @@ cat > ".flow/specs/$SPEC_NAME/.state.json" <<JSON
101
103
  "phase_status": {},
102
104
  "strategy": "auto",
103
105
  "execute_state": {},
104
- "created": "$(date -u +%Y-%m-%d)",
105
- "updated": "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
106
+ "created": "YYYY-MM-DD",
107
+ "updated": "YYYY-MM-DDTHH:MM:SSZ"
106
108
  }
107
- JSON
108
- echo "$SPEC_NAME" > .flow/.active-spec
109
109
  ```
110
110
 
111
111
  If `GOAL` is empty, `AskUserQuestion` to gather it before writing `.state.json`.
112
112
 
113
113
  Then seed a minimal `.progress.md`:
114
114
 
115
- ```bash
116
- cat > ".flow/specs/$SPEC_NAME/.progress.md" <<MD
115
+ Use the `Write` tool for `.flow/specs/$SPEC_NAME/.progress.md`:
116
+
117
+ ```markdown
117
118
  # Progress Log — $SPEC_NAME
118
119
 
119
120
  **Goal**: $GOAL
120
121
  **Mode**: $FLAG_MODE
121
- **Created**: $(date -u +%Y-%m-%d)
122
+ **Created**: YYYY-MM-DD
122
123
 
123
124
  ## Decisions
124
125
  (populated during /curdx-flow:spec)
125
126
 
126
127
  ## Learnings
127
128
  (populated during /curdx-flow:implement)
128
- MD
129
129
  ```
130
130
 
131
131
  ### Branch E: no args, no flags
@@ -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