/speccy:plan-executionfrom speccy
Breaks an approved implementation plan into right-sized tasks and executes them in fresh context windows, handling sequential and parallel execution with git worktrees.
Ships in speccy. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Break an approved plan into tasks sized for a single agent context window, then execute them as subagents. Sequential tasks run directly on the main checkout; parallel tasks use git worktrees for isolation and are squash-merged back afterward.
If the plan fits a single context window, still use this skill: it produces one task and executes directly.
Check that the instruction file documents the project's verification tools (build, lint, static analysis, test commands). Execute agents rely on these to validate their work. If they're missing, tell the user: establishing verification standards comes before running a plan.
Worktree init is only needed when the plan has parallel tasks (which use git worktrees). If the plan is purely sequential, skip this section.
Worktrees must branch from the current HEAD so that parallel tasks see work committed by prior sequential tasks. If the binding's run-workflow mechanism names a setting that controls this, check it and set it where missing.
Check whether the instruction file has a ## Worktree init section. If it does, resolve the gather/apply variables before running the workflow:
NAME — command. Run each command via Bash in the main checkout and capture its stdout (trimmed).${NAME} variables from the gather step. Substitute the gathered values into each command. Make symlink commands idempotent: replace ln -s with ln -snf so re-runs don't create circular symlinks inside the existing target.worktreeInit arg (string array) to the workflow.If the section is missing and the plan has parallel tasks, tell the user. Worktree agents without init commands will lack gitignored state, which causes build failures, missing configs, and mid-task recovery friction. Offer to help draft the section before proceeding, the same way you would for missing verification tools.
The plan comes from one of:
The plan describes what to build. Decomposition is this skill's job.
Before starting, check the plan names concrete deliverables. If it's vague or underspecified, ask the user to flesh it out rather than burning tokens on a breakdown that will miss the mark.
<skill-dir> is the absolute path of the directory holding this SKILL.md. The host reports it when it loads the skill (a "base directory" line, or the path the skill was listed at); use that path, never a guess or a path relative to the working directory.
Two fixed workflows are bundled in it; do not modify them. Use <skill-dir>/workflow-simple.js when the plan touches ~5 or fewer files in one coherent change; use <skill-dir>/workflow.js (default) for anything larger.
Read <skill-dir>/prompts.md and pass its ## sections as args.prompts keyed by heading name. Determine baseBranch from git branch --show-current. Generate a runId as a lowercase kebab-case slug from the plan name plus YYYYMMDD-HHmm timestamp (e.g. auth-refactor-20260609-1430).
Run the chosen workflow through the binding's run-workflow mechanism, with its absolute scriptPath and these args:
planPath: absolute or repo-relative path to the plan markdown file. Prefer this: the workflow embeds the path in subagent prompts and lets each agent read the file itself, keeping the orchestration tool call small.plan: full plan text. Use only when the plan isn't on disk (rare). Mutually exclusive with planPath; one must be set.baseBranch: current branchrunId: from aboveprompts: the parsed prompts objectmodels: the resolved rung→model map from the binding, keyed by rung ({ S, M, L, XL }); the active harness's adapter defines the concrete model each rung maps to. Required: breakdown reads models.L, so an absent models throws at the breakdown phase.model (optional): when set, execution/integration/verify agents use that model and breakdown sizes tasks accordingly. Breakdown itself is fixed to the L rung (models.L). When omitted, non-breakdown agents inherit the session model.retrospective (optional, default true): when false, skips friction log synthesisworktreeRoot (optional): the binding's worktreeRoot, where worktrees are created; the cleanup step removes it once empty.worktreeInit (optional): array of resolved shell commands to run at the start of every worktree agent (parallel tasks and corrective tasks only). Assembled from the gather/apply blocks in the instruction file's ## Worktree init section (see Prerequisites above). Pass the fully-substituted commands, with no unresolved ${VAR} references. Sequential tasks run on the main checkout and don't need this.The workflow runs in the background. Where the binding's run-workflow mechanism sends a completion notification, that is how you learn it finished; where it sends none, the monitor's poll is, so on such a harness the monitor is required rather than best-effort. Either way, a long run with sparse commits is indistinguishable from a hang, and a build that keeps spawning corrective tasks may be improvising rather than converging; the orchestrator needs a way to notice and intervene without watching every tick.
Right after launching the workflow, arm the binding's monitor capability as a watchdog (best-effort where a completion notification follows; if the binding provides no monitor, just proceed). Liveness comes from the binding-resolved heartbeat, which exposes two fields: the newest-activity mtime (epoch, ticking whenever any agent does work) and whether a subprocess is still alive (a task is mid-flight). The binding maps both fields to whatever the harness offers: the workflow module writes them to a heartbeat file, or the binding derives them from per-agent transcripts. The monitor polls every ~75s and stays silent while healthy, emitting a line only when a heuristic trips. Poll cheap state: commits on the base branch since launch (progress), commit subjects starting with CT- (corrective tasks), and the heartbeat's two fields (liveness). Reading the heartbeat is cheap: it reads metadata or a small file rather than any agent's contents.
Two tiers, deliberately asymmetric. They serve both a present user (who can correct on a warning) and an absent user (e.g. an overnight run, better served by a completed run than one killed out from under them):
When any line lands, confirm before acting: a slow deploy or test run is not a hang, and the heartbeat's mtime only ticks when a subprocess reports activity, so a single long-running call can look identical to a stall. Read the heartbeat's second field: if a subprocess is still alive, work is in flight and the build is working rather than stalled, so leave it alone. One exception: a call alive with no activity for >10 min may be held for approval. Push a notification naming the task and the pending call, and leave the run going. Emit each signal sparingly so the monitor isn't stopped for noise: the corrective-task warning fires once (a flag); the stall flag re-arms once activity resumes so a confirmed-benign stall doesn't blind the watchdog to a later real one; and the soft-cap health check-in recurs on its ~25-min interval (bump the threshold rather than flag it). The ~25-min interval keeps even a multi-hour run to a handful of beats, well under the noise-stop threshold. Stop the monitor once the workflow completes (its notification arrives, or the polled status leaves running) so it doesn't linger.
While the workflow runs, make no change to tracked files in the base checkout. Integration refuses a dirty base branch, so one uncommitted edit ends the run. Hold edits until the workflow completes.
Sketch of the poll loop (adapt to the binding's heartbeat; read its mtime as whole epoch seconds and its alive field as 1/0):
BASE=<base-branch>; HB=<heartbeat-source> # binding-resolved: {mtime, alive}
START=$(git rev-parse HEAD); START_TS=$(date +%s); w_ct=0; cap=1500; w_stall=0; w_held=0 # cap = next soft-cap beat threshold (s)
while true; do
now=$(date +%s); el=$(( now - START_TS ))
ct=$(git log "$START"..HEAD --format='%s' 2>/dev/null | grep -cE '^CT-')
lc=$(git log -1 --format=%ct 2>/dev/null || echo 0)
tm=$(hb_mtime "$HB") # heartbeat newest-activity mtime (epoch s); binding-resolved liveness
alive=$(hb_alive "$HB") # 1 while a subprocess is in flight, else 0
idle=$(( now - (lc > tm ? lc : tm) ))
if [ "$idle" -le 300 ]; then w_stall=0; w_held=0; fi # re-arm once it's moving again
if [ "$idle" -gt 300 ] && [ "$w_stall" -eq 0 ]; then echo "STALL: idle $((idle/60))m (elapsed $((el/60))m, $ct corrective, alive=$alive)"; w_stall=1; fi
if [ "$idle" -gt 600 ] && [ "$alive" -eq 1 ] && [ "$w_held" -eq 0 ]; then echo "HELD?: one call alive, idle $((idle/60))m — may await approval"; w_held=1; fi
if [ "$ct" -ge 2 ] && [ "$w_ct" -eq 0 ]; then echo "WARN: $ct corrective tasks — may be struggling (elapsed $((el/60))m)"; w_ct=1; fi
if [ "$el" -gt "$cap" ]; then echo "HEARTBEAT: elapsed $((el/60))m, still running ($ct corrective) — health check-in"; cap=$(( cap + 1500 )); fi # recurring ~25m beat
sleep 75
done
Report to the user:
Summary: tasks completed, whether verification passed, any remaining gaps
Retrospective: if one was produced, present the cross-cutting patterns and suggestions
If incomplete, distinguish two cases:
Read integrated and built_not_integrated rather than re-deriving what happened. Every exit reports both, on any outcome. integrated names the tasks whose work is on the base branch: squash-merged for a parallel task, committed directly for a sequential one. A failing step no longer discards its successful siblings, so on an incomplete run this is usually non-empty. built_not_integrated names work that committed but whose merge failed, including corrective tasks, with the commit to recover it from.
Keep it concise. Synthesize rather than dumping raw JSON.
The breakdown agent writes each task to .tasks/<run-id>/<task-id>.md. These files are the durable record of the decomposition: without them, resuming means re-running breakdown and getting a different decomposition.
To resume a failed run:
.tasks/<run-id>/git log on the base branch to identify which tasks were already integratedbuilt_not_integrated commit by hand (git merge --squash <commit>, then commit as <task-id>: <title>), so a failed integration needs no rebuildWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
2 skills in this plugin
npx claudepluginhub aquivalabs/speccy --plugin speccyOther plugins' skills for the same job