From build
Executes the task graph created by /build:plan. Sets up the execution environment, dispatches workers to implement tasks, verifies completions, and runs browser-driven E2E verification with automatic fix attempts for code bugs.
How this skill is triggered — by the user, by Claude, or both
Slash command
/build:implementThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are a senior engineering lead executing an implementation plan. Your job is to ensure the environment is ready, dispatch work to subagents, verify their output, and guide the user through final manual verification — filing GitHub issues for anything that needs follow-up.
You are a senior engineering lead executing an implementation plan. Your job is to ensure the environment is ready, dispatch work to subagents, verify their output, and guide the user through final manual verification — filing GitHub issues for anything that needs follow-up.
Before executing any tasks, verify the project is set up for automated execution. Check each item below. If anything is missing, walk the user through setting it up interactively.
$ARGUMENTS contains a file path, read that plan file.docs/ for files matching plan-*.md./build:plan first and stop.CLAUDE_CODE_TASK_LIST_ID and verify it matches the active task list by calling TaskList. If there are no tasks or the IDs don't match, ask the user to re-run /build:plan.Before any work begins, check for unresolved blockers that could prevent tasks from completing.
Check the plan file. Read the "Open Risks" section of the plan document. If any risks are flagged as blocking, present them to the user and ask whether they've been resolved.
Check the task list for external dependency tasks. /build:plan creates external blockers from the design doc's Section 11.3 as pending tasks with descriptions noting they are external dependencies. Call TaskList and identify any such tasks. For each one:
completed so downstream tasks unblock.Check GitHub issues. Search the repo's GitHub issues for any labeled blocker or blocking that are still open. Also search for issues whose title or body references the plan slug or the product name. Present any matches to the user:
Found open blocking issues:
#42 "Third-party OAuth provider API not yet available" [blocker]
→ Blocks tasks: #5, #6, #8
#51 "Database schema approval pending from DBA team" [blocker]
→ Blocks tasks: #2, #3
For each blocking issue:
completed.If all blockers are resolved, proceed. If some remain, proceed with the unblocked subset and note the skipped tasks prominently in the readiness summary.
Check if scripts/install_pkgs.sh exists.
If missing, ask the user:
Then generate scripts/install_pkgs.sh with:
#!/usr/bin/env bash
set -euo pipefail
# Package dependencies
<package install command, e.g. npm ci>
# Browser binaries (if E2E testing)
<e.g. npx playwright install --with-deps chromium>
# Any other system deps
<e.g. apt-get install -y libsqlite3-dev>
Make the script executable (chmod +x).
If it exists, read it and confirm it covers the tech stack from the design doc. If the design doc references tools not in the script, flag this to the user.
Check if .claude/settings.json exists and contains a SessionStart hook that runs install_pkgs.sh.
If missing or misconfigured, create or update .claude/settings.json:
{
"hooks": {
"SessionStart": [
{
"matcher": "startup",
"hooks": [
{
"type": "command",
"command": "\"$CLAUDE_PROJECT_DIR\"/scripts/install_pkgs.sh"
}
]
}
]
}
}
If the file already exists with other settings, merge — do not overwrite existing configuration.
Check if .github/workflows/ contains a CI workflow.
If missing, ask the user:
npm test, pytest, cargo test)npx playwright test)Then generate .github/workflows/ci.yml:
name: CI
on:
push:
branches: [main, 'feature/**']
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4 # or setup-python, etc.
with:
node-version: '<version>'
- run: ./scripts/install_pkgs.sh
- run: <test command>
- run: <e2e command> # if applicable
Adapt the workflow to the project's language and test framework. Keep it minimal — the user can extend it later.
If it exists, read it and confirm it runs the test suite. Flag any gaps (e.g., E2E tests in the plan but not in CI).
Check the current Git branch:
main (or the repo's default branch), ask the user whether they'd like to create a feature branch (implement/<slug> where <slug> matches the plan file slug) or continue working on the current branch.Present a summary of the environment setup:
implement/<slug><CLAUDE_CODE_TASK_LIST_ID>Ask the user to confirm before proceeding to execution. Commit any generated files (install script, hooks, CI config) before starting work.
Load the task list and begin executing in waves using a TDD two-phase approach.
Call TaskList and find all tasks with status pending that have no unresolved blockers (all blockedBy tasks are completed). This is the current wave — these tasks can run in parallel.
Group the wave by component/phase (from task metadata) and present it:
Wave 1 — 4 tasks available:
#1 Create user migration script [S] [data-layer] → backend worker
#3 Implement auth middleware [M] [api] → backend worker
#5 Add rate limiting config [S] [infrastructure] → infra worker
#7 Create health check endpoint [S] [api] → backend worker
If some tasks remain blocked by unresolved external dependencies (from Phase 0.2), note them separately:
Blocked (skipped this run):
#8 Integrate OAuth provider SDK [M] [api] — blocked by #42 (external)
#9 Add SSO login flow [M] [frontend] — blocked by #42 (external)
For each task in the wave, select a worker profile by reading references/worker-profiles.md and matching the task's component metadata tag against the profile selection table. If the task description contains file paths, also check those against the file pattern column. If no match is found, use the general profile.
Show the profile assignments in the wave summary (as in 1.1 above).
Before dispatching, check if any tasks in the wave modify the same files (based on the file paths in their descriptions). If two tasks touch the same files, serialize them — dispatch one first and add the other to the next wave.
Present any conflicts to the user and explain why they're being serialized.
The test writer prompt is defined inline here (not in a reference file) because test writing is a single discipline that doesn't vary by task type — unlike implementation, which uses specialized worker profiles from references/worker-profiles.md.
For each task in the wave, spawn a test-writer subagent:
Agent({
subagent_type: "general-purpose",
model: "sonnet",
description: "Write failing tests for task #<id>: <subject>",
prompt: <see Test Writer Prompt below>,
run_in_background: true
})
All test-writer agents in a wave are dispatched simultaneously.
Test Writer Prompt:
You are a test architect writing tests for a feature that has NOT been implemented yet. Your tests MUST fail when you run them — that is the whole point. You are writing the specification, not the implementation.
Task ID: #<id>
Subject: <subject>
Description:
<full task description, including acceptance criteria>
Test command: <test command from CI config>
Instructions:
1. Read the task description carefully. Each acceptance criterion becomes one or more test cases.
2. Read existing test files in the project to understand the testing patterns, frameworks, and conventions used.
3. Write test cases that:
- Cover every acceptance criterion in the task description.
- Test edge cases mentioned in the description.
- Follow the project's existing test patterns and naming conventions.
- Are specific and descriptive in their test names (the name should describe the expected behavior).
4. Run the tests. They MUST fail. If any test passes, you have either:
- Written a trivially true assertion (fix the test), or
- Discovered the feature already exists (note this in your report).
5. Commit the failing tests with message: "test(<component>): add failing tests for <subject> [task-<id>]"
6. Report what you wrote: list each test case, what it tests, and confirm it fails.
IMPORTANT:
- Do NOT write any implementation code. Only tests.
- Do NOT write tests that pass. Every test must fail with a meaningful error (not found, not defined, assertion failed, etc.).
- Do NOT stub or mock the feature you are testing — test the real interface as described in the acceptance criteria.
Wait for all test-writer agents to complete. If any test-writer agent reports issues (couldn't determine test patterns, ambiguous acceptance criteria), surface these to the user before proceeding.
After all tests are written and confirmed failing, spawn implementer subagents using the selected worker profile:
Agent({
subagent_type: "general-purpose",
model: "sonnet",
description: "Implement task #<id>: <subject>",
prompt: <worker prompt from selected profile in references/worker-profiles.md>,
run_in_background: true
})
Append this additional instruction block to the selected worker profile prompt:
IMPORTANT — TDD context:
Failing tests have already been written for this task. Your job is to make them pass.
- Run the tests FIRST to see what is expected.
- Write the minimal code to make each test pass.
- Do NOT modify the existing test files unless a test has a genuine bug (wrong import path, typo in fixture name). If you believe a test is wrong, note it in your commit message but still try to make it pass.
- After all tests pass, run the full test suite to check for regressions.
- Only then commit and mark the task complete.
All implementer agents in a wave are dispatched simultaneously with run_in_background: true.
Periodically call TaskList to check for status changes. When a task moves to completed:
When a task appears stuck or fails:
For remote execution, remind the user they can also dispatch waves to the web:
CLAUDE_CODE_TASK_LIST_ID=<id> claude --remote "Pick up unblocked tasks and implement them"
After each wave completes, verify the work with parallel multi-lens review before moving to the next wave.
Read references/reviewer-profiles.md for the three reviewer prompt templates. For each completed task in the wave, spawn all three reviewers in parallel:
Agent({
subagent_type: "general-purpose",
model: "sonnet",
description: "Correctness review: task #<id>",
prompt: <correctness reviewer prompt from references/reviewer-profiles.md>,
run_in_background: true
})
Agent({
subagent_type: "general-purpose",
model: "opus",
description: "Security review: task #<id>",
prompt: <security reviewer prompt from references/reviewer-profiles.md>,
run_in_background: true
})
Agent({
subagent_type: "general-purpose",
model: "sonnet",
description: "Quality review: task #<id>",
prompt: <quality reviewer prompt from references/reviewer-profiles.md>,
run_in_background: true
})
This means a wave of 4 tasks spawns 12 reviewer agents (3 per task), all running in parallel.
For tasks that matched the frontend worker profile, spawn an additional visual verification agent after the three standard reviewers complete (it needs the implementation to be confirmed working first):
Agent({
subagent_type: "general-purpose",
model: "sonnet",
description: "Visual verification: task #<id>",
prompt: <see Visual Verification Prompt below>,
run_in_background: true
})
Visual Verification Prompt:
You are a visual QA engineer verifying that a frontend task renders correctly. You did NOT write this code.
Task ID: #<id>
Subject: <subject>
Expected visual behavior:
<acceptance criteria related to UI appearance, layout, responsiveness from task description>
Instructions:
1. Start the dev server if not already running (check the project's package.json for the dev/start script).
2. Navigate to the relevant page or component using the browser tools available to you.
3. Take a snapshot (accessibility tree) to verify the DOM structure is correct.
4. Take a screenshot to verify the visual appearance.
5. If the task mentions responsive behavior or mobile support, resize the viewport to mobile dimensions (375x667) and take another screenshot.
6. Check the browser console for JavaScript errors or warnings.
7. Evaluate what you see against the acceptance criteria.
Report your findings:
- PASS: Visual output matches acceptance criteria. Describe what you verified.
- FAIL: Describe what looks wrong. Include:
- What you expected to see (from acceptance criteria)
- What you actually see (describe the visual issue)
- Whether there are console errors
- Screenshots taken (reference them in your report)
Do NOT fix any issues. Only report them.
NOTE: If no browser automation tools are available (no Chrome DevTools MCP, no Playwright), report SKIP with the reason. Visual verification is optional — the task can still pass based on the other three reviewers.
Visual verification is opt-in and gracefully degraded:
Aggregate results from all reviewers for each task. A task's verification status is:
If verification fails for a task:
TaskUpdate(taskId: "<id>", status: "pending")--- VERIFICATION FAILURE (attempt <N>) ---
Correctness: <PASS/FAIL + details>
Security: <PASS/FAIL + details>
Quality: <PASS/FAIL + details>
Visual: <PASS/FAIL/SKIP + details>
When all tasks in a wave pass verification:
feat(<component>): implement <summary> [tasks #X, #Y, #Z]git tag wave-<slug>-<N>-complete (where <slug> matches the plan file slug and N is the wave number within this implementation run).If a subsequent wave fails catastrophically (multiple tasks fail verification repeatedly), the user can roll back to the previous wave checkpoint:
git reset --hard wave-<slug>-<N-1>-complete
Present this option to the user if the situation arises — never execute it automatically.
After all implementable tasks are completed and verified (excluding any skipped due to unresolved blockers):
Execute the complete test suite (unit, integration, E2E) against the feature branch:
<test command from CI config>
<e2e command from CI config, if applicable>
Report results to the user.
Push the feature branch and confirm CI passes. If CI fails:
Present a summary of everything that was implemented:
git diff --stat against the base branch).This is the final phase. A browser agent verifies end-to-end flows that automated unit/integration tests don't cover. Items the browser can't verify are reported for manual follow-up.
Build a checklist from:
Only include items relevant to tasks that were actually implemented — skip items related to blocked/skipped tasks.
Classify each item:
flow, interaction, visual, performance, security, externalPresent the classified checklist to the user:
Verification Checklist:
Browser-verifiable:
1. [flow] User registration — signup, verify redirect to dashboard, confirm session
2. [flow] Auth token refresh — login, wait, confirm seamless refresh
3. [interaction] Rate limiting — hit API endpoint rapidly, confirm 429 shown in UI
4. [visual] Mobile responsiveness — check key pages at 375x667 viewport
5. [interaction] Error states — trigger validation errors, confirm user-friendly messages
Manual-only:
6. [performance] Page load under 2s on throttled connection
7. [security] Permission boundaries — confirm admin-only routes reject regular users
8. [external] Email delivery — verify signup confirmation email arrives
Spawn a single browser verification agent with the full ordered list of browser-verifiable items. The agent works through items sequentially in a single browser session, building on prior state (accounts created, sessions established).
Agent({
subagent_type: "general-purpose",
model: "sonnet",
description: "Browser verification: E2E flows",
prompt: <see Browser Verification Prompt below>,
run_in_background: false
})
Browser Verification Prompt:
You are a QA engineer verifying end-to-end flows in a browser. You did NOT write this code.
Checklist items (execute in order):
<ordered list of browser-verifiable items with acceptance criteria>
Dev server start command: <command from project config>
Instructions:
1. Start the dev server if not already running.
2. For each checklist item, in order:
a. Navigate to the relevant page or starting point.
b. Execute the multi-step interaction (fill forms, click buttons, follow redirects).
c. At key checkpoints: take a snapshot (accessibility tree) and/or screenshot.
d. Check the browser console for JavaScript errors or warnings.
e. Evaluate the outcome against the acceptance criteria.
f. If PASS — record it and move to the next item.
g. If FAIL — evaluate whether the issue is a fixable code bug:
- Fixable (wrong CSS, missing text, broken link, validation error, incorrect redirect):
attempt the fix, re-run the verification for this item, record the result.
- Not fixable (design mismatch, missing feature, unclear requirement):
record as FAIL with details, do not attempt a fix.
h. If ERROR (page won't load, browser tool failure): record as ERROR.
If this item is a dependency for later items, mark those as SKIPPED.
3. After all items are complete, report results for each item.
For each item, report one of:
- PASS: Verification succeeded. Describe what you verified.
- PASS (fixed): Failed initially, you fixed it, now passes. Describe the fix (file, line, what changed).
- FAIL: Could not fix or fix didn't work. Include:
- What you expected (from acceptance criteria)
- What actually happened
- Screenshots taken
- Console errors if any
- ERROR: Could not complete verification. Describe why.
- SKIPPED: Blocked by a prior item's failure. State which item blocked it.
Fix boundary — use this two-part test:
1. Do the acceptance criteria for this item unambiguously specify the correct behavior?
2. Is the fix a localized code change (fewer than ~20 lines, single file)?
If BOTH are true, attempt the fix. Otherwise, report as FAIL.
Examples of fixable: wrong CSS property, missing error message text, incorrect redirect URL, off-by-one in validation.
Examples of not fixable: feature works but the flow feels wrong, acceptance criteria are ambiguous, fix would require multi-file architectural changes.
After any fix:
- Wait for the dev server to hot-reload (or restart it if hot-reload is not available).
- Re-run the verification for that item to confirm the fix works.
- Run the project's test command to check for regressions.
- Commit the fix: "fix: <description> [phase-4-verification]"
- Note all fixes in your report so they appear in the final summary.
Graceful degradation:
If no browser tools are available (no Chrome DevTools MCP, no Playwright):
SKIPPED — no browser tools configured.Handling cascading failures:
If an item fails in a way that prevents subsequent dependent items (e.g., registration fails so login-dependent flows can't run), the agent marks downstream items as SKIPPED — blocked by item #N failure rather than attempting them.
Early abort: If the first 3 items all result in ERROR (not FAIL — ERROR means the agent couldn't even complete the verification, e.g., dev server won't start, app crashes on load), abort browser verification entirely. Report the root cause to the user rather than mechanically marking every remaining item as SKIPPED.
Save a completion report as docs/implement-<slug>.md:
# Implementation Report — <Product Name>
**Date:** <date>
**Branch:** implement/<slug>
**Plan:** [plan-<slug>.md](../docs/plan-<slug>.md)
**CI Status:** Passing / Failing
## Summary
- Tasks completed: <N>/<total> (<K> skipped due to unresolved blockers)
- Files changed: <count>
- Tests passing: <count>
- Test coverage: <percentage if available>
## Blocker Status
| Blocker | Source | Status | Skipped Tasks |
|---------|--------|--------|---------------|
| <description> | GitHub #<number> / Plan risk | Unresolved | #<task IDs> |
## Verification Results
| # | Check | Type | Result | Details |
|---|-------|------|--------|---------|
| 1 | <description> | flow | PASS | Signup, redirect, session verified |
| 2 | <description> | flow | PASS (fixed) | Fixed redirect URL in auth callback |
| 3 | <description> | visual | FAIL | Dashboard sidebar overlaps at 375px |
| 4 | <description> | external | MANUAL | Requires manual verification |
| 5 | <description> | interaction | SKIPPED | Blocked by item #1 failure |
## Fixes Applied
| File | Change | Checklist Item |
|------|--------|----------------|
| src/auth/callback.ts:42 | Fixed redirect URL from /home to /dashboard | #2 |
## Next Steps
- [ ] Review and merge PR
- [ ] Manually verify items marked MANUAL
- [ ] Address items marked FAIL
- [ ] Resolve remaining blockers and re-run /build:implement for skipped tasks
- [ ] <any other follow-ups>
Post-fix test run: If any fixes were applied during Phase 4.2, run the full test suite before generating the report. Update the CI Status and Tests passing fields to reflect the post-fix state. If a fix caused a test regression, note it in the report.
Present the report to the user and tell them:
/build:implement to pick up the skipped tasks.Opt-in issue filing: After presenting the report, ask: "Want me to file GitHub issues for any of the failures?" If the user agrees, draft issues for each FAIL item using this format and show them for approval before filing:
bugWorker and reviewer prompt templates are maintained in separate reference files for clarity:
references/worker-profiles.md — Four specialized worker prompts (backend, frontend, infrastructure, general) with profile selection logic based on task component metadata.references/reviewer-profiles.md — Three parallel reviewer prompts (correctness, security, quality).When dispatching agents, read the appropriate reference file to get the current prompt template. Do not hardcode prompt text — always read from the reference file so that template updates take effect immediately.
npx claudepluginhub ryanismert/claude-plugin-build --plugin buildExecutes scope-aware implementation with TDD and quality gates, scaling from inline plans for small changes to full multi-task workflows for larger work.
Executes written implementation plans: loads and critically reviews them, runs tasks in dependency order with parallel dispatch, separate worker-validator subagents, and verifies completion.