@pavp/wavefront 1.1.0 → 1.1.1

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.
@@ -13,7 +13,7 @@ Change request: $ARGUMENTS
13
13
 
14
14
  ## Steps
15
15
  1. **Intake** — read `requirement-intake` skill; classify as a CHANGE; produce/append the work item in `.claude/.planning/REQUIREMENTS.md` (Type: change). Interactive + proactive: ask blocking questions, suggest gaps (esp. what existing behavior must be preserved).
16
- 2. **Map (mandatory, read-only)** — dispatch the `mapper` agent over the target module(s). It reports current state + a change-plan (ADD/MODIFY/KEEP, layers, blast radius, regression surface). Do NOT skip this. Write the change-plan into `PHASE_PLAN.md`.
16
+ 2. **Map (mandatory, read-only)** — dispatch the `mapper` agent over the target module(s). It reports current state + a change-plan (ADD/MODIFY/KEEP, layers, blast radius, regression surface). Do NOT skip this. Write the change-plan into `PHASE_PLAN.md` and set its `type: change` (so `/wavefront-execute` runs modify mode and refuses to overwrite the module).
17
17
  3. **Plan** — turn the change-plan into ordered tasks (each tagged module-builder modify / tester / i18n-tokens / reviewer). Map new acceptance criteria → tests; note the regression set (existing tests that must stay green).
18
18
  4. **Execute (modify mode)** — dispatch `module-builder` in MODIFY mode with the mapper change-plan; it edits only the planned files, preserves existing code/public API. Then `tester`: extend tests for new criteria AND confirm the regression set still passes. Then `i18n-tokens` if UI strings/tokens changed. Update `STATE.md` after each task.
19
19
  5. **Verify (mandatory regression)** — `/wavefront-verify` style: reviewer in **change-review (diff-aware)** mode + run new tests AND the full module's existing tests (`yarn test --testPathPatterns=<module>`) + tsc + lint. PASS requires: reviewer PASS, new criteria covered, AND no regression (existing tests green).
@@ -10,19 +10,24 @@ allowed-tools: Read, Write, Edit, Bash, Grep, Glob, Agent
10
10
  Execute the plan for: $ARGUMENTS
11
11
 
12
12
  ## Steps
