agentleFS
BhavinMBhavinM/my-claude-setup/.claude/skills/create-plan/SKILL.md

create-plan

Skill0 starsChanged 10 months agoMITView on GitHub

Create complete implementation plans with phases for new features or projects. Use when starting a new feature, planning a refactor, or designing a system ('create a plan', 'plan this feature', 'design the phases for...', 'plan the implementation'). Do NOT use for implementing code (use /implement), reviewing existing plans (use /review-plan), or quick single-file changes.

26 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use codebase-migrate, email-draft-polish and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • composio-communitySkill

    codebase-migrate

    Run large codebase migrations and multi-file refactors. Uses the Composio CLI to coordinate issue tracking, batched PRs, and CI verification while the agent executes the transforms locally across hundreds of files.

    Also in 3 projects that use this

  • composio-communitySkill

    email-draft-polish

    Draft, rewrite, or condense emails with target tone, length, and audience; use for cold outreach, replies, status updates, or escalations where clarity and brevity matter.

    Also in 3 projects that use this

  • jesgarramSkill

    implement-plan

    Convert a plan document into Claude Code tasks with dependencies. Pure parser that reads plans from context/plans/ and creates executable task workflows.

    Also in 8 projects that use this

  • mhylleSkill

    iterate-plan

    Update existing implementation plans through user feedback with thorough research and validation. Also migrates old checkbox-based plans to the new Task tools system. This skill should be used when iterating on implementation plans, updating plans based on new requirements, refining technical approaches in existing plans, migrating old plans to Task tools, or when the user wants to modify a previously created plan file. Triggers on requests like "update the plan", "change the implementation approach", "iterate on this plan", "migrate to new system", or when feedback is provided about an existing plan document.

    Also in 3 projects that use this

  • shawn-dumasSkill

    validate-plan

    Validate an orchestration plan after pre-flight certification. Runs adversarial review, deep review (verify prompt data against codebase), and PoC gate for risky approaches. Auto-invoked by orchestrate-* skills at Step 8.

    Also in 3 projects that use this

  • joshuaalpuertoSkill

    research-codebase

    Conducts structured research across a codebase to answer questions about architecture, components, and data flow. Use when investigating how code works, where functionality lives, or how systems interact. Decomposes questions, runs parallel investigations, synthesizes findings with file:line references, and produces persistent research documents.

    Also in 3 projects that use this

  • +3 more from composio-community

The file

Show its rules and text

We split this skill into the rules it gives an agent

24 rules. 0 are common, 13 are distinctive, and 11 are very specific to this project.

  • 0

    Common

    Most of the 24 edited versions we read keep these.

  • 13

    Distinctive

    This author's own choices. Worth a look.

  • 11

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create a complete plan with phases for: $ARGUMENTS

    line 17
  2. Very specific:

    Read the task description above.

    line 38
  3. Distinctive:

    If the description says "add voice commands" but doesn't specify which commands, ASK.

    line 49
  4. Distinctive:

    Read both templates completely:

    line 55
  5. Distinctive:

    Every section in these templates is required.

    line 59
  6. Very specific:

    Before creating tasks, run TaskList to check if tasks already exist from a previous session or before a compact.

    line 79
  7. Very specific:

    Read existing tasks with TaskGet for each task ID

    line 80
  8. Distinctive:

    If no tasks exist, create them now.

    line 84
  9. Very specific:

    Write plans/{folder}/plan.md with ALL sections from the template:

    line 101
  10. Distinctive:

    Before creating phase files, plan the full decomposition.

    line 119
  11. Very specific:

    If the feature involves React components, Next.js pages, or UI work, invoke this skill BEFORE designing phases:

    line 123
  12. Very specific:

    Use it.todo('description') for TDD stubs

    line 147
  13. Very specific:

    Use vi.hoisted() for mock variables needed before module evaluation

    line 148
  14. Very specific:

    Import paths: import 'server-only', @/ path alias for project root

    line 183
  15. Distinctive:

    Keep these patterns in mind for every code block you write in phase files.

    line 188
  16. Distinctive:

    Write the complete phase file following PHASE-TEMPLATE.md exactly.

    line 204
  17. Very specific:

    After creating each phase file, run these validators to catch issues immediately (before review agents get involved).

    line 254
  18. Distinctive:

    If any validator exits non-zero, fix the issue before moving to the next phase.

    line 270
  19. Distinctive:

    After reviews and audit complete, provide the user with:

    line 302
  20. Distinctive:

    If you notice context was compacted or you're unsure of current progress:

    line 318
  21. Very specific:

    Run TaskList to see all tasks and their status

    line 320
  22. Very specific:

    Run TaskGet {id} on that task to read full details

    line 322
  23. Distinctive:

    Fix: Follow Task List pattern in Step 4 — mark tasks complete as you go.

    line 340
  24. Distinctive:

    Fix: Use the exact prompt templates from Delegation Guide.

    line 356

