Execute the implementation planning workflow using the plan template to generate design artifacts.
Generates implementation plans by analyzing specs and constitution, then creates design artifacts. Use this to plan features before coding, with optional stacked PR workflow support.
/plugin marketplace add nprbst/speck-market/plugin install nprbst-speck-speck@nprbst/speck-market$ARGUMENTS
You MUST consider the user input before proceeding (if not empty).
Parse command-line flags from user input:
--stacked: Enable stacked PR workflow mode (write workflow metadata to plan.md)Setup: Extract prerequisite context from the auto-injected comment in the prompt:
<!-- SPECK_PREREQ_CONTEXT
{"MODE":"multi-repo","FEATURE_DIR":"/path/to/root-repo/specs/010-feature","IMPL_PLAN":"/path/to/child-repo/specs/010-feature/plan.md","TASKS":"/path/to/child-repo/specs/010-feature/tasks.md","REPO_ROOT":"/path/to/child-repo","TEMPLATE_DIR":"/path/to/plugin/templates","AVAILABLE_DOCS":["../../../8-specs/specs/010-feature/spec.md",".speck/memory/constitution.md"]}
-->
Path Usage:
FEATURE_DIR: Directory containing shared artifacts (spec.md, research.md, data-model.md) - READ ONLYIMPL_PLAN: Full path where plan.md should be written - WRITE HERETASKS: Full path where tasks.md should be written (used by /speck:tasks)REPO_ROOT: Root directory of current repository (for relative path calculations)TEMPLATE_DIR: Directory containing templates (plan-template.md, spec-template.md, etc.) - USE FOR TEMPLATESMODE: "single-repo" or "multi-repo" (child in multi-repo setup)Multi-repo behavior:
Fallback: If the comment is not present (VSCode hook bug), run:
speck setup-plan --json
Parse JSON for FEATURE_SPEC, IMPL_PLAN, SPECS_DIR, BRANCH.
IMPORTANT: Do NOT invent or guess CLI paths. Use ONLY the path above.
Parse JSON output to extract FEATURE_SPEC, IMPL_PLAN, SPECS_DIR, and BRANCH.
Load context (use Read tool for all files):
{TEMPLATE_DIR}/plan-template.md (e.g., /Users/.../.claude/plugins/.../templates/plan-template.md)Execute plan workflow: Follow the structure in IMPL_PLAN template to:
**Workflow Mode**: stacked-pr## User Story Groupings
**Suggested Stacking Strategy**:
- Branch 1: US1, US2 (Database layer)
- Branch 2: US3, US4 (API endpoints)
- Branch 3: US5, US6 (UI components)
These groupings represent natural boundaries for stacked PRs. Each group can be implemented in a separate branch with its own pull request.
Write plan.md: Use the IMPL_PLAN path from prerequisite context to write plan.md file.
Stop and report: Command ends after Phase 2 planning. Report branch, IMPL_PLAN path, and generated artifacts.
Extract unknowns from Technical Context above:
Generate and dispatch research agents:
For each unknown in Technical Context:
Task: "Research {unknown} for {feature context}"
For each technology choice:
Task: "Find best practices for {tech} in {domain}"
Consolidate findings in research.md using format:
{REPO_ROOT}/specs/{feature}/research.md (local to child repo - each repo does its own research)Output: research.md with all NEEDS CLARIFICATION resolved
Prerequisites: research.md complete
Before generating contracts: Check for existing shared contracts
If {FEATURE_DIR}/contracts/ exists and contains files:
If no contracts exist, proceed to generate them below
Extract entities from feature spec → data-model.md:
{REPO_ROOT}/specs/{feature}/data-model.md (local to child repo - each repo has its own data model)Generate API contracts from functional requirements (only if no shared contracts exist):
{FEATURE_DIR}/contracts/ (shared - goes to root repo, accessible to all child repos)Generate quickstart.md with developer setup instructions:
{REPO_ROOT}/specs/{feature}/quickstart.md (local to child repo)Agent context update:
speck update-agent-contextOutput: data-model.md (local), contracts/* (shared, if created), quickstart.md (local), agent-specific file