| name | nv-implement |
| description | Implement planned work by fanning out parallel subagents on isolated worktrees — TDD at pre-agreed seams, per-slice nv-review-local-changes, merge back, full suite once at the end. |
| disable-model-invocation | true |
nv-implement
Implement the work described (plan file, spec, or ticket) as vertical slices, one subagent per slice, each on its own worktree. Use /tdd where possible, at pre-agreed seams. Run typechecking regularly, single test files regularly, and the full test suite once at the end.
Invoking this skill authorizes the commits it produces (slice commits, review refactor commits, merge commits, and integration fixes).
Workflow
- [ ] 1. Cut the work into seams
- [ ] 2. Feature branch + one worktree per seam
- [ ] 3. Fan out subagents (TDD → commit → /nv-review-local-changes)
- [ ] 4. Merge slices back
- [ ] 5. Integration pass (typecheck + cross-slice fallout)
- [ ] 6. Full suite once + teardown
1. Cut the work into seams
Split the plan into slices that touch disjoint files — each slice independently committable and testable. Typical Novu cuts: policy/backend logic, create-path + migration, copy/DTO/docs, dashboard UI.
For each seam decide upfront: is it TDD-able (public function, use case, resolver → yes) or verify-by-lint (dashboard UI with no unit harness → no)? Tell the subagent which.
Done when: every plan item is owned by exactly one seam, and no two seams edit the same file. If two seams must touch the same file, merge them into one slice — do not parallelize a conflict.
2. Feature branch + one worktree per seam
git fetch origin next
git checkout -b <feature-branch> origin/next
git worktree add -b <feature-branch>-<seam> ../wt-<seam> HEAD
Symlink dependencies into each worktree (no install needed):
ln -s <main-checkout>/node_modules ../wt-<seam>/node_modules
Done when: git worktree list shows one worktree per seam, all at the feature branch HEAD.
3. Fan out subagents
Launch all slice subagents in one message (parallel Task calls, run_in_background: true). Each prompt must carry full context — subagents see nothing of this conversation. Include:
- Worktree path + branch; hard boundary: work ONLY there
- The slice's goal and the locked product decisions it depends on
- Exact files to change and files owned by other slices (do not touch)
/tdd instruction for TDD-able seams: vertical slices, one behavior at a time, with the prioritized behavior list
- The test command (see Commands below) and instruction to run single spec files regularly
- Closing step: commit with
type(scope): why, then run /nv-review-local-changes from the worktree
Done when: every subagent reports commits + test results + review triage. Read each summary; a subagent that skipped review or left tests red gets resumed, not merged.
4. Merge slices back
From the main checkout, on the feature branch:
git merge --no-ff <feature-branch>-<seam> -m "merge: <slice summary>"
Merge in dependency order (backend policy before tests that rely on it). Then remove worktrees and delete slice branches.
Done when: all slice branches merged, git worktree list shows only the main checkout, slice branches deleted.
5. Integration pass
Slices were reviewed in isolation — the seams between them were not. Expect cross-slice fallout: one slice changed copy while another slice's spec asserts the old string; one slice widened a type another slice consumes.
- Typecheck:
pnpm exec nest build in apps/api; ReadLints on dashboard files
- Run every spec file touched by any slice, together, from the main checkout
- Fix fallout as small commits on the feature branch
Done when: typecheck is clean and all touched spec files pass in one run.
6. Full suite once + teardown
Run the full relevant suite once (e.g. all src/app/agents/**/*.spec.ts). Report genuinely-related failures fixed; unrelated environmental failures named as such — not silently ignored, not chased.
Done when: suite result reported with pass/fail counts and any unrelated failures explained.
Commands (Novu)
cd apps/api && pnpm exec nest build
TS_NODE_PROJECT=tsconfig.spec.json TS_NODE_TRANSPILE_ONLY=true NODE_ENV=test \
NOVU_ENTERPRISE=true CLERK_ENABLED=true NEW_RELIC_ENABLED=false \
NODE_OPTIONS=--no-experimental-strip-types \
npx mocha --timeout 15000 --require ts-node/register --exit --no-config 'src/path/to/file.spec.ts'
Dashboard has no unit harness for most components — verify via ReadLints; do not invent a test harness.
Guardrails
- One slice, one worktree, one branch — a subagent that edits outside its worktree corrupts a sibling slice.
- Slice commits and review refactor commits stay separate (per
/nv-review-local-changes); never amend or squash them during merge.
- E2E suites that need a running API/DB are out of scope for slices — flag them for CI instead.
- If a Linear ticket is required for the eventual PR, create it early; hand off to
/novu-prepare-pr when implementation is done.
Related skills
/tdd — the red-green loop each TDD-able slice runs
/nv-review-local-changes — each slice's closing review
- novu-prepare-pr — PR prep after implementation
- nv-worktree-commands — worktree debugging reference