“Common” is measured: kept by at least 6 in 10 of the 24 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Create Complete Plan

Create a complete plan with phases for: $ARGUMENTS

Current Plans

Existing plans in the repository (avoid naming conflicts):

!ls plans/ 2>/dev/null || echo "(no plans directory yet)"

Workflow Overview

This skill creates a full planning package:

  1. Folder structure with date-prefixed naming
  2. plan.md with all sections (phases added iteratively)
  3. Reference reading from actual codebase for pattern accuracy
  4. Phase files created one at a time with correct code patterns
  5. Review via sub-agents for template + codebase compliance

Step 1: Clarify Requirements

The user has experienced 20-phase plans built on wrong assumptions — hours of work discarded because a 30-second question wasn't asked upfront. Clarification prevents this waste.

Read the task description above. If anything is ambiguous or underspecified, use AskUserQuestion to clarify before proceeding.

Questions to ask if not clear from the description:

  1. Problem: What specific problem are we solving? What pain point does this address?
  2. Scope: Is this a small feature, medium enhancement, or major system?
  3. Users: Who uses this feature? (specific roles, account types)
  4. Integrations: Does this connect to external services or APIs?
  5. Data: What data does this create, read, update, or delete?
  6. UI: Where does this appear in the app? New page, existing page, component?

If the description says "add voice commands" but doesn't specify which commands, ASK. If it says "improve performance" but doesn't specify what's slow, ASK. The user prefers a brief clarification dialogue over assumptions that lead to rework.

Step 2: Read Templates

The user created these templates specifically so phases don't miss required sections. Skipping template reading causes incomplete phases that require rework during implementation.

Read both templates completely:

  • references/PLAN-TEMPLATE.md
  • references/PHASE-TEMPLATE.md

Every section in these templates is required.

Step 3: Create Folder Structure

Folder naming pattern: plans/{YYMMDD}-{feature-name}/

Examples:

  • plans/250202-voice-assistant/
  • plans/250202-notification-system/
  • plans/250202-api-refactor/

Create these items:

  1. Main folder: plans/{YYMMDD}-{feature-name}/
  2. Planning reviews folder: plans/{YYMMDD}-{feature-name}/reviews/planning/
  3. Code reviews folder: plans/{YYMMDD}-{feature-name}/reviews/code/

Step 4: Create Task List

Tasks survive context compacts — skipping this check causes duplicate tasks and lost progress.

Before creating tasks, run TaskList to check if tasks already exist from a previous session or before a compact. If tasks exist:

  1. Read existing tasks with TaskGet for each task ID
  2. Find the first task with status pending or in_progress
  3. Resume from that task — do NOT recreate the task list

If no tasks exist, create them now. The user depends on task tracking to prevent skipped sections.

Example task list:

Task 1: Create plan.md structure (all sections except Phase Table content)
Task 2: Read codebase references
Task 3: Design phase breakdown
Task 4: Create Phase 01 - [Title]
Task 5: Create Phase 02 - [Title]
[...continue for all phases...]
Task N: Review complete plan (delegate to review sub-agents)
Task N+1: Flow audit (3+ phases only — /audit-plan)

