spectre-create-plan

star 142

๐Ÿ‘ป | Create implementation plan from PRD - primary agent

Codename-Inc By Codename-Inc schedule Updated 5/24/2026

name: "spectre-create_plan" description: "๐Ÿ‘ป | Create implementation plan from PRD - primary agent" user-invocable: true

create_plan

Input Handling

Treat the current command arguments as this workflow's input. When invoked from a slash command, use the forwarded $ARGUMENTS value.

create_plan: Transform PRD into Technical Implementation Plan

Description

  • What โ€” Conduct codebase research, collect clarifications, generate implementation plan
  • Outcome โ€” Complete plan.md with technical approach, phases, and architecture; ready for task breakdown
  • Role โ€” Sr. staff engineer biasing to YAGNI + SOLID + KISS + DRY

ARGUMENTS Input

<ARGUMENTS> $ARGUMENTS </ARGUMENTS>

Step (1/4) - Codebase Architecture Research

  • Action โ€” CheckExistingResearch: Check if technical research already completed.
    • Read TASK_DIR/task_context.md; look for "## Technical Research" section.
    • If found with comprehensive analysis โ†’ use existing research; skip to Step 3.
    • If ARGUMENTS contains --depth light and TASK_DIR/task_context.md already contains substantive router research (file locations, code understanding, codebase patterns, and impact summary) โ†’ use existing research; skip to Step 3.
    • Else โ†’ proceed with new research below.
  • Action โ€” AutomatedResearch: Spawn parallel research agents for comprehensive analysis.
    • Use @finder to find all files related to feature area.
    • Dispatch multiple parallel @analyst subagents to understand current implementation patterns. Pay particular attention to how and where data is accessed that will be needed for this feature.
    • Use @patterns to surface canonical reference implementations already in the codebase โ€” these become "follow this file" anchors in the plan.
    • Wait for ALL agents to complete before proceeding.
    • Read ALL identified files into context.
  • Action โ€” TraceCodePaths: Trace through relevant execution paths.
    • Identify the key entry points for the feature area (routes, handlers, event listeners, CLI commands).
    • Follow the data flow end-to-end: from input โ†’ processing โ†’ storage โ†’ output.
    • Find similar features already implemented in the codebase and study how they work โ€” these are your implementation reference.
    • Read the actual code at each step; do not rely on file names or agent summaries alone.
  • Action โ€” DocumentationReview: Review core architecture documentation.
    • Review CLAUDE.md for rules and key patterns.
    • Review README.md for major components.
    • Cross-reference automated findings with documentation.
  • Action โ€” PatternAnalysis: Synthesize findings.
    • Synthesize agent findings with manual code path analysis.
    • Identify reusable components and utilities from research.
    • Note integration patterns with existing systems.
    • Validate agent discoveries through code inspection.
  • Output Location โ€” DetermineOutputDir: Decide where to save artifacts for this workflow.
    • branch_name=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo unknown)
    • If user specifies target_dir/path โ†’ OUT_DIR={that value}
    • Else โ†’ OUT_DIR=docs/tasks/{branch_name}
    • mkdir -p "OUT_DIR/specs" && mkdir -p "OUT_DIR/clarifications"
  • Action โ€” SaveResearch: Save technical research to task context (if newly completed).
    • If research was just completed โ†’ update {OUT_DIR}/task_context.md with a "## Technical Research" section summarizing architecture patterns, dependencies, similar features found, and integration requirements.
    • Else โ†’ skip (existing research already in context).

Step (2/4) - Technical Clarifications

