@haposoft/cafekit 0.8.7 → 0.8.9
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.
- package/package.json +1 -1
- package/src/claude/CLAUDE.md +2 -2
- package/src/claude/agents/code-auditor.md +9 -1
- package/src/claude/agents/inspector.md +24 -1
- package/src/claude/agents/spec-maker.md +26 -22
- package/src/claude/agents/test-runner.md +27 -5
- package/src/claude/hooks/spec-state.cjs +2 -1
- package/src/claude/migration-manifest.json +2 -1
- package/src/claude/rules/workflow.md +5 -4
- package/src/claude/scripts/validate-spec-output.cjs +271 -0
- package/src/claude/skills/code-review/references/spec-compliance-review.md +1 -1
- package/src/claude/skills/develop/SKILL.md +43 -12
- package/src/claude/skills/develop/references/quality-gate.md +43 -40
- package/src/claude/skills/specs/SKILL.md +32 -27
- package/src/claude/skills/specs/references/review.md +2 -2
- package/src/claude/skills/specs/rules/tasks-generation.md +35 -9
- package/src/claude/skills/specs/templates/task.md +43 -33
- package/src/claude/skills/sync/SKILL.md +2 -2
- package/src/claude/skills/sync/references/sync-protocols.md +5 -5
- package/src/claude/skills/test/SKILL.md +32 -1
|
@@ -45,7 +45,7 @@ DO NOT write implementation code until an approved spec exists.
|
|
|
45
45
|
|
|
46
46
|
<DEFINITION-OF-DONE>
|
|
47
47
|
A task is NOT done because code compiles or a placeholder renders.
|
|
48
|
-
A task is done only when the task file's Completion Criteria AND
|
|
48
|
+
A task is done only when the task file's Completion Criteria AND Evidence section are satisfied with real execution proof. Existing specs may use `Task Test Plan & Verification Evidence` or legacy `Verification & Evidence`; treat those as the same contract.
|
|
49
49
|
</DEFINITION-OF-DONE>
|
|
50
50
|
|
|
51
51
|
<CONTRACT-FIDELITY>
|
|
@@ -53,6 +53,11 @@ If the spec/task explicitly names a framework, auth system, datastore, transport
|
|
|
53
53
|
You MUST NOT silently replace it with a simpler custom substitute ("for MVP", "placeholder", "temporary auth", "in-memory until later") unless the spec itself is updated first.
|
|
54
54
|
</CONTRACT-FIDELITY>
|
|
55
55
|
|
|
56
|
+
<SCOPE-FIDELITY>
|
|
57
|
+
The approved `scope_lock`, requirements, design contracts, and active task packet are the implementation contract.
|
|
58
|
+
You MUST implement all scoped behavior for the active task, MUST NOT add out-of-scope behavior, and MUST NOT mark work done while required surfaces exist only as orphaned files, unmounted UI, unregistered routes, uncalled loaders, or placeholder wiring.
|
|
59
|
+
</SCOPE-FIDELITY>
|
|
60
|
+
|
|
56
61
|
## Anti-Rationalization Protocol
|
|
57
62
|
|
|
58
63
|
| Thought (Excuse) | Reality (Rule) |
|
|
@@ -66,12 +71,14 @@ You MUST NOT silently replace it with a simpler custom substitute ("for MVP", "p
|
|
|
66
71
|
flowchart TD
|
|
67
72
|
A["/hapo:develop \u003cfeature\u003e"] --> B[Step 1: Load Spec]
|
|
68
73
|
B -->|Missing| Z[Stop: Run /hapo:specs]
|
|
69
|
-
B -->|Ready| C[Step 2: Scout
|
|
74
|
+
B -->|Ready| C[Step 2: Task-Aware Scout (inspector)]
|
|
70
75
|
C --> D[Step 3: Implement Code (god-developer)]
|
|
71
|
-
D --> E[Step 4: Quality Gate: Test + Review + Evidence]
|
|
72
|
-
E -->|Fail
|
|
76
|
+
D --> E[Step 4: Quality Gate: Test + Spec Review + Code Review + Evidence]
|
|
77
|
+
E -->|Fail| D
|
|
73
78
|
E -->|Pass| F[Step 5: State Sync + Incremental Docs Sync]
|
|
74
|
-
F -->
|
|
79
|
+
F --> H{More tasks?}
|
|
80
|
+
H -->|Yes| B
|
|
81
|
+
H -->|No| G[Final Integration Scout + Report Completion]
|
|
75
82
|
```
|
|
76
83
|
|
|
77
84
|
### Step 1: Initialize & Load Spec
|
|
@@ -85,7 +92,7 @@ flowchart TD
|
|
|
85
92
|
- Objective + Constraints
|
|
86
93
|
- Related Files
|
|
87
94
|
- Completion Criteria
|
|
88
|
-
- Task Test Plan & Verification Evidence
|
|
95
|
+
- Evidence (or `Task Test Plan & Verification Evidence` / legacy `Verification & Evidence`)
|
|
89
96
|
- Exact executable verification commands named in the task
|
|
90
97
|
- Requirement IDs referenced by the task
|
|
91
98
|
- Named technologies, frameworks, protocols, and data stores that the task/spec explicitly requires
|
|
@@ -94,11 +101,26 @@ flowchart TD
|
|
|
94
101
|
- Before coding, set the active task(s) to `in_progress` in both markdown and `spec.json.task_registry`, or route through `/hapo:sync` if the runtime expects the sync protocol.
|
|
95
102
|
|
|
96
103
|
### Step 2: Scout (Codebase Inspection)
|
|
97
|
-
- **Mandatory:** Call agent `Agent(subagent_type="inspector", ...)`
|
|
104
|
+
- **Mandatory per task:** Call agent `Agent(subagent_type="inspector", ...)` before implementing EVERY active task. This is task-aware scouting, not a one-time global scan.
|
|
105
|
+
- The inspector prompt MUST include:
|
|
106
|
+
- Active task file path and extracted task packet
|
|
107
|
+
- Requirement IDs and `scope_lock`
|
|
108
|
+
- Relevant `design.md` contracts/invariants
|
|
109
|
+
- Prior completed task outputs from `spec.json.task_registry`
|
|
110
|
+
- Related Files from the active task
|
|
111
|
+
- Inspector MUST report:
|
|
112
|
+
- Real runtime entrypoints/callers affected by the task (`App.tsx`, routes, CLI command, worker registration, manifest, API consumer, etc.)
|
|
113
|
+
- Existing integration points and adjacent code patterns to follow
|
|
114
|
+
- Prior task outputs this task must consume or preserve
|
|
115
|
+
- Blast-radius touchpoints and dependent files that can regress
|
|
116
|
+
- Reachability risks: orphan components, unmounted UI, unregistered routes, uncalled services/loaders, unused providers, disconnected reducers/actions
|
|
117
|
+
- Exact files likely safe to modify and any files outside `Related Files` that require a justified scope escape
|
|
118
|
+
- If the inspector cannot identify the entrypoint/caller for a runtime-facing task, STOP and route back to spec correction or ask the user. Do not guess.
|
|
98
119
|
|
|
99
120
|
### Step 3: Implement Code
|
|
100
121
|
- Act as `god-developer` OR directly write code, executing tasks specified in the loaded Markdown file(s) sequentially.
|
|
101
122
|
- **Important:** You may create and modify files directly, but must faithfully follow the design from the Spec.
|
|
123
|
+
- You MUST use the Step 2 scout report as implementation context. If code reality contradicts the task packet, stop and reconcile the spec before coding.
|
|
102
124
|
- Progress tracking: Temporarily change `[ ]` to `[/]` in Spec files while coding is in progress. Do NOT mark `[x]` before Step 4 passes.
|
|
103
125
|
- **Task Boundary Protocol (CRITICAL):**
|
|
104
126
|
- Default editable scope is `Related Files` from the task packet.
|
|
@@ -112,18 +134,22 @@ flowchart TD
|
|
|
112
134
|
- **Named Technology Rule:** If the task/spec explicitly requires a named dependency or runtime choice (for example Better Auth, Hono, Next.js proxy routes, Redis, Drizzle, S3), you MUST implement that choice or stop. Do not swap it for a custom/in-memory/local substitute and still call the task complete.
|
|
113
135
|
- **Cross-Service Reality Rule:** If a task spans multiple processes or runtimes (web ↔ API, worker ↔ DB, extension ↔ backend), you MUST prove the integration uses shared real state or a real contract boundary. Process-local placeholders on both sides do not count as completion.
|
|
114
136
|
- **Placeholder Completion Rule:** You MAY scaffold future files only when the active task truly needs them to compile, but placeholder route handlers, in-memory stores, or fake adapters MUST NOT be used as evidence that the current task's behavior works end-to-end.
|
|
137
|
+
- **Reachability Rule:** Runtime-facing work is incomplete until it is reachable from the real entrypoint/caller named in the task evidence or Step 2 scout report. Creating a component/service/route/provider/reducer without importing, mounting, registering, or invoking it is not implementation.
|
|
138
|
+
- **Prior Output Consumption Rule:** If this task depends on previous task outputs, verify those outputs are consumed through real code paths. If a prior output is unused and this task is responsible for wiring it, wire it now; if a later task owns the wiring, keep the current task pending unless that deferral is named in the active task evidence.
|
|
115
139
|
|
|
116
140
|
### Step 4: Self-Healing (Quality Gate Auto-Fix)
|
|
117
141
|
The moment you finish coding, DO NOT proceed further. Switch to `references/quality-gate.md` and run the automatic review loop.
|
|
118
|
-
**Mantra:** All feedback from code-auditor must be addressed thoroughly: Score >= 9.5 & Zero Critical issues.
|
|
142
|
+
**Mantra:** Scope/spec compliance first, code quality second. All feedback from code-auditor must be addressed thoroughly: Score >= 9.5 & Zero Critical issues.
|
|
119
143
|
|
|
120
144
|
- Passing Step 4 requires ALL of the following:
|
|
121
|
-
1. Automated verification passes, including preflight compile/typecheck/build health and every exact command named in the task's `Task Test Plan & Verification Evidence`
|
|
122
|
-
2.
|
|
123
|
-
3.
|
|
145
|
+
1. Automated verification passes, including preflight compile/typecheck/build health and every exact command named in the task's `Evidence` section (or `Task Test Plan & Verification Evidence` / legacy `Verification & Evidence`)
|
|
146
|
+
2. Spec compliance review passes: every scoped requirement and active task criterion is implemented, with no extras and no omissions
|
|
147
|
+
3. Code quality review passes
|
|
148
|
+
4. Task evidence passes (artifacts/runtime surfaces/reachability/negative-path checks from the task file are proven)
|
|
124
149
|
- `PRECHECK_FAIL` outranks `NO_TESTS`. If compile/typecheck/build fails, the task is FAIL even when no test suite exists yet.
|
|
125
150
|
- `NO_TESTS` is NOT equivalent to PASS. If the task explicitly requires a test command or automated test proof, `NO_TESTS` is a FAIL or BLOCKED outcome until the requirement is satisfied or the spec is corrected.
|
|
126
151
|
- If build/test passes but task evidence is missing, the task is still FAIL.
|
|
152
|
+
- If runtime-facing work is orphaned, unmounted, unregistered, uncalled, or unreachable from the declared entrypoint/caller, the task is still FAIL.
|
|
127
153
|
- If the implementation silently replaced a named contract choice or relies on cross-service process-local stand-ins, the task is still FAIL.
|
|
128
154
|
- Only escalate to the user after 3 consecutive failed review rounds.
|
|
129
155
|
|
|
@@ -135,7 +161,7 @@ The moment you finish coding, DO NOT proceed further. Switch to `references/qual
|
|
|
135
161
|
- `spec.json.task_registry[path].status = "done"`
|
|
136
162
|
- `completed_at` + `last_updated_at`
|
|
137
163
|
- synchronized top-level `updated_at`
|
|
138
|
-
- a human-readable verification receipt inside the task's `
|
|
164
|
+
- a human-readable verification receipt inside the task's `Evidence` section showing which commands ran, their outcomes, and what proof was observed
|
|
139
165
|
- Verification receipts with `PRECHECK_FAIL`, `FAIL`, `UNVERIFIED`, or an explicit note that the implementation intentionally simplified a named contract MUST NOT be synchronized as `done`.
|
|
140
166
|
- After syncing the active task, run a **Task Closeout Docs Checkpoint**
|
|
141
167
|
- Task Closeout Docs Checkpoint:
|
|
@@ -147,6 +173,11 @@ The moment you finish coding, DO NOT proceed further. Switch to `references/qual
|
|
|
147
173
|
- Task-level docs sync happens after every verified completed task, but actual edits still depend on `Docs impact`.
|
|
148
174
|
- In **Specific-Task Mode**, STOP after sync and report the result.
|
|
149
175
|
- In **Full-Spec Mode**, only after sync may you re-read `task_registry`, pick the next unblocked pending task, and repeat from Step 1 for that task.
|
|
176
|
+
- When no pending tasks remain, run a **Final Integration Scout** before reporting completion:
|
|
177
|
+
- Trace runtime entrypoints from `main`/route/CLI/worker/manifest/API consumer through the scoped feature surfaces.
|
|
178
|
+
- Compare reachable behavior against `scope_lock`, `requirements.md`, `design.md`, and all task Completion Criteria.
|
|
179
|
+
- FAIL completion if any scoped surface is missing, any created runtime-facing artifact is orphaned, or spec progress/registry says done while evidence is missing.
|
|
180
|
+
- Only then set top-level progress to `code_done` / next phase.
|
|
150
181
|
|
|
151
182
|
---
|
|
152
183
|
## Attached References
|
|
@@ -1,23 +1,27 @@
|
|
|
1
|
-
# Quality Gate —
|
|
1
|
+
# Quality Gate — Task Evidence + Two-Stage Review Loop
|
|
2
2
|
|
|
3
3
|
This is the critical checkpoint protecting codebase quality at Step 4 of `hapo:develop`.
|
|
4
4
|
Runs AUTOMATICALLY. Only escalates to user after 3 consecutive failures or a critical block.
|
|
5
|
-
Green tests are NOT enough. The gate requires
|
|
5
|
+
Green tests are NOT enough. The gate requires four proofs:
|
|
6
6
|
1. Automated verification (typecheck/test/build)
|
|
7
|
-
2.
|
|
8
|
-
3.
|
|
7
|
+
2. Spec compliance review (scope/task/design adherence)
|
|
8
|
+
3. Code quality review
|
|
9
|
+
4. Task evidence (completion criteria + runtime/artifact/reachability proof from the task file)
|
|
9
10
|
|
|
10
11
|
## Automation Semantics
|
|
11
12
|
|
|
12
|
-
- If the task names exact commands in `Task Test Plan & Verification Evidence`
|
|
13
|
+
- If the task names exact commands in `Evidence` (or `Task Test Plan & Verification Evidence` / legacy `Verification & Evidence`), those exact commands are mandatory and must run before any fallback repo defaults.
|
|
13
14
|
- Preflight compile/typecheck/build health is mandatory. If compile/typecheck/build fails before tests are meaningful, the gate result is `PRECHECK_FAIL`, not `NO_TESTS`.
|
|
14
15
|
- `NO_TESTS` is never an automatic PASS.
|
|
15
16
|
- `NO_TESTS` is acceptable only when the task does **not** require a dedicated test suite command and every other required automated command/evidence item passes.
|
|
16
17
|
- If the task explicitly requires tests and the repo has no such test command or suite, the task is FAIL or BLOCKED, not done.
|
|
18
|
+
- If the task kind implies a concrete test type, the gate must enforce it: unit tests for logic/regression, component or integration tests for stateful UI or cross-module wiring, E2E/UI-flow checks for complete user workflows, visual/responsive checks for layout/theme work, accessibility checks for interactive UI, and smoke checks for scaffold/config. Performance/security checks are mandatory only when specified by requirement/risk/boundary.
|
|
17
19
|
- Named frameworks, auth systems, transports, datastores, and runtime boundaries in the task/spec are contractual. Silent substitutions are review failures, not acceptable implementation trade-offs.
|
|
18
20
|
- Multi-process or multi-runtime flows must prove shared real state or a real boundary contract. Matching in-memory placeholders on both sides do not count as working integration.
|
|
21
|
+
- Scope fidelity is mandatory: missing scoped behavior, extra unapproved behavior, or task output that exists only as orphaned/unreachable code is a review failure even when build/tests pass.
|
|
22
|
+
- Runtime-facing artifacts must be reachable from the real entrypoint/caller named by the task or the task-aware scout report.
|
|
19
23
|
|
|
20
|
-
##
|
|
24
|
+
## Quality Cycle
|
|
21
25
|
|
|
22
26
|
Maximum retry counter: **3 attempts**. Exceeding 3 triggers a collapse warning.
|
|
23
27
|
|
|
@@ -26,69 +30,68 @@ Variable: retry_count = 0
|
|
|
26
30
|
|
|
27
31
|
Before START_LOOP:
|
|
28
32
|
- Read the active task file(s)
|
|
29
|
-
- Extract Related Files, Completion Criteria, Task Test Plan & Verification Evidence
|
|
33
|
+
- Extract Related Files, Completion Criteria, Evidence (or Task Test Plan & Verification Evidence / legacy Verification & Evidence)
|
|
30
34
|
- Extract the exact executable verification commands in declaration order
|
|
31
35
|
- Extract relevant design contracts/invariants for the touched area
|
|
36
|
+
- Extract scope_lock, requirement IDs, runtime entrypoints/callers, and reachability proof obligations
|
|
32
37
|
- If any of these are missing or too vague to verify, FAIL immediately and route back to spec correction
|
|
33
38
|
|
|
34
39
|
START_LOOP:
|
|
35
40
|
---------------------------------------------------------------
|
|
36
|
-
|
|
41
|
+
STAGE A: Test + SPEC COMPLIANCE review
|
|
37
42
|
---------------------------------------------------------------
|
|
38
43
|
→ Agent(subagent_type="test-runner",
|
|
39
|
-
prompt="Run task-aware verification for the recently implemented code. Read the active task file(s) and execute the exact verification commands named there first, in order. Preflight compile/typecheck/build failures must be reported as PRECHECK_FAIL and take precedence over NO_TESTS. After that, run any additional repo-level typecheck/test/build checks needed for confidence. Inspect named artifacts/runtime outputs. For multi-service tasks, verify the flow does not rely on process-local stand-ins masquerading as shared state. Return PASS only if automated checks and task evidence both pass. Mark anything unexecuted as UNVERIFIED. Treat NO_TESTS as non-passing unless the task did not require a dedicated test suite.",
|
|
44
|
+
prompt="Run task-aware verification for the recently implemented code. Read the active task file(s) and execute the exact verification commands named there first, in order. Preflight compile/typecheck/build failures must be reported as PRECHECK_FAIL and take precedence over NO_TESTS. After that, run any additional repo-level typecheck/test/build checks needed for confidence. Inspect named artifacts/runtime outputs and prove runtime reachability from declared entrypoints/callers. For multi-service tasks, verify the flow does not rely on process-local stand-ins masquerading as shared state. Return PASS only if automated checks and task evidence both pass. Mark anything unexecuted as UNVERIFIED. Treat NO_TESTS as non-passing unless the task did not require a dedicated test suite.",
|
|
40
45
|
description="Test [feature]")
|
|
41
46
|
|
|
42
47
|
→ Agent(subagent_type="code-auditor",
|
|
43
|
-
prompt="
|
|
44
|
-
description="
|
|
48
|
+
prompt="SPEC COMPLIANCE REVIEW ONLY. Do not trust the implementer's report. Read the active task file(s), scope_lock, referenced requirements, design contracts, task-aware scout report, and actual code. Verify line by line that every scoped requirement and completion criterion is implemented, nothing out-of-scope was added, and every runtime-facing artifact is reachable from the declared entrypoint/caller or explicitly deferred to a named later task. Missing deliverables, placeholder-only wiring, orphan components/services, unmounted UI, unregistered routes, uncalled loaders, missing runtime entrypoints, overscope edits outside the task packet, silent replacement of named technologies/contracts, or fake cross-service proof via process-local state are Critical even if build/tests pass. Return SPEC_PASS or SPEC_FAIL, critical count, file:line findings, and evidence gaps.",
|
|
49
|
+
description="Spec review [feature]")
|
|
45
50
|
|
|
46
51
|
Wait for BOTH to return results.
|
|
47
52
|
|
|
48
|
-
|
|
49
|
-
COMBINE RESULTS
|
|
50
|
-
---------------------------------------------------------------
|
|
51
|
-
|
|
52
|
-
CASE 1 — PRECHECK_FAIL OR Automated FAIL OR required command missing OR Evidence FAIL / UNVERIFIED OR NO_TESTS when tests were required:
|
|
53
|
+
CASE 1 — PRECHECK_FAIL OR Automated FAIL OR required command missing OR Evidence FAIL / UNVERIFIED OR Reachability FAIL / SPEC_FAIL OR NO_TESTS when tests were required:
|
|
53
54
|
- Increment retry_count++
|
|
54
55
|
- If retry_count >= 3:
|
|
55
56
|
→ COLLAPSE! AskUserQuestion: "Quality gate cannot prove this task is complete! User intervention required!"
|
|
56
57
|
- If retry_count < 3:
|
|
57
|
-
→ Return to Step 3 (god-developer). Fix the failing checks or missing evidence first.
|
|
58
|
-
→ GOTO START_LOOP
|
|
58
|
+
→ Return to Step 3 (god-developer). Fix the failing checks, spec gaps, or missing evidence first.
|
|
59
|
+
→ GOTO START_LOOP
|
|
60
|
+
|
|
61
|
+
CASE 2 — Test PASS + Evidence PASS + SPEC_PASS:
|
|
62
|
+
→ Proceed to STAGE B code quality review.
|
|
59
63
|
|
|
60
|
-
|
|
64
|
+
STAGE B:
|
|
65
|
+
---------------------------------------------------------------
|
|
66
|
+
CODE QUALITY REVIEW (only after spec compliance passes)
|
|
67
|
+
---------------------------------------------------------------
|
|
68
|
+
→ Agent(subagent_type="code-auditor",
|
|
69
|
+
prompt="CODE QUALITY REVIEW. Spec compliance already passed. Review recently written code for security, logic correctness, architecture, YAGNI/KISS/DRY, maintainability, tests, and project conventions. Also re-check that no recent edits broke dependents found by the task-aware scout report. Return score (X/10), critical count, warning list, and concrete file:line findings.",
|
|
70
|
+
description="Quality review [feature]")
|
|
71
|
+
|
|
72
|
+
CASE 3 — Code quality review FAIL (Score < 9.5 OR Critical > 0):
|
|
61
73
|
- Increment retry_count++
|
|
62
74
|
- If retry_count >= 3:
|
|
63
75
|
→ COLLAPSE! AskUserQuestion: "Code does not meet minimum standards! User intervention required!"
|
|
64
76
|
- If retry_count < 3:
|
|
65
|
-
→ Fix each review issue
|
|
66
|
-
→ GOTO
|
|
77
|
+
→ Fix each review issue.
|
|
78
|
+
→ GOTO START_LOOP unless the fix is prose-only and cannot affect evidence; otherwise re-run Stage B.
|
|
67
79
|
|
|
68
|
-
CASE
|
|
80
|
+
CASE 4 — Test PASS + Evidence PASS + SPEC_PASS + Code quality review PASS (Score >= 9.5 AND Critical = 0):
|
|
69
81
|
→ PASS! Auto-approved.
|
|
70
|
-
→ PROCEED to completion report with a verification receipt summarizing exact commands executed, artifact/runtime proof, and review result.
|
|
71
|
-
|
|
72
|
-
REVIEW_ONLY:
|
|
73
|
-
---------------------------------------------------------------
|
|
74
|
-
Re-run ONLY code-auditor (tests already passed and no new evidence-producing code changed)
|
|
75
|
-
---------------------------------------------------------------
|
|
76
|
-
→ Agent(subagent_type="code-auditor", ...)
|
|
77
|
-
|
|
78
|
-
IF Score >= 9.5 AND Critical = 0 → PASS!
|
|
79
|
-
IF Score < 9.5 OR Critical > 0:
|
|
80
|
-
- retry_count++
|
|
81
|
-
- If retry_count >= 3 → COLLAPSE
|
|
82
|
-
- Else → fix issues, GOTO REVIEW_ONLY
|
|
82
|
+
→ PROCEED to completion report with a verification receipt summarizing exact commands executed, artifact/runtime/reachability proof, spec review result, and code quality review result.
|
|
83
83
|
```
|
|
84
84
|
|
|
85
85
|
## Critical Issue Definitions
|
|
86
|
+
|
|
86
87
|
- **Security:** XSS vulnerabilities, SQL injection, leaked env tokens/secrets.
|
|
87
|
-
- **Performance:** Bottlenecks, O(n
|
|
88
|
+
- **Performance:** Bottlenecks, O(n^3) algorithms, unbounded loops over DB calls.
|
|
88
89
|
- **Architecture:** Breaking MVC boundaries, cross-module coupling, convention violations.
|
|
89
90
|
- **Principles:** YAGNI violations, KISS violations, DRY violations (excessive code duplication).
|
|
90
91
|
- **Evidence / Done-Criteria Drift:** Missing required artifacts, placeholder-only wiring, missing entrypoints, unproven completion criteria, or runtime contract mismatches.
|
|
91
|
-
- **
|
|
92
|
+
- **Reachability Failure:** Orphan components/services/hooks/routes/workers/commands/providers/reducers, unmounted UI, unregistered routes, uncalled data loaders, unused providers, disconnected actions, or any runtime-facing artifact that cannot be reached from the declared entrypoint/caller.
|
|
93
|
+
- **Scope Drift:** Scoped acceptance criteria omitted, behavior added outside `scope_lock`, or a task marked complete while part of its approved requirement remains unwired.
|
|
94
|
+
- **Overscope Delivery Drift:** Implementing later-task deliverables or editing out-of-scope files without direct justification for the active task packet.
|
|
92
95
|
- **Contract Substitution Drift:** Replacing a named framework/auth/transport/datastore/runtime boundary with a custom simplification without a spec amendment.
|
|
93
96
|
- **Cross-Service Reality Failure:** Claiming end-to-end behavior across web/api/worker/extension boundaries while state only exists in local process memory or placeholder adapters.
|
|
94
97
|
|
|
@@ -96,8 +99,8 @@ REVIEW_ONLY:
|
|
|
96
99
|
|
|
97
100
|
Must log the Quality Gate result to the terminal for user visibility:
|
|
98
101
|
|
|
99
|
-
- **Quick Pass:** `✓ Step 4 Quality Gate: Test PASS + Evidence PASS + Review 9.5/10 - Auto-Approved`
|
|
100
|
-
- **Hard-Won Pass:** `✓ Step 4 Quality Gate: Failed 2 rounds → Test PASS + Evidence PASS + Review 9.6/10`
|
|
102
|
+
- **Quick Pass:** `✓ Step 4 Quality Gate: Test PASS + Evidence PASS + Spec PASS + Review 9.5/10 - Auto-Approved`
|
|
103
|
+
- **Hard-Won Pass:** `✓ Step 4 Quality Gate: Failed 2 rounds → Test PASS + Evidence PASS + Spec PASS + Review 9.6/10`
|
|
101
104
|
- **Preflight Fail:** `[x] Step 4 Quality Gate: PRECHECK_FAIL → compile/typecheck/build failed before tests mattered`
|
|
102
|
-
- **Fix Needed:** `[~] Step 4 Quality Gate: Tests/evidence failed → returned to god-developer`
|
|
105
|
+
- **Fix Needed:** `[~] Step 4 Quality Gate: Tests/spec/evidence failed → returned to god-developer`
|
|
103
106
|
- **Awaiting Rescue:** `[!] Step 4 Quality Gate: Failed 3 rounds! Awaiting user intervention...`
|
|
@@ -80,6 +80,9 @@ Forbidden generated artifacts:
|
|
|
80
80
|
- Do NOT create shorthand task files such as `tasks/task-R0-1.md`, `tasks/task-R1-1.md`, or `tasks/R0-1-<slug>.md`.
|
|
81
81
|
- The template file name is never the output file name. `templates/spec-state.json` is only the schema source for generated `spec.json`.
|
|
82
82
|
- Task hydration is session/task-state synchronization only; it MUST NOT be written as a markdown artifact.
|
|
83
|
+
- Before marking a spec ready, run the deterministic validator:
|
|
84
|
+
- `node .claude/scripts/validate-spec-output.cjs specs/<feature>`
|
|
85
|
+
- Any validator failure blocks `ready_for_implementation = true`.
|
|
83
86
|
|
|
84
87
|
### Writing Style
|
|
85
88
|
- Concise, prefer bullet lists
|
|
@@ -266,7 +269,10 @@ Load: `references/scope-inquiry.md`
|
|
|
266
269
|
- Load `rules/tasks-parallel-analysis.md` for parallel markers (default: enabled)
|
|
267
270
|
- Each task file follows template `templates/task.md`
|
|
268
271
|
- `Related Files` and test plans must inherit paths, contracts, and test targets from the codebase scout. If exact files/tests cannot be named for an enhancement, run targeted inspect before generating tasks.
|
|
269
|
-
- Each task file MUST include `Completion Criteria` and `
|
|
272
|
+
- Each task file MUST include `Completion Criteria` and `Evidence` sections detailed enough that a downstream quality gate can prove the task is truly done. Existing specs may use `Task Test Plan & Verification Evidence` or legacy `Verification & Evidence`.
|
|
273
|
+
- Each task's `Evidence` MUST choose the right proof type for the touched surface: unit for pure logic, component/integration for UI or state wiring, E2E/UI flow for complete user workflows, visual/responsive checks for style/layout work, accessibility checks for interactive UI, smoke checks for scaffold/config, regression checks for bug fixes, and performance/security checks only when the requirement or risk calls for them.
|
|
274
|
+
- Every task MUST preserve the approved `scope_lock`: implement all scoped acceptance criteria for its requirement, avoid out-of-scope features, and record any intentional deferral as a named later task rather than implicit omission.
|
|
275
|
+
- For UI/app/runtime features, generate a final integration/reachability task or final section that names the real runtime entrypoint and proves prior task outputs are imported, mounted, registered, invoked, or otherwise reachable.
|
|
270
276
|
- Build `spec.json.task_registry` alongside `task_files`. For each task file, register at minimum:
|
|
271
277
|
- `id`
|
|
272
278
|
- `title`
|
|
@@ -278,11 +284,11 @@ Load: `references/scope-inquiry.md`
|
|
|
278
284
|
- `last_updated_at`
|
|
279
285
|
- Update `spec.json` phase + task metadata
|
|
280
286
|
|
|
281
|
-
#### Requirement-
|
|
282
|
-
Tasks MUST be organized
|
|
287
|
+
#### Requirement-Covered Task Grouping (MANDATORY)
|
|
288
|
+
Tasks MUST be organized by implementation flow while preserving explicit requirement coverage. Foundation work uses `R0`; feature work uses `R1+`.
|
|
283
289
|
|
|
284
290
|
**Naming convention:** `tasks/task-R{N}-{SEQ}-<slug>.md`
|
|
285
|
-
- `R{N}` =
|
|
291
|
+
- `R{N}` = foundation or implementation cluster (R0 foundation, R1+ feature work)
|
|
286
292
|
- `{SEQ}` = sequential number within that requirement (01, 02, 03...)
|
|
287
293
|
- `<slug>` = descriptive kebab-case name
|
|
288
294
|
|
|
@@ -301,11 +307,11 @@ tasks/
|
|
|
301
307
|
```
|
|
302
308
|
|
|
303
309
|
**Splitting rules:**
|
|
304
|
-
-
|
|
305
|
-
- A task file
|
|
306
|
-
-
|
|
307
|
-
-
|
|
308
|
-
- After generating all tasks: verify **every requirement ID** appears
|
|
310
|
+
- Split by real implementation dependency chain first: model/schema -> service -> API -> UI -> integration.
|
|
311
|
+
- A task file MAY cover multiple requirement IDs when one code change naturally satisfies them.
|
|
312
|
+
- A requirement MAY be covered by multiple task files when it spans layers.
|
|
313
|
+
- Do not create all tasks under `R0`; `R0` is only shared foundation/setup.
|
|
314
|
+
- After generating all tasks: verify **every requirement ID** appears in at least one task file's `## Requirements` section — gaps = failure.
|
|
309
315
|
- **Legacy Protection:** If the `research.md` identified existing codebase files or tests that will be broken (Blast Radius), you MUST generate explicitly tasked files (e.g., `task-R5-01-update-legacy-tests.md`) to fix those breakages. Do not leave broken tests out of scope.
|
|
310
316
|
|
|
311
317
|
**Dependency ordering:** Tasks within the same requirement are ordered by natural implementation flow. Cross-requirement dependencies use `Dependencies:` field referencing other task file names.
|
|
@@ -314,23 +320,17 @@ tasks/
|
|
|
314
320
|
Each task file MUST be **self-contained and implementation-ready** — detailed enough for a junior developer or AI coding agent to execute without guessing.
|
|
315
321
|
|
|
316
322
|
**Structure per task file:**
|
|
317
|
-
1. **
|
|
318
|
-
2. **
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
- Validation rules
|
|
325
|
-
- `_Requirements: X.X_` at the END of every sub-task — **no exceptions**
|
|
326
|
-
3. **Test coverage** — Last major step in every task must cover unit + integration tests
|
|
327
|
-
4. **Related Files** — Table with exact paths, action type, and descriptions
|
|
328
|
-
5. **Completion Criteria** — Observable, testable criteria (checkbox format)
|
|
329
|
-
6. **Risk Assessment** — Table with risk, severity, mitigation
|
|
323
|
+
1. **Context** — why this task exists, current state, target outcome, relevant exact files.
|
|
324
|
+
2. **Steps** — concise implementation checklist with business intent and code-level detail.
|
|
325
|
+
3. **Requirements** — list requirement IDs and acceptance criteria covered by this task.
|
|
326
|
+
4. **Related Files** — table with exact paths, action type, and descriptions when paths are known; otherwise run scout first.
|
|
327
|
+
5. **Completion Criteria** — observable, testable criteria.
|
|
328
|
+
6. **Evidence** — automated command(s), artifact/runtime proof, negative-path proof, and runtime reachability proof.
|
|
329
|
+
7. **Risk Assessment** — table with risk, severity, mitigation.
|
|
330
330
|
|
|
331
331
|
**Parallel markers:** Append `(P)` to tasks that can run concurrently (no data dependency, no shared files, no prerequisite approval from another task). Tasks serving DIFFERENT requirements are often parallelizable.
|
|
332
332
|
|
|
333
|
-
**FORBIDDEN:** Task files with only
|
|
333
|
+
**FORBIDDEN:** Task files with only vague checkboxes and no exact files, requirements, or evidence. Compact is good; vague is invalid.
|
|
334
334
|
|
|
335
335
|
### Step 8: Task Hydration
|
|
336
336
|
Load: `references/task-hydration.md`
|
|
@@ -354,6 +354,7 @@ Load: `references/review.md` + `rules/design-review.md`
|
|
|
354
354
|
### Step 9.5: Finalization Audit (MANDATORY)
|
|
355
355
|
- Re-scan the `tasks/` directory and rebuild `spec.json.task_files` from the real filesystem (sorted, relative paths)
|
|
356
356
|
- Rebuild `spec.json.task_registry` from the real filesystem if it is missing, stale, or missing keys. Preserve task status fields when the path still matches.
|
|
357
|
+
- Run `node .claude/scripts/validate-spec-output.cjs specs/<feature>` and treat any non-zero exit as a blocking failure.
|
|
357
358
|
- FAIL if any task file exists on disk but is missing from `task_files`
|
|
358
359
|
- FAIL if any path in `task_files` does not exist on disk
|
|
359
360
|
- FAIL if any task file exists on disk but is missing from `task_registry`
|
|
@@ -361,8 +362,10 @@ Load: `references/review.md` + `rules/design-review.md`
|
|
|
361
362
|
- FAIL if any task file path does not match `tasks/task-R{N}-{SEQ}-<slug>.md` with two-digit `SEQ` (for example `tasks/task-R0-01-project-scaffolding.md`)
|
|
362
363
|
- FAIL if a newly generated non-trivial spec lacks a `research.md` Evidence Summary with codebase scout result, external research result or skip rationale, selected decision, rejected alternatives, and downstream task/test implications.
|
|
363
364
|
- FAIL if any requirement or NFR mapping uses non-numeric labels (`NFR-1`, `SEC-1`, etc.)
|
|
364
|
-
- FAIL if a task lacks `Completion Criteria` or `Task Test Plan & Verification Evidence`
|
|
365
|
-
- FAIL if
|
|
365
|
+
- FAIL if a task lacks `Completion Criteria` or `Evidence` (existing `Task Test Plan & Verification Evidence` or legacy `Verification & Evidence` is accepted)
|
|
366
|
+
- FAIL if a task creates runtime-facing artifacts but neither proves reachability from an entrypoint/caller nor names a later integration task responsible for wiring them.
|
|
367
|
+
- FAIL if a UI/app/runtime spec has multiple user-facing task outputs but no final integration/reachability task or final integration section.
|
|
368
|
+
- FAIL if accepted validation decisions exist in reports but are not reflected in the implementation-facing sections of affected artifacts (`Context`, `Steps`, `Requirements`, `Completion Criteria`, `Evidence`, canonical contracts, or requirements text).
|
|
366
369
|
- FAIL if the spec scope/provider was switched away from Anthropic/Claude but `requirements.md`, `design.md`, or `tasks/*.md` still contain stale provider-specific strings such as `Claude API`, `Haiku`, or `haiku_reachable`. `research.md` is the only allowed place for historical cost comparisons.
|
|
367
370
|
- FAIL if privacy/delete-data work lacks a single canonical deletion policy. The design MUST explicitly choose either:
|
|
368
371
|
1. hard-delete with no re-registration lock, or
|
|
@@ -445,7 +448,7 @@ specs/
|
|
|
445
448
|
├── requirements.md # Technical requirements (EARS format)
|
|
446
449
|
├── research.md # Research notes
|
|
447
450
|
├── design.md # Architectural design
|
|
448
|
-
├── tasks/ #
|
|
451
|
+
├── tasks/ # Foundation + implementation clusters (R0, R1, R2...)
|
|
449
452
|
│ ├── task-R0-01-foundation.md
|
|
450
453
|
│ ├── task-R1-01-<slug>.md
|
|
451
454
|
│ ├── task-R1-02-<slug>.md
|
|
@@ -500,13 +503,14 @@ Before finalizing any specification, assert all the following:
|
|
|
500
503
|
- [ ] **Requirements traceability** matrix present in design.md
|
|
501
504
|
- [ ] **Canonical Contracts & Invariants** filled for auth/transport/persistence/artifact-sensitive work
|
|
502
505
|
- [ ] **Every task file** maps to at least 1 valid in-scope requirement ID
|
|
503
|
-
- [ ] **Every task file** includes `
|
|
506
|
+
- [ ] **Every task file** includes `Evidence` with executable or inspectable proof
|
|
504
507
|
- [ ] **State Machine Blueprint:** design.md contains Mermaid diagrams for non-trivial flows
|
|
505
508
|
- [ ] **Dependency graph complete**: no task can start before its blockers are listed
|
|
506
509
|
- [ ] **Risk matrix filled**: likelihood × impact, with mitigation for High items
|
|
507
510
|
- [ ] **Test strategy defined**: what gets unit tested, integration tested, e2e validated
|
|
508
511
|
- [ ] **task_files inventory synced**: no missing or orphaned task references
|
|
509
512
|
- [ ] **task_registry synced**: every task file has exactly one machine-state entry with valid status + dependencies
|
|
513
|
+
- [ ] **deterministic validator passed**: `node .claude/scripts/validate-spec-output.cjs specs/<feature>`
|
|
510
514
|
- [ ] **Validation gate consistent**: validation_recommended and validation.status agree with spec risk
|
|
511
515
|
- [ ] **Provider wording clean**: no stale vendor/provider strings outside allowed research context
|
|
512
516
|
- [ ] **spec.json fully updated**: phase, current_phase, progress, timestamps, approvals, design_context
|
|
@@ -533,6 +537,7 @@ Before finalizing any specification, assert all the following:
|
|
|
533
537
|
- `design.md` — Design document template
|
|
534
538
|
- `research.md` — Research log template
|
|
535
539
|
- `task.md` — Template for individual task file
|
|
540
|
+
- `.claude/scripts/validate-spec-output.cjs` — Deterministic validator for generated spec artifacts
|
|
536
541
|
|
|
537
542
|
### Rules (`rules/`)
|
|
538
543
|
- `ears-format.md` — EARS requirements standard
|
|
@@ -42,8 +42,8 @@ These rules override any self-reasoning or optimization the system may attempt:
|
|
|
42
42
|
4. **Apply YAGNI to fixes.** When user says "configure later" or "decide later", add a single note to the task file. Do NOT generate multiple concrete implementations (e.g., 4 provider files when user only asked for abstraction).
|
|
43
43
|
5. **No false completion.** You MUST NOT set `validation.status = "completed"` or `ready_for_implementation = true` until a reconciliation audit proves the accepted findings and validation decisions are reflected in the physical spec artifacts.
|
|
44
44
|
6. **Provider drift is a real defect.** If the scope changed away from Claude/Anthropic, stale strings like `Claude API`, `Haiku`, or `haiku_reachable` in `requirements.md`, `design.md`, or `tasks/*.md` are validation failures. `research.md` may mention them only as historical comparison.
|
|
45
|
-
7. **Implementation-facing propagation is mandatory.** A decision that affects implementation is NOT considered applied if it only appears in `Risk Assessment`, `validate-log.md`, or `red-team-report.md`. It must update at least one of: `requirements.md`, `Canonical Contracts & Invariants`, `
|
|
46
|
-
8. **CafeKit command dialect only.** Validation output MUST use `/hapo:develop <feature>` as the implementation handoff.
|
|
45
|
+
7. **Implementation-facing propagation is mandatory.** A decision that affects implementation is NOT considered applied if it only appears in `Risk Assessment`, `validate-log.md`, or `red-team-report.md`. It must update at least one of: `requirements.md`, `Canonical Contracts & Invariants`, `Context`, `Steps`, `Requirements`, `Completion Criteria`, or `Evidence`.
|
|
46
|
+
8. **CafeKit command dialect only.** Validation output MUST use `/hapo:develop <feature>` as the implementation handoff. Never mention `/sdd:execute-spec`, `/sdd:*`, `/work`, `/code`, `/specs <feature> --approve`, `/hapo:specs <feature> --approve`, or non-CafeKit aliases.
|
|
47
47
|
9. **CafeKit task filename convention only.** Task files MUST use `tasks/task-R{N}-{SEQ}-<slug>.md` with two-digit `SEQ` (for example `tasks/task-R0-01-project-scaffolding.md`). Files like `tasks/R0-1-project-scaffolding.md` are legacy/foreign format; rename them and update `spec.json.task_files`, `spec.json.task_registry`, and dependency references before passing validation.
|
|
48
48
|
|
|
49
49
|
---
|
|
@@ -28,6 +28,7 @@ Detail bullets must include:
|
|
|
28
28
|
**Every task must**:
|
|
29
29
|
- Build on previous outputs (no orphaned code)
|
|
30
30
|
- Connect to the overall system (no hanging features)
|
|
31
|
+
- Stay inside the approved `scope_lock` and requirement IDs; do not add unapproved features or silently drop scoped behavior
|
|
31
32
|
- Progress incrementally (no big jumps in complexity)
|
|
32
33
|
- Validate core functionality early in sequence
|
|
33
34
|
- Respect architecture boundaries defined in design.md (Architecture Pattern & Boundary Map)
|
|
@@ -37,6 +38,10 @@ Detail bullets must include:
|
|
|
37
38
|
- Use major task summaries sparingly—omit detail bullets if the work is fully captured by child tasks.
|
|
38
39
|
|
|
39
40
|
**End with integration tasks** to wire everything together.
|
|
41
|
+
- For UI/app/runtime workflows, the final integration task MUST name the real entrypoint (`App.tsx`, route, command, worker, extension manifest, API route, etc.) and verify every user-visible surface from the requirements is reachable from that entrypoint.
|
|
42
|
+
- Components, services, routes, commands, workers, providers, and data loaders created by earlier tasks MUST be consumed by a later integration task or explicitly marked as internal support in `design.md`; orphaned deliverables are invalid.
|
|
43
|
+
- Prefer compact, implementation-ready task prose over large boilerplate. The golden shape is: `Context` -> `Steps` -> `Requirements` -> `Related Files` -> `Completion Criteria` -> `Evidence` -> `Risk Assessment`.
|
|
44
|
+
- A compact task is valid when it names exact files/contracts, maps requirements, and gives executable evidence. Do not expand it into nested filler just to satisfy a template.
|
|
40
45
|
|
|
41
46
|
### 3. Flexible Task Sizing
|
|
42
47
|
|
|
@@ -80,6 +85,7 @@ Grouping tasks vertically by requirement carries the risk of "siloed" or fragmen
|
|
|
80
85
|
1. **Foundation First (The R0 Concept)**: Extract shared infrastructure, core database migrations, authentication wrappers, and base UI layouts into foundational tasks running before feature work. If these aren't explicitly in requirements, classify them as `task-R0-XX-foundation.md` or map them to the most logical architectural requirement. All parallel feature tasks MUST depend on these foundation tasks.
|
|
81
86
|
2. **Shared Interfaces (Horizontal Contracts)**: Sub-tasks that touch shared cross-requirement architecture (like registering a new page in a global `router.ts` or adding a column to a shared table) MUST explicitly reference the shared contract defined in `design.md`.
|
|
82
87
|
3. **Integration Enforcers**: If R1 and R2 interact (e.g., R2 UI displays data fetched by R1 backend), the later task MUST have a sub-task explicitly dedicated to "Wiring/Integrating with [Previous Feature] output".
|
|
88
|
+
4. **Final Runtime Integration**: For any feature that has a user-facing screen, public route, CLI command, background worker, browser extension surface, or API flow, create a final integration task (or a final integration section in the last dependent task) that proves the whole scoped feature works from its runtime entrypoint. This task MUST fail if prior-task outputs exist but are not imported, mounted, registered, or invoked.
|
|
83
89
|
|
|
84
90
|
### 3d. Spike Tasks for Complex/Uncertain Areas (MANDATORY)
|
|
85
91
|
|
|
@@ -136,31 +142,51 @@ Every task file MUST contain the Risk Assessment table, even if no risks are ide
|
|
|
136
142
|
- Never mark implementation work or integration-critical verification as optional—reserve `*` for auxiliary/deferrable test coverage that can be revisited post-MVP.
|
|
137
143
|
- Never mark auth, permissions, privacy, data deletion, migration, schema, or contract verification work as optional.
|
|
138
144
|
|
|
139
|
-
### Mandatory
|
|
145
|
+
### Mandatory Evidence Section
|
|
140
146
|
|
|
141
|
-
Every new task file MUST include a `##
|
|
147
|
+
Every new task file MUST include a `## Evidence` section. Existing specs may still use the v0.8 heading `## Task Test Plan & Verification Evidence` or the legacy `## Verification & Evidence` heading; readers and sync tools must support all three.
|
|
142
148
|
|
|
143
|
-
That section is the task-level test plan and MUST contain:
|
|
149
|
+
That section is the task-level test plan and proof checklist. It MUST contain:
|
|
144
150
|
1. **Automated proof** — exact command(s) for typecheck, tests, build, or explicit `N/A`
|
|
145
151
|
2. **Artifact/runtime proof** — exact files, routes, UI surfaces, generated outputs, or persisted state to inspect
|
|
146
152
|
3. **Contract/negative-path proof** — at least one contract-preserving check for unauthorized, invalid, missing-permission, rollback, or failure-path behavior when relevant
|
|
153
|
+
4. **Reachability proof** — when the task creates a runtime-facing artifact, name the upstream entrypoint or caller that reaches it; if reachability is deferred, name the exact later integration task responsible
|
|
147
154
|
|
|
148
155
|
Rules:
|
|
149
156
|
- If the task produces a build artifact or generated file, name the exact artifact path to inspect.
|
|
150
157
|
- If the task wires entrypoints (popup, content script, route, worker, CLI command), name the exact runtime surface that must exist after implementation.
|
|
158
|
+
- If the task creates a UI component, service, hook, reducer, route handler, worker, command, or data loader, the evidence MUST prove it is either reachable from the declared runtime surface or intentionally internal support for a named later task.
|
|
151
159
|
- If verification depends on environment or manual setup, document the blocker explicitly instead of implying success.
|
|
152
160
|
- Build success alone is NEVER enough evidence for a completed task.
|
|
153
161
|
- For provider-sensitive work, use provider-neutral wording unless the scope lock explicitly names a vendor.
|
|
154
162
|
- For delete-data/privacy work, task text MUST match the single deletion/retention policy chosen in `design.md`. Mixed policies are invalid.
|
|
155
163
|
|
|
164
|
+
### Test Type Selection
|
|
165
|
+
|
|
166
|
+
Choose verification by task risk and touched surface. Do not force every task to include every test type, but do not omit the test type that proves the task's actual behavior.
|
|
167
|
+
|
|
168
|
+
| Task kind | Required / expected proof |
|
|
169
|
+
|---|---|
|
|
170
|
+
| Pure logic, data transform, parser, sorting, filtering, validator | Unit test plus negative-path case |
|
|
171
|
+
| Stateful UI component or user interaction | Component test or integration test; add runtime UI check if the component must be mounted |
|
|
172
|
+
| Cross-module state, API, persistence, provider, or service boundary | Integration test that proves real contract/state handoff |
|
|
173
|
+
| User-facing workflow across screens/components | E2E or UI flow verification after the vertical slice exists |
|
|
174
|
+
| Layout, theme, responsive, visual style | Runtime/visual viewport checks; screenshot proof when practical |
|
|
175
|
+
| Keyboard/focus/form/modal/table interaction | Accessibility check for focus, labels, roles, and keyboard behavior |
|
|
176
|
+
| Scaffolding/config/release plumbing | Smoke checks: typecheck/build/test/dev-server or equivalent |
|
|
177
|
+
| Bug fix/regression | Regression test reproducing the old failure, then passing |
|
|
178
|
+
| Performance/security-sensitive requirement or touched surface | Performance/security check only when specified by requirements, design risk, or changed boundary |
|
|
179
|
+
|
|
180
|
+
`hapo:specs` writes the expected proof into each task. `hapo:develop` executes the task-local proof before marking the task done. `hapo:test` runs the broader system pass after implementation or for a requested feature scope.
|
|
181
|
+
|
|
156
182
|
## Task Hierarchy Rules
|
|
157
183
|
|
|
158
184
|
### Maximum 2 Levels
|
|
159
|
-
-
|
|
160
|
-
-
|
|
161
|
-
- **No deeper nesting** (no 1.1.1)
|
|
162
|
-
- If a major task would contain only a single actionable item, collapse the structure and promote the sub-task to the major level
|
|
163
|
-
- When a major task exists purely as a container, keep the checkbox description concise and avoid duplicating detailed bullets
|
|
185
|
+
- Prefer one actionable checkbox per real implementation step.
|
|
186
|
+
- Use sub-tasks (`1.1`, `1.2`) only when a step has multiple separately verifiable units.
|
|
187
|
+
- **No deeper nesting** (no `1.1.1`).
|
|
188
|
+
- If a major task would contain only a single actionable item, collapse the structure and promote the sub-task to the major level.
|
|
189
|
+
- When a major task exists purely as a container, keep the checkbox description concise and avoid duplicating detailed bullets.
|
|
164
190
|
|
|
165
191
|
### Sequential Numbering
|
|
166
192
|
- Major tasks MUST increment: 1, 2, 3, 4, 5...
|
|
@@ -210,6 +236,6 @@ Rules:
|
|
|
210
236
|
- If gaps found: Return to requirements or design phase
|
|
211
237
|
- No requirement should be left without corresponding tasks
|
|
212
238
|
|
|
213
|
-
Use
|
|
239
|
+
Use the requirement ID style already present in `requirements.md` (`R1`, `REQ-01`, or `N.M`). The task filename cluster (`task-R1-01-*`) does not have to mirror every requirement ID exactly, but every requirement MUST be listed in at least one task's `## Requirements` section.
|
|
214
240
|
|
|
215
241
|
Document any intentionally deferred requirements with rationale.
|