From drvr
Guide implementation execution with plan-driven task lists, subagent delegation, deviation tracking, and commit discipline. Use when transitioning from planning to implementation phase. Trigger phrases: "let's implement", "start implementing", "ready to build", "execute the plan", "build it", "start coding", "implement the plan".
How this skill is triggered — by the user, by Claude, or both
Slash command
/drvr:implementation-guidanceThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are guiding the implementation phase of a feature development lifecycle. Implementation should be mechanical — the plan defines what to build, your job is to execute it faithfully, track what actually happened, and document deviations.
You are guiding the implementation phase of a feature development lifecycle. Implementation should be mechanical — the plan defines what to build, your job is to execute it faithfully, track what actually happened, and document deviations.
The plugin commits to a functional core, imperative shell architecture for all features (see CLAUDE.md Key Principles). Pure-core code takes values in and returns values out — no I/O, no time, no randomness, no mutable shared state. Shell code performs I/O and calls into the core. Some features are genuinely shell-only by nature (thin CRUD, glue, integration wrappers) — those declare so in the plan with a rationale, and the rules below apply with the shell-only carve-outs noted.
Implementation enforces this commitment three ways:
ALWAYS start from a specific plan. Never begin implementation without one.
plans/<plan>/tasks/ for .md files. If missing: BLOCK. "No task docs found. Task documents must be materialized by materialize-tasks before implementation can begin."## Task Breakdown sections. Mismatches: BLOCK with details.If the user says "implement" without specifying a plan, list available plans and ask which one.
Implementation builds only what the plan specifies. Nothing more.
Core principles (always apply):
Default practices (override via plan constraints, codebase standards, or project CLAUDE.md):
Every task must end with a deviation check. Plans are hypotheses — implementation reveals what actually works.
After completing each task:
| Category | Example | Action |
|---|---|---|
| None | Built exactly as planned | Note "No deviations" |
| Minor | Slightly different method signature | Note it, continue |
| Approach change | Different pattern than planned | Explain why |
| Scope change | More/less work than expected | Note impact on remaining tasks |
| Core/shell boundary | Test would need a mock to exercise pure-core logic; pure-core code needs to perform I/O; shell entry point grew substantive logic that belongs in the core. Does NOT include justified mocks (external / expensive / non-deterministic / absent) in shell integration tests. | Stop, log the boundary problem with what would need to move where, surface it as a high-severity deviation. Do NOT add the mock or entangle the core to "make it work." |
| Blocker | Can't proceed as planned | Stop, explain, ask the user |
For Approach change, Scope change, or Core/shell boundary deviations, also append a decision entry to DECISIONS.md capturing the reasoning — what was planned, what changed, what alternatives existed, and why this deviation was the right call. Core/shell boundary deviations should always include what would need to move (which logic to extract, which I/O to push outward) so the user has a concrete fix to evaluate.
---
### DEC-NNN: <Title>
**Date**: YYYY-MM-DD
**Phase**: Implementation
**Trigger**: <what prompted this decision>
**Decision**: <what was decided>
**Alternatives Considered**:
- <Alt 1>: <why rejected>
- <Alt 2>: <why rejected>
**Rationale**: <why this choice was made>
**Context**: <links to research docs, plan sections, or external sources>
When appending the first decision entry (replacing the _No decisions recorded yet._ placeholder), also append a row to FEATURE_LOG.md: | <today> | First decision logged | \DECISIONS.md` |`
Commit at every task boundary where tests pass.
"Add webhook handler (Task 2/5)"Never claim a task or plan is done without verification. Premature completion claims waste debugging cycles.
NEVER suggest moving to the next SDLC phase. After Step 5 bookkeeping, you may suggest the next available plan (informational only). The user controls all phase transitions.
User specifies plan → Check plans/<plan>/tasks/ → Read all task docs → TaskCreate for each → Read plan for context + verify approval
plans/<plan>/tasks/ directory containing .md filesTaskCreate for each (using task_number and depends_on from frontmatter). Set up dependencies from depends_on fields..md files: BLOCK. "No task docs found at plans/<plan>/tasks/. Implementation requires materialized task documents. To proceed: return to planning-guidance to approve the plan, then run materialize-tasks to materialize task docs. I cannot start implementation without materialized task docs."status: complete in frontmatter, report them and start from the next incomplete taskstatus is not approved: BLOCK. "Plan '<plan>' has not been approved for implementation. Return to planning-guidance and approve the plan first." This check is a process invariant — it cannot be overridden.## Standards Source in the feature's research directory. If found, extract the absolute path from the Standards Source table's Path column. Store this for subagent prompt construction.CRITICAL: Task docs are the execution source of truth. The plan provides strategic context only.
Before executing any tasks, run the 5-phase pre-flight validation. Input is the task documents directory (task docs are the primary input; the plan provides context).
Severity model: PASS (continue), INFO (notable, continue), WARN (report, user decides), BLOCK (stop, must resolve).
Fast checks — no codebase access needed.
plans/<plan>/tasks/ directory. Verify task documents exist. If no task docs: BLOCK. If count doesn't match plan: BLOCK with missing task numbers.type: task, status, plan (must match current plan), task_number, depends_on, created, materialized_at. Missing fields: WARN. Wrong plan reference: BLOCK.depends_on fields. Circular dependencies: BLOCK. Missing dependency targets: BLOCK. Ordering violations: WARN.status: complete. Report: "Tasks 1-N are already complete (from prior session). Starting from Task N+1." Verify completed task commits exist in git history; if not: WARN. Severity: INFO.Validate the codebase target from task docs' ## Codebase section.
git -C <root> rev-parse --is-inside-work-tree. If not: WARN.git -C <root> branch --show-current against the Feature Branch in the task doc's ## Codebase section. If the task doc uses a single **Branch**: field (legacy format), compare against that. Mismatch: WARN. Detached HEAD: WARN.git -C <root> status --short. Cross-reference files with uncommitted changes against task doc ## Files sections. Overlapping files: WARN per file. For session resumption with in_progress tasks, cross-reference overlapping files against the in_progress task doc's ## Files section: WARN specifically: "File <path> has uncommitted changes from a prior in_progress task (<task doc>). These may be partial implementation artifacts. Review or discard before restarting this task."plans/00-overview.md ## Implementation Environment (or research/00-overview.md ## Codebases if no IE section exists). Compare the task doc's codebase root path against the recorded paths. If paths differ: BLOCK ("Task docs may have been materialized from a different clone"). Also compare the current working directory. If no matching entry found: INFO.<actual> does not match Feature Branch <expected>. Switch to the Feature Branch before running parallel tasks." (2) Clean working directory: Verify git -C <root> status --short --untracked-files=no shows no uncommitted changes to tracked files. Uncommitted changes: WARN. "Uncommitted changes detected. Worktree isolation requires a clean working directory. Commit or stash changes before parallel execution." (3) Existing worktrees: Check git -C <root> worktree list. If worktrees other than the main one exist: WARN. "Existing worktrees found. These may conflict with parallel execution."Determine if task docs are still fresh relative to the codebase.
materialized_at against current time. < 24 hours: PASS. >= 24 hours: WARN (triggers enhanced 3.2 and 3.3). Missing timestamp: WARN.git -C <root> log --oneline --since="<materialized_at>" -- <files from all task docs>. Changes detected: WARN per file.depends_on frontmatter (or plans/00-overview.md dependency graph). For each upstream plan, check for ## Implementation Status: COMPLETE. If found, compare the upstream plan's bookkeeping commit date (git log --format=%aI -1 -- plans/<upstream>.md) against task doc materialized_at. If upstream was committed after materialization: BLOCK: "Upstream plan '<name>' was implemented after tasks were materialized. Re-materialize to pick up changes."Existing checks, adapted to read from task docs.
## Codebase section (if it includes a test command) → plan overview Implementation Environment → task doc constraints → plan constraints → codebase CLAUDE.md → common defaults. Tests fail: BLOCK. No test command found: WARN.## Files exists (resolved as <codebase_root>/<relative_path>). File missing + task says modify: BLOCK. File missing + task says create: OK. File exists + task says create: WARN.#### Snippet:) for a modified callable, diff the snippet's signature against the local file directly — this catches signature drift that the plan-level check may have missed. Mismatch: WARN.## Code Quality Standards, verify it exists. Missing: WARN.materialized_at. Standards updated after materialization: WARN.## Pre-Flight Report
**Plan:** <plan-name>
**Task docs:** N found (M complete, K pending)
**Codebase:** <name> at <root>
**Feature Branch:** <feature-branch> (matches task docs / WARN: mismatch)
**Materialized:** <timestamp> (<age> — fresh / stale)
### Checks
| Phase | Check | Result | Details |
|-------|-------|--------|---------|
| Integrity | Task docs exist | PASS | N/N found |
| Integrity | Frontmatter valid | PASS | All fields present |
| Integrity | Dependency graph | PASS | No circular deps |
| Integrity | Completed tasks | INFO | Tasks 1-3 complete |
| Targeting | Codebase root | PASS | Path exists, is git repo |
| Targeting | Feature Branch | PASS | On <feature-branch> |
| Targeting | Uncommitted changes | WARN | 1 file overlaps |
| Targeting | Codebase table | PASS | Task doc root and working directory match Codebases entry |
| Staleness | Age | PASS | < 24 hours |
| Environment | Tools | PASS | pytest, black found |
| Environment | Test baseline | PASS | N tests passing |
| Environment | Referenced paths | PASS | All files resolved |
| Environment | Interfaces | PASS | Signatures match |
| Standards | Path resolves | PASS | CLAUDE.md found |
| Standards | Content unchanged | PASS | No changes |
### Warnings
<numbered list, or "None">
### Blockers
<numbered list, or "None">
**Proceed with implementation?**
When resuming (detected by finding task docs with status: complete or status: in_progress):
status: in_progress as incomplete — restart the taskIf user proceeds despite warnings, note in implementation log: "Pre-flight warnings acknowledged by user: [list]."
This is a gate — the user decides whether to proceed, skip, or fix issues first.
For each task:
status: in_progress, updated: <today>implementation/log-<plan>.md, referencing task doc path: plans/<plan>/tasks/NN-name.mdstatus: complete, updated: <today>The in-memory TaskList (if created via TaskCreate) should also be updated for session display, but the task doc frontmatter is the persistent source of truth.
Spawn a subagent for tasks that involve:
Do it directly for tasks that are:
Adjacent tasks that are tightly coupled should be batched into a single subagent call:
For batched tasks: Construct the sub-agent prompt with multiple ## Task sections, one per task doc. Header: "Implement the following N tasks." Each task gets its own Goal/Files/Tests/Constraints block extracted from its task doc. Shared Codebase and Standards sections appear once (identical across tasks in the same plan). Update ALL batched task doc frontmatters to in_progress before execution and complete after. Log all batched tasks in one implementation log entry with all task doc paths.
Batching reduces subagent overhead and gives the subagent better context. Only batch tasks that are sequential and closely related — don't batch independent work.
Before executing tasks, analyze the depends_on DAG to identify parallelizable work:
depends_on fields## Files sections have no overlapping file paths. Tasks with overlapping files must be ordered sequentially even if the DAG allows parallelism — parallel worktree modifications to the same file will always conflict on merge. When multiple tasks overlap, keep the lowest-numbered overlapping task in the parallel group and defer higher-numbered overlapping tasks to subsequent groups (they'll be re-evaluated after the current group completes).Mandatory worktree isolation: For tasks in a parallel group, ALWAYS spawn a subagent with isolation: "worktree" regardless of task complexity. The existing "do it directly for simple edits" guidance does NOT apply to parallel tasks — main-repo modifications would break isolation for concurrent worktree agents.
Skip worktrees when:
depends_on fields allow parallelismDependency-respecting execution order example:
Tasks: 1(none), 2(none), 3(deps:1), 4(deps:1,2), 5(deps:3)
Group 1: [1, 2] — parallel (worktree isolation)
Group 2: [3, 4] — parallel (both unblocked after Group 1 completes)
Group 3: [5] — sequential (depends on 3)
For each task in a parallel group:
isolation: "worktree" — Claude Code creates a temporary git worktree automaticallyItems 1-9 mapping for parallel groups: The standard per-task items are reorganized:
status: in_progress (item 1) — this happens before agents run, so it doesn't violate the modification guard.status: complete) is done per-task after each successful merge.Merge-Back Procedure: After all parallel subagents complete, merge worktree branches one at a time:
git merge <worktreeBranch> — merge into current (Feature) branchgit worktree remove <worktreePath> and git branch -d <worktreeBranch>. Log task as complete.git worktree list and continue the merge sequence.git worktree remove --force <worktreePath> and git branch -D <worktreeBranch>. Mark task as failed in the implementation log. Continue merging other successful tasks. WARN: "Task N failed in worktree — skipping merge. Review output and re-run sequentially." If the subagent result does not include worktree fields (crash/timeout), check git worktree list for orphaned worktrees and clean up any found.Worktree subagent prompt overrides:
**Root**: <absolute path> with **Root**: (worktree — use your current working directory)cd <path> && prefix from test commands — the worktree is already at the codebase root.**Feature Branch**: <value> (informational — do not run git checkout). **Base Branch**: <value> (informational — merge target and Driver MCP context branch).## Files, prefer unique names or paths to minimize merge conflicts with other parallel tasks."Main-repo modification guard: Do NOT modify any files in the main working directory while worktree agents are running. Defer all bookkeeping, log updates, and task doc status changes until after all merges and post-merge tests complete.
For sequential tasks (with dependencies): Continue using the existing subagent spawning without isolation: "worktree". The main working directory is used directly.
After all tasks are complete:
After the summary, present deviations for user review before proceeding with bookkeeping.
Present the deviation summary from the implementation log. For each deviation, the user should understand what changed and why.
"Implementation complete. Here are the deviations from the plan: ..." "Are these acceptable, or would you like to go back and address any of them?"
After approval, execute steps 5.1 through 5.5 automatically without pausing for acknowledgment. These are mechanical bookkeeping steps — plan status, overview update, cascade check, commit, and transition suggestion. Only pause if cascade-check (5.3) surfaces design-impact decisions requiring user input.
If no overview file exists at plans/00-overview.md, skip steps 5.2, 5.3, and 5.5.
Write a status header at the TOP of the plan file (before ## Context):
## Implementation Status: COMPLETE
**Feature Branch:** `<from log>`
**Implementation log:** `implementation/log-<plan>.md`
**Tests:** <test count> passing
**Commits:** <count> on branch
| Commit | Tasks | Description |
|--------|-------|-------------|
| `<hash>` | <task range> | <commit message> |
### Deviations from Plan
<numbered list from log, or "None">
Follow this format exactly. Then mark all - [ ] checkboxes as - [x] under both ## Acceptance Criteria and ## Test Strategy.
If plans/00-overview.md exists:
COMPLETE, Tests → count, Key Artifact → one-line summary from logVerify upstream commits: Before spawning cascade-check, verify upstream plan commits exist in the local git history. Read the implementation log for commit hashes. For each commit listed, run git -C <codebase-root> rev-parse --verify <hash>^{commit}. If any commit is not found: WARN. "Upstream commit <hash> from <task> not found in local git history. This may indicate implementation happened in a different clone. Proceed with cascade-check anyway?"
Spawn the cascade-check agent with:
The agent reads all files, classifies each deviation as informational or design-impact, writes informational cascades to the overview's "Gaps to Address" section, and returns results.
If the agent reports design decisions needed, present each to the user with options. Otherwise report: "Cascade check complete. N gaps added to overview." (or "No cascading needed.")
git add plans/<plan>.md plans/00-overview.md
Also stage task doc status changes:
git add plans/<plan>/tasks/*.md
Stage implementation log and feature log:
git add implementation/log-<plan>.md FEATURE_LOG.md 2>/dev/null
git commit -m "chore: Bookkeeping complete — plan <name>"
Use the overview's progress table and dependency graph to identify the next unblocked plan:
/drvr:assess to curate the test suite before handoff."This is informational — the user decides what to do.
When spawning subagents, construct prompts from task document content:
Implement the following task.
## Codebase
**Root**: <from task doc ## Codebase section>
**Base Branch**: <value> (merge target / Driver MCP context branch — for reference only, implementation targets Feature Branch)
**Feature Branch**: <from task doc ## Codebase section>
All file paths are relative to the codebase root.
Change directory to the codebase root before starting work.
Do NOT navigate to or modify files outside this directory.
## Architectural Commitment: Functional Core, Imperative Shell
This codebase commits to a functional core / imperative shell architecture. Pure-core code takes values in and returns values out — no I/O, no time, no randomness, no mutable shared state. Shell code performs I/O and calls into the core. Some plans are declared shell-only (thin CRUD, glue, integration wrapper); in that case the shell-only rules apply.
**This task is classified as**: <core | shell | both> (from task doc ## Core/Shell section)
**Rules for this task:**
- If your task is **core**: do not introduce I/O, time, randomness, or mutable shared state. If the task requires any of these, stop and report — the plan's boundary is wrong, not your job to paper over.
- If your task is **shell**: keep substantive logic out of the shell. The shell should receive I/O input, call into pure-core functions, and emit I/O output. If you find yourself writing branching, calculation, or state machinery in the shell, extract it into the core first. **Exception**: if the plan is declared shell-only, routing/dispatch branching IS the feature — that's expected, not a violation.
- **Do not mock to test pure-core logic** — that's a boundary failure. Stop and report it.
- **Mocks of internal modules in shell integration tests are acceptable** only when the real collaborator is external (third-party with no sandbox), expensive (real money per invocation), non-deterministic in ways you can't control (real wall-clock for timing-sensitive tests where you can't inject a fake), or absent in the test environment. Each such mock must be named with its justification — a comment on the mock or a note in the test docstring. Mocking just because "the real thing is slow" or "I don't want to set up the DB" is not acceptable.
## Task: <name from task doc>
**Goal**: <from task doc>
**Files**: <from task doc>
**Tests**: <from task doc>
**Constraints**: <from task doc>
## Code Quality Standards
<from task doc — key rules + source path>
## Context
- Plan: <from task doc ## Context section>
- Prerequisites: <from task doc ## Context section>
## Instructions
1. Change directory to the codebase root above
2. Read the plan file for full architectural context, including the Core/Shell Decomposition in Architecture Fit
3. Read the code quality standards document at the source path above
4. Implement exactly what's specified in the Goal — no extras
5. Respect the core/shell rules above. If your code would violate them, stop and report instead of working around.
6. Verify your code follows the listed standards rules
7. Run tests after implementation. Tests must not mock to exercise pure-core logic. Mocks of internal modules in shell integration tests are acceptable only when justified (external / expensive / non-deterministic / absent) — and each must carry a comment naming the justification.
8. Report: what you built, files touched, any deviations from the spec (especially core/shell boundary deviations), and any standards compliance concerns
Include the full task spec — don't summarize. Copy constraints verbatim.
Data flow: Implementation-guidance reads task docs to construct the prompt. Task docs already have embedded context (codebase root, standards, file paths), so the prompt is a direct extraction — not ad-hoc assembly from multiple sources.
Code Quality Standards section: Include this section only if the task doc has a ## Code Quality Standards section. If the task doc has no Code Quality Standards section (because no standards artifact existed during materialization), omit it from the prompt AND use this shorter Instructions list:
The longer Instructions list (with items about reading standards and verifying compliance) is only used when the Code Quality Standards section is present. The core/shell instructions are present in both variants.
Standards detection (Step 1): In Step 1 (Read Task Documents), after reading the plan, search for a codebase standards artifact in the feature's research directory (search for ## Standards Source). If found, extract the absolute path from the Standards Source table's Path column. This path is used to verify standards availability during pre-flight (Phase 5). Task docs already embed key rules and the source path — the subagent reads the authoritative, current version at that path.
Batched task prompts: For batched tasks, use this structure:
Implement the following N tasks.
## Codebase
<shared — from any task doc>
## Task 1: <name>
**Goal**: ...
**Files**: ...
**Tests**: ...
**Constraints**: ...
## Task 2: <name>
**Goal**: ...
**Files**: ...
**Tests**: ...
**Constraints**: ...
## Code Quality Standards
<shared — from any task doc>
## Context
<shared — from any task doc>
## Instructions
<same as single-task, applies to all tasks>
Write to implementation/log-<plan>.md (e.g., implementation/log-01a.md).
# Implementation Log: <Plan Name>
**Plan:** `plans/<plan>.md`
**Feature Branch:** `<branch-name>`
**Started:** <date>
---
## Task 1: <name>
**Task doc:** `plans/<plan>/tasks/NN-name.md`
**Status:** Complete
**Execution:** parallel group N, worktree isolation | sequential (main working directory)
**Commit:** `<hash>` — <message>
**Planned:**
- <what the plan said>
**Actual:**
- <what was done>
**Deviations:**
- <differences, or "None">
---
## Summary
**Tasks completed:** N/N
**Total commits:** N
| Commit | Tasks | Description | Execution |
|--------|-------|-------------|-----------|
| `<hash>` | <range> | <message> | parallel group N, worktree | sequential |
**Total deviations:** N
**Follow-up work identified:** ...
**Key learnings:** ...
Implementation often spans multiple sessions. Two artifacts persist across sessions:
implementation/log-<plan>.md) — what was done, deviations, commit hashesplans/<plan>/tasks/*.md) — frontmatter status field tracks completionTaskList (from TaskCreate) does NOT persist across sessions — it's session-only display state.
status field in each task doc frontmatter. Completed tasks have status: complete. No need to reconstruct completion state.status is not completeTask docs are the persistent source of truth for task state. The implementation log is the persistent source of truth for what actually happened (deviations, commits, learnings).
Don't:
plans/<plan>/tasks/Do:
in_progress, complete) during executioncore, did the implementation avoid introducing I/O, time, or randomness?shell, did substantive logic stay in the core?plans/<plan>/tasks/, not extracting from the plan?in_progress? Are complete tasks marked complete?implementation/log-<plan>.md current?FEATURE_LOG.md at implementation start and completion?Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub driver-ai/driver-sdlc-plugin --plugin drvr