Dynamically generate up to 10 technical questions based on research findings. IMPORTANT: Only ask questions genuinely not answered in the PRD or discoverable through code investigation. Goal: eliminate scope and design ambiguity. If a question involves choosing between approaches, present options with Pros/Cons/Trade-offs.

  • Action โ€” LightModeClarifications: If ARGUMENTS contains --depth light, do NOT stop for user clarifications. Use conservative, codebase-consistent defaults and record them in the plan's Filled Assumptions section, then skip to Step 3. If an unresolved question would affect canonical scope, security/privacy, data correctness, or public API behavior, return control to plan with a tier reassessment recommendation instead of guessing.

  • Action โ€” DetectClarificationMethod: Check if AskUserQuestion tool is available.

    • If available โ†’ use inline clarification flow (Path A).
    • If not available โ†’ use file-based clarification flow (Path B).

Path A: Inline Clarifications (AskUserQuestion available)

  • Action โ€” AskInline: Present questions directly using AskUserQuestion.
    • Ask the most critical questions (up to 4 at a time, the tool limit).
    • For approach decisions, present options as choices.
    • If more than 4 questions, ask in batches โ€” most important first.
    • Use responses (and intelligent defaults for any skipped) to proceed.

Path B: File-Based Clarifications (no AskUserQuestion)

  • Action โ€” GenerateClarifications: Create targeted technical questions document.
    • Create directory if missing: {OUT_DIR}/clarifications/
    • Create file: {OUT_DIR}/clarifications/plan_clarifications_{YYYY-MM-DD_HHMMSS}.md
    • Format each question with <response></response> blocks for user answers.
    • For approach decisions, list options inline with Pros/Cons/Trade-offs/Impact.
  • Action โ€” RequestUserInput: Direct user to answer clarifications.
    • Message: "I saved technical clarifications here: {clarifications_file_path}. Please add answers inside <response></response> blocks. Leave blocks empty for me to proceed with intelligent assumptions. When ready, reply 'Read it'."
    • Render ACTION REQUIRED footer (see Next Steps section for format).
  • Wait โ€” User replies "Read it" after updating clarifications document.
  • Action โ€” ReadClarifications: Re-open clarifications file from disk.
    • If user provides path โ†’ use it.
    • Else โ†’ open most recent {OUT_DIR}/clarifications/plan_clarifications_*.md.
    • Read entire file; use responses when provided; proceed with assumptions if empty.

