Help us improve
Share bugs, ideas, or general feedback.
From crafter
Implement phase of RPI methodology. Executes a task-graph-driven implementation using isolated agents with strict RED/GREEN/VALIDATE gate enforcement. Use when executing an implementation plan from the draft skill.
npx claudepluginhub agentpatterns/craft --plugin crafterHow this skill is triggered — by the user, by Claude, or both
Slash command
/crafter:craftThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
**RPI Phase 3 of 3:** Research → Plan → **Implement**
Orchestrates code implementation workflows: swift/quick changes, standard implementations, build-simplify-review cycles. Routes by user intent or detects state from project reports.
Executes multi-phase implementation plans by dispatching tasks to sub-agents, tracking progress per-task in plan.json, and coordinating sequential phases.
Executes implementation plans from plan.md files via Superpower Loop phases: task creation, batch execution with verification, git commits. Use after plan ready or on 'execute the plan'.
Share bugs, ideas, or general feedback.
RPI Phase 3 of 3: Research → Plan → Implement
Use this skill to execute an implementation plan using task-graph-driven orchestration with isolated agents for strict test-first discipline.
Receives: Task graph (epic + per-agent-step child tasks) created by /draft — or creates it from the plan file if the task graph doesn't exist yet
Produces: Working feature with passing tests + craft-execution-log.md execution audit trail + session artifact at .crafter/sessions/
Does NOT read: The plan file during execution — task contexts are self-contained
The Implement phase executes a task graph created by /draft. Each task's context contains everything needed for agent dispatch. The naming convention enforces ordering. Readiness is computed from the task graph state.
Three registered agents per TDD phase (see plugins/crafter/agents/):
Plus agent-remediate for fixing failures and agent-no-test for non-TDD phases.
Use this skill when:
/draftDon't use for:
REQUIRED: Create craft-execution-log.md in the project root at the start of every craft session. Append entries throughout orchestration. This provides an observable audit trail of agent dispatch and gate results.
Entry format (one per line, append-only):
[DISPATCHED] {task name} — agent type: {agent-test|agent-impl|agent-validate}, mode: {sync|parallel}
[GATE PASS] {task name} — {RED|GREEN|VALIDATE} gate passed
[GATE FAIL] {task name} — {RED|GREEN|VALIDATE} gate failed: {reason}
[CLOSED] {task name}
[REMEDIATION] {task name} — attempt {N}: {description}
[BLOCKED] {task name} — escalating to user: {reason}
Before starting the orchestration loop, detect which tracker is available:
yx list --format json — if it succeeds → YAKS models .beads/config.yaml — if it exists → BEADS modeTaskCreate/TaskList/TaskUpdate)Each mode follows the same workflow structure. The tracker is an infrastructure detail — agent isolation, TDD gates, and execution log are identical across all three modes.
YAKS: Find the target epic via user input or yx list --format json. Verify the epic has child yaks with agent-type fields set. If no epic exists yet, read the plan file and create the yaks task graph now — see the task-graph-decomposition procedure.
BEADS: Use Skill: beads:list to find the target epic bead. Verify child beads exist with agent-type fields set. If no epic exists yet, create beads from the plan file using Skill: beads:create.
NATIVE: Use TaskList to find existing tasks for this session. If no tasks exist yet, create them with TaskCreate. Note: native tasks are session-scoped — they do not persist across sessions (see Session Recovery).
If resuming a previous session, this step is the same — the readiness computation skips done tasks automatically.
This is the core execution loop. It runs until all tasks in the epic are done or an unrecoverable error occurs.
Loop:
a. Compute ready tasks (see Readiness Computation below)
b. If no ready tasks and non-done tasks remain → escalate to user
c. If no ready tasks and all tasks are done → proceed to final verification
d. For each ready task:
- Read task context (see tracker-specific command below)
- Determine agent type from field: agent-type
- Dispatch Task with agent prompt built from task context
- If multiple ready tasks: dispatch in parallel (single message, multiple Task calls)
e. Wait for agent(s) to complete
f. For each completed agent:
- If gate PASSED → mark done (tracker-specific command below)
- If RED gate FAILED (tests pass immediately) → STOP, report to user
- If GREEN gate FAILED → proceed to validation anyway
- If VALIDATE found failures → create remediation tasks (see Remediation)
g. Loop back to (a)
Tracker commands for step (d) read context and step (f) mark done:
| Action | YAKS | BEADS | NATIVE |
|---|---|---|---|
| Read context | yx context "{name}" | Skill: beads:show "{name}" | TaskGet {id} |
| Mark done | yx done "{name}" | Skill: beads:close "{name}" | TaskUpdate {id} completed |
| List/progress | yx list | Skill: beads:list | TaskList |
See workflow-detail.md for agent prompt templates and dispatch details.
YAKS and NATIVE: Parse the task list for the epic and apply these rules:
P2 from P2-Core-Logic)donedone is readyBEADS: Use Skill: beads:ready — it returns the set of ready tasks directly, replacing the in-skill computation above.
This enables parallel dispatch across independent phase groups while enforcing sequential ordering within TDD triplets.
For each ready task, build the agent prompt from its context:
Task tool using the registered agent type matching the task's agent-type field (e.g., subagent_type: crafter:agent-test)When readiness computation returns multiple tasks, dispatch them all in a single message with multiple Task tool calls. TDD phases can't parallelize internally (Implement needs Write Test's output on disk), but independent phases parallelize across each other automatically via the naming convention.
When Agent 3 (Validate) finds failures:
YAKS: Create remediation and re-validation yaks via yx add with --field "agent-type=agent-remediate" / --field "agent-type=agent-validate". See workflow-detail.md for the full procedure and context template.
BEADS: Create remediation and re-validation beads via Skill: beads:create under the same phase group parent.
NATIVE: Create remediation and re-validation tasks via TaskCreate under the same phase group.
In all modes: name remediation 04-remediate-attempt-{M} and re-validation 05-revalidate-attempt-{M}. Mark the original validate task done (it completed its job — reporting failures). If attempt count reaches 2 and re-validation still fails, STOP — ask the user.
After each task completes, report status using the tracker list command:
**Progress Update:**
- [done] P1-Schema-Setup
- [done] P2-Core-Logic / 01-write-tests
- [done] P2-Core-Logic / 02-implement
- [wip] P2-Core-Logic / 03-validate (dispatched)
- [todo] P3-Repository-Layer (waiting for P2)
After all tasks in the epic are done:
Check plannotator availability: Bash: plannotator --version
If available: Run plannotator review via Bash to open the full git diff in the browser code review UI. Wait for the result:
plannotator review. Repeat until LGTM.If unavailable: Skip browser review; proceed to next-steps prompt.
After final verification passes, write a single session artifact to .crafter/sessions/YYYY-MM-DD-{topic}.md. This is the ONLY persistent artifact from the entire research → plan → implement flow.
Required sections:
craft-execution-log.md)Use kebab-case for the topic slug (e.g., 2026-03-07-add-discount-codes.md).
Use AskUserQuestion to present:
Implementation complete. All {N} tasks done, tests passing.
Session artifact: .crafter/sessions/YYYY-MM-DD-{topic}.md
What would you like to do?
1. Code review — review the diff for quality issues
2. Simplify — refine recently modified code for clarity and maintainability
3. Reflect — extract learnings to improve skills, hooks, CLAUDE.md
4. Commit and push — run /commit
CRITICAL: The three-agent pattern exists to maintain honest separation between tests and implementation.
If Agent 1's tests pass immediately (before implementation):
The VALIDATE gate is the project's full test and lint suite. Agent 3 determines the gate command by reading the project's CLAUDE.md (or package.json / equivalent build file) for the configured test, type-check, and lint commands. All commands must exit 0.
Example for a TypeScript/Bun project: tsc --noEmit && vitest run && biome check .
Example for a Python project: mypy . && pytest && ruff check .
Agent 3 always derives the actual commands from the project rather than using hardcoded defaults.
If VALIDATE fails only on the lint command (tests pass, type-check clean), apply the lint fast path instead of creating remediation tasks:
biome check --write --unsafe, ruff check --fix .)This avoids heavyweight remediation for trivially auto-fixable lint issues.
If Agent 2 cannot make tests pass:
YAKS: Run yx list --format json for the epic and recompute readiness. Done tasks = completed work; ready tasks = next to dispatch; waiting tasks = predecessors not yet done. No special recovery logic needed.
BEADS: Same as YAKS — use Skill: beads:list and Skill: beads:ready. Bead state persists cross-session.
NATIVE: Native tasks are session-scoped only — they do not persist across Claude Code sessions. On recovery, recreate the task list from the session artifact at .crafter/sessions/ or the plan file, then resume the orchestration loop.
Once all tasks done and verified:
.crafter/sessions/YYYY-MM-DD-{topic}.md is the persistent record/commit skillWhy isolated agents? Each agent loads only what it needs:
No agent carries the full research or planning context. Each task context provides exactly the information the dispatched agent needs.