/rdf:r-planfrom RDF: rfxn Development Framework
Decomposes a spec into an execution-grade, phase-by-phase implementation plan written to docs/plans/. Second stage of the spec-plan-build-ship pipeline.
Ships in RDF: rfxn Development Framework. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Take a spec (or equivalent input) and decompose it into an
execution-grade implementation plan written to
docs/plans/{YYYY-MM-DD}-{topic}-plan.md. You never write code.
You produce plans.
This is the second stage of the spec-plan-build-ship pipeline.
In Claude Code this stage is tuned for Fable at high effort. If the active
model is not Fable, mention once: "Tip: launch plan sessions with
claude --model fable --effort high" — then continue on the current model.
Never block, and never switch models mid-session (a model switch rebuilds
the whole prompt cache).
$ARGUMENTS — input source for the plan:
/rdf:r-plan — auto-detect most recent spec in docs/specs/
/rdf:r-plan docs/specs/foo.md — file path (contains / or ends with .md)
/rdf:r-plan https://github.com/... — GitHub URL (starts with http/https)
/rdf:r-plan #42 — issue shorthand (# + digits)
/rdf:r-plan --resume — resume interrupted plan (resolved via rdf_active_plan_path)
/rdf:r-plan --resume <path> — set pointer to <path> and resume
/rdf:r-plan --full|--quick|--bugfix — set the task-class tier (may combine with a spec input)
Argument detection logic:
/ or ends with .md → file path → read as spec inputhttp or https → GitHub URL → fetch via gh# followed by digits → issue shorthand → gh issue view {N}--resume → resume from active plan (see Resume Protocol)--resume <path> → validate <path> exists; rdf_set_active_plan "<path>"; enter Resume Protocol--full / --quick / --bugfix → task-class tier flag (see Tier Selection); a tier flag may accompany any input formdocs/specs/ for most recent file by mtimeInput validation:
gh CLI available, fetch and validate responsegh CLI available, fetch issue bodydocs/specs/ sorted by mtime descending, use
most recent. If docs/specs/ is empty or missing, offer transparent
delegation to /rdf:r-spec:
"No spec found. Would you like to start with /rdf:r-spec to design
one first? [Y/n]"
If Y: run the /rdf:r-spec workflow inline, then continue into
planning when the spec is complete. If N: stop.Before planning, resolve the task-class tier (reference/tiers.md — the single source of truth for tier semantics and gate caps):
source ~/.rdf/state/rdf-bus.sh
rdf_session_init
tier="$(rdf_active_tier)" # inherits the tier /rdf:r-spec set, else full
If ~/.rdf/state/rdf-bus.sh is absent (helpers not yet bootstrapped — fresh
plugin install before its first session restart), skip session init, treat
the tier as full, and resolve the plan from the committed docs/plans/
file directly; restart the session (plugin) or run rdf deploy claude-code
(checkout) to deliver them.
Flag override. If --full, --quick, or --bugfix is present, it wins:
map to full / quick-plan / bugfix and record it with
rdf_set_active_tier <tier>.
Inherited tier. If /rdf:r-spec already set a session tier (pointer present)
and no flag overrides it, honor it silently — no re-prompt.
No flag, no inherited tier. Present the heuristic suggestion from
reference/tiers.md and let the user confirm:
Assessing scope... {one-line read of the ask}.
Suggested tier: {heuristic}.
[1] full (default) [2] quick-plan [3] bugfix
Select tier [1]:
A bare Enter selects [1] full — one keystroke, today's behavior. On any
choice, record it with rdf_set_active_tier <tier>.
The resolved tier drives the **Tier:** preamble marker (Step 2.1) and the
tier-scaled output paths (Step 2.2a).
At command startup, create tasks for live progress tracking:
TaskCreate:
subject: "Read codebase and spec, plan decomposition strategy"
activeForm: "Reading codebase and spec"
TaskCreate:
subject: "Write execution-grade implementation phases"
activeForm: "Writing implementation phases"
TaskCreate:
subject: "Challenge review and user approval"
activeForm: "Reviewing plan"
Issue each TaskCreate in its own message, in the order shown — see
reference/progress-tracking.md
for why parallel batches break display order.
Lifecycle: all tasks start pending. Before starting each step,
mark its task in_progress. After completing, mark completed.
If --resume (with or without <path>) is specified, OR if rdf_active_plan_path returns a plan with incomplete phases:
~/.rdf/state/rdf-bus.sh; rdf_session_init. Read the active plan:
plan_path="$(rdf_active_plan_path)". If --resume <path> was given,
call rdf_set_active_plan "<path>" first.--- horizontal
rule before the next phase heading (or EOF)--- is truncated — regenerate it**Phases:** {N} count against actual
phase headings to detect missing phasesResuming plan for: {topic}
Written: {M} phases complete
Truncated: Phase {N} (will regenerate)
Missing: Phases {N+1}-{total}
Continue? [Y/start fresh]
rdf_clear_active_plan) and begin from Step 1.Mark task "Read codebase and spec" as in_progress.
Plans must be execution-grade: a fresh agent with zero codebase context can execute any phase mechanically, step by step, without asking questions or reading the spec. This is the difference between an architect's outline and construction blueprints.
Read the input source (spec file, GitHub issue, or URL) in full. Extract:
Before writing any phase, read every file that will be touched. Collect:
This is mandatory. Plans written without reading the codebase produce vague phases ("extract functions to new file") that block the engineer with ambiguity. Plans written after reading the codebase produce precise phases ("cut lines 61-173 from functions.apf, paste after boilerplate in apf_ipt.sh").
Mark task "Read codebase and spec" as completed.
Plan files are written to docs/plans/{YYYY-MM-DD}-{topic}-plan.md.
Derive the filename at runtime:
TODAY="$(command date +%Y-%m-%d)"
TOPIC="{slugified topic from spec or user input}"
PLAN_FILE="docs/plans/${TODAY}-${TOPIC}-plan.md"
If PLAN_FILE already exists, append a disambiguating suffix (-v2,
-v3, ...) — never overwrite a committed plan.
Create docs/plans/ if absent: command mkdir -p docs/plans/.
Mark task "Write execution-grade implementation phases" as in_progress.
Every plan starts with four sections before any phases:
Header:
# Implementation Plan: {topic}
**Goal:** {1-2 sentence description of what is being built/changed}
**Architecture:** {brief description of the approach}
**Tech Stack:** {language, version floor, test framework, key tools}
**Spec:** docs/specs/{filename}
**Phases:** {N}
**Plan Version:** 3.0.6
**Tier:** {full | quick-plan | bugfix}
The **Plan Version:** 3.0.6 marker is what schema validators key on
for version-aware checks — see Plan-Version Awareness in
reference/plan-schema.md. New plans must
carry the current marker; legacy plans without it bypass the strictest
rules with an INFO log.
The **Tier:** marker (plan-schema Rule 10) records the task-class ceremony
level resolved in Tier Selection; /rdf:r-build and the dispatcher read it to cap
gates. It sits on its own line immediately after **Plan Version:**. Absent →
full.
The **Phases:** {N} line enables crash recovery — compare against
actual phase headings to detect missing phases on resume.
Conventions:
Define patterns used across multiple phases ONCE here so phases can reference them without repetition:
## Conventions
**Boilerplate** — every new file starts with:
{exact template with placeholders marked}
**Naming pattern** — {convention for new files, functions, variables}
**Commit message format** — {project-specific format}
**CRITICAL:** {project-specific constraints — e.g., "never git add -A"}
File Map:
One table listing ALL files across the entire plan:
## File Map
### New Files
| File | Lines | Purpose | Test File |
|------|-------|---------|-----------|
### Modified Files
| File | Changes | Test File |
|------|---------|-----------|
### Deleted Files
| File | Reason |
|------|--------|
Every new or modified file must have a corresponding test file column
entry. If no test applies, state N/A (config) or N/A (docs).
Phase Dependencies:
Structured dependency list — required for all plans. /rdf:r-build --parallel reads this to determine which phases can run concurrently.
Format:
Example:
If all phases are strictly sequential:
The ASCII art dependency graph from prior plans is still permitted as a supplementary visual aid but is not read by the build command. The structured list is the machine-parseable source of truth.
Break the spec into numbered implementation phases. Each phase is a unit of work that can be committed independently.
Guidelines for decomposition:
The resolved tier (Tier Selection) scales the plan artifact and its review path. See reference/tiers.md for the full ceremony table.
full — current behavior: the full plan written to
docs/plans/{date}-{topic}-plan.md, challenge review in Step 3.quick-plan — write ONE condensed
docs/plans/{date}-{topic}-quickplan.md: a folded Context/Goals block (~15
lines, from the spec or the ask) followed by phases. A single review pass in
Step 3 — no separate spec review.bugfix — write a ≤ 2-phase plan: Phase 1 lands a failing regression test
(red) then the minimal fix (green); an optional Phase 2 is follow-up
hardening. Schema-validate only (Step 2.7) and skip the Step 3 challenge
review — the build-time sentinel-lite is the adversarial pass. Phase 1's
Accept MUST require the failing test first.For each phase, provide orchestration metadata:
Execution mode (how the dispatcher runs it):
[serial-context] — 1 file, simple change, stays in main session[serial-agent] — 2-5 files or files with dependencies, one subagent[parallel-agent] — 6+ independent files, parallel subagentsThe dispatcher automatically classifies change scope and selects quality gates based on the phase's file list, description, and governance context. No risk, type, or gate tagging is needed in the plan — the dispatcher derives these at execution time.
Note: [parallel-agent] mode is for INTRA-PHASE parallelism
(multiple engineers within one phase). INTER-PHASE parallelism
(multiple phases running concurrently) is handled by /rdf:r-build --parallel, which reads the Phase Dependencies list above. The
planner does not need to think about inter-phase parallelism — the
build command derives it from the dependency graph.
For any [parallel-agent] phase, explicitly list which files belong
to which parallel track. No file may appear in more than one track.
If files cannot be cleanly separated, downgrade to [serial-agent].
This is the critical section. Each phase contains numbered steps with checkboxes. Each step is 2-5 minutes of work.
Every step must include:
grep -c '\.rdf/governance/' canonical/agents/engineer.md
# expect: 1
The final step of every phase is a commit step with a pre-written commit message.
Self-correction notes: When you discover a subtlety mid-planning (dependency ordering, scoping issue, variable shadowing, a "wait — this won't work because..."), preserve the reasoning inline. These notes prevent the engineer from re-discovering the same gotcha.
Edge case propagation: If the spec (Section 11b) lists edge cases, each edge case must map to at least one step in the plan. Check the spec's edge case table and verify coverage. If an edge case is deferred, note it explicitly with rationale.
The complete format for each phase:
---
### Phase {N}: {description}
{1-2 sentence summary of what this phase does and why}
**Files:**
- Create: `path/to/new.file` (test: `tests/new.bats`)
- Modify: `path/to/existing.file` (what changes)
- Delete: `path/to/removed.file` (why)
- **Mode**: {serial-context | serial-agent | parallel-agent}
- **Accept**: {acceptance criteria — concrete, testable, pass/fail}
- **Test**: {test file + test names, or verification commands with expected output}
- **Edge cases**: {spec edge cases covered by this phase, or "none"}
- **Regression-case**: {tests/foo.bats::@test "named test" | N/A — <category> — <reason>}
- Full shape, category, and disambiguation rules:
[reference/plan-schema.md](../reference/plan-schema.md) Rules 4-7.
- Quick reference: category ∈ {docs, performance, logging, refactor,
security}; pure test-addition phases use `refactor` (not `security`);
`security` requires CVE/bug/issue ref in reason.
- [ ] **Step 1: {action}**
{exact code block or old→new diff}
- [ ] **Step 2: Verify**
```bash
{command}
# expect: {expected output}
Step 3: Commit
{git add + git commit with pre-written message}
**Mandatory phase metadata fields:** Mode, Accept, Test, Edge cases, Regression-case.
Omitting any field is a plan quality failure.
**Accept criteria** must be concrete and testable — "governance works"
is not acceptable. "grep -c '.rdf/governance/' in all 4 agent files
returns 1 each" is acceptable.
**Test field** must name specific test files or verification commands
with expected output. "run tests" is not acceptable.
Every phase MUST end with a `---` horizontal rule. This is the crash
safety marker — a phase without a trailing `---` is considered
truncated and will be regenerated on `--resume`.
### 2.7 Validate Schema
Validate the drafted plan file (`$PLAN_FILE`) against
[reference/plan-schema.md](../reference/plan-schema.md). Walk every rule
(Plan-Version Awareness, then Rules 1-9) against every phase. List any
violations to the user with the rule number and exact failure message,
fix them in-place, and re-run the pass until clean.
**Rule 9 check (test-count self-consistency):** For each phase, scan the
`**Test**` field and step prose for an explicit test-count assertion (an
integer adjacent to a test noun — e.g., *"expect 5 tests pass"*,
*"14 new tests"*, or a `# expect: <N>` comment). If a count assertion is
found and is not marked `TODO`, count the `@test` references and
`# expect:` lines in the phase body. If the declared count does not match
the asserted count, report the mismatch with the exact failure message
from Rule 9 and halt before proceeding to Step 3 (reviewer dispatch).
**RC Contract Evidence check:** Verify the plan preamble contains an
`## RC Contract Evidence` section when the plan references named
helper functions with explicit return-code contracts (as per planner
Step 1.5). If the section is absent and the plan names caller-helper-fn
pairs, report: *"Plan preamble missing RC Contract Evidence section —
run planner Step 1.5 to generate it."* Halt before reviewer dispatch.
Do not proceed to Step 3 (Review) with outstanding schema violations —
the reviewer and `/rdf:r-build` apply the same rules and would reject the
plan downstream. Catching violations here saves a reviewer cycle and a
dispatch failure.
Mark task "Write execution-grade implementation phases" as `completed`.
---
## Step 3: Review + Approve
Mark task "Challenge review and user approval" as `in_progress`.
### 3.1 Plan Review
After writing the full plan, dispatch the `rdf-reviewer-challenge`
subagent (challenge mode, high effort; no per-invocation model override).
The dispatch prompt must include the quality standard as an explicit
checklist:
Review this implementation plan against the quality standard. Each criterion is checked independently — if ANY fail, finding is MUST-FIX:
- Phase N: none or - Phase N: [deps] for every phaseAlso review for:
Calibration: only flag MUST-FIX(blocking-concern) if the issue would prevent an engineer from executing the step without guessing. Style preferences, naming opinions, and alternative approaches are INFORMATIONAL(risk-area), not MUST-FIX.
File: $PLAN_FILE (the docs/plans/{date}-{topic}-plan.md path from Step 2.0) Mode: challenge
Fix issues and re-dispatch (max 3 cycles). If MUST-FIX findings
remain after 3 cycles, present to the user for resolution.
### 3.2 User Approval
Present the plan summary:
Plan written to: $PLAN_FILE {N} phases | {serial count} serial, {parallel count} parallel Estimated gates: {total gate invocations across all phases}
Please review the plan. Approve to finalize, or request changes. [approve/change/replan]
Wait for user approval. If the user requests changes:
- Adjust phases, re-tag, rewrite the plan file
- Do NOT re-run the spec design phases — use `/rdf:r-spec` for that
### 3.3 Commit Planning Artifacts (mandatory)
Plans are committed at creation. Stage the plan file and commit:
```bash
git add "$PLAN_FILE"
# If the spec is not yet committed:
git diff --cached --name-only | grep -q docs/specs/ || git add "$SPEC_PATH"
git commit -m "Add {topic} implementation plan
[New] $PLAN_FILE — {N}-phase implementation plan"
The plan is now a tracked artifact and cannot be silently overwritten by a subsequent session. This is the central guarantee of the post-3.1.2 plan model.
After committing:
source ~/.rdf/state/rdf-bus.sh
rdf_set_active_plan "$PLAN_FILE"
This records the plan as active for the current session. The pointer file .rdf/active-plan-${RDF_SESSION_ID} is gitignored.
Mark task "Challenge review and user approval" as completed.
After all steps complete, present the pipeline handoff:
> **Plan ready** — `$PLAN_FILE` ({N} phases)
> Run `/rdf:r-build` to begin execution, or `/rdf:r-build 3` for a specific phase.
> In Claude Code, run the build in an Opus session: `claude --model opus`.
A plan is execution-grade when ALL of the following are true. These are not aspirational — the reviewer checks each one and any failure is MUST-FIX.
# expect:)reference/plan-schema.md satisfied (covers
crash-safety markers, mandatory metadata fields, Regression-case
shape and category, security CVE/bug/issue requirement, and Plan
Version marker)A plan that says "extract functions to new file" is an outline. A plan that says "cut lines 61-173 from functions.apf, paste after boilerplate in apf_ipt.sh, add sourcing line to hub, run bash -n, expect exit 0" is execution-grade.
| Primitive | Syntax | Best for |
|---|---|---|
| Table | | col | col | | File maps, phase summaries, decision tables |
| Task list | - [x] / - [ ] | Phase steps, progress tracking |
| Blockquote | > | Handoff prompts, self-correction notes |
| Bold | **text** | Labels, phase metadata keys |
| Italic | *text* | Status keywords |
| Inline code | `text` | Paths, commands, file names, hashes |
Do NOT use (not rendered in Claude Code):
HTML tags, <details>, ANSI color codes, Mermaid diagrams, footnotes.
/rdf:r-build.---.
This enables --resume to detect truncated phases.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub rfxn/rdf --plugin rdf38 skills in this plugin
/r-auditUse when you want a full codebase audit: dispatches parallel reviewer and QA passes across the tree.
/r-audit-slopAI slop audit. Finds dead code, orphan helpers, noop functions,
/r-buildUse when a plan exists and you want it built: dispatches the plan-execution orchestrator (engineer/QA/review gates) per phase at the right tier.
/r-context-auditMeasure, score, and report on Claude Code context overhead for this
/r-envUse to assess the environment against an optimal Claude Code + RDF setup: code intelligence plugins and language servers, tools, limits, sandbox, Claude Code currency, .claude files and the price table, with exact fix commands.
/r-initUse to initialize RDF governance on a new or existing repository.
Other plugins' skills for the same job