Step 5: Create plan.md (Without Phase Details)

Write plans/{folder}/plan.md with ALL sections from the template:

  1. YAML Frontmatter (title, status, priority, tags, dates)
  2. Executive Summary (Mission, Big Shift, Deliverables)
  3. Phasing Strategy (Phase Constraints, Phase File Naming)
  4. Phase Table — Header row only, no content rows yet
  5. Architectural North Star (patterns with Core Principle + Enforcement)
  6. Component Library Priority (check your UI library before building custom)
  7. Security Requirements (RLS, Input Validation, Authorization, Error Handling)
  8. Implementation Standards (Test Strategy, Documentation Standard)
  9. Success Metrics & Quality Gates
  10. Global Decision Log (ADRs)
  11. Resources & References

Complete ALL sections except Phase Table rows. Missing sections are caught during review (Step 9) but cost extra review cycles to fix.

Step 6: Design Phase Breakdown

Before creating phase files, plan the full decomposition.

Load Frontend Guidelines (If Applicable)

If the feature involves React components, Next.js pages, or UI work, invoke this skill BEFORE designing phases:

/vercel-react-best-practices

This loads 57 performance rules across 8 categories. Reference these when designing data fetching patterns, component architecture, and bundle optimization requirements.

Phase Constraints

Phases that exceed one context window cause Claude to lose earlier context mid-implementation, producing incomplete or inconsistent code. Each phase should be atomic enough for implementation in 1 context window (~15KB document, ~2-3 hour focused session).

30 small phases > 5 large phases

Wrong ApproachRight Approach
"Phase 01: Database + API + UI"Split into 3 phases
"Phase 02: Full Feature Implementation"Break into atomic steps
"Phase 03: Testing and Polish"TDD is Step 0 in EACH phase

TDD Note: Both backend and frontend code require full unit tests:

  • Backend (services, schemas, APIs): Unit tests in __tests__/{feature}/
  • Frontend (React/TSX): Component tests using happy-dom (default) and @testing-library/react
  • The default happy-dom environment works for component tests. Only add // @vitest-environment happy-dom if explicitly overriding another environment.
  • Use it.todo('description') for TDD stubs
  • Use vi.hoisted() for mock variables needed before module evaluation
  • For Supabase client mocks, add .then() method for thenable/awaitable pattern
  • Path aliases in tests: use your project's configured path alias (e.g., @/ or ~/)

Atomic phase examples:

  • Phase 01: Database Schema & RLS Policies
  • Phase 02: Service Layer Functions
  • Phase 03: Server Actions with Validation
  • Phase 04: List View Component
  • Phase 05: Create Form Component

The test: Can Claude implement this phase without running out of context? If unsure, split it.

Step 7: Read Codebase References

Code blocks written from memory often don't match the real codebase — this is the #1 source of phase quality issues. Reading actual files before writing phases ensures patterns are accurate.

Identify which file types the feature will need and read one reference for each:

Feature NeedsReference to Read
Server actionsGlob app/home/[account]/**/*server-actions*.ts → read one
Service layerGlob app/home/[account]/**/*service*.ts → read one
Zod schemasGlob app/home/[account]/**/*.schema.ts → read one
SQL migrations / RLSGlob supabase/migrations/*.sql → read a recent one
React componentsGlob app/home/[account]/**/_components/*.tsx → read one
Page filesGlob app/home/[account]/**/page.tsx → read one
TestsGlob __tests__/**/*.test.ts → read one

Key patterns to extract and use in phase code blocks:

  • Server action pattern: 'use server' + Zod parse + getSession() auth check
  • Account resolution: slug → ID via client.from('accounts').select('id').eq('slug', data.accountSlug).single()
  • Permission check: your RLS helper function (e.g., client.rpc('check_account_access', { ... }))
  • Supabase client: createClient() from @/lib/supabase/server
  • Service factory: createXxxService(client: SupabaseClient<Database>) wrapping a private class
  • Import paths: import 'server-only', @/ path alias for project root
  • File naming: _lib/schema/ (singular), server-actions.ts, exports ending in Action
  • TypeScript: consider enums or union types for constants, interface preferred for objects
  • After mutations: revalidatePath('/home/[account]/...')

