.cursor/skills/nv-implement/SKILL.md
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).
- [ ] 1. Cut the work into seams
- [ ] 2. Resolve feature branch + one worktree per seam
- [ ] 3. Fan out subagents (TDD → commit → /nv-park-and-review)
- [ ] 4. Merge slices back into the feature branch
- [ ] 5. Integration pass (typecheck + cross-slice fallout + thermo-nuclear review)
- [ ] 6. Full suite once + teardown
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.
Detect the integration target first (git branch --show-current):
next / main / master): treat the current branch as <feature-branch>. Do not create a new branch from origin/next. Slice worktrees branch from this HEAD; all merges go back here.next / main / master (or detached): create a new feature branch from origin/next, then proceed.git fetch origin next
# only when starting fresh from next/main/master:
git checkout -b <feature-branch> origin/next
# always — slice branches from current feature-branch HEAD:
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: <feature-branch> is set (existing or newly created), and git worktree list shows one worktree per seam, all at that feature branch HEAD.
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:
/tdd instruction for TDD-able seams: vertical slices, one behavior at a time, with the prioritized behavior listtype(scope): why, then run /nv-park-and-review from the worktreeDone 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.
From the main checkout, on <feature-branch> (the same branch resolved in step 2 — never merge slices into next directly):
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 into <feature-branch>, git worktree list shows only the main checkout, slice branches deleted.
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.
pnpm exec nest build in apps/api; ReadLints on dashboard filesthermo-nuclear-code-quality-review subagent over the full feature-branch diff (merge-base with origin/next → HEAD) — the main agent runs this, not a slice. Fix valid findings as small commits; re-run touched specs after.Done when: typecheck is clean, all touched spec files pass in one run, and the whole-diff review is done with valid findings addressed.
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.
# API typecheck (catches what TS_NODE_TRANSPILE_ONLY hides)
cd apps/api && pnpm exec nest build
# Single spec file(s) — mocha, from apps/api
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.
origin/next or merge slices into next./nv-park-and-review); never amend or squash them during merge./novu-prepare-pr when implementation is done./tdd — the red-green loop each TDD-able slice runs/nv-park-and-review — each slice's closing reviewthermo-nuclear-code-quality-review — the whole-diff audit in step 5