Implement phase of RPI methodology. Executes beads-driven task graph using isolated agents for test-first discipline. Use when executing an implementation plan from the draft skill.
62
73%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./tiles/crafter/skills/craft/SKILL.mdRPI Phase 3 of 3: Research → Plan → Implement
Use this skill to execute an implementation plan using beads-driven orchestration with isolated agents for strict test-first discipline.
The Implement phase executes a beads task graph created by /draft. Each beads issue is a self-contained agent task with everything needed for dispatch. The dependency graph enforces ordering. beads:ready drives execution.
Three agent types per TDD phase:
Input: Beads epic with per-agent-step issues (created by /draft)
Output: Working feature with passing tests
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] {issue title} — agent type: {agent-test|agent-impl|agent-validate}, mode: {sync|parallel}
[GATE PASS] {issue title} — {RED|GREEN|VALIDATE} gate passed
[GATE FAIL] {issue title} — {RED|GREEN|VALIDATE} gate failed: {reason}
[CLOSED] {issue title}
[REMEDIATION] {issue title} — attempt {N}: {description}
[BLOCKED] {issue title} — escalating to user: {reason}Before starting the orchestration loop, check whether beads is available by attempting beads:search.
beads:show. Process issues in dependency order as described in the inline context. Use craft-execution-log.md as the sole record of progress. Skip all beads:* commands but follow all other workflow steps identically (agent dispatch, gates, remediation).Find the target epic via user input or beads:search. Verify the epic has issues with dependencies wired. If beads is unavailable, use the inline epic context provided in the task prompt.
If resuming a previous session, this step is the same — beads:ready will return only unblocked, uncompleted tasks.
This is the core execution loop. It runs until all issues in the epic are closed or an unrecoverable error occurs.
Loop:
a. Run beads:ready for the epic → list of unblocked tasks
b. If no ready tasks and open tasks remain → something is blocked, escalate to user
c. If no ready tasks and no open tasks remain → all done, proceed to final verification
d. For each ready task:
- Read issue description (contains full Agent Context)
- Determine agent type from label (agent-test, agent-impl, agent-validate, no-test)
- Dispatch Task with agent prompt built from issue description
- 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 → close the issue via beads:close → unblocks dependents
- 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 issues (see Remediation)
g. Loop back to (a)See workflow-detail.md for agent prompt templates and dispatch details.
For each ready issue, build the agent prompt from the issue description:
beads:showTask tool (synchronous, subagent_type: general-purpose)When beads:ready returns multiple tasks, dispatch them all in a single message with multiple Task tool calls. This happens naturally when:
TDD phases can't parallelize internally (Implement needs Write Test's output on disk), but independent phases parallelize across each other automatically via the dependency graph.
When Agent 3 (Validate) finds failures:
beads:create with label agent-remediate:
P{N}: Remediate — {Phase Name} (attempt {M})beads:create with label agent-validate:
P{N}: Re-Validate — {Phase Name} (attempt {M})blocked status and STOP — ask the userAfter each issue closes, report status. Use beads:list to show overall progress:
**Progress Update:**
- [closed] P1: Apply Schema
- [closed] P2: Write Tests — Core Logic
- [closed] P2: Implement — Core Logic
- [open] P2: Validate — Core Logic (in progress)
- [open] P3: Repository Layer (blocked)
- [open] P4: Write Tests — Apply Discount (blocked)After all issues in the epic are closed:
CRITICAL: The three-agent pattern exists to maintain honest separation between tests and implementation.
If Agent 1's tests pass immediately (before implementation):
If Agent 2 cannot make tests pass:
Recovery is trivial: run beads:ready for the epic.
No special recovery logic needed. The beads state is the execution state.
Once all issues closed and verified:
/commit skillWhy isolated agents? Each agent loads only what it needs:
No agent carries the full research or planning context. Each beads issue description provides exactly the information the dispatched agent needs.
2a98cc1
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.