plugins/spectre-codex/skills/plan/SKILL.md
👻 | Unified planning entry point - researches, assesses complexity, routes to workflow - primary agent
npx skillsauth add codename-inc/spectre planInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Treat the current command arguments as this workflow's input. When invoked from a slash command, use the forwarded $ARGUMENTS value.
<ARGUMENTS> $ARGUMENTS </ARGUMENTS>
⚠️ NON-NEGOTIABLE: This workflow MUST invoke nested workflows via the Skill tool. Failure to invoke
Skill(create_plan)andSkill(create_tasks)(Claude slash route:create_planandcreate_tasks) is a critical error. Do NOT summarize, describe, or skip these workflows. INVOKE THEM.
After ANY user conversation or questions:
You MUST call these skills (not describe them):
skill: "spectre-create_plan" and args: "{path} --depth {tier}" — generates plan.mdskill: "spectre-create_tasks" and args: "{path}" — generates tasks.mdtasks.md or plan.md — use scoped namesAction — DetermineOutputDir:
OUT_DIR=docs/tasks/{branch_name} (or user-specified)mkdir -p "${OUT_DIR}"Action — ScanExistingContext: Read all existing artifacts in {OUT_DIR}/ (if you haven't already) and assess coverage across 4 dimensions.
Scan for: task_context.md, specs/plan.md, concepts/scope.md, specs/ux.md, research/*.md
While scanning concepts/scope.md and specs/ux.md, extract any filled assumptions — places where the upstream artifact defaulted a value because the user didn't specify (e.g., DB choice, retry policy, copy variants, segment fallbacks). Carry these forward to Step 3's design surface so they're reviewer-visible before plan generation.
| Dimension | Covered if artifact contains... | Covered by |
| --- | --- | --- |
| File locations | Specific file paths relevant to this feature, entry points, config files | @finder |
| Code understanding | Data flow analysis, dependency tracing, how current code works with file:line refs | @analyst |
| Codebase patterns | Similar implementations found in codebase, reusable components, naming/style conventions | @patterns |
| External research | Best practices, libraries/frameworks, prior art, common pitfalls with source links | @web-research |
For each dimension, assess: covered (artifact has substantive findings for this feature) or gap (missing, superficial, or about a different feature).
Action — DispatchResearch: Spawn agents only for dimensions marked as gaps. Skip agents whose dimensions are already covered. Each prompt must include the feature/problem description from ARGUMENTS so the agent has full context.
If all 4 covered → skip to SaveResearch (merge existing findings into task_context.md if scattered across files)
If gaps exist → spawn only the needed agents in parallel:
@finder (if File locations = gap) — "Find all files, components, entry points, routes, and configuration related to [feature/problem]. Include: (1) files that would need to be modified or extended, (2) entry points where this feature connects to the system (routes, handlers, event listeners, CLI commands), (3) configuration files, schemas, or migrations that may be affected, (4) test files covering the affected areas. Return file paths organized by relevance."
@analyst (if Code understanding = gap) — "Analyze how the code paths related to [feature/problem] work end-to-end. Trace: (1) data flow from input through processing to storage and output, (2) key dependencies and how components interact, (3) state management patterns and data access methods in the affected areas, (4) error handling and edge cases in the current implementation. Return findings with specific file:line references."
@patterns (if Codebase patterns = gap) — "Find existing implementations in this codebase that are similar to [feature/problem] and could serve as a reference. Look for: (1) analogous features already built — how were they structured?, (2) reusable components, utilities, or abstractions we should leverage, (3) conventions for naming, file organization, and code style in this area, (4) testing patterns used for similar features. Return concrete code examples with file:line references."
@web-research (if External research = gap) — "Research best practices, proven patterns, relevant libraries/frameworks, and how other projects solve [feature/problem]. Focus on: (1) industry best practices and common pitfalls, (2) libraries or frameworks that simplify this work, (3) how well-known open-source projects approach similar problems, (4) architectural patterns recommended for this type of feature. Return findings with source links."
Wait for all dispatched agents; read identified files
Action — SaveResearch: Merge all findings (existing artifacts + new agent results) into {OUT_DIR}/task_context.md with sections: Architecture Patterns, Dependencies, Implementation Approaches, Impact Summary, and External Research (best practices, recommended libraries/frameworks, prior art, common pitfalls)
Use research findings from Step 1 to determine appropriate planning depth.
Action — AssessFromResearch: Score complexity signals from research:
| Signal | Source | Assessment | | --- | --- | --- | | Files impacted | @finder | 1-3 files = Low, 4-8 = Med, 9+ = High | | Pattern match | @patterns | Clear existing pattern = Low, Adapt pattern = Med, New pattern = High | | Components crossed | @analyst | 1 component = Low, 2-3 = Med, 4+ = High | | Data model changes | Research findings | None = Low, Modify existing = Med, New models/schema = High | | Integration points | Research findings | Internal only = Low, 1-2 external = Med, 3+ external = High | | External complexity | @web-research | Well-documented with libraries = Low, Some prior art = Med, Novel/emerging = High |
Action — CheckHardStops: Any true = automatic COMPREHENSIVE.
db_schema_destructive — drops, renames, or non-additive column changesdata_migration_required — backfill, transform, or row-by-row data changenew_service_or_component — net-new service, daemon, or top-level componentauth_or_pii_change — authn/authz flow, session handling, PII storage/exposuresecrets_or_credentials_handling — new secret introduced, rotation, or boundary changepayment_billing_logic — money flow, invoicing, charge logicpublic_api_change — externally-consumed API surface modifiedconcurrent_writes_or_locking — concurrency, locking, or distributed coordinationcaching_consistency — cache invalidation, staleness windows, multi-tier cachingcross_service_or_cross_workspace_change — coordinated change across services or workspacesslo_sla_risk — latency, throughput, or availability budget at stakeAction — DetermineTier (decisive rules, not point-scoring):
When in doubt between two tiers, choose the higher. The cost of over-planning a small change is hours; the cost of under-planning a large one is weeks.
Action — LogTier: Note the assessed tier in your response for transparency, then proceed immediately to the next step. Do NOT ask for confirmation.
CHECKPOINT: After determining tier, proceed IMMEDIATELY to the next step — Step 3 (High-Level Design) for STANDARD/COMPREHENSIVE, or Step 4 (Route) for LIGHT. Do NOT end turn here. Do NOT ask user to confirm the tier.
SKIP IF LIGHT — proceed directly to Step 4.
Goal: align on the shape of the solution before generating a full plan. This catches misalignments early and gives the user a chance to redirect before reading a long plan doc.
Action — PresentDesign: Synthesize research from Step 1 into a single proposed approach with open questions. Present inline (do not write a separate design file).
Format:
Here's the high-level design I'd take. Scan the shape, then resolve any open questions or push back on the approach.
Approach: [1-2 paragraph summary of the solution shape — what changes structurally, not file-by-file]
Key components touched:
path/file.ts— [what shifts and why]path/other.ts— [what shifts and why]Key decisions:
- [decision] — [rationale; alternative considered]
- [decision] — [rationale; alternative considered]
How we'll know it works (verification spine):
- [change] → [test name | observable behavior | state condition]
- [change] → [test name | observable behavior | state condition]
Filled assumptions (surfaced from scope.md / ux.md / inferred):
- [assumption] — source: [scope.md / ux.md / default]
- [assumption] — source: [scope.md / ux.md / default]
Open questions (with default assumption):
- [question] — default: [assumption]
- [question] — default: [assumption]
Reply with answers, edits to the approach, or 'looks good' to continue.
CRITICAL:
create_plan.create_plan and create_tasks build on.Action — IterateDesign: If the user replies with answers, edits, or pushback, update the design and re-present. Loop until user says 'looks good' (or equivalent).
Wait — User signals alignment.
Action — PersistDesign: Append a "Selected Design" section to {OUT_DIR}/task_context.md capturing the agreed approach, key decisions, and resolved questions. This is what create_plan consumes.
CHECKPOINT: After alignment, proceed IMMEDIATELY to Step 4. The ONLY valid next action is invoking a Skill.
┌────────────────────────────────────────────────────────────────────────┐
│ YOU MUST USE THE SKILL TOOL TO INVOKE THESE COMMANDS │
│ │
│ ❌ WRONG: "I'll now create the plan..." │
│ ❌ WRONG: "The next step would be to run create_plan" │
│ ❌ WRONG: Ending turn without invoking Skill tool │
│ │
│ ✅ CORRECT: Skill tool with skill: "spectre-create_plan", args: "..." │
│ ✅ CORRECT: Skill tool with skill: "spectre-create_tasks", args: "..."│
└────────────────────────────────────────────────────────────────────────┘
DO NOT:
YOU MUST:
skill: "spectre-create_plan", args: "{OUT_DIR}/task_context.md --depth {tier}"skill: "spectre-create_tasks", args: "{OUT_DIR}/task_context.md"If LIGHT:
skill: "spectre-create_tasks", args: "{OUT_DIR}/task_context.md --depth light"ElseIf STANDARD:
skill: "spectre-create_plan", args: "{OUT_DIR}/task_context.md --depth standard"skill: "spectre-create_tasks", args: "{OUT_DIR}/task_context.md"ElseIf COMPREHENSIVE:
skill: "spectre-create_plan", args: "{OUT_DIR}/task_context.md --depth comprehensive"skill: "spectre-create_tasks", args: "{OUT_DIR}/task_context.md"After tasks return, do a fast self-check against tier signals:
If an escalation/downgrade is triggered, surface it as a recommendation — do NOT silently re-run. Format:
Tier reassessment: I planned this as {original tier}, but tasks revealed {signal}. Recommend re-running as {new tier}. Reply 'rerun' to regenerate or 'keep' to proceed as-is.
Only proceed past this checkpoint when the user confirms.
Skill(spectre-guide) skill for Next Stepstesting
👻 | Independent multi-lens review of plan.md and/or tasks.md — finds overengineering, missing verification, hallucinated deps, weak references
data-ai
👻 | Unified planning entry point - researches, assesses complexity, routes to workflow - primary agent
data-ai
👻 | Transform requirements into executable tasks - primary agent
testing
👻 | Independent multi-lens review of plan.md and/or tasks.md — finds overengineering, missing verification, hallucinated deps, weak references