@pavp/wavefront 0.1.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.
Files changed (48) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +226 -0
  3. package/agents/i18n-tokens.md +58 -0
  4. package/agents/mapper.md +64 -0
  5. package/agents/module-builder.md +90 -0
  6. package/agents/reviewer.md +65 -0
  7. package/agents/tester.md +84 -0
  8. package/bin/wavefront.js +91 -0
  9. package/commands/wavefront-change.md +26 -0
  10. package/commands/wavefront-execute.md +28 -0
  11. package/commands/wavefront-feature.md +25 -0
  12. package/commands/wavefront-fix.md +28 -0
  13. package/commands/wavefront-init.md +27 -0
  14. package/commands/wavefront-plan.md +30 -0
  15. package/commands/wavefront-ship.md +26 -0
  16. package/commands/wavefront-state.md +23 -0
  17. package/commands/wavefront-verify.md +24 -0
  18. package/hooks/lint-after-edit.sh +43 -0
  19. package/hooks/typecheck-on-stop.sh +27 -0
  20. package/install.sh +83 -0
  21. package/package.json +67 -0
  22. package/planning-templates/PHASE_PLAN.md +37 -0
  23. package/planning-templates/PROJECT.md +18 -0
  24. package/planning-templates/REQUIREMENTS.md +27 -0
  25. package/planning-templates/ROADMAP.md +12 -0
  26. package/planning-templates/STATE.md +21 -0
  27. package/settings.template.json +29 -0
  28. package/skills/clean-architecture/SKILL.md +46 -0
  29. package/skills/component-composition/SKILL.md +67 -0
  30. package/skills/component-composition/examples/compound-component.md +62 -0
  31. package/skills/data-fetching-react-query/SKILL.md +68 -0
  32. package/skills/design-intake/SKILL.md +69 -0
  33. package/skills/design-system-inventory/SKILL.md +38 -0
  34. package/skills/forms-rhf-zod/SKILL.md +75 -0
  35. package/skills/gateway-pattern/SKILL.md +79 -0
  36. package/skills/hook-patterns/SKILL.md +74 -0
  37. package/skills/i18n-next-intl/SKILL.md +59 -0
  38. package/skills/module-structure/SKILL.md +98 -0
  39. package/skills/mui-design-tokens/SKILL.md +60 -0
  40. package/skills/naming-conventions/SKILL.md +65 -0
  41. package/skills/repository-pattern/SKILL.md +128 -0
  42. package/skills/requirement-intake/SKILL.md +65 -0
  43. package/skills/responsive-layouts/SKILL.md +64 -0
  44. package/skills/selector-pattern/SKILL.md +59 -0
  45. package/skills/store-zustand/SKILL.md +63 -0
  46. package/skills/sync-audit/SKILL.md +52 -0
  47. package/skills/testing-jest-rtl/SKILL.md +83 -0
  48. package/uninstall.sh +36 -0
