@haposoft/cafekit 0.7.29 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -12
- package/package.json +4 -1
- package/src/claude/CLAUDE.md +81 -135
- package/src/claude/agents/brainstormer.md +24 -13
- package/src/claude/agents/code-auditor.md +1 -1
- package/src/claude/agents/spec-maker.md +2 -2
- package/src/claude/agents/test-runner.md +10 -8
- package/src/claude/rules/ai-dev-rules.md +36 -51
- package/src/claude/rules/hook-protocols.md +35 -0
- package/src/claude/rules/orchestrator.md +11 -0
- package/src/claude/rules/workflow.md +41 -45
- package/src/claude/skills/brainstorm/SKILL.md +123 -39
- package/src/claude/skills/chrome-devtools/scripts/package.json +3 -1
- package/src/claude/skills/code-review/references/spec-compliance-review.md +1 -1
- package/src/claude/skills/develop/SKILL.md +4 -4
- package/src/claude/skills/develop/references/quality-gate.md +2 -2
- package/src/claude/skills/git/SKILL.md +19 -2
- package/src/claude/skills/git/references/finish-branch.md +61 -0
- package/src/claude/skills/pdf/scripts/__pycache__/check_bounding_boxes.cpython-314.pyc +0 -0
- package/src/claude/skills/specs/SKILL.md +15 -6
- package/src/claude/skills/specs/references/review.md +1 -1
- package/src/claude/skills/specs/rules/tasks-generation.md +3 -3
- package/src/claude/skills/specs/templates/task.md +4 -2
- package/src/claude/skills/sync/SKILL.md +2 -2
- package/src/claude/skills/sync/references/sync-protocols.md +4 -4
- package/src/claude/skills/test/SKILL.md +4 -1
- package/src/claude/skills/test/references/execution-strategy.md +3 -1
- package/src/claude/skills/test/references/test-memory.md +2 -2
|
@@ -136,11 +136,11 @@ Every task file MUST contain the Risk Assessment table, even if no risks are ide
|
|
|
136
136
|
- Never mark implementation work or integration-critical verification as optional—reserve `*` for auxiliary/deferrable test coverage that can be revisited post-MVP.
|
|
137
137
|
- Never mark auth, permissions, privacy, data deletion, migration, schema, or contract verification work as optional.
|
|
138
138
|
|
|
139
|
-
### Mandatory
|
|
139
|
+
### Mandatory Task Test Plan & Verification Evidence
|
|
140
140
|
|
|
141
|
-
Every task file MUST include a `##
|
|
141
|
+
Every new task file MUST include a `## Task Test Plan & Verification Evidence` section. Existing specs may still use the legacy `## Verification & Evidence` heading; readers and sync tools must support both.
|
|
142
142
|
|
|
143
|
-
That section MUST contain:
|
|
143
|
+
That section is the task-level test plan and MUST contain:
|
|
144
144
|
1. **Automated proof** — exact command(s) for typecheck, tests, build, or explicit `N/A`
|
|
145
145
|
2. **Artifact/runtime proof** — exact files, routes, UI surfaces, generated outputs, or persisted state to inspect
|
|
146
146
|
3. **Contract/negative-path proof** — at least one contract-preserving check for unauthorized, invalid, missing-permission, rollback, or failure-path behavior when relevant
|
|
@@ -58,7 +58,9 @@
|
|
|
58
58
|
- [ ] {{Criteria 2 — measurable behavior or negative-path outcome}}
|
|
59
59
|
- [ ] {{Criteria 3 — maps directly to acceptance criteria from requirements.md and can be proven below}}
|
|
60
60
|
|
|
61
|
-
##
|
|
61
|
+
## Task Test Plan & Verification Evidence
|
|
62
|
+
|
|
63
|
+
This section is the task-level test plan. It names the exact commands, observable runtime/artifact proof, and negative-path checks required before this task can be marked done.
|
|
62
64
|
|
|
63
65
|
- [ ] Automated verification
|
|
64
66
|
- Command(s): `{{TYPECHECK / TEST / BUILD COMMANDS OR N/A}}`
|
|
@@ -82,4 +84,4 @@
|
|
|
82
84
|
> **Parallel marker**: Append `(P)` to the title if this task can run concurrently with another (usually when serving different requirements).
|
|
83
85
|
> **Test note**: If a test coverage sub-task can be deferred post-MVP, mark it with `- [ ]*`.
|
|
84
86
|
> **Requirement mapping**: Every sub-task MUST end with `_Requirements: X.X_`. No mapping = invalid task file.
|
|
85
|
-
> **Verification rule**: No `##
|
|
87
|
+
> **Verification rule**: No `## Task Test Plan & Verification Evidence` section = invalid task file. Existing specs may use legacy `## Verification & Evidence`; agents must support both headings.
|
|
@@ -34,8 +34,8 @@ Scans the `spec.json` against all physical `task-R*.md` files to detect mismatch
|
|
|
34
34
|
|
|
35
35
|
1. **Precision Edits:** Never overwrite the entire `spec.json` string blindly. Update only the required keys, while keeping JSON valid.
|
|
36
36
|
2. **Machine + Human Sync:** Every task status update MUST modify both `spec.json.task_registry[...]` and the matching markdown task file header/status section.
|
|
37
|
-
3. **Markdown Integrity:** When marking a task `done`, only then turn `[ ]` into `[x]` inside `## Implementation Steps` and relevant `Completion Criteria` / `
|
|
38
|
-
4. **Verification Receipt Rule:** `done` is illegal without a human-readable verification receipt already present in `## Verification & Evidence` (commands executed, artifact/runtime proof, or equivalent concrete evidence). If proof is missing, keep the task `in_progress` or `blocked`.
|
|
37
|
+
3. **Markdown Integrity:** When marking a task `done`, only then turn `[ ]` into `[x]` inside `## Implementation Steps` and relevant `Completion Criteria` / `Task Test Plan & Verification Evidence` checkboxes that have actual proof. Legacy `Verification & Evidence` sections are supported.
|
|
38
|
+
4. **Verification Receipt Rule:** `done` is illegal without a human-readable verification receipt already present in `## Task Test Plan & Verification Evidence` or legacy `## Verification & Evidence` (commands executed, artifact/runtime proof, or equivalent concrete evidence). If proof is missing, keep the task `in_progress` or `blocked`.
|
|
39
39
|
5. **Task Docs Hook:** Every time `hapo:sync` marks a task as `done`, it must flag that a task-level docs checkpoint is now due for that verified task.
|
|
40
40
|
6. **Phase Prompt Rule:** When `hapo:sync` marks the final pending task in the whole feature as `done`, it should automatically prompt the user if they'd like to advance the phase, but only after the docs checkpoint for that last completed task has been considered.
|
|
41
41
|
|
|
@@ -15,7 +15,7 @@ When requested to update a phase or change task configuration, `spec.json` must
|
|
|
15
15
|
- full relative path like `tasks/task-R0-02-extension-shell.md`
|
|
16
16
|
* **Status Update:** If a task changes to `blocked`, the matching `task_registry[path].status` must become `"blocked"`, `task_registry[path].blocker` must record the reason, and `spec.json.status` / `spec.json.blocker` must reflect the top-level block if work is globally blocked.
|
|
17
17
|
* **Timestamp Rule:** Update `task_registry[path].started_at`, `completed_at`, and `last_updated_at` consistently with the new state. Also refresh `spec.json.updated_at`.
|
|
18
|
-
* **Done-State Rule:** Never set `task_registry[path].status = "done"` unless the matching markdown task file already contains a verification receipt in `## Verification & Evidence`, or the caller explicitly provides proof that can be written there first.
|
|
18
|
+
* **Done-State Rule:** Never set `task_registry[path].status = "done"` unless the matching markdown task file already contains a verification receipt in `## Task Test Plan & Verification Evidence` or legacy `## Verification & Evidence`, or the caller explicitly provides proof that can be written there first.
|
|
19
19
|
* **Receipt Integrity Rule:** A valid verification receipt must include the exact commands run, their outcomes, and artifact/runtime proof. Receipts containing `PRECHECK_FAIL`, `FAIL`, `UNVERIFIED`, or explicit "placeholder / simplified for MVP / production later" contract deviations are not eligible for `done`.
|
|
20
20
|
* **Contract Fidelity Rule:** If the task file notes or evidence show that a named framework/auth/runtime choice from the spec was silently replaced, sync MUST refuse `done` until the spec is amended or the implementation is corrected.
|
|
21
21
|
* **Task Docs Rule:** After a task is moved to `done`, emit a short alert that a task-level docs checkpoint is due for this verified task.
|
|
@@ -27,12 +27,12 @@ The structure of `tasks/task.md` relies heavily on exact keyword markers. Follow
|
|
|
27
27
|
### A. Completing a Task
|
|
28
28
|
When `/hapo:sync <feature> <task-id> done`:
|
|
29
29
|
1. Find: `**Status:** pending` (or `in_progress` / `blocked`).
|
|
30
|
-
2. Inspect `##
|
|
30
|
+
2. Inspect `## Task Test Plan & Verification Evidence` first. If the task uses legacy `## Verification & Evidence`, inspect that section instead. If it has no explicit proof lines (commands run, artifact proof, runtime proof, or blockers cleared), STOP and refuse to mark the task done.
|
|
31
31
|
3. Refuse completion if the receipt contains any non-passing marker such as `PRECHECK_FAIL`, `FAIL`, `UNVERIFIED`, or an explicit note that the implementation substituted a named contract with a placeholder/custom simplification.
|
|
32
32
|
4. Replace with: `**Status:** done`.
|
|
33
33
|
5. Locate block: `## Implementation Steps`.
|
|
34
34
|
6. Convert `- [ ]` into `- [x]` strictly within that section.
|
|
35
|
-
7. Update relevant checkboxes in `## Completion Criteria` and `##
|
|
35
|
+
7. Update relevant checkboxes in `## Completion Criteria` and `## Task Test Plan & Verification Evidence` only when the caller provides or the file already contains real proof. For legacy task files, update `## Verification & Evidence` instead.
|
|
36
36
|
8. Surface a note such as: `Docs checkpoint due: task Rn-mm just completed`.
|
|
37
37
|
|
|
38
38
|
### B. Blocking a Task
|
|
@@ -59,7 +59,7 @@ When `/hapo:sync audit <feature>` is activated:
|
|
|
59
59
|
- Missing disk file referenced in registry → remove or flag it
|
|
60
60
|
- Markdown says `done` but registry not done → registry wins only if evidence already exists; otherwise downgrade markdown or flag conflict
|
|
61
61
|
- Registry says `done` but markdown still pending → update markdown only if evidence exists
|
|
62
|
-
- Either side says `done` but `## Verification & Evidence` has no concrete proof → downgrade to `in_progress` or flag conflict instead of preserving fake completion
|
|
62
|
+
- Either side says `done` but `## Task Test Plan & Verification Evidence` / legacy `## Verification & Evidence` has no concrete proof → downgrade to `in_progress` or flag conflict instead of preserving fake completion
|
|
63
63
|
- Either side says `done` but the receipt contains `PRECHECK_FAIL`, `FAIL`, `UNVERIFIED`, or explicit contract-substitution notes → downgrade to `in_progress` or flag conflict
|
|
64
64
|
5. **Correction Alert:** Output a brief markdown alert detailing mismatches fixed and any unresolved conflicts requiring manual review.
|
|
65
65
|
6. **Task Docs Alert:** If audit reveals tasks newly marked `done`, include whether task-level docs sync appears still due or already accounted for in the current run summary.
|
|
@@ -27,6 +27,7 @@ Designed to work **after `hapo:develop`**. Standalone `/hapo:test` uses the same
|
|
|
27
27
|
NEVER claim tests pass when they were NOT actually executed.
|
|
28
28
|
NEVER mock, stub, or skip a failing test to produce a green result.
|
|
29
29
|
If no test command is detected, report NO_TESTS — do not fabricate results.
|
|
30
|
+
If a test command exits 0 but runs 0 tests, report NO_TESTS — this is a green lie, not a PASS.
|
|
30
31
|
If tests fail, list every failure explicitly — do not summarize failures away.
|
|
31
32
|
</HARD-GATE>
|
|
32
33
|
|
|
@@ -65,7 +66,8 @@ affected by recent file changes. See `references/execution-strategy.md` Phase A.
|
|
|
65
66
|
**Code testing (default):**
|
|
66
67
|
1. Pre-flight: run typecheck/lint to catch compile errors first
|
|
67
68
|
2. Execute test command with coverage flags
|
|
68
|
-
3. Collect
|
|
69
|
+
3. Collect test counts, coverage percentages, and fail stack traces
|
|
70
|
+
4. Treat 0 executed tests as `NO_TESTS`, even if the command exits 0
|
|
69
71
|
|
|
70
72
|
**UI verification (`--ui` / `--ui-auth` / `--ui-flow`):**
|
|
71
73
|
Execute multi-page discovery, then spawn **Parallel UI Subagents** (test-runner instances) to handle Smoke, Core-Vitals, Accessibility, SEO, Security, and User Flows simultaneously.
|
|
@@ -146,6 +148,7 @@ It merges the JSON data into `.hapo/test-memory.json` per `references/test-memor
|
|
|
146
148
|
|
|
147
149
|
- `references/execution-strategy.md` — Blast-radius algorithm, auto-detect logic, UI verification phases (A–E)
|
|
148
150
|
- `references/failure-triage.md` — Failure categories, triage decision tree, escalation rules
|
|
151
|
+
- `references/test-memory.md` — `.hapo/test-memory.json` schema and merge rules
|
|
149
152
|
|
|
150
153
|
## Related
|
|
151
154
|
|
|
@@ -84,6 +84,9 @@ cargo test
|
|
|
84
84
|
flutter test --coverage
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
+
After each command, parse the runner output for executed test count. A successful
|
|
88
|
+
exit with 0 executed tests is `NO_TESTS`, not `PASS`.
|
|
89
|
+
|
|
87
90
|
### Coverage Thresholds
|
|
88
91
|
|
|
89
92
|
| Metric | Minimum | Focus Areas |
|
|
@@ -360,4 +363,3 @@ Flag as `Security Warning` if:
|
|
|
360
363
|
- API keys, secrets, or JWT tokens visible in page HTML
|
|
361
364
|
- Mixed content (HTTP resources on HTTPS page) detected via network audit
|
|
362
365
|
- `autocomplete="off"` missing on password fields
|
|
363
|
-
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Test Memory
|
|
2
2
|
|
|
3
|
-
The
|
|
3
|
+
The `.hapo/test-memory.json` file in the target project serves as the Long-Term Memory for the testing ecosystem.
|
|
4
4
|
|
|
5
5
|
## Schema
|
|
6
6
|
|
|
@@ -37,4 +37,4 @@ Example:
|
|
|
37
37
|
</lessons_learned>
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
The orchestrating `hapo:test` skill (Phase 4) then intercepts this block and automatically merges it into
|
|
40
|
+
The orchestrating `hapo:test` skill (Phase 4) then intercepts this block and automatically merges it into `.hapo/test-memory.json`.
|