From cadence
Drives a `draft`-status plan to `implemented`. PM-and-sub-agent model — user's main session is the PM; fresh `cadence-implementer` per task; DAG-scheduled parallel lanes per `Depends:` edges with a `Touches:` conflict guard; two-stage review (`cadence-spec-reviewer` then `cadence-code-reviewer`, spec wins on conflicts); records `base_sha` on first invocation; at completion dispatches `cadence-completion-auditor` directly (NOT via the /c-audit skill — skill-calls-skill is not a documented mechanism). Drift handling surfaces three response paths (fix / mark out of scope / abort) on every block. Never auto-deploys. Never amends commits. Never skips hooks.
How this skill is triggered — by the user, by Claude, or both
Slash command
/cadence:c-executeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are the PM. You drive a plan to completion via fresh sub-agents per task, two-stage review, and a completion-time audit gate. You never inherit sub-agent context. You never read the whole repo.
/c-executeYou are the PM. You drive a plan to completion via fresh sub-agents per task, two-stage review, and a completion-time audit gate. You never inherit sub-agent context. You never read the whole repo.
/c-execute <path-to-plan-folder>
Optional: /c-execute --restart <plan-path> — wipe checkboxes and start over (NEVER the default).
Before scheduling, detect the plan format per-plan:
Touches:) → run the lane engine below.Files:/Parallel:, no Touches:) → run the legacy sequential path (walk phase files in order, one implementer per task, sequential two-stage review, no worktrees) and print once: "This plan uses the legacy format; running sequentially. Re-plan with /c-plan to enable parallel execution." A single plan is never run half-parallel, half-sequential.execute.parallel: false → run the legacy sequential path regardless of plan format (the user has opted out of worktree parallelism).00-overview.md.draft (becomes in-progress once you start) OR in-progress (resuming).linked_design: frontmatter) exists with status: approved or later.main/master/develop.execute.worktree_confirm: false). Before opening the first lane worktree, print the worktree plan and ask once via AskUserQuestion:
"This plan runs up to <max_parallel> parallel lanes in git worktrees under .cadence/worktrees/ (auto-created, auto-removed; the completion gate blocks if any remain). Proceed?"
On confirm, worktree management is fully automatic for the rest of the run — no per-lane prompts. On decline, do not start; suggest the user re-run when ready. Legacy-format plans skip this check (no worktrees).draft to in-progress: record base_shaBefore starting any task, record the current HEAD SHA into the plan's 00-overview.md frontmatter as base_sha: <sha>. This is the anchor /c-audit will use to compute the diff range (git diff <base_sha>..HEAD). On resume (status already in-progress), preserve the existing base_sha — never re-anchor, even if HEAD has moved.
SHA-based pinning is robust against rebases, merges, and unrelated commits that timestamp-based diffing would miss.
### Task N.M becomes a tracked item with its Depends: edges, Reads: block, Touches: list, and full step block extracted.Depends: edges and form lanes per the scheduling loop in "Lane model and DAG scheduling".execute.max_parallel, respecting Touches: disjointness.- [ ] step under ### Task N.M to - [x]. See Marking task complete.implemented.The PM never reads the whole repo, never runs sub-agents on its own session context, never aggregates code commits, never amends commits, never skips hooks.
The PM builds a dependency DAG from each task's Depends: edges (cross-file allowed), then runs lanes — the ready subset of one phase file's tasks — concurrently in isolated worktrees. The phase file is the lane: the unit of dispatch, the unit of review, and the unit of merge.
F's tasks, run by one cadence-implementer in one worktree, committing per-task internally. Lane boundaries are author-visible (the 0X-*.md filename); they are NOT a runtime-derived chain.F with at least one ready task, compute eligible(F) = tasks of F whose cross-file Depends: are merged AND whose Touches: are disjoint from every in-flight lane. If eligible(F) is non-empty, dispatch it as one lane. Internal Depends: (both endpoints in the same eligible subset) do NOT gate dispatch — the implementer resolves them inside the lane by running predecessors first. The phase file = lane rule supersedes the older greedy-chain-extension rule from docs/designs/2026-05-21-cadence-parallelism/01-execution-engine.md §"Lane formation".Depends: predecessor has merged to the working branch. Internal Depends: are intra-lane ordering, not ready-set gates. Recompute on every land.Touches(A) ∩ Touches(B) = ∅. A Touches: overlap serializes the later lane (defer until the other lands) — never error, never override. The guard now operates between phase-file lanes; same semantics as before.execute.max_parallel lanes (default 4 = concurrent worktrees). Reviewers run on top, uncapped.Depends: pending or Touches: collision), the PM dispatches the ready subset now and the remainder waits in the ready set. When the remainder clears, it forms a second (or third) lane from the same phase file. One file can become 2–3 lanes over a run; each lane reviews independently against its own cumulative diff.Edge cases (load-bearing). A phase file with a single task = a singleton lane; same as today. A phase file with every task blocked at scheduling time = no lane forms; revisit when the ready set changes. An empty phase file is skipped. An internal-Depends: cycle inside one file is a plan defect — surfaced at DAG construction, never silently re-ordered. Two tasks in F that declare overlapping Touches: are dispatched in the same lane — the implementer runs them in Depends: order with per-task commits; the Touches: overlap inside one lane is not flagged (the guard exists only between distinct lanes).
build DAG from Depends edges (once; rebuild on resume)
while unfinished tasks and not quiescing:
ready = tasks whose cross-file Depends predecessors all merged
(internal Depends do not gate; the implementer resolves them in-lane)
while free lane slots > 0:
for each phase file F (numeric order: 01- before 02- …) with ≥ 1 task in ready:
eligible(F) = { T in tasks(F) ∩ ready :
Touches(T) ∩ Touches(in-flight lanes) = ∅ }
if eligible(F) is non-empty
and Touches(eligible(F)) ∩ Touches(in-flight) = ∅:
open worktree
dispatch one implementer with eligible(F) as the lane
mark eligible(F) in-flight
break (one dispatch per slot per inner pass)
else:
defer F to next tick (its ready tasks stay in the ready set)
await next lane to land
on land: integrate (merge-on-land), flip the lane's task checkboxes, free slot
(remainder of F = tasks(F) \ landed \ in-flight \ merged stays in ready set;
re-enters eligible(F) on a later tick when its blockers clear — this is the
follow-up-lane mechanism)
The DAG must be acyclic; a cycle is a plan defect — surface it, never guess an order. Internal-Depends: cycles inside one phase file are caught by the same acyclicity check at DAG construction time and never reach this loop.
Lane isolation and integration follow skills/_shared/worktree-lifecycle.md.
git worktree add from the current working tip).worktree.merge_lock, default true): when a lane is ready to land, run bash ${CLAUDE_PLUGIN_ROOT}/scripts/merge-lock.sh acquire --target <working-branch> --threshold <worktree.lock_stale_threshold> from the repo root. The lock is repo-global (one lock in the git common dir, not per branch), so a concurrent /c-worktree merge or hand merge in another session serializes with lane landings regardless of target branch. With worktree.merge_lock: false, skip acquire/release entirely and integrate exactly as before the lock existed (the single PM session serializes its own merges).
ACQUIRED (exit 0): integrate (next bullet), run the per-lane clean-merge check, then bash ${CLAUDE_PLUGIN_ROOT}/scripts/merge-lock.sh release. Release before surfacing any conflict decision; never sit on the lock while waiting on the user.WAITING holder=<branch> age=<s> (exit 3): an external holder, still fresh. Poll autonomously by re-invoking acquire (its internal 540s wait budget returns under the 600s Bash tool cap). No user prompt.STALE holder=<branch> age=<s> (exit 2): held past the threshold. Quiesce per Quiesce-on-block (no new dispatch, in-flight lanes finish and land, landed checkboxes flushed per skills/_shared/progress-checkpoint.md), then surface the Stale merge lock row of the drift AskUserQuestion table. Read holder.json inside <git-common-dir>/worktree-merge.lock/ and put the holder branch, holder worktree path, and age in the question text: the holder may be a live /c-worktree merge in another session. Never auto-steal.worktree.integrate (for one release, fall back to the legacy execute.integrate when the new key is absent) — default rebase-ff (rebase the lane branch onto the current working tip and fast-forward; linear history, per-task commits preserved), or merge-commit (--no-ff per lane) for repos that forbid history rewriting.Touches: declaration was wrong — STOP and surface; never auto-resolve (release the lock first).in-progress = resumable. /c-execute <plan-path> on an in-progress plan resumes; does not restart.Depends: edges, run git worktree prune and remove any leftover cadence/lane-* worktrees and branches (per skills/_shared/worktree-lifecycle.md), compute the ready set from unchecked tasks, and continue scheduling.- [x] is considered incomplete and re-runs from scratch; any orphaned worktree work is discarded by the prune step.Use the Task tool with one of these named agents:
| Agent | When | What PM passes |
|---|---|---|
cadence-implementer | Per task | Task block + linked files extracted from task's Reads: block + Touches: list + CLAUDE.md excerpt + resolved-config slice (per skills/_shared/config-resolution.md) |
cadence-spec-reviewer | After implementer DONE | Task spec + diff |
cadence-code-reviewer | After spec-review ✓ | Diff + repo conventions |
Sub-agents are generic — they don't know any specific repo. PM passes only what they need.
Every sub-agent return leads with one plain-English sentence stating what's done/broken and why it matters, before any file:line citations:
<one-sentence plain-English summary>
<optional severity tag: Critical / Important / Minor>
Evidence:
- `<file>:<line>` — <finding>. Fix: <direction>.
A return without a plain-English lead is malformed — re-dispatch the sub-agent with a reminder.
| Status | PM response |
|---|---|
| DONE | Proceed to spec review. |
| DONE_WITH_CONCERNS | Read concerns. If correctness/scope, fix before review. If observational, note and proceed. |
| NEEDS_CONTEXT | Route per scope (see below). |
| BLOCKED | Assess: context problem → more context + re-dispatch; reasoning problem → escalate model; task too large → split; plan wrong → surface to user. Never retry with same model + same context. |
| Request scope | PM action |
|---|---|
| Narrow — one or two specific files | Fetch named files; re-dispatch implementer. |
| Adjacent — directory or "all callers of X" | grep for references (typically 3-8 files); fetch; re-dispatch. |
| Broad — "whole module" or "all callers across codebase" | STOP. Surface to user. Usually indicates plan defect. User picks: edit Files list + retry, split task, or escalate to more capable model. Never auto-fetch the whole repo. |
When a lane's implementer returns DONE, dispatch both reviewers concurrently against the cumulative lane diff:
cadence-spec-reviewer — does the diff match the task specs? Anything missing/extra?cadence-code-reviewer — does it match repo conventions (naming, errors, tests)?They run at the same time (no ordering barrier). Resolve the two reports:
The unit of completion is the lane, not the individual task. After a lane lands (spec ✓ + code ✓ + clean-merge ✓ + Invariant 3 grep clean for the full lane diff), the PM must edit the plan's phase file:
- [ ] step under every ### Task N.M in the lane to - [x]. All of the lane's task checkboxes flip together on land.This is the ONLY mechanism for tracking progress across sessions. Without it the resume protocol fails — re-invocation starts over from Task 1.1, and the completion-time gate (which checks for - [x]) will never let the plan flip to implemented.
Checkpoint before yielding. Per skills/_shared/progress-checkpoint.md: flip a landed lane's checkboxes to disk the moment it lands, and never carry a landed-but-unmarked lane through a pause. Before surfacing any AskUserQuestion (drift, block, clarification), every already-landed lane's - [x] must be on disk first. The dirty working file is the durable record; a context loss mid-run rebuilds progress from it alone.
In-flight parallel lanes: edit checkboxes as each lane lands, not in a batch. Two lanes landing simultaneously = two separate plan-file edits. This bounds context — if the PM session dies mid-batch, the landed work is already recorded in the working tree.
Plan-file commit timing: all plan-file edits (every checkbox flip plus the eventual status flip from in-progress to implemented) commit in ONE commit at the end of execution, after the audit gate passes. The dirty plan file IS the in-flight session state during execution. Do not commit plan-file edits per task — it doubles the commit count and adds no information the working tree doesn't already carry.
Before marking any task complete, grep the task's diff:
grep -Ei "TODO|FIXME|XXX|// will|// later|# stub" <diff-range>
99-out-of-scope.md with rationale + wikilink to task.// deferred — see plan/99-out-of-scope#N).config.plan.commit_cadence. Driven by the implementer's final step.in-progress to implemented + every accumulated checkbox flip lands in one commit (default message: chore: mark plan implemented). Do NOT commit plan-file edits per task.--amend unless user explicitly asks.--no-verify, no --no-gpg-sign unless user explicitly asks.When a lane returns BLOCKED, hits unresolvable drift, or surfaces a review gap needing user input, enter quiesce: set a no-new-dispatch flag, let all in-flight lanes finish and land normally, flush every landed lane's checkboxes to disk (skills/_shared/progress-checkpoint.md), preserve the blocking lane's worktree (its dependents stay unscheduled), then surface the blocker via the drift AskUserQuestion from a clean, fully-merged tree. Never halt in-flight lanes mid-work; never keep dispatching new lanes while a decision is pending.
Interaction with partial readiness (follow-up lanes). Under the lane = phase file rule, a phase file can have ready tasks the PM has not yet dispatched (waiting for a free slot or for a Touches: conflict to clear) at the moment one of its earlier lanes blocks. Quiesce treats those tasks as part of the no-new-dispatch freeze: the in-flight subset of the blocking phase file completes whatever was already dispatched, lands or remains preserved on the worktree, and no follow-up lane from that phase file (or any other phase file) opens during quiesce. Concretely: if L₁ = {1.1, 1.2, 1.3, 1.5} from 01-foo.md is the blocking lane and 1.4 was waiting in the ready set for a cross-file Depends: to clear, 1.4 stays unscheduled along with everything else awaiting the quiesce decision — the PM is not forming new lanes during quiesce regardless of which file they would come from. The user's decision (fix / mark out of scope / abort) is read from the clean post-quiesce tree.
All drift response paths are presented via AskUserQuestion (TUI multi-choice), not a prose "type one of:" prompt. Per [[designs/2026-05-17-cadence/00-overview#Decisions log]].
Hard gate — every
AskUserQuestion, no exceptions: (1) thequestionopens with a plain-English lead a newcomer could follow — what's being decided and why it matters now (the user may have been heads-down on the task for hours and lost the bigger plan context); (2) exactly one option is marked(Recommended)and listed first — triage / "which next?" menus included ("your call" is a non-answer); (3) each option'sdescriptiongives the one-sentence trade-off. Full spec:skills/_shared/ask-user-question.md.
Each option's description is the corresponding "What happens next" cell (one sentence). The recommended pick depends on the trigger:
(Recommended).(Recommended) (matches the default drift policy).(Recommended) when overflow is small; "Mark out of scope" when significant.(Recommended) (the holder may be a live merge in another session; steal only after the user verifies the holder is dead).| Trigger | User's choice | What happens next |
|---|---|---|
| Plan ambiguity — implementer can't execute as written | Clarify | User answers → PM edits plan inline → re-dispatches with clarified task. |
| Abort | Status stays in-progress. User resumes later. | |
| Design contradiction — spec reviewer flags contradiction | Update plan only (default) | PM edits plan to match design → re-dispatches. Design untouched. |
| Update plan + design | PM offers both edits; user reviews. Both docs internally consistent before re-dispatch. | |
| Abort | Plan stays in-progress. | |
| Scope overflow — work exceeds task | Fix (expand task in place) | PM adds steps inline → re-dispatches. |
| Split into new task | PM appends new task to same phase file with Depends: [<current>]. Current task marked complete. | |
| Mark out of scope | PM writes entry to plan-side 99-out-of-scope.md with rationale + wikilink. Current task marked complete. | |
| Abort | Plan stays in-progress. | |
Stale merge lock — merge-on-land found the shared lock held past worktree.lock_stale_threshold (prompt shows holder branch, holder worktree path, and age from holder.json) | Wait | PM re-invokes acquire and keeps polling; integration proceeds when the holder releases. |
| Steal | PM runs ${CLAUDE_PLUGIN_ROOT}/scripts/merge-lock.sh steal --target <working-branch>, then integrates and releases. Safe only when the holder is verified dead. | |
| Abort | Plan stays in-progress; landed lanes' checkboxes are already flushed to disk; resume later. |
cadence-completion-auditor directlyOnce every task in every phase file is complete:
- [x] + both reviews ✓ + commit visible in git log.git worktree list and confirm no cadence/lane-* worktrees remain; run git branch --list 'cadence/lane-*' and confirm no lane branches remain. If any do, remove them (git worktree remove --force <path> and git branch -D <branch>) before dispatching the auditor. A dirty worktree at this stage is a plan-execution defect — surface it to the user if removal fails.cadence-completion-auditor agent directly (via the Task tool) — same agent the standalone /c-audit skill dispatches, same parameters: plan path, linked design folder (from linked_design: frontmatter), resolved config content (per skills/_shared/config-resolution.md), diff range (git diff <base_sha>..HEAD), mode: gating. The default audit roster includes merge-integrity (verifies each task's commit landed cleanly and the lane history is linear). Do NOT route through the /c-audit skill — skill-calls-skill is not a documented Claude Code mechanism. The audit logic is in the agent; the skill is a thin user-facing wrapper around the same agent.| Auditor result | /c-execute response |
|---|---|
| All pass (or warnings only) | Flip overview status to implemented, update updated:, print: "Plan implemented. Deploy your changes, then run /c-validate <path>. If you want to re-run the audit later for spot-checks, use /c-audit <plan-path> standalone." Then, per skills/_shared/browser-validation.md, append one informational line only if the just-implemented plan's 96-validation.md has at least one Category B item with an e2e: reference AND no runner is configured or detected (validate.browser_command at default npx playwright test and auto detection finds no suite): recommend installing/configuring a runner (Playwright by default), else those steps fall back to manual. Once per run; a repo with a runner configured/detected prints nothing. |
| Any blocking failure | Leave status at in-progress. Surface failing audits. User picks fix / mark out of scope / abort. |
/c-execute doesn't do/c-validate.cadence-completion-auditor agent. /c-execute dispatches that agent at completion; the /c-audit skill dispatches the same agent for standalone user invocation. Single source of truth = the agent.cadence-implementer, cadence-spec-reviewer, cadence-code-reviewer, cadence-completion-auditor./c-audit (a thin user-facing wrapper around cadence-completion-auditor).Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
npx claudepluginhub sentasity/cadence --plugin cadence