Plan phase of RPI methodology. Consumes research artifact or topic and produces compact implementation plan with test specs and Agent Context blocks. Use after research or to start planning a non-trivial feature.
65
79%
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/draft/SKILL.mdRPI Phase 2 of 3: Research → Plan → Implement
Use this skill after research (or standalone) to create a compact implementation plan with behavioral test specifications and Agent Context blocks for each phase.
The Plan phase creates a compact spec that fits in context by:
/craft can dispatch isolated agents per phaseOutput: Compact plan (~200 lines) at docs/plans/YYYY-MM-DD-{topic}-plan.md
Use this skill when:
Don't use for:
If research artifact exists:
Read: docs/plans/YYYY-MM-DD-{topic}-research.mdIf no research artifact, create an inline summary (condensed):
Ask the user to clarify if needed:
Write the plan directly to docs/plans/YYYY-MM-DD-{topic}-plan.md using the Write tool and the template structure. Use kebab-case for the topic slug (e.g., 2026-02-21-add-discount-codes-plan.md).
Note: The plan file serves as a human-readable audit trail for code review, PR descriptions, and design understanding. It is NOT the runtime source of truth for /craft — beads issues are (see Step 3b).
Required sections:
/craftPhase ordering:
See template.md for the complete template with Agent Context block reference.
After writing the plan file, create a beads epic and per-agent-step issues that /craft will execute. The beads task graph is the contract between draft and craft — each issue is self-contained with everything an agent needs.
Before creating beads issues, verify beads is available by attempting beads:epic.
## Inline Task Graph (beads unavailable)
### P1: Apply Schema [no-test] [no blockers]
- **Agent Context:** {full agent context as would appear in beads issue}
### P2: Write Tests — Core Logic [agent-test, L3] [blocked-by: P1]
- **Agent Context:** {full agent context}
### P2: Implement — Core Logic [agent-impl] [blocked-by: P2-Write-Tests]
- **Agent Context:** {full agent context}
...Each inline issue follows the same description format as beads issues — self-contained with everything an agent needs. /craft will consume this inline graph when beads is unavailable.
Procedure (when beads is available):
beads:epic with the feature name as the titlebeads:dep so ordering is enforced:
beads:label:
rpi-phase on all issuesagent-test, agent-impl, agent-validate, or no-test per agent typeL3 or L4 for boundary test level (TDD phases only)Issue description format: Each issue description MUST contain the full Agent Context — everything an agent needs to execute without reading the plan file or any other external document. See template.md for the self-contained issue description templates for each agent type.
Example decomposition for a 6-phase feature:
Epic: "Add Discount Codes"
Phase 1 (no-test):
├── P1: Apply Schema [no blockers]
Phase 2 (TDD, L3):
├── P2: Write Tests — Core Logic [blocked-by P1]
├── P2: Implement — Core Logic [blocked-by P2-Write-Tests]
├── P2: Validate — Core Logic [blocked-by P2-Implement]
Phase 3 (no-test):
├── P3: Repository Layer [blocked-by P2-Validate]
Phase 4 (TDD, L3):
├── P4: Write Tests — Apply Discount [blocked-by P3]
├── P4: Implement — Apply Discount [blocked-by P4-Write-Tests]
├── P4: Validate — Apply Discount [blocked-by P4-Implement]
Phase 5 (TDD, L4):
├── P5: Write Tests — POST /orders [blocked-by P4-Validate]
├── P5: Implement — POST /orders [blocked-by P5-Write-Tests]
├── P5: Validate — POST /orders [blocked-by P5-Implement]
Phase 6 (verification):
└── P6: Full Integration [blocked-by P5-Validate]Tell the user:
/craftImplementation plan saved. Next steps:
- Plan file (audit trail): docs/plans/YYYY-MM-DD-{topic}-plan.md
- Beads epic created: {epic name} ({N} issues, dependencies wired)
- Run `/craft` to execute — it will dispatch agents from beads issues
- Session recovery: if interrupted, `/craft` picks up where it left off via beads:ready
- If changes needed, clarify what to adjust and I'll update both the plan and beads issuesTest specs in the plan MUST be behavioral descriptions, not tool-specific code. The agents executing /craft will consult the project's CLAUDE.md for testing tools and patterns.
Describe invariant properties that must hold:
Describe behavior at the use case boundary:
expect(mockRepository.create).toHaveBeenCalledWith(...)Describe the HTTP contract:
{ id, total } on success, 400 with { error } on validation failure"See template.md for detailed guidelines.
Every implementation phase with tests MUST include an #### Agent Context subsection in the plan file (for audit). The same Agent Context is embedded in each beads issue description (for execution). This is the contract between /draft and /craft.
Required fields:
See template.md for the Agent Context block reference and beads issue description templates.
Each phase should:
Good boundaries: Database schema, Core functions, Repository, Feature use cases, HTTP routes
Bad boundaries: "Implement everything", mixing multiple layers
/craft to dispatch agentsOnce plan is complete and reviewed:
docs/plans/YYYY-MM-DD-{topic}-plan.md (audit trail)beads:list or beads:epic/craft — it executes purely from beads issues, not the plan fileWhy plan after research? The plan phase is a compaction point:
The beads task graph provides durable state across sessions:
beads:ready)/craft again picks up exactly where it left off2a98cc1
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.