13
- 1. Read `.claude/.planning/PHASE_PLAN.md` (item $ARGUMENTS) and `STATE.md`. Resume at the first wave/task not marked done. Check the `parallelization` config flag (default off).
13
+ 1. Read `.claude/.planning/PHASE_PLAN.md` (item $ARGUMENTS) and `STATE.md`. Resume at the first wave/task not marked done (and read STATE's `Resume context` if present — the interrupted task + last error). Check the `parallelization` config flag (default off).
14
+ 1b. **Determine build mode from the plan's `type:` field** (PHASE_PLAN § Work item):
15
+ - `type: feature` → **create mode** (build from scratch). If the target module dir already exists, STOP — a create plan must not overwrite working code; tell the user to run `/wavefront-change` instead.
16
+ - `type: change` or `type: fix` → **modify mode** — the plan MUST carry a `mapper` change-plan (ADD/MODIFY/KEEP file list). If it doesn't (e.g. the plan came from `/wavefront-plan`, not `/wavefront-change`/`/wavefront-fix`), STOP and ask the user to re-plan via the change/fix flow. Pass the change-plan to module-builder; it edits ONLY listed files.
14
17
  2. Execute **wave by wave** (a single-module item is just one wave with one item):
15
- - **If `parallelization` is on AND the wave has multiple independent items:** dispatch their `module-builder` subagents **in parallel** multiple Agent calls in ONE message. Each builder gets ONLY its module slice (target files + relevant skills + acceptance criteria). Wait for the whole wave to finish before the next wave.
18
+ - **Before any parallel dispatch collision check:** confirm the wave's items declare NO shared-file overlap (compare each item's target files + the plan's Risks/shared-file notes). If two items in the wave touch the same file (`@/api/endpoints`, global types, etc.), DO NOT parallelize them run those two serially even when `parallelization` is on. Only genuinely disjoint items go parallel.
19
+ - **If `parallelization` is on AND the wave has multiple independent items (collision check passed):** dispatch their `module-builder` subagents **in parallel** — multiple Agent calls in ONE message. Each builder gets ONLY its module slice (target files + relevant skills + acceptance criteria). Wait for the whole wave to finish before the next wave.
16
20
  - **Otherwise (default):** run items sequentially.
17
21
  - Within any single module, tasks are always sequential (layer chain): types→api→gateway→repo→store→selector→hook→view→barrels.
18
22
  3. Per item, after build: dispatch `tester`, then `i18n-tokens` if UI changed. (These can also run per-item within the wave.)
19
- 4. After EACH task/item: mark done in `PHASE_PLAN.md`, update `STATE.md` (current wave, last step, next step). Resume point.
23
+ 4. After EACH task/item: mark done in `PHASE_PLAN.md`, update `STATE.md` (current wave, last step, next step). Resume point. **On a task FAILURE (agent error, tsc/lint/test red that can't be auto-fixed):** stop, and write STATE's `Resume context` — the failed task, the owning agent, and the exact error — so the next run resumes WITH that context instead of blindly re-dispatching.
20
24
  5. After a wave: run `tsc --noEmit` + `yarn lint`; fix failures (route to owning agent) before the next wave.
21
25
  6. Do NOT run the reviewer here — that's `/wavefront-verify`. Stop after the build/test/i18n tasks and report status + next command (`/wavefront-verify "<title>"`).
22
26
 
23
27
  ## Rules
24
- - Persist STATE after each task AND each wave (interruption-safe; resume mid-plan).
28
+ - Persist STATE after each task AND each wave (interruption-safe; resume mid-plan). On failure, persist `Resume context` (failed task + agent + error).
25
29
  - Fresh-context dispatch: each subagent gets only its slice.
26
- - Parallel only across INDEPENDENT items in the same wave; never parallelize items that touch the same shared file.
30
+ - Parallel only across INDEPENDENT items in the same wave; **run the collision check first** — never parallelize items that touch the same shared file, even with the flag on.
31
+ - Build mode follows the plan's `type:`: feature→create (refuse to overwrite an existing module), change/fix→modify (requires a mapper change-plan; edit only listed files).
27
32
  - Within a module, always sequential (dependency chain).
28
33
  - Stop and ask on Ask-first (new dep, shared-file edit, breaking change).
@@ -13,7 +13,7 @@ Bug: $ARGUMENTS
13
13
 
14
14
  ## Steps
15
15
  1. **Intake / repro** — read `requirement-intake` skill; classify as a FIX. Capture the bug as a work item in `.claude/.planning/REQUIREMENTS.md` (Type: fix): expected vs actual behavior, reproduction steps, affected area. Ask for repro details if missing (a bug you can't reproduce, you can't verify fixed).
16
- 2. **Diagnose + locate (read-only)** — dispatch the `reviewer` agent in **diagnose mode**. It traces the data flow through the layers and reports root cause as `file:line + why wrong + fix direction`. Write the diagnosis into `PHASE_PLAN.md`. No edits yet.
16
+ 2. **Diagnose + locate (read-only)** — dispatch the `reviewer` agent in **diagnose mode**. It traces the data flow through the layers and reports root cause as `file:line + why wrong + fix direction`. Write the diagnosis into `PHASE_PLAN.md` and set its `type: fix` (so `/wavefront-execute`, if used, runs modify/patch mode — never create). No edits yet.
17
17
  3. **Regression test RED** — dispatch the `tester` agent (bug regression flow): write a colocated test that reproduces the bug and **fails against current code** (RED). Confirm it's actually red (run it). This captures the bug.
18
18
  4. **Patch** — dispatch `module-builder` in **patch mode** (smallest focused change at the diagnosed location; respects surrounding code; touches only what's needed).
19
19
  5. **GREEN + regression** — re-run the new test → must PASS. Run the module's existing tests + tsc + lint → no regression.
@@ -12,11 +12,15 @@ Verify the work item: $ARGUMENTS
12
12
  ## Steps
13
13
  1. Read the item's `REQUIREMENTS` (acceptance criteria) + `PHASE_PLAN` (what was built).
14
14
  2. Dispatch the `reviewer` subagent (code-review mode) over the changed module/files → expect PASS/FAIL with BLOCKER/WARNING/NIT.
15
- 3. Run the tests for the work item (`yarn test --testPathPatterns=<module>`) and `yarn typecheck` + `yarn lint`. Note: a single-module test run trips the 85% global coverage gate (exit 1) even when tests pass — judge by `Tests: N passed`, not the exit code.
15
+ 3. Run the tests for the work item (`yarn test --testPathPatterns=<module>`) and `yarn typecheck` + `yarn lint`.
16
+ - **Coverage-gate discriminator (do NOT judge by exit code alone):** a single-module run trips the 85% GLOBAL coverage gate → `exit 1` even when every test passed. Distinguish by parsing the Jest summary:
17
+ - Read the `Tests:` line. **Real failure** = it shows `N failed` (N≥1), OR a `FAIL <path>` test-suite line, OR a tsc/lint error. → tests NOT green.
18
+ - **Coverage-only failure** = `Tests: M passed` with `0 failed`, exit 1, and the only error is the coverage threshold (`Jest: "global" coverage threshold ... not met`). → tests ARE green; the gate trip is expected for a single-module run, not a verdict failure.
19
+ - tsc/lint are judged normally (any reported error = fail).
16
20
  4. Check each **acceptance criterion** is actually covered by a passing test. List any uncovered.
17
21
  5. Verdict:
18
- - **PASS** (reviewer PASS + tests green + criteria covered) → update `STATE.md` (status: verified, next = `/wavefront-ship`). Report.
19
- - **FAIL** → write a concise fix plan (what failed, which file, which agent should fix) into `STATE.md` blockers + report. Do not ship.
22
+ - **PASS** (reviewer PASS + tests green per the discriminator + criteria covered) → update `STATE.md` (status: verified, next = `/wavefront-ship`). Report.
23
+ - **FAIL** (real test failures, tsc/lint errors, reviewer FAIL, or uncovered criteria) → write a concise fix plan (what failed, which file, which agent should fix) into `STATE.md` blockers + `Resume context` + report. Do not ship. A coverage-only gate trip with all tests passing is NOT a fail.
20
24
  6. Do NOT edit code here — verify is read-only/dispatch. Fixes go back through `/wavefront-execute` or the owning agent.
21
25
 
22
26
  ## Rules
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pavp/wavefront",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Claude Code frontend-engineering agent framework for scaffold-nextjs-app apps (Next.js/React/MUI/Clean Architecture). Installs agents, skills, and an orchestration loop into a project's .claude/.",
5
5
  "bin": {
6
6
  "wavefront": "bin/wavefront.js"
@@ -14,6 +14,13 @@
14
14
  ## Execution progress
15
15
  <which PHASE_PLAN tasks are done; which is next>
16
16
 
17
+ ## Resume context
18
+ > Set by `/wavefront-execute` (or `/wavefront-verify`) ONLY when a task fails or is interrupted. Empty on a clean run. Lets the next run resume WITH context instead of blindly re-dispatching the same task.
19
+ - Interrupted/failed task: <task # + name from PHASE_PLAN, or empty>
20
+ - Owning agent: <module-builder|tester|i18n-tokens|reviewer>
21
+ - Last error: <the exact tsc/lint/test/agent error>
22
+ - What a resume should do: <re-run as-is | needs a fix first | needs user input>
23
+
17
24
  ## Decisions log
18
25
  - <date> <decision> — <why>
19
26