@@ -0,0 +1,91 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ // wavefront CLI — thin Node wrapper over the bundled install.sh / uninstall.sh.
5
+ // The shell scripts hold the real copy/symlink logic; this only resolves paths,
6
+ // validates args, and forwards them so npm and git-clone installs share one code path.
7
+
8
+ const path = require('path');
9
+ const fs = require('fs');
10
+ const { spawnSync } = require('child_process');
11
+
12
+ const PKG_ROOT = path.resolve(__dirname, '..');
13
+ const VERSION = require(path.join(PKG_ROOT, 'package.json')).version;
14
+
15
+ function fail(msg) {
16
+ console.error(`error: ${msg}`);
17
+ process.exit(1);
18
+ }
19
+
20
+ function usage() {
21
+ console.log(`wavefront ${VERSION} — Claude Code frontend-engineering agents
22
+
23
+ Usage:
24
+ wavefront install --global <target-app> [--with-hooks] install to ~/.wavefront and symlink into <target-app>/.claude
25
+ wavefront install --local <target-app> [--with-hooks] copy the surface into <target-app>/.claude
26
+ wavefront uninstall <target-app> [--purge-home] remove the surface from <target-app>
27
+ wavefront help show this help
28
+ wavefront version print version
29
+
30
+ <target-app> is a scaffold-nextjs-app project root (the dir containing package.json).
31
+ --with-hooks also installs the quality-gate hooks (eslint/stylelint --fix, tsc on stop).
32
+ Run via npx without a global install: npx @pavp/wavefront install --local <target-app>`);
33
+ }
34
+
35
+ function runScript(scriptName, args) {
36
+ const script = path.join(PKG_ROOT, scriptName);
37
+ if (!fs.existsSync(script)) fail(`bundled ${scriptName} missing from package at ${PKG_ROOT}`);
38
+ const bash = process.platform === 'win32' ? null : 'bash';
39
+ if (!bash) fail('wavefront install requires bash (macOS/Linux). On Windows use WSL.');
40
+ const res = spawnSync(bash, [script, ...args], { stdio: 'inherit' });
41
+ if (res.error) fail(`failed to run ${scriptName}: ${res.error.message}`);
42
+ process.exit(res.status === null ? 1 : res.status);
43
+ }
44
+
45
+ function cmdInstall(rest) {
46
+ // install.sh expects: <mode> <target> [--with-hooks] (positional order matters)
47
+ const mode = rest[0];
48
+ if (mode !== '--global' && mode !== '--local') {
49
+ fail('install needs a mode: --global or --local');
50
+ }
51
+ const target = rest[1];
52
+ if (!target) fail('install needs a <target-app> path');
53
+ const withHooks = rest.includes('--with-hooks');
54
+ const args = [mode, target];
55
+ if (withHooks) args.push('--with-hooks');
56
+ runScript('install.sh', args);
57
+ }
58
+
59
+ function cmdUninstall(rest) {
60
+ const target = rest[0];
61
+ if (!target) fail('uninstall needs a <target-app> path');
62
+ const args = [target];
63
+ if (rest.includes('--purge-home')) args.push('--purge-home');
64
+ runScript('uninstall.sh', args);
65
+ }
66
+
67
+ function main() {
68
+ const [cmd, ...rest] = process.argv.slice(2);
69
+ switch (cmd) {
70
+ case 'install':
71
+ return cmdInstall(rest);
72
+ case 'uninstall':
73
+ return cmdUninstall(rest);
74
+ case 'version':
75
+ case '--version':
76
+ case '-v':
77
+ console.log(VERSION);
78
+ return;
79
+ case 'help':
80
+ case '--help':
81
+ case '-h':
82
+ case undefined:
83
+ usage();
84
+ return;
85
+ default:
86
+ usage();
87
+ fail(`unknown command: ${cmd}`);
88
+ }
89
+ }
90
+
91
+ main();
@@ -0,0 +1,26 @@
1
+ ---
2
+ description: Change an EXISTING feature — intake → map (read-only) → plan → execute in modify mode → verify with mandatory regression → ship. Use for extending/modifying a module that already exists.
3
+ disable-model-invocation: true
4
+ argument-hint: "<prompt | user story | spec describing the change>"
5
+ allowed-tools: Read, Write, Edit, Bash, Grep, Glob, Agent
6
+ ---
7
+
8
+ # wavefront-change
9
+
10
+ Change request: $ARGUMENTS
11
+
12
+ > For modifying existing code. Map-first + regression are mandatory (modifying working code is higher-risk than greenfield).
13
+
14
+ ## Steps
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`.
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
+ 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
+ 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).
20
+ 6. **Ship** — `/wavefront-ship` (confirm first; verified only).
21
+
22
+ ## Rules
23
+ - Map before edit — always. No modify without a mapper change-plan.
24
+ - Regression is part of the gate, not optional.
25
+ - Touch only what the change-plan lists; preserve public API unless the plan changes it.
26
+ - Stop and ask on Ask-first (new dep, shared-file edit, public-API change).
@@ -0,0 +1,28 @@
1
+ ---
2
+ description: Execute a PHASE_PLAN — drive module-builder → tester → i18n-tokens through the tasks in dependency order, updating STATE after each. Resumes from STATE if interrupted.
3
+ disable-model-invocation: true
4
+ argument-hint: "<work item title>"
5
+ allowed-tools: Read, Write, Edit, Bash, Grep, Glob, Agent
6
+ ---
7
+
8
+ # wavefront-execute
9
+
10
+ Execute the plan for: $ARGUMENTS
11
+
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).
14
+ 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.
16
+ - **Otherwise (default):** run items sequentially.
17
+ - Within any single module, tasks are always sequential (layer chain): types→api→gateway→repo→store→selector→hook→view→barrels.
18
+ 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.
20
+ 5. After a wave: run `tsc --noEmit` + `yarn lint`; fix failures (route to owning agent) before the next wave.
21
+ 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
+
23
+ ## Rules
24
+ - Persist STATE after each task AND each wave (interruption-safe; resume mid-plan).
25
+ - 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.
27
+ - Within a module, always sequential (dependency chain).
28
+ - Stop and ask on Ask-first (new dep, shared-file edit, breaking change).
@@ -0,0 +1,25 @@
1
+ ---
2
+ description: Start a new-feature work item — run interactive intake on a prompt/user-story/spec and produce a REQUIREMENTS spec. First step of the new-feature loop.
3
+ disable-model-invocation: true
4
+ argument-hint: "<prompt | user story | path-to-spec>"
5
+ allowed-tools: Read, Write, Edit, Grep, Glob
6
+ ---
7
+
8
+ # wavefront-feature
9
+
10
+ Intake a new feature: $ARGUMENTS
11
+
12
+ ## Steps
13
+ 1. Read the `requirement-intake` skill (`.claude/skills/requirement-intake/SKILL.md`) and follow it.
14
+ 2. Read `.claude/.planning/PROJECT.md` for context (run `/wavefront-init` first if missing).
15
+ 3. Classify the input ($ARGUMENTS) as prompt / user story / spec. If it's a path, read the file.
16
+ 4. Run intake **interactively + proactively**: extract intent/scope/entities/layers, then surface Open questions (blocking) and Suggested additions (edge cases, error states, i18n/a11y, implicit criteria). Ask the blocking questions before finalizing.
17
+ 5. **Design intake (if UI work):** if the input references or attaches a design (Figma — live via a configured Figma MCP, else as an export/image; image/screenshot path, HTML, a reference screen, or just a description — or NOTHING), run the `design-intake` skill → produce a design-spec mapped to `@/ui`+tokens. With no design, use the continuity path (`design-system-inventory`). Record the design-spec with the work item; flag any gaps (design elements with no `@/ui` equivalent) as Ask-first.
18
+ 6. Write the work item into `.claude/.planning/REQUIREMENTS.md` (append a new section; status: `planned`-ready once questions resolved).
19
+ 7. Add it to `ROADMAP.md` (Now/Next) and update `STATE.md` (active item, next step = `/wavefront-plan`).
20
+ 8. Report the spec summary (+ design-spec if any) + next command: `/wavefront-plan "<title>"`.
21
+
22
+ ## Rules
23
+ - Do not plan or write feature code here — intake only.
24
+ - Don't finalize with unresolved blocking questions.
25
+ - Acceptance criteria must be testable (they drive the tester later).
@@ -0,0 +1,28 @@
1
+ ---
2
+ description: Fix a bug — intake/repro → diagnose+locate (read-only) → regression test RED → patch → GREEN → verify → ship. Use for bug fixes, not new features or feature changes.
3
+ disable-model-invocation: true
4
+ argument-hint: "<bug description or reproduction steps>"
5
+ allowed-tools: Read, Write, Edit, Bash, Grep, Glob, Agent
6
+ ---
7
+
8
+ # wavefront-fix
9
+
10
+ Bug: $ARGUMENTS
11
+
12
+ > Bug-fix posture: smallest change that fixes it, captured by a regression test that fails before and passes after.
13
+
14
+ ## Steps
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.
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
+ 4. **Patch** — dispatch `module-builder` in **patch mode** (smallest focused change at the diagnosed location; respects surrounding code; touches only what's needed).
19
+ 5. **GREEN + regression** — re-run the new test → must PASS. Run the module's existing tests + tsc + lint → no regression.
20
+ 6. **Verify** — `reviewer` change-review (diff-aware) mode: confirm the patch is minimal, public API intact, and the regression test + existing tests pass. PASS/FAIL.
21
+ 7. **Ship** — `/wavefront-ship` (confirm first; verified only). Commit references the bug.
22
+ 8. Update `STATE.md` after each step (resume-safe).
23
+
24
+ ## Rules
25
+ - Test before fix: the regression test must be RED before patching, GREEN after. If it's not RED first, it doesn't capture the bug.
26
+ - Patch posture: minimal change; no refactors/cleanup riding along.
27
+ - The regression test stays permanently (prevents recurrence).
28
+ - Diagnose is read-only; patch is module-builder; never skip the RED step.
@@ -0,0 +1,27 @@
1
+ ---
2
+ description: Initialize wavefront planning artifacts (.claude/.planning/) for this project. Run once per project before the loop.
3
+ disable-model-invocation: true
4
+ argument-hint: "(no args)"
5
+ allowed-tools: Read, Write, Bash, Glob
6
+ ---
7
+
8
+ # wavefront-init
9
+
10
+ Set up the planning workspace for the wavefront loop in this project.
11
+
12
+ ## Steps
13
+ 1. Create `.claude/.planning/` if missing.
14
+ 2. For each of PROJECT, REQUIREMENTS, ROADMAP, STATE — if the file doesn't already exist in `.claude/.planning/`, create it from the wavefront template (the templates live in the installed wavefront surface; if not present locally, write the equivalent skeleton: see structure below). Do NOT overwrite existing planning files.
15
+ 3. Fill `PROJECT.md` by inspecting the repo: read `package.json`, `README.md`, `src/` layout, existing `src/modules/*` to describe what the app is, its stack, and domain notes. Ask the user to confirm/correct the PROJECT summary.
16
+ 4. Leave REQUIREMENTS/ROADMAP/STATE as empty skeletons (populated by feature/plan runs).
17
+ 5. Report what was created and the next command (`/wavefront-feature "<work item>"`).
18
+
19
+ ## Skeleton reference
20
+ - PROJECT.md: what the app is · stack · conventions source (wavefront skills) · domain notes · constraints.
21
+ - REQUIREMENTS.md: per-work-item spec (filled by intake).
22
+ - ROADMAP.md: Now / Next / Done backlog.
23
+ - STATE.md: active item · last step · next step · progress · decisions · blockers.
24
+
25
+ ## Rules
26
+ - Idempotent: never clobber existing planning files.
27
+ - PROJECT facts come from reading the repo, not assumptions — confirm with the user.
@@ -0,0 +1,30 @@
1
+ ---
2
+ description: Turn a REQUIREMENTS work item into an executable PHASE_PLAN (which agents, which layers/files, in dependency order).
3
+ disable-model-invocation: true
4
+ argument-hint: "<work item title>"
5
+ allowed-tools: Read, Write, Edit, Grep, Glob
6
+ ---
7
+
8
+ # wavefront-plan
9
+
10
+ Plan the work item: $ARGUMENTS
11
+
12
+ ## Steps
13
+ 1. Read the work item from `.claude/.planning/REQUIREMENTS.md` (match by title $ARGUMENTS). If missing, tell the user to run `/wavefront-feature` first.
14
+ 2. Read the relevant wavefront skills to size the work: `clean-architecture`, `module-structure`, plus the pattern skills for the layers this touches.
15
+ 3. For a **new module**: plan the full bottom-up chain (types/schemas → api → gateway → repository → store → selectors → view+hooks → components → barrels → tests → i18n → review). For a smaller feature, include only the needed tasks.
16
+ 4. Map each acceptance criterion to the test(s) that will cover it.
17
+ 5. Note risks: shared-file edits (e.g. `@/api/endpoints`), new deps (ask-first), anything that touches existing code.
18
+ 6. **Dependency analysis → waves** (if the item spans multiple modules/entities): group them into waves.
19
+ - Items in the **same wave** are INDEPENDENT (no cross-import, no shared-file edits between them) → parallel-safe.
20
+ - A later wave depends on an earlier one (e.g. module B imports module A's public API → A in wave 1, B in wave 2).
21
+ - **Any two items that edit the SAME shared file** (`@/api/endpoints`, global types) go in the same wave-lane SERIALLY, never parallel (avoids write races).
22
+ - A single-module item = one wave, one item (sequential layer chain inside it). Within a module, tasks are always sequential.
23
+ 7. Write `.claude/.planning/PHASE_PLAN.md`: tasks in dependency order per item, each tagged with its agent (module-builder / tester / i18n-tokens / reviewer); annotate waves (`## Wave 1 (parallel): moduleA, moduleB` / `## Wave 2: moduleC`).
24
+ 8. Update `STATE.md` (status: planned, next step = `/wavefront-execute`). Report the plan (+ waves) + next command.
25
+
26
+ ## Rules
27
+ - Within a module: sequential (the Clean Arch layer chain is a dependency order).
28
+ - Across independent modules: group into parallel waves (executed concurrently only if config `parallelization` is on; otherwise sequential).
29
+ - Two items touching the same shared file are NOT parallel — serialize them.
30
+ - Every task names its agent and target files. Reviewer is the last task per item (PASS gate).
@@ -0,0 +1,26 @@
1
+ ---
2
+ description: Ship a verified work item — create a branch, commit the work, and open a PR. Only runs on a verified item.
3
+ disable-model-invocation: true
4
+ argument-hint: "<work item title>"
5
+ allowed-tools: Read, Bash, Grep, Glob
6
+ ---
7
+
8
+ # wavefront-ship
9
+
10
+ Ship the verified work item: $ARGUMENTS
11
+
12
+ ## Preconditions
13
+ - `STATE.md` shows the item status = `verified`. If not, stop and tell the user to run `/wavefront-verify` (don't ship unverified work).
14
+
15
+ ## Steps
16
+ 1. Confirm the item is verified (STATE). Show the user the changed files (`git status`, `git diff --stat`) and the planned commit message + PR title; **ask for confirmation before any git write** (branch/commit/push/PR are shared-state actions).
17
+ 2. On confirm: create a branch following the scaffold convention `feat/<kebab-title>` (or `fix/…` for fixes). Validate the branch name (`yarn validate:branch` if present).
18
+ 3. Stage the work item's files (named, not `git add -A` blindly). Commit with a Conventional Commit message derived from the work item (`feat: <intent>`). NEVER add Claude/AI as co-author or in the body.
19
+ 4. Push the branch; open a PR with `gh pr create` — body = intent + scope + acceptance criteria checklist + test plan.
20
+ 5. Update `STATE.md` (status: shipped) and `ROADMAP.md` (move item to Done). Report the PR URL.
21
+
22
+ ## Rules
23
+ - Never ship unverified work.
24
+ - Branch/commit/push/PR are irreversible/shared — confirm with the user first.
25
+ - No Claude/AI attribution in commits or PRs.
26
+ - Use Conventional Commits + the scaffold's branch-naming convention.
@@ -0,0 +1,23 @@
1
+ ---
2
+ description: Show the current wavefront loop position (active work item, last/next step, progress, blockers) from .planning/STATE.md.
3
+ argument-hint: "(no args)"
4
+ allowed-tools: Read, Glob
5
+ ---
6
+
7
+ # wavefront-state
8
+
9
+ Show where the loop stands.
10
+
11
+ ## Steps
12
+ 1. Read `.claude/.planning/STATE.md`. If missing, say the project isn't initialized (`/wavefront-init`).
13
+ 2. Read `ROADMAP.md` for Now/Next/Done context.
14
+ 3. Report concisely:
15
+ - Active work item + status.
16
+ - Last step done · next step (the exact command to run).
17
+ - Execution progress (which PHASE_PLAN tasks done/next).
18
+ - Any blockers.
19
+ 4. If there's a clear next command, name it so the user can continue.
20
+
21
+ ## Rules
22
+ - Read-only. Never edit planning files here.
23
+ - This is the safe "where am I?" command — fine for Claude to invoke automatically (no `disable-model-invocation`).
@@ -0,0 +1,24 @@
1
+ ---
2
+ description: Verify executed work — run the reviewer agent + test suite against the work item, check acceptance criteria, and emit a fix plan if anything fails.
3
+ disable-model-invocation: true
4
+ argument-hint: "<work item title>"
5
+ allowed-tools: Read, Bash, Grep, Glob, Agent
6
+ ---
7
+
8
+ # wavefront-verify
9
+
10
+ Verify the work item: $ARGUMENTS
11
+
12
+ ## Steps
13
+ 1. Read the item's `REQUIREMENTS` (acceptance criteria) + `PHASE_PLAN` (what was built).
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.
16
+ 4. Check each **acceptance criterion** is actually covered by a passing test. List any uncovered.
17
+ 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.
20
+ 6. Do NOT edit code here — verify is read-only/dispatch. Fixes go back through `/wavefront-execute` or the owning agent.
21
+
22
+ ## Rules
23
+ - Read-only on source (reviewer + test runs). No edits.
24
+ - Acceptance criteria are the bar — reviewer PASS alone isn't enough if a criterion is untested.
@@ -0,0 +1,43 @@
1
+ #!/usr/bin/env bash
2
+ # wavefront PostToolUse hook — lint (+autofix) the file Claude just edited/wrote.
3
+ # Warn-only: never blocks (exit 0). The reviewer agent is the real gate.
4
+ # Reads the PostToolUse JSON on stdin; acts only on TS/JS/style files in the project.
5
+ set -uo pipefail
6
+
7
+ input="$(cat)"
8
+ file_path="$(printf '%s' "$input" | jq -r '.tool_input.file_path // empty' 2>/dev/null)"
9
+ cwd="$(printf '%s' "$input" | jq -r '.cwd // empty' 2>/dev/null)"
10
+
11
+ [ -n "$file_path" ] || exit 0
12
+ [ -f "$file_path" ] || exit 0
13
+ cd "${cwd:-.}" 2>/dev/null || exit 0
14
+
15
+ # Only run inside a project that has the tooling.
16
+ [ -f package.json ] || exit 0
17
+
18
+ case "$file_path" in
19
+ *.ts|*.tsx|*.js|*.jsx)
20
+ tool="eslint" ;;
21
+ *.css|*.scss)
22
+ tool="stylelint" ;;
23
+ *)
24
+ exit 0 ;;
25
+ esac
26
+
27
+ run_bin() {
28
+ # Prefer local binary; fall back to npx without network install.
29
+ if [ -x "node_modules/.bin/$1" ]; then "node_modules/.bin/$1" "${@:2}"; else npx --no-install "$@"; fi
30
+ }
31
+
32
+ if [ "$tool" = "eslint" ]; then
33
+ out="$(run_bin eslint --fix "$file_path" 2>&1)"; status=$?
34
+ else
35
+ out="$(run_bin stylelint --fix "$file_path" 2>&1)"; status=$?
36
+ fi
37
+
38
+ if [ $status -ne 0 ] && [ -n "$out" ]; then
39
+ # Warn-only: surface to Claude as context, do not block.
40
+ jq -n --arg msg "wavefront $tool found issues in $file_path (autofixed what it could):"$'\n'"$out" \
41
+ '{systemMessage: $msg, suppressOutput: true}' 2>/dev/null || true
42
+ fi
43
+ exit 0
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env bash
2
+ # wavefront Stop hook — run a project-wide typecheck once when Claude finishes.
3
+ # Warn-only: never blocks the stop (exit 0). tsc is whole-project (needs the @/ path graph),
4
+ # so it runs at end-of-turn, not per-edit.
5
+ set -uo pipefail
6
+
7
+ input="$(cat)"
8
+ cwd="$(printf '%s' "$input" | jq -r '.cwd // empty' 2>/dev/null)"
9
+ cd "${cwd:-.}" 2>/dev/null || exit 0
10
+
11
+ [ -f package.json ] || exit 0
12
+ [ -f tsconfig.json ] || exit 0
13
+
14
+ # Prefer the project's typecheck script; fall back to tsc directly.
15
+ if grep -q '"typecheck"' package.json 2>/dev/null; then
16
+ out="$(yarn --silent typecheck 2>&1)"; status=$?
17
+ elif [ -x node_modules/.bin/tsc ]; then
18
+ out="$(node_modules/.bin/tsc --noEmit --skipLibCheck 2>&1)"; status=$?
19
+ else
20
+ exit 0
21
+ fi
22
+
23
+ if [ $status -ne 0 ] && [ -n "$out" ]; then
24
+ jq -n --arg msg "wavefront typecheck failed:"$'\n'"$out" \
25
+ '{systemMessage: $msg, suppressOutput: true}' 2>/dev/null || true
26
+ fi
27
+ exit 0
package/install.sh ADDED
@@ -0,0 +1,83 @@
1
+ #!/usr/bin/env bash
2
+ # wavefront installer — frontend engineering agents for scaffold-nextjs-app apps.
3
+ # Usage:
4
+ # ./install.sh --global <target-app> [--with-hooks] install to ~/.wavefront/ and symlink into <target-app>/.claude
5
+ # ./install.sh --local <target-app> [--with-hooks] copy the surface into <target-app>/.claude
6
+ # --with-hooks also installs the quality-gate hooks (eslint --fix on edit, tsc on stop).
7
+ set -euo pipefail
8
+
9
+ REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
10
+ HOME_DIR="${WAVEFRONT_HOME:-$HOME/.wavefront}"
11
+ SURFACE=(agents skills commands planning-templates)
12
+
13
+ die() { echo "error: $*" >&2; exit 1; }
14
+
15
+ usage() {
16
+ cat <<'EOF'
17
+ wavefront installer
18
+ ./install.sh --global <target-app> [--with-hooks] install to ~/.wavefront/ and symlink into the app
19
+ ./install.sh --local <target-app> [--with-hooks] copy the surface into the app
20
+ Notes:
21
+ - <target-app> is a scaffold-nextjs-app project (the app's root, containing package.json).
22
+ - Override the global dir with WAVEFRONT_HOME.
23
+ - --with-hooks copies hooks/ into .claude/hooks and writes .claude/settings.wavefront.json
24
+ (you merge it into .claude/settings.json — installer never overwrites your settings).
25
+ EOF
26
+ }
27
+
28
+ [ $# -ge 2 ] || { usage; exit 1; }
29
+ MODE="$1"; TARGET="$2"; WITH_HOOKS=""
30
+ [ "${3:-}" = "--with-hooks" ] && WITH_HOOKS=1
31
+
32
+ [ -d "$TARGET" ] || die "target app dir not found: $TARGET"
33
+ CLAUDE_DIR="$TARGET/.claude"
34
+ mkdir -p "$CLAUDE_DIR"
35
+
36
+ install_hooks() {
37
+ [ -n "$WITH_HOOKS" ] || return 0
38
+ echo "→ installing quality-gate hooks into $CLAUDE_DIR/hooks"
39
+ rm -rf "${CLAUDE_DIR:?}/hooks"
40
+ cp -r "$REPO_DIR/hooks" "$CLAUDE_DIR/hooks"
41
+ chmod +x "$CLAUDE_DIR"/hooks/*.sh
42
+ cp "$REPO_DIR/settings.template.json" "$CLAUDE_DIR/settings.wavefront.json"
43
+ echo " ⚠ merge $CLAUDE_DIR/settings.wavefront.json into $CLAUDE_DIR/settings.json (hooks block)."
44
+ command -v jq >/dev/null 2>&1 || echo " ⚠ hooks need 'jq' on PATH."
45
+ }
46
+
47
+ install_global() {
48
+ echo "→ installing surface to $HOME_DIR"
49
+ mkdir -p "$HOME_DIR"
50
+ for d in "${SURFACE[@]}"; do
51
+ rm -rf "${HOME_DIR:?}/$d"
52
+ cp -r "$REPO_DIR/$d" "$HOME_DIR/$d"
53
+ done
54
+ echo "→ symlinking into $CLAUDE_DIR"
55
+ for d in "${SURFACE[@]}"; do
56
+ local link="$CLAUDE_DIR/$d"
57
+ if [ -e "$link" ] && [ ! -L "$link" ]; then
58
+ die "$link exists and is not a symlink — refusing to overwrite. Remove it or use --local."
59
+ fi
60
+ rm -f "$link"
61
+ ln -s "$HOME_DIR/$d" "$link"
62
+ done
63
+ echo "✓ global install done. Update later with: git -C \"$REPO_DIR\" pull && ./install.sh --global \"$TARGET\""
64
+ }
65
+
66
+ install_local() {
67
+ echo "→ copying surface into $CLAUDE_DIR"
68
+ for d in "${SURFACE[@]}"; do
69
+ [ -d "$REPO_DIR/$d" ] || continue
70
+ rm -rf "${CLAUDE_DIR:?}/$d"
71
+ cp -r "$REPO_DIR/$d" "$CLAUDE_DIR/$d"
72
+ done
73
+ echo "✓ local copy done."
74
+ }
75
+
76
+ case "$MODE" in
77
+ --global) install_global; install_hooks ;;
78
+ --local) install_local; install_hooks ;;
79
+ -h|--help) usage; exit 0 ;;
80
+ *) usage; die "unknown mode: $MODE" ;;
81
+ esac
82
+
83
+ echo "Agents available in Claude Code: module-builder, tester, i18n-tokens, reviewer."
package/package.json ADDED
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "@pavp/wavefront",
3
+ "version": "0.1.0",
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
+ "bin": {
6
+ "wavefront": "bin/wavefront.js"
7
+ },
8
+ "scripts": {
9
+ "prepare": "node -e \"if(process.env.CI !== 'true') require('child_process').execSync('husky', {stdio: 'inherit'})\"",
10
+ "release": "semantic-release",
11
+ "release:dry": "semantic-release --dry-run",
12
+ "validate:commits": "commitlint --from origin/main --to HEAD --verbose",
13
+ "validate:branch": "node scripts/validate-branch-name.js"
14
+ },
15
+ "files": [
16
+ "bin/",
17
+ "agents/",
18
+ "skills/",
19
+ "commands/",
20
+ "planning-templates/",
21
+ "hooks/",
22
+ "install.sh",
23
+ "uninstall.sh",
24
+ "settings.template.json",
25
+ "README.md",
26
+ "LICENSE"
27
+ ],
28
+ "publishConfig": {
29
+ "access": "public",
30
+ "provenance": true
31
+ },
32
+ "engines": {
33
+ "node": ">=18"
34
+ },
35
+ "os": [
36
+ "darwin",
37
+ "linux"
38
+ ],
39
+ "keywords": [
40
+ "claude-code",
41
+ "claude",
42
+ "agents",
43
+ "nextjs",
44
+ "react",
45
+ "mui",
46
+ "clean-architecture",
47
+ "frontend",
48
+ "scaffold-nextjs-app"
49
+ ],
50
+ "repository": {
51
+ "type": "git",
52
+ "url": "git+https://github.com/pavp/wavefront.git"
53
+ },
54
+ "homepage": "https://github.com/pavp/wavefront#readme",
55
+ "bugs": {
56
+ "url": "https://github.com/pavp/wavefront/issues"
57
+ },
58
+ "license": "MIT",
59
+ "devDependencies": {
60
+ "@commitlint/cli": "^21.0.1",
61
+ "@commitlint/config-conventional": "^21.0.1",
62
+ "@semantic-release/changelog": "^6.0.3",
63
+ "@semantic-release/git": "^10.0.1",
64
+ "husky": "9.1.7",
65
+ "semantic-release": "25.0.3"
66
+ }
67
+ }
@@ -0,0 +1,37 @@
1
+ # PHASE_PLAN — <work item>
2
+
3
+ > Executable plan produced by `/wavefront-plan`. Drives `/wavefront-execute`.
4
+
5
+ ## Work item
6
+ <title> · type: feature|change|fix · ref: REQUIREMENTS § <title>
7
+
8
+ ## Approach
9
+ <1–3 sentences: how this gets built, which modules>
10
+
11
+ ## Waves (multi-module items only; single-module = one wave)
12
+ > Items in the same wave are independent (parallel-safe when config `parallelization` is on).
13
+ > Items touching the same shared file must NOT share a parallel wave.
14
+ - Wave 1 (parallel): <moduleA>, <moduleB>
15
+ - Wave 2: <moduleC depends on A>
16
+
17
+ ## Tasks (dependency order, grouped by wave/item)
18
+ > Each task: agent · target files · status (pending|done). Sequential within a module.
19
+
20
+ 1. [ ] **types+schemas** — module-builder — `modules/<m>/<m>.types.ts`
21
+ 2. [ ] **api** — module-builder — `modules/<m>/api/<entity>-api.ts` (+ endpoints, ask-first)
22
+ 3. [ ] **gateway** — module-builder — `repositories/<entity>/gateways/`
23
+ 4. [ ] **repository** — module-builder — keys/options/queries/mutations/types/index
24
+ 5. [ ] **store** — module-builder — (if local state)
25
+ 6. [ ] **selectors** — module-builder — (as needed)
26
+ 7. [ ] **view + hooks** — module-builder — business + controller split
27
+ 8. [ ] **components** — module-builder — `@/ui` + tokens
28
+ 9. [ ] **barrels** — module-builder — index.ts
29
+ 10. [ ] **tests** — tester — colocated, cover acceptance criteria
30
+ 11. [ ] **i18n + tokens** — i18n-tokens — de-hardcode
31
+ 12. [ ] **review** — reviewer — PASS gate (lint+tsc+conventions)
32
+
33
+ ## Acceptance criteria → tests map
34
+ - <criterion> → <test it maps to>
35
+
36
+ ## Risks / notes
37
+ <shared-file edits, deps, anything risky>
@@ -0,0 +1,18 @@
1
+ # PROJECT
2
+
3
+ > Project-level context for wavefront. Written once by `/wavefront-init`, edited rarely.
4
+
5
+ ## What this app is
6
+ <one paragraph: the product, its users, its purpose>
7
+
8
+ ## Stack
9
+ scaffold-nextjs-app: Next.js 15 · React 19 · MUI 7 · React Query · Zustand · RHF + Zod · next-intl · Jest/RTL · Clean Architecture.
10
+
11
+ ## Conventions source of truth
12
+ wavefront skills in `.claude/skills/` (clean-architecture, module-structure, naming-conventions, + patterns). Scaffold pin: `8edaa0b`.
13
+
14
+ ## Domain notes
15
+ <entities, business rules, external systems the agents should know>
16
+
17
+ ## Constraints
18
+ <perf, a11y, deadlines, things to avoid>
@@ -0,0 +1,27 @@
1
+ # REQUIREMENTS
2
+
3
+ > Per-work-item spec produced by intake (`requirement-intake` skill). One section per active work item.
4
+
5
+ ## Work item: <short title>
6
+ Type: feature | change | fix
7
+ Source: prompt | user story | spec
8
+ Status: intake | planned | in-progress | verified | shipped
9
+
10
+ ### Intent
11
+ <who, what, why — 1–3 sentences>
12
+
13
+ ### Scope
14
+ - In: <included>
15
+ - Out: <excluded>
16
+
17
+ ### Entities & layers touched
18
+ <entities; Clean Arch layers affected>
19
+
20
+ ### Acceptance criteria (→ tests)
21
+ - [ ] <observable criterion>
22
+
23
+ ### Resolved questions
24
+ - <q> → <answer>
25
+
26
+ ### Notes
27
+ <anything the plan/execute steps need>