[Planning] Use when the user provides an implementation plan file and asks to analyze it, assess impact, update specifications, or verify planned changes.
[Planning] Use when the user provides an implementation plan file and asks to analyze it, assess impact, update specifications, or verify planned changes.
Quick Summary
Goal: Analyze an implementation plan, assess its impact on the codebase, and update specification documents accordingly.
Analysis — Assess architecture impact, business logic changes, testing strategy
Approval Gate — Present findings for explicit user approval before any spec updates
Spec Update — Execute approved changes to specification documents
Key Rules:
Planning-only skill -- never implement code changes
Always collaborate and get user approval before proceeding
Maintain bidirectional traceability between plan and specification
Be skeptical. Apply critical thinking, sequential thinking. Every claim needs traced proof, confidence percentages (Idea should be more than 80%).
Implementation Plan Analysis & Specification Update
PLANNING-ONLY — Collaboration Required
DO NOT use the EnterPlanMode tool — you are ALREADY in a planning workflow.
DO NOT implement or execute any code changes.
COLLABORATE with the user: ask decision questions, present options with recommendations.
After plan analysis, validate findings with user approval.
user to confirm the analysis before any next steps.
ASK
You are to operate as an expert full-stack principal developer, software architect, and technical analyst to analyze a detailed implementation plan, perform comprehensive impact analysis, and update specification documents using the configured repository stack.
IMPORTANT: Always thinks hard, plan step by step to-do list first before execute. Always remember to-do list, never compact or summary it when memory context limit reach. Always preserve and carry your to-do list through every operation.
Prerequisites:
PHASE 1: EXTERNAL MEMORY-DRIVEN IMPLEMENTATION PLAN ANALYSIS
Build a structured knowledge model in .ai/workspace/analysis/[plan-name].analysis.md.
PHASE 1A: INITIALIZATION AND DISCOVERY
Initialize the analysis file with standard headings
IMPLEMENTATION PLAN COMPREHENSIVE ANALYSIS
IMPLEMENTATION_PLAN_DEEP_ANALYSIS: Thorough analysis of the implementation plan file:
Plan Structure Analysis:
Read and parse the implementation plan completely
Extract all planned features, requirements, and changes
Identify implementation phases and dependencies
Document under ## Implementation Plan Overview
Requirements Extraction:
Parse Knowledge Graph from implementation plan
Extract new business requirements
Map functional and non-functional requirements
Identify changed business workflows
Document under ## Extracted Requirements
Planned Changes Analysis:
Catalog all planned code changes (new files, modifications, deletions)
Identify affected components, services, and layers
Map file-level changes to business capabilities
Extract integration points
Document under ## Planned Changes Analysis
Architecture Impact Assessment:
Analyze how changes affect overall system architecture
Identify CQRS pattern impacts (new Commands/Queries/Events)
Map domain entity changes and repository patterns
Document under ## Architecture Impact Assessment
Existing Specification Analysis:
Read and analyze existing specification document structure
Identify current test cases, requirements, entity relationships
Map existing test coverage to planned changes
Document under ## Current Specification Analysis
AFFECTED_COMPONENTS_DISCOVERY: For each planned change, discover:
Plan-Driven Analysis: Base all analysis on the detailed implementation plan
Specification Structure Preservation: Maintain standardized specification format
Comprehensive Impact Assessment: Analyze direct and indirect effects
End-to-End Workflow Mapping: Understand affected business processes
Enterprise Architecture Awareness: Respect the project's architectural patterns
Quality-Focused Testing: Create comprehensive test specifications
Specification Completeness: Ensure full traceability
Risk Assessment and Mitigation: Identify risks and provide rollback strategies
Bidirectional Traceability: Maintain clear mapping between plan and spec
Coverage Preservation: Maintain existing test coverage while adding new
Related
plan
workflow-feature
MANDATORY FINAL TASKS: After creating all planning todo tasks, ALWAYS add these three final tasks:
Task: "Write test specifications for each phase" — Add ## Test Specifications with TC-{FEATURE}-{NNN} IDs to every phase file. Use /spec [mode=tests] if feature docs exist. Use Evidence: TBD for TDD-first mode.
Task: "Run /plan-validate" — Trigger /plan-validate skill to interview the user with critical questions and validate plan assumptions
Task: "Run /plan-review" — Trigger /plan-review skill to auto-review plan for validity, correctness, and best practices
REMINDER — Planning-Only Skill
DO NOT use EnterPlanMode tool.
DO NOT start implementing.
ALWAYS validate with user approval after analysis.
ASK user to confirm findings before any execution begins.
ASK user for clarification when multiple approaches exist.
[IMPORTANT] Use TaskCreate to break ALL work into small tasks BEFORE starting — including tasks for each file read. This prevents context loss from long files. For simple tasks, AI MUST ATTENTION ask user whether to skip.
Prerequisites:
docs/specs/ — Test specifications by module (read existing TCs to include test strategy in plan)
AI Mistake Prevention — Failure modes to avoid on every task:
Re-read files after context changes. Context compaction, resume, or long-running work can make memory stale; verify current files before acting.
Verify generated content against source evidence. AI hallucinates APIs, names, claims, and document facts. Check the relevant source before documenting or referencing.
Check downstream references before deleting or renaming. Removing an artifact can stale docs, generated mirrors, configs, and callers; map references first.
Trace the full impact chain after edits. Changing a definition can miss derived outputs and consumers. Follow the affected chain before declaring done.
Verify ALL affected outputs, not just the first. One green check is not all green checks; validate every output surface the change can affect.
Assume existing values are intentional — ask WHY before changing. Before changing a constant, limit, flag, wording, or pattern, read nearby context and history.
Surface ambiguity before acting — don't pick silently. Multiple valid interpretations require an explicit question or stated assumption with risk.
Keep shared guidance role-relevant. Universal guidance must help every receiving skill or agent; code-specific obligations belong only in code-specific protocols.
Understand Code First — HARD-GATE: Do NOT write, plan, or fix until you READ existing code.
Search 3+ similar patterns (grep/glob) — cite file:line evidence
Read existing files in target area — understand structure, base classes, conventions
Run python .claude/scripts/code_graph trace <file> --direction both --json when .code-graph/graph.db exists
Map dependencies via connections or callers_of — know what depends on your target
Write investigation to .ai/workspace/analysis/ for non-trivial tasks (3+ files)
Re-read analysis file before implementing — never work from memory alone. — why: long context drifts from the file; the file is ground truth
NEVER invent new patterns when existing ones work — match exactly or document deviation. — why: divergent patterns fragment the codebase and slow every future reader
Evidence-Based Reasoning — Speculation is FORBIDDEN. Every claim needs proof.
Cite file:line, grep results, or framework docs for EVERY claim
Declare confidence: >80% act freely, 60-80% verify first, <60% DO NOT recommend
Cross-service validation required for architectural changes
"I don't have enough evidence" is valid and expected output
BLOCKED until:- [ ] Evidence file path (file:line) - [ ] Grep search performed - [ ] 3+ similar patterns found - [ ] Confidence level stated
Forbidden without proof: "obviously", "I think", "should be", "probably", "this is because"
If incomplete → output: "Insufficient evidence. Verified: [...]. Not verified: [...]."
Nested Task Expansion Contract — For workflow-step invocation, the [Workflow] ... row is only a parent container; the child skill still creates visible phase tasks.
Call TaskList first. If a matching active parent workflow row exists, set nested=true and record parentTaskId; otherwise run standalone.
Create one task per declared phase before phase work. When nested, prefix subjects [N.M] $skill-name — phase.
When nested, link the parent with TaskUpdate(parentTaskId, addBlockedBy: [childIds]).
Orchestrators must pre-expand a child skill's phase list and link the workflow row before invoking that child skill or sub-agent.
Mark exactly one child in_progress before work and completed immediately after evidence is written.
Complete the parent only after all child tasks are completed or explicitly cancelled with reason.
Blocked until:TaskList done, child phases created, parent linked when nested, first child marked in_progress.
Project Reference Docs Gate — Run after task-tracking bootstrap and before target/source file reads, grep, edits, or analysis. Project docs override generic framework assumptions.
Identify scope: file types, domain area, and operation.
Read every required doc. If docs/project-config.json, the docs index, lessons.md, CLAUDE.md, AGENTS.md, or any task-required reference doc is missing or stale, auto-run /project-init or the narrow lower-level route (/project-config, /docs-init, /scan-all, /scan --target=<key>, /claude-md-init) before ordinary project-specific work. If Codex mirrors or AGENTS.md are missing/stale, ask the user to run /sync-codex; do not auto-run it.
Before target work, state: Reference docs read: ... | Not applicable: ....
Task Tracking & External Report Persistence — Bootstrap this before execution; then run project-reference doc prefetch before target/source work.
Create a small task breakdown before target file reads, grep, edits, or analysis. On context loss, inspect the current task list first.
Mark one task in_progress before work and completed immediately after evidence; never batch transitions.
For plan/review work, create plans/reports/{skill}-{YYMMDD}-{HHmm}-{slug}.md before first finding.
Append findings after each file/section/decision and synthesize from the report file at the end.
Final output cites Full report: plans/reports/{filename}.
Blocked until: task breakdown exists, report path declared for plan/review work, first finding persisted before the next finding.
Critical Thinking Mindset — Apply critical thinking, sequential thinking. Every claim needs traced proof, confidence >80% to act.
Anti-hallucination: Never present guess as fact — cite sources for every claim, admit uncertainty freely, self-check output for errors, cross-reference independently, stay skeptical of own confidence — certainty without evidence root of all hallucination.
Sequential Thinking Protocol — Structured multi-step reasoning for complex/ambiguous work. Use when planning, reviewing, debugging, or refining ideas where one-shot reasoning is unsafe.
Thought N/M: [aspect] — one aspect per thought, state assumptions/uncertainty
Thought N/M [REVISION of Thought K]: ... — when prior reasoning invalidated; state Original / Why revised / Impact
Thought N/M [BRANCH A from Thought K]: ... — explore alternative; converge with decision rationale
Thought N/M [HYPOTHESIS]: ... then [VERIFICATION]: ... — test before acting
Thought N/N [FINAL] — only when verified, all critical aspects addressed, confidence >80%
Mandatory closers: Confidence % stated · Assumptions listed · Open questions surfaced · Next action concrete.
Stop conditions: confidence <80% on any critical decision → escalate via AskUserQuestion · ≥3 revisions on same thought → re-frame the problem · branch count >3 → split into sub-task.
Implicit mode: apply methodology internally without visible markers when adding markers would clutter the response (routine work where reasoning aids accuracy).
Deep-dive: see /sequential-thinking skill (.claude/skills/sequential-thinking/SKILL.md) for worked examples (API design, debugging, architecture), advanced techniques (spiral refinement, hypothesis testing, convergence), and meta-strategies (uncertainty handling, revision cascades).
Plan Quality — Every plan phase MUST ATTENTION include test specifications.
Add ## Test Specifications section with TC-{FEATURE}-{NNN} IDs to every phase file
Map every functional requirement to ≥1 TC (or explicit TBD with rationale)
TC IDs follow TC-{FEATURE}-{NNN} format — reference by ID, never embed full content
Before any new workflow step: call TaskList and re-read the phase file
On context compaction: call TaskList FIRST — never create duplicate tasks
Verify TC satisfaction per phase before marking complete (evidence must be file:line, not TBD)
Mode: TDD-first → reference existing TCs with Evidence: TBD. Implement-first → use TBD → /spec [mode=tests] fills after.
Iterative Phase Quality — Score complexity BEFORE planning.
Complexity signals: >5 files +2, cross-service +3, new pattern +2, DB migration +2
Score >=6 → MUST ATTENTION decompose into phases. Each phase:
Start Phase N+1 only after Phase N passes VERIFY — why: building on an unverified phase compounds errors downstream
Phase success = all TCs pass + code-reviewer agent approves + no CRITICAL findings.
MANDATORY IMPORTANT MUST ATTENTION include ## Test Specifications with TC IDs per phase. Call TaskList before creating new tasks.
MANDATORY IMPORTANT MUST ATTENTION search 3+ existing patterns and read code BEFORE any modification. Run graph trace when graph.db exists.
MANDATORY IMPORTANT MUST ATTENTION cite file:line evidence for every claim. Confidence >80% to act, <60% = do NOT recommend.
MANDATORY IMPORTANT MUST ATTENTION score complexity first. Score >=6 → decompose. Each phase: plan → implement → review → fix → verify. No skipping.
MUST ATTENTION apply critical + sequential thinking — every claim needs appropriate traced evidence (file:line for repo/code claims; source URL or artifact section for research, product, content, and docs claims); confidence >80% to act, <60% DO NOT recommend. Anti-hallucination: never present guess as fact, admit uncertainty freely, cross-reference independently, stay skeptical of own confidence.
MUST ATTENTION apply sequential-thinking — multi-step Thought N/M, REVISION/BRANCH/HYPOTHESIS markers, confidence % closer; see /sequential-thinking skill.
MUST ATTENTION apply AI mistake prevention — verify generated content against evidence, trace downstream references before deleting or renaming, verify all affected outputs, re-read files after context loss, and surface ambiguity before acting.
MANDATORY Bootstrap task tracking before target work; transition one task at a time.
MANDATORY Persist plan/review findings to plans/reports/ incrementally and synthesize from disk.
MANDATORY After task-tracking bootstrap and before target/source work, read required project-reference docs and cite Reference docs read: ....
MANDATORY Always include lessons.md; project conventions override generic defaults.
MANDATORY If project config, root instruction files, or any required reference doc is missing or stale, auto-run /project-init or the narrow lower-level route before ordinary project-specific work.
MANDATORY Parent workflow rows do not replace child phase tracking; expand phases and link the parent when nested.
MANDATORY Orchestrators pre-expand child skill phases before invocation; use [N.M] $skill-name — phase prefixes and one-in_progress discipline.
Closing Reminders
IMPORTANT MUST ATTENTION — Protocols in force (concise digest of the SYNC/shared blocks this skill carries):
AI Mistake Prevention: verify generated content against evidence, trace downstream references, verify all affected outputs, re-read after context loss, surface ambiguity.
Understand Code First: read code and grep 3+ patterns before modifying.
Evidence: cite file:line; confidence >80% to act.
Nested Task Creation: expand child phases, link parent when nested.
Project Reference Docs: read required project docs before target work.