--- name: spec description: Creates a concise engineering implementation plan based on user requirements and saves it to specs directory argument-hint: "[user prompt]" --- # Plan Create a detailed implementation plan based on the user's requirements provided through the `USER_PROMPT` variable. Analyze the request, think through the implementation approach, and save a comprehensive specification document to `PLAN_OUTPUT_DIRECTORY/spec-.md` that can be used as a blueprint for actual development work. **The output filename MUST begin with the `spec-` prefix.** Follow the `Instructions` and work through the `Workflow` to create the plan. ## Variables USER_PROMPT: $1 PLAN_OUTPUT_DIRECTORY: `specs/` ## Instructions - IMPORTANT: If no `USER_PROMPT` is provided, stop and ask the user to provide it. - Carefully analyze the user's requirements provided in the USER_PROMPT variable - Determine the task type (chore|feature|refactor|fix|enhancement) and complexity (simple|medium|complex) - Think deeply (ultrathink) about the best approach to implement the requested functionality or solve the problem - Explore the codebase to understand existing patterns and architecture - Follow the Plan Format below to create a comprehensive implementation plan - Include all required sections and conditional sections based on task type and complexity - Generate a descriptive, kebab-case filename based on the main topic of the plan, **prefixed with `spec-`** (e.g. `spec-in-memory-ttl-lru-cache`) - Save the complete implementation plan to `PLAN_OUTPUT_DIRECTORY/spec-.md` - Ensure the plan is detailed enough that another developer could follow it to implement the solution - Include code examples or pseudo-code where appropriate to clarify complex concepts - Consider edge cases, error handling, and scalability concerns ## Workflow 1. Analyze Requirements - THINK HARD and parse the USER_PROMPT to understand the core problem and desired outcome 2. Explore Codebase - Understand existing patterns, architecture, and relevant files 3. Design Solution - Develop technical approach including architecture decisions and implementation strategy 4. Document Plan - Structure a comprehensive markdown document with problem statement, implementation steps, and testing approach 5. Generate Filename - Create a descriptive kebab-case filename based on the plan's main topic, **prefixed with `spec-`** 6. Save & Report - Follow the `Report` section to write the plan to `PLAN_OUTPUT_DIRECTORY/spec-.md` and provide a summary of key components ## Plan Format Follow this format when creating implementation plans: ```md # Plan: ## Task Description ## Objective ## Problem Statement ## Solution Approach ## Relevant Files Use these files to complete the task: ## Implementation Phases ### Phase 1: Foundation ### Phase 2: Core Implementation ### Phase 3: Integration & Polish ## Step by Step Tasks IMPORTANT: Execute every step in order, top to bottom. ### 1. - - ### 2. - - ## Testing Strategy ## Acceptance Criteria ## Validation Commands Execute these commands to validate the task is complete: - Example: `uv run python -m py_compile apps/*.py` - Test to ensure the code compiles ## Notes ``` ## Report After creating and saving the implementation plan, provide a concise report with the following format: ``` ✅ Implementation Plan Created File: PLAN_OUTPUT_DIRECTORY/spec-.md Topic: Key Components: -
-
-
```