Keep these patterns in mind for every code block you write in phase files. The review step (Step 9) will flag any code blocks that deviate from these codebase patterns.

Step 8: Create Phases (Iterative)

For EACH phase, in order:

8a: Add Row to Phase Table

Edit plan.md to add the phase row:

| **01** | [Title](./phase-01-slug.md) | [Focus] | Pending |

8b: Create Phase File

Write the complete phase file following PHASE-TEMPLATE.md exactly.

File: plans/{folder}/phase-{NN}-{slug}.md

Include skill in Frontmatter — without it, the implementer won't know which skill to invoke and will use generic patterns instead of project-specific ones.

Phase TypeSkill Value
Database schema, migrations, RLSpostgres-expert
Server actions, services, APIserver-action-builder
React forms with validationreact-form-builder
E2E testsplaywright-e2e
React components/pagesvercel-react-best-practices
UI/UX focused workweb-design-guidelines

Example frontmatter:

---
title: "Phase 01 - Database Schema"
skill: postgres-expert
status: pending
---

For phases spanning multiple concerns, list the primary skill or use comma-separated values:

skill: react-form-builder, vercel-react-best-practices

Required sections (from template):

  1. YAML Frontmatter (title, description, status, dependencies, tags, dates, skill)
  2. Overview (brief description, single-sentence Goal)
  3. Context & Workflow (How the Project Uses This, User Workflow, Problem Being Solved)
  4. Prerequisites & Clarifications (Questions for User with Context/Assumptions/Impact)
  5. Requirements (Functional + Technical)
  6. Decision Log (phase-specific ADRs)
  7. Implementation Steps — Step 0: TDD is first
  8. Verifiable Acceptance Criteria (Critical Path, Quality Gates, Integration)
  9. Quality Assurance (Manual Testing, Automated Testing, Performance Testing, Review Checklist)
  10. Dependencies (Upstream, Downstream, External)
  11. Completion Gate (Sign-off checklist)

Code blocks in phases should match codebase patterns from Step 7 — not memory, not generic examples. Generic code blocks cause the implementer to write code that doesn't follow project conventions, creating rework. If you don't remember the exact pattern, re-read the reference file from Step 7 before writing the code block.

8c: Update Task Status

Mark the phase task as completed, move to next phase.

8d: Validate Phase Quality

After creating each phase file, run these validators to catch issues immediately (before review agents get involved). Run them via Bash — they read from stdin but only need {"cwd": "."}:

# Check for skeleton/placeholder content (catches the Phase 17 lesson)
echo '{"cwd":"."}' | uv run $CLAUDE_PROJECT_DIR/.claude/hooks/validators/validate_no_placeholders.py \
  --directory plans/{folder} --extension .md

# Check TDD tasks appear before implementation tasks
echo '{"cwd":"."}' | uv run $CLAUDE_PROJECT_DIR/.claude/hooks/validators/validate_tdd_tasks.py \
  --directory plans/{folder} --extension .md

# Confirm the phase file was actually created
echo '{"cwd":"."}' | uv run $CLAUDE_PROJECT_DIR/.claude/hooks/validators/validate_new_file.py \
  --directory plans/{folder} --extension .md

If any validator exits non-zero, fix the issue before moving to the next phase. Placeholder content and missing TDD steps are the two most common causes of rework during implementation.

8e: Repeat

Continue until all phases are created.

Step 9: Review Complete Plan

Independent review agents catch template gaps and codebase compliance issues that self-review misses. The user depends on this step to prevent discovering problems during implementation when they're 10x more costly to fix.

