npx claudepluginhub sienklogic/plan-build-run --plugin pbrThis skill is limited to using the following tools:
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Enables AI agents to execute x402 payments with per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents pay for APIs, services, or other agents.
STOP — DO NOT READ THIS FILE. You are already reading it. This prompt was injected into your context by Claude Code's plugin system. Using the Read tool on this SKILL.md file wastes ~7,600 tokens. Begin executing Step 1 immediately.
Before ANY tool calls, display this banner:
╔══════════════════════════════════════════════════════════════╗
║ PLAN-BUILD-RUN ► IMPORTING PLAN ║
╚══════════════════════════════════════════════════════════════╝
Then proceed to Step 1.
You are the orchestrator for /pbr:import. This skill imports an external plan document (design doc, RFC, AI-generated plan, etc.) into the Plan-Build-Run planning format. It validates the imported document against project context, detects conflicts with locked decisions and existing architecture, and generates properly formatted PLAN.md files. Your job is to stay lean, do conflict detection inline, and delegate only the plan checker to a Task() subagent.
Reference: skills/shared/context-budget.md for the universal orchestrator rules.
Additionally for this skill:
.planning/config.json exists (run /pbr:begin first).planning/ROADMAP.md exists with at least one phase.planning/REQUIREMENTS.md exists (optional — if absent, skip requirement ID cross-referencing and warn the user: "No REQUIREMENTS.md found. Skipping REQ-ID validation.")Execute these steps in order.
Reference: skills/shared/config-loading.md for the tooling shortcut and config field reference.
$ARGUMENTS for phase number--from <filepath> flag (path to the external document to import)--skip-checker flag (skip plan validation step)
3b. Parse optional --prd <filepath> flag.
--prd is present: branch into PRD Import Flow (Steps A–G below) immediately after writing .active-skill.--prd and --from are present: treat --prd as the primary flag; --from is ignored with an [INFO] note.--prd is present but no filepath follows: display error "Missing filepath for --prd flag." and stop..planning/.active-skill using the Write tool.→ If --prd flag was set: jump to PRD Import Flow (Step A). Do not continue to Step 2.
.planning/phases/{NN}-{slug}/.planning/STATE.md*-PLAN.md)
Entered when
--prd <filepath>is present in $ARGUMENTS. Steps A–G replace Steps 2–11 entirely for this path.
--prd <filepath> path.Analyze the PRD content for the presence of these six required sections:
| Section | What to look for |
|---|---|
| Project name / title | A clear product name or title |
| Problem statement | What problem the product solves, who it's for |
| Goals / success criteria | Measurable outcomes, KPIs, or acceptance tests |
| Functional requirements | Feature list, user stories, or capabilities |
| Non-functional requirements | Performance, security, reliability constraints |
| Out of scope / deferred | Explicitly excluded features |
For each section that is absent or ambiguous, record it as a gap.
If 1–3 gaps found: Batch all gaps into ≤ 3 AskUserQuestion calls (max 4 options each). Ask the user to supply the missing info:
Example AskUserQuestion for missing requirements:
Use AskUserQuestion:
question: "The PRD doesn't clearly specify functional requirements. Please describe the main features or capabilities this product must have."
header: "Fill Gap"
options: [] ← freeform (no options means free text input)
multiSelect: false
If 0 gaps: proceed directly to Step C with no prompts.
Incorporate user answers into the extraction context used in Step C.
Using the PRD content (plus any gap-fill answers from Step B), generate the content for three files. Do this inline in your context — no subagents for these three files.
C1. Generate PROJECT.md content using templates/PROJECT.md.tmpl as the structure:
{project_name}: extract from PRD title/header{ONE sentence core value statement}: extract from problem statement / visionC2. Generate REQUIREMENTS.md content using templates/REQUIREMENTS.md.tmpl as the structure:
C3. Generate CONTEXT.md content using templates/project-CONTEXT.md.tmpl as the structure:
Check config: Read .planning/config.json. If prd.auto_extract is true, skip this step entirely and proceed directly to Step E.
If prd.auto_extract is false (default):
Display a preview of the three generated files (show first 10 lines of each with a ... truncation).
Then present the confirmation gate using the approve-revise-abort pattern from skills/shared/gate-prompts.md:
Use AskUserQuestion:
question: "Approve these extracted files? (PROJECT.md, REQUIREMENTS.md, CONTEXT.md — ROADMAP.md will be generated next)"
header: "Approve?"
options:
- label: "Approve" description: "Write files and generate ROADMAP.md"
- label: "Request changes" description: "Describe what to adjust before writing"
- label: "Abort" description: "Cancel PRD import"
multiSelect: false
.planning/.active-skill and stop with message: "PRD import cancelled."For each of the three files (PROJECT.md, REQUIREMENTS.md, CONTEXT.md in .planning/):
.planning/PROJECT.md, etc.).question: ".planning/{filename} already exists. Overwrite it?"
header: "Overwrite?"
options:
- label: "Yes" description: "Replace existing file"
- label: "No" description: "Keep existing, skip this file"
.planning/PROJECT.md.planning/REQUIREMENTS.md.planning/CONTEXT.mdDisplay: ◐ Generating ROADMAP.md via planner...
Spawn the planner subagent:
Task({
subagent_type: "pbr:planner",
prompt: "
You are the planner agent in Roadmap Mode.
<files_to_read>
CRITICAL: Read these files BEFORE any other action:
1. .planning/PROJECT.md
2. .planning/REQUIREMENTS.md
3. .planning/CONTEXT.md
</files_to_read>
Generate `.planning/ROADMAP.md` from the project files above.
Use the roadmap template at `${CLAUDE_PLUGIN_ROOT}/templates/ROADMAP.md.tmpl`.
Apply Requirement Coverage Validation: every requirement in REQUIREMENTS.md must appear in at least one phase.
Apply the Dual Format requirement: Quick-scan checklist at top + detailed phase descriptions.
Wrap all phases in a Milestone section named after the project.
Write ROADMAP.md to `.planning/ROADMAP.md`.
Output your completion marker when done: ## PLANNING COMPLETE
"
})
After the Task() completes:
.planning/ROADMAP.md exists (Glob check).G1. Initialize STATE.md (if it does not already exist):
node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js state load.planning/STATE.md with frontmatter fields:
project: {project_name from PROJECT.md}
current_phase: 1
status: planning
source: prd-import
prd_file: {filepath}
G2. Update STATE.md with PRD import status:
status: planningsource: prd-import and prd_file: {filepath}G3. Commit (if planning.commit_docs is true in config):
Reference: skills/shared/commit-planning-docs.md for the standard commit pattern.
docs(planning): init project docs from PRD import
Stage: .planning/PROJECT.md, .planning/REQUIREMENTS.md, .planning/CONTEXT.md, .planning/ROADMAP.md (if generated), .planning/STATE.md.
G4. Delete .planning/.active-skill.
G5. Display completion banner:
╔══════════════════════════════════════════════════════════════╗
║ PLAN-BUILD-RUN ► PRD IMPORT COMPLETE ✓ ║
╚══════════════════════════════════════════════════════════════╝
**Project**: {project_name}
**Source**: {prd_filepath}
Files generated:
✓ .planning/PROJECT.md
✓ .planning/REQUIREMENTS.md
✓ .planning/CONTEXT.md
{✓ or ✗} .planning/ROADMAP.md
Requirements extracted: {count} REQ-IDs
Gaps filled: {count} (via interactive prompts)
╔══════════════════════════════════════════════════════════════╗
║ ▶ NEXT UP ║
╚══════════════════════════════════════════════════════════════╝
**Plan Phase 1** — generate execution plans for the first phase
`/pbr:plan 1`
<sub>`/clear` first → fresh context window</sub>
**Also available:**
- `/pbr:discuss` — review and refine decisions before planning
- `/pbr:status` — see full project overview
End of PRD Import Flow. Steps 2–11 below apply only to the standard --from flow.
Read all relevant context files. This context is used for conflict detection in Step 4.
1. ROADMAP.md — extract current phase goal, dependencies, requirements, success criteria
2. REQUIREMENTS.md — extract REQ-IDs mapped to this phase
3. CONTEXT.md (project-level, if exists) — extract locked decisions, deferred ideas, constraints
4. Phase CONTEXT.md (if exists at .planning/phases/{NN}-{slug}/CONTEXT.md) — phase-specific locked decisions from /pbr:discuss
5. config.json — extract feature flags, depth, model settings
6. Prior SUMMARY.md files — use digest-select depth per `skills/shared/digest-select.md` (direct deps: full body for conflict detection, transitive: frontmatter only, 2+ back: skip)
7. Research SUMMARY.md (if exists at .planning/research/SUMMARY.md)
8. Seeds — glob .planning/seeds/*.md, check trigger field for matches:
- trigger equals the phase slug
- trigger is a substring of the phase directory name
- trigger equals the phase number as integer
- trigger equals * (always matches)
9. Pending todos — scan .planning/todos/pending/ for items related to this phase
10. Notes (if .planning/notes/ exists) — check for related notes
Collect all of this into a context bundle for use in Steps 4 and 5.
If --from <filepath> was provided:
If no --from flag:
Parse the document into structured sections:
Compare the imported plan against ALL loaded context from Step 2.
<format_rules> HARD REQUIREMENTS FOR THIS STEP — violations are bugs:
[BLOCKER], [WARNING], [INFO]. Never CRITICAL, HIGH, MEDIUM, LOW, or any other label.WRONG (never do this):
| Area | Import | Project | Severity |
|---|---|---|---|
| Framework | Fastify | Express | CRITICAL |
RIGHT (always do this): [BLOCKER] Framework mismatch Found: Plan uses Fastify with @fastify/view Expected: Express 5.x (locked decision in CONTEXT.md) → Replace Fastify with Express 5.x </format_rules>
Run each of these checks. If any matches, record a [BLOCKER]:
Run each of these checks. If any matches, record a [WARNING]:
[INFO] No REQUIREMENTS.md — REQ-ID coverage check skipped instead..planning/todos/pending/?Run each of these checks. If any matches, record an [INFO]:
.planning/notes/?.planning/seeds/ that could enhance the plan?patterns fields) should the imported plan follow?Present ALL findings in a single report using this EXACT plain-text format. NEVER use markdown tables. NEVER change the labels. NEVER skip a section even if it has 0 findings:
## Conflict Detection Report
### BLOCKERS ({count})
[BLOCKER] {Short title}
Found: {what the imported plan says or does}
Expected: {what the project context requires}
→ {Specific action to resolve}
[BLOCKER] {Short title}
Found: ...
Expected: ...
→ ...
### WARNINGS ({count})
[WARNING] {Short title}
Found: {what was detected}
Impact: {what could go wrong if not addressed}
→ {Suggested action}
### INFO ({count})
[INFO] {Short title}
Note: {relevant information or suggestion}
IMPORTANT: Always present ALL findings (blockers + warnings + info) together in one report before taking any action.
Using the imported document (adjusted for any blocker resolutions from Step 4) and the loaded project context, generate PLAN.md content.
YAML frontmatter — ALL required fields:
---
phase: "{NN}-{slug}"
plan: "{phase}-{plan_num}"
type: "{task type: feature, refactor, config, test, docs}"
wave: {wave number — 1 for independent plans, 2+ for dependent plans}
depends_on: [{list of plan IDs this plan depends on}]
files_modified: [{list of files this plan creates or modifies}]
autonomous: {true if no checkpoints needed, false if human input required}
discovery:
approach: "{brief description of what this plan accomplishes}"
open_questions: [{any unresolved questions from the import}]
must_haves:
truths: [{core invariants this plan must satisfy}]
artifacts: [{files that must exist after execution}]
key_links: [{connections to other parts of the system}]
provides: [{what downstream plans can depend on from this plan}]
gap_closure: {false for standard plans, true if closing gaps}
---
Task XML — for each task in the plan:
<task id="{plan_id}-T{N}">
<name>{Imperative task name}</name>
<files>{comma-separated list of files this task touches}</files>
<action>
{Step-by-step implementation instructions — specific enough for an executor agent to follow mechanically.}
{Include exact file paths, function signatures, import statements.}
</action>
<verify>
{Concrete verification commands: test commands, grep checks, build commands.}
{Each verify step must be runnable from the command line.}
</verify>
<done>{One-sentence definition of done for this task.}</done>
</task>
Scope rules:
<!-- inferred from codebase: ... -->Wave assignment:
Skip this step if:
--skip-checker flag is setfeatures.plan_checking is false in configIf validation is enabled:
Display to the user: ◐ Spawning plan checker...
Spawn the plan checker Task():
Task({
subagent_type: "pbr:plan-checker",
prompt: <checker prompt>
})
NOTE: The pbr:plan-checker subagent type auto-loads the agent definition. Do NOT inline it.
Checker Prompt Template:
You are the plan-checker agent.
<files_to_read>
CRITICAL: Read these files BEFORE any other action:
1. .planning/CONTEXT.md — locked decisions and constraints (if exists)
2. .planning/STATE.md — current project state and progress
3. .planning/ROADMAP.md — phase structure, goals, and dependencies
</files_to_read>
<plans_to_check>
{For each generated PLAN.md:}
--- Plan File: {filename} ---
[Inline the FULL content of each plan file]
--- End Plan File ---
</plans_to_check>
<phase_context>
Phase goal: {goal from roadmap}
Phase requirements: {REQ-IDs}
</phase_context>
<context>
{Inline .planning/CONTEXT.md if it exists — project-level locked decisions}
{Inline .planning/phases/{NN}-{slug}/CONTEXT.md if it exists — phase-level locked decisions}
</context>
<import_note>
These plans were imported from an external document, not generated by the standard planner.
Pay extra attention to:
- Consistency with project conventions
- Completeness of verify steps
- Accuracy of files_modified lists
- Whether task actions are specific enough for mechanical execution
</import_note>
Run all verification dimensions on these plans. Return your structured report.
Do NOT write any files. Return your findings as your response text.
Process checker results — completion marker check:
After the plan-checker completes, check for completion markers in the Task() output:
## CHECK PASSED is present: skip the revision loop entirely and proceed to Step 7.## ISSUES FOUND is present: enter the revision loop below.Revision loop:
Reference: skills/shared/revision-loop.md for the full Check-Revise-Escalate pattern (max 3 iterations).
Follow the revision loop with:
Write each plan to .planning/phases/{NN}-{slug}/PLAN-{plan_num}.md.
If existing plans are being replaced (user confirmed in Step 1):
*-PLAN.md files in the phase directory before writing new onesStep 7b — Spot-check artifacts:
After writing plan files, verify they landed on disk:
.planning/phases/{NN}-{slug}/PLAN-*.md to confirm files existPerform all state updates in this order:
8a. Update ROADMAP.md Progress table (REQUIRED — do this BEFORE updating STATE.md):
.planning/ROADMAP.md## Progress tablePlans Complete column to 0/{N} where N = number of plan files createdStatus column to plannedCRITICAL -- DO NOT SKIP: Update STATE.md frontmatter AND body with import status.
8b. Update STATE.md:
8c. Generate dependency fingerprints: For each dependency phase (phases that this phase depends on, per ROADMAP.md):
dependency_fingerprints field to each plan's YAML frontmatter:
dependency_fingerprints:
"01-01": "len:4856-mod:2025-02-08T09:40"
"01-02": "len:4375-mod:2025-02-08T09:43"
8d. Update CONTEXT.md (conditional):
If the import process surfaced new locked decisions (from blocker resolutions in Step 4), append them to .planning/CONTEXT.md under the Decisions section.
8e. Emit workflow event (conditional): If the event-logger script is available:
node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js event workflow plan-import --phase {N} --plans {count} --source {filepath_or_user_input}
Falls back silently if the command is not available.
Reference: skills/shared/commit-planning-docs.md for the standard commit pattern.
Stage the new PLAN.md files and any updated state files:
docs({phase}): import plans for phase {N} ({count} plans, {wave_count} waves)
Delete .planning/.active-skill if it exists. This must happen on all paths (success, partial, and failure) before reporting results.
Present a summary of the import using the branded banner:
╔══════════════════════════════════════════════════════════════╗
║ PLAN-BUILD-RUN ► IMPORT COMPLETE ✓ ║
╚══════════════════════════════════════════════════════════════╝
**Phase {N}: {name}** — {plan_count} plans imported
Source: {filepath or "user input"}
Conflicts resolved: {count of blockers resolved in Step 4}
Warnings acknowledged: {count}
Plans:
{phase}-01: {plan name} (Wave {W}, {task_count} tasks)
{phase}-02: {plan name} (Wave {W}, {task_count} tasks)
Wave execution order:
Wave 1: Plan 01, Plan 02 (parallel)
Wave 2: Plan 03 (depends on 01, 02)
Must-haves coverage: {count} truths across {plan_count} plans
Requirements traced: {count}/{total} REQ-IDs covered
╔══════════════════════════════════════════════════════════════╗
║ ▶ NEXT UP ║
╚══════════════════════════════════════════════════════════════╝
**Build Phase {N}** — execute these imported plans
`/pbr:build {N}`
<sub>`/clear` first → fresh context window</sub>
**Also available:**
- `/pbr:plan {N}` — re-plan from scratch if import needs rework
- `/pbr:discuss {N}` — talk through details before building
IMPORTANT: On ALL error exits below, delete .planning/.active-skill if it exists before displaying the error message.
If the specified phase does not exist in ROADMAP.md, display:
╔══════════════════════════════════════════════════════════════╗
║ ERROR ║
╚══════════════════════════════════════════════════════════════╝
Phase {N} not found.
**To fix:** Run `/pbr:status` to see available phases.
If REQUIREMENTS.md or ROADMAP.md do not exist, display:
╔══════════════════════════════════════════════════════════════╗
║ ERROR ║
╚══════════════════════════════════════════════════════════════╝
Project not initialized.
**To fix:** Run `/pbr:begin` first.
If --from <filepath> points to a nonexistent file, display:
╔══════════════════════════════════════════════════════════════╗
║ ERROR ║
╚══════════════════════════════════════════════════════════════╝
File not found: {filepath}
**To fix:** Check the path and try again.
If the PRD file is < 100 characters:
╔══════════════════════════════════════════════════════════════╗
║ ERROR ║
╚══════════════════════════════════════════════════════════════╝
PRD file appears empty or too short to extract meaningful content.
**To fix:** Provide a more complete PRD document (minimum ~100 characters).
If user selects "Abort" at the confirmation gate (Step D):
Display: "PRD import cancelled." and delete .planning/.active-skill.
If the imported document contains no actionable tasks, display:
╔══════════════════════════════════════════════════════════════╗
║ ERROR ║
╚══════════════════════════════════════════════════════════════╝
The imported document is too vague to convert into plans. No specific tasks, files, or implementation steps found.
**To fix:** Provide a more detailed document, or use `/pbr:plan {N}` to generate plans from scratch.
After 3 revision iterations without passing, display:
╔══════════════════════════════════════════════════════════════╗
║ ERROR ║
╚══════════════════════════════════════════════════════════════╝
Import plan checker failed to pass after 3 revision iterations.
**To fix:** Review the remaining issues below and decide whether to proceed or revise manually.
Present remaining issues and ask user to decide: proceed or intervene.
| File | Purpose | When |
|---|---|---|
.planning/phases/{NN}-{slug}/PLAN-{NN}.md | Imported plan files | Step 7 |
.planning/ROADMAP.md | Plans Complete + Status updated to planned | Step 8a |
.planning/STATE.md | Updated with plan status and import source | Step 8b |
.planning/CONTEXT.md | Updated if blockers surfaced new locked decisions | Step 8d |
.planning/PROJECT.md | Generated from PRD | Step E (PRD flow) |
.planning/REQUIREMENTS.md | Generated from PRD | Step E (PRD flow) |
.planning/CONTEXT.md | Generated from PRD | Step E (PRD flow) |
.planning/ROADMAP.md | Generated by planner subagent | Step F (PRD flow) |