Step (3/4) - Create Implementation Plan

  • Action โ€” DetermineDepth: Read --depth from ARGUMENTS

    • Default: standard if not specified
    • Options: light, standard, comprehensive
  • Action โ€” DetectOrchestratedMode: If ARGUMENTS contains --no-review, this workflow is being invoked by plan as part of the meta-flow. Generate and save the plan, then return control to plan without asking for standalone user review.

  • Action โ€” DesignTechnicalApproach: Create the implementation plan.

    Every plan, regardless of depth, MUST include the verification spine. LIGHT is concise, not shallow: keep it brief and decisive, but still explain the solution shape, codebase pattern to follow, risks/assumptions, and how the work will be verified.

    Required for LIGHT, STANDARD, and COMPREHENSIVE:

    1. Overview โ€” 1โ€“2 paragraphs: what problem, what shape the solution takes, why this approach.
    2. Technical Approach โ€” How the change actually lands: components touched, data flow, key decisions with rationale. Reference existing patterns from @patterns research by file:line (e.g., "follow the shape of src/widgets/HotDogWidget.ts:42 for the registration step").
    3. Critical Files for Implementation โ€” 1โ€“7 specific files from research. Format: path/to/file.ts โ€” reason (Core logic to modify / Pattern to follow / Interface to implement / Test to extend). No guesses โ€” only files surfaced during Step 1 research.
    4. External Dependencies โ€” Verify Before Implementation โ€” Every third-party package required, with exact version and a one-line existence check. Format: package@1.2.3 โ€” verify: npm view package@1.2.3 (or pip equivalent). Required even if "no new packages" (write that explicitly). This is the slopsquatting fence: ~20% of AI-suggested packages don't exist; we catch that here, not in production.
    5. Verification โ€” How We Know This Works โ€” For each major change in Technical Approach, 1โ€“3 falsifiable signals: a test name, an observable behavior, or a state/file condition. Prose like "the feature works" is not acceptable โ€” it must be checkable. Format: <change> โ†’ verifies by: <test name | observable behavior | state condition>. These become acceptance criteria in create_tasks downstream.
    6. Out-of-Bounds โ€” DO NOT add โ€” 4โ€“8 concrete things the implementation must NOT add, even if "best practice." Examples: rate limiting, retry/backoff, caching layer, optimistic UI, soft-delete, telemetry events, feature flags, admin UI. This is the YAGNI fence against familiar-shape bias (agents reproduce mature-system patterns unprompted). Be specific to this feature, not generic.
    7. Risks & Filled Assumptions โ€” Two short subsections:
      • Risks: what could go wrong (e.g., concurrent write race, migration ordering, third-party rate limit). Each with a one-line mitigation or "accept and monitor."
      • Filled Assumptions: things the plan defaulted because the spec didn't say (e.g., "Assumed Postgres; spec didn't specify DB." "Assumed retry count = 0; spec didn't mention failure modes."). Reviewer-visible by design โ€” these are the silent decisions that bite at execution.

    LIGHT constraints:

    • Keep the seven required sections compact: usually 1 short paragraph or 3โ€“5 bullets per section.
    • Prefer one clear implementation path that follows existing codebase patterns; do not enumerate broad alternatives.
    • Do not add standalone clarification gates, review gates, plan_review, or expanded architecture sections.
    • If the plan needs more than 3 critical files, a new abstraction, data migration, public API change, or unresolved scope/security/data correctness decision, stop and return a tier reassessment recommendation to plan.

    COMPREHENSIVE additionally requires: 8. Current State โ€” How the affected code path works today, with file:line refs. Anchored to research findings. 9. Implementation Phases โ€” Ordered phases, each with its own Verification subsection (Phase N succeeds when โ€ฆ). Phases must be sequenced by dependency, not by file. Migration phases come before consumer phases. 10. Component / Data Architecture โ€” Where data is created, mutated, and read. Schema deltas if any. 11. API Design โ€” Endpoint signatures, request/response shapes, error contracts. Required if any external or internal API surface changes. 12. Migration Plan โ€” Required if any data-layer change. Up + down migration sketch, backfill strategy, rollback plan. 13. Testing Strategy โ€” What test types cover what (unit / integration / e2e), where new tests live, what's deferred to the post-feature coverage task.

    Use your judgment on section length, not on inclusion. If a required section is genuinely N/A for this feature, write the section header followed by "N/A โ€” ". Empty section headers are not acceptable; absent section headers are not acceptable.

  • Action โ€” DocumentPlan: Save to {OUT_DIR}/specs/plan.md (use scoped name if exists)

  • Action โ€” RequestReview:

    • If --no-review is present:

      "Draft implementation plan saved to {path}. Returning to plan for the next routed step."

      Do NOT wait for user approval. Return control to the invoking plan workflow.

    • Else:

      "Implementation plan saved to {path}. Review and reply with feedback or 'Approved' to proceed."

  • Wait โ€” User provides feedback or approval, unless --no-review is present.

Step (4/4) - Finalize and Present Next Steps

  • Action โ€” ConfirmCompletion:

    • If --no-review is present:

      "Draft implementation plan saved to {plan_path}. Returning to plan."

      Stop here. Do not render the standalone Next Steps footer.

    "๐ŸŽฏ Implementation Planning Complete. Documents: {plan_path}, task_context.md"

  • Action โ€” RenderFooter: Use Skill(spectre-guide) skill for Next Steps footer

Install via CLI
npx skills add https://github.com/Codename-Inc/spectre --skill spectre-create-plan
Repository Details
star Stars 142
call_split Forks 15
navigation Branch main
article Path SKILL.md
More from Creator
Codename-Inc
Codename-Inc Explore all skills →