Spawn one agent per file for thorough reviews. See Delegation Guide for:

  • Batching rules (max 4 concurrent agents to prevent context window blowout)
  • Agent prompt templates for plan.md and phase reviews
  • Anti-patterns to avoid when delegating
  • Batching examples for plans of different sizes

Step 10: Flow Audit (3+ Phases)

For plans with 3 or more phases, run a flow audit to catch structural issues that per-phase reviews cannot see — circular dependencies, missing dependency declarations, wrong phase ordering, and stale artifacts.

Skip this step for 1-2 phase plans (too small for flow issues).

/audit-plan plans/{YYMMDD}-{feature-name}

This invokes /audit-plan which writes a report to {plan-folder}/reviews/planning/flow-audit.md. The /implement orchestrator gate-checks this report before starting implementation — if the overall assessment is "Major Restructuring Needed", implementation blocks.

If the audit finds Critical/High issues: Fix them in the phase files before reporting the plan as ready. Re-run /audit-plan after fixes to confirm the issues are resolved.

Step 11: Report Summary

After reviews and audit complete, provide the user with:

  1. Folder location: plans/{YYMMDD}-{feature-name}/
  2. Files created:
    • plan.md
    • phase-01-.md through phase-NN-.md
    • reviews/planning/ folder with review files
  3. Review status:
    • Plan.md: template score (X/11)
    • Each phase: template score (X/12) + codebase score (N issues by severity)
    • Flow audit (3+ phases): overall assessment + Critical/High issue count
  4. Overall verdict: Ready/Not Ready for implementation
  5. Critical issues (if any) that need addressing before implementation

Resuming After Context Compact

If you notice context was compacted or you're unsure of current progress:

  1. Run TaskList to see all tasks and their status
  2. Find the in_progress task — that's where you were
  3. Run TaskGet {id} on that task to read full details
  4. Continue from that task — don't restart from the beginning

Tasks persist across compacts. The task list is your source of truth for progress, not your memory.

Pattern for every work session:

TaskList → find in_progress or first pending → TaskGet → continue work → TaskUpdate (completed) → next task

Troubleshooting

Context Window Overflow

Symptom: Agent loses track of phases mid-creation, produces incomplete or inconsistent output.

Cause: Too many phases being created without task tracking, or review agents spawned without batching.

Fix: Follow Task List pattern in Step 4 — mark tasks complete as you go. For reviews, batch agents in groups of 4 per the Delegation Guide.

Missing Template Sections

Symptom: Review agents flag missing sections in plan.md or phase files.

Cause: Template not read before writing, or sections skipped during creation.

Fix: Re-read the template (references/PLAN-TEMPLATE.md or references/PHASE-TEMPLATE.md) and add the missing sections. Each section exists because omitting it caused implementation problems.

Agent Delegation Failures

Symptom: Review agents skip the /review-plan skill invocation or produce superficial reviews.

Cause: Vague delegation prompts that don't specify the skill to invoke or what success looks like.

Fix: Use the exact prompt templates from Delegation Guide. Include both the imperative command AND explanation of what the review entails.

Patterns That Prevent User-Reported Failures

The user experienced each of these failures. Understanding the harm helps you avoid them:

Pattern to AvoidHarm When Ignored
Writing code blocks without reading codebasePhases contain wrong patterns, caught late during implementation
Large multi-concern phasesPhases exceed context window, work gets lost mid-implementation
Skipping template sectionsThe user created templates so requirements aren't re-explained each time
Assuming instead of askingWrong plan built on false premises, hours of wasted effort
Self-reviewing the planBlind spots missed; /review-plan catches template AND codebase deviations
Vague delegation promptsAgents misinterpret and skip skill invocation
Folder without date prefixFolders become unsorted chronologically
Skipping TaskList checkDuplicates tasks if resuming after context compact

Template Locations

  • Plan: references/PLAN-TEMPLATE.md
  • Phase: references/PHASE-TEMPLATE.md

These templates are auto-loaded into your context from the skill's references/ folder. Match them section-by-section.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.