| name | ezra-create-plan |
| description | [NOT APPLICABLE — Ezra-specific reference; do not invoke in this project] Create detailed implementation plans through interactive research and iteration |
Implementation Plan
You are tasked with creating detailed implementation plans through an interactive, iterative process. You should be skeptical, thorough, and work collaboratively with the user to produce high-quality technical specifications.
Initial Response
When this command is invoked:
-
Check if parameters were provided:
- If a file path or ticket reference was provided as a parameter, skip the default message
- Immediately read any provided files FULLY
- Begin the research process
-
If no parameters provided, respond with:
I'll help you create a detailed implementation plan. Let me start by understanding what we're building.
Please provide:
1. The task/ticket description (or reference to a ticket file)
2. Any relevant context, constraints, or specific requirements
3. Links to related research or previous implementations
I'll analyze this information and work with you to create a comprehensive plan.
Tip: You can also invoke this command with a description directly: `/ezra-create-plan add user authentication`
For deeper analysis, try: `/ezra-create-plan think deeply about the excel extraction eval pipeline`
Then wait for the user's input.
Process Steps
Step 1: Context Gathering & Initial Analysis
-
Read all mentioned files immediately and FULLY:
- Ticket references or Linear ticket links
- Research documents
- Related implementation plans
- Any JSON/data files mentioned
- IMPORTANT: Use the Read tool WITHOUT limit/offset parameters to read entire files
- CRITICAL: DO NOT spawn sub-tasks before reading these files yourself in the main context
- NEVER read files partially - if a file is mentioned, read it completely
-
Spawn initial research tasks to gather context:
Before asking the user any questions, use specialized agents to research in parallel:
- Use the codebase-locator agent to find all files related to the ticket/task
- Use the codebase-analyzer agent to understand how the current implementation works
- If a Linear ticket is mentioned, use the linear-ticket-reader agent to get full details
These agents will:
- Find relevant source files, configs, and tests
- Identify the specific directories to focus on (e.g.,
app/ for frontend, temporal-worker/ for backend)
- Trace data flow and key functions
- Return detailed explanations with file:line references
-
Read all files identified by research tasks:
- After research tasks complete, read ALL files they identified as relevant
- Read them FULLY into the main context
- This ensures you have complete understanding before proceeding
-
Analyze and verify understanding:
- Cross-reference the ticket requirements with actual code
- Identify any discrepancies or misunderstandings
- Note assumptions that need verification
- Determine true scope based on codebase reality
-
Present informed understanding and focused questions:
Based on the ticket and my research of the codebase, I understand we need to [accurate summary].
I've found that:
- [Current implementation detail with file:line reference]
- [Relevant pattern or constraint discovered]
- [Potential complexity or edge case identified]
Questions that my research couldn't answer:
- [Specific technical question that requires human judgment]
- [Business logic clarification]
- [Design preference that affects implementation]
Only ask questions that you genuinely cannot answer through code investigation.
Step 2: Research & Discovery
After getting initial clarifications:
-
If the user corrects any misunderstanding:
- DO NOT just accept the correction
- Spawn new research tasks to verify the correct information
- Read the specific files/directories they mention
- Only proceed once you've verified the facts yourself
-
Create a research todo list using TodoWrite to track exploration tasks
-
Spawn parallel sub-tasks for comprehensive research:
- Create multiple Task agents to research different aspects concurrently
- Use the right agent for each type of research:
For deeper investigation:
- codebase-locator - To find more specific files (e.g., "find all files that handle [specific component]")
- codebase-analyzer - To understand implementation details (e.g., "analyze how [system] works")
- codebase-pattern-finder - To find similar features we can model after
For related tickets:
- linear-searcher - To find similar issues or past implementations
Each agent knows how to:
- Find the right files and code patterns
- Identify conventions and patterns to follow
- Look for integration points and dependencies
- Return specific file:line references
- Find tests and examples
-
Wait for ALL sub-tasks to complete before proceeding
-
Present findings and design options:
Based on my research, here's what I found:
**Current State:**
- [Key discovery about existing code]
- [Pattern or convention to follow]
**Design Options:**
1. [Option A] - [pros/cons]
2. [Option B] - [pros/cons]
**Open Questions:**
- [Technical uncertainty]
- [Design decision needed]
Which approach aligns best with your vision?
Step 3: Plan Structure Development
Once aligned on approach:
-
Create initial plan outline:
Here's my proposed plan structure:
## Overview
[1-2 sentence summary]
## Implementation Phases:
1. [Phase name] - [what it accomplishes]
2. [Phase name] - [what it accomplishes]
3. [Phase name] - [what it accomplishes]
Does this phasing make sense? Should I adjust the order or granularity?
-
Get feedback on structure before writing details
Step 4: Detailed Plan Writing
After structure approval:
- Write the plan to
docs/plans/<feature-slug>/plan.md
- Use kebab-case for the feature slug directory name
- See
docs/plans/README.md for conventions and the plans index
- Examples:
docs/plans/excel-extraction-eval/plan.md
docs/plans/auth-refactor/plan.md
- Use this template structure:
# [Feature/Task Name] Implementation Plan
## Overview
[Brief description of what we're implementing and why]
## Current State Analysis
[What exists now, what's missing, key constraints discovered]
## Desired End State
[A Specification of the desired end state after this plan is complete, and how to verify it]
### Key Discoveries:
- [Important finding with file:line reference]
- [Pattern to follow]
- [Constraint to work within]
## What We're NOT Doing
[Explicitly list out-of-scope items to prevent scope creep]
## Implementation Approach
[High-level strategy and reasoning]
## Phase 1: [Descriptive Name]
### Overview
[What this phase accomplishes]
### Changes Required:
#### 1. [Component/File Group]
**File**: `path/to/file.ext`
**Changes**: [Summary of changes]
```[language]
// Specific code to add/modify
```
### Success Criteria:
#### Automated Verification:
- [ ] Migration applies cleanly: `make migrate`
- [ ] Unit tests pass: `make test-component`
- [ ] Type checking passes: `npm run typecheck`
- [ ] Linting passes: `make lint`
- [ ] Integration tests pass: `make test-integration`
#### Manual Verification:
- [ ] Feature works as expected when tested via UI
- [ ] Performance is acceptable under load
- [ ] Edge case handling verified manually
- [ ] No regressions in related features
**Implementation Note**: After completing this phase and all automated verification passes, pause here for manual confirmation from the human that the manual testing was successful before proceeding to the next phase.
---
## Phase 2: [Descriptive Name]
[Similar structure with both automated and manual success criteria...]
---
## Testing Strategy
### Backend Test Planning (when applicable)
When the implementation plan includes new backend services, CRUD modules, business logic, or API endpoints:
1. **Spawn `pytest-test-planner` agent** for each new backend source file in the plan:
- Provide the planned file path and a description of its expected public interface (functions, classes, dependencies)
- The agent returns: test case table, factory requirements, mocking strategy, edge cases
- Example spawn:
```python
Task(
subagent_type="pytest-test-planner",
prompt=f"""Analyze the planned module at {source_file_path}.
Expected interface:
{description_of_functions_and_classes}
Package root: {package_root}
Create a test plan following the standard format.""",
description=f"Plan tests for {source_file_name}"
)
```
2. **Embed each test plan** in the plan's Testing Strategy section, grouped by source file
3. For each file, include the post-implementation generation command:
`/ezra-generate-backend-tests --plan <source-file>`
(The `--plan` flag tells the skill to skip planning since it was already done here)
Skip this step for:
- Config-only changes (pyproject.toml, Dockerfile, etc.)
- Migration-only changes
- Documentation changes
### Frontend Test Planning (when applicable)
When the implementation plan includes new frontend components, hooks, utilities, or pages:
1. **Spawn `vitest-test-planner` agent** for each new frontend source file:
- Provide source file path, expected exports/props
- Include the package root and package name (detected from the file path)
- The agent returns: tier classification, test cases, factory/MSW gaps
- Example spawn:
```python
Task(
subagent_type="vitest-test-planner",
prompt=f"""Create test plan for {source_file_path}.
Package root: {package_root}
Package name: {pkg_name}
Expected interface:
{description_of_exports_and_props}
Create a test plan following the standard format.""",
description=f"Plan frontend tests for {source_file_name}"
)
```
2. **Embed each test plan** in the Testing Strategy section, grouped by package
3. Include post-implementation command:
`/ezra-generate-frontend-tests <source-file>`
Skip for:
- Style-only changes (CSS, Tailwind)
- Config changes (next.config, tsconfig)
- Documentation changes
### E2E Test Planning (when applicable)
When the implementation plan includes new user-facing features, pages, or critical flows:
1. **Identify E2E-worthy flows**: Plan E2E tests for:
- New pages or routes with real backend interaction
- Critical business flows (CRUD operations, multi-step forms)
- Features involving multiple services (frontend + backend API)
Skip E2E for:
- Pure UI changes (covered by Vitest integration tests)
- Backend-only changes (covered by pytest)
- Config/infra changes
2. **Write E2E spec in the plan** per flow:
```markdown
#### E2E Spec: [Flow Name]
**App**: app | example
**File**: `frontend/apps/{app}/tests/e2e/specs/[feature].spec.ts`
**POM**: `frontend/apps/{app}/tests/e2e/poms/[feature].page.ts`
**Seed Data (via Playwright fixtures):**
- Create [entity] via `POST {api-url}/api/[endpoint]` with `{ field: "value" }`
- Cleanup: `DELETE {api-url}/api/[endpoint]/{id}` (CI: ephemeral DB, no cleanup needed)
**Test Cases:**
| # | Test Name | Steps | Expected |
|---|-----------|-------|----------|
| 1 | loads page | Navigate to /feature | Heading visible |
| 2 | creates item | Fill form, submit | Success message |
```
3. Include post-implementation command:
`/ezra-generate-e2e-tests --app {app} [spec-name]`
### Manual Testing Steps:
1. [Specific step to verify feature]
2. [Another verification step]
3. [Edge case to test manually]
## Performance Considerations
[Any performance implications or optimizations needed]
## Migration Notes
[If applicable, how to handle existing data/systems]
## References
- Original ticket: [Link to Linear ticket or reference]
- Related research: `docs/research/[relevant].md` or `docs/spikes/[relevant].md`
- Similar implementation: `[file:line]`
Step 5: Sync and Review
-
Update the plans index:
- Add an entry to the table in
docs/plans/README.md
-
Present the draft plan location:
I've created the initial implementation plan at:
`docs/plans/<feature-slug>/plan.md`
Please review it and let me know:
- Are the phases properly scoped?
- Are the success criteria specific enough?
- Any technical details that need adjustment?
- Missing edge cases or considerations?
-
Iterate based on feedback - be ready to:
- Add missing phases
- Adjust technical approach
- Clarify success criteria (both automated and manual)
- Add/remove scope items
-
Continue refining until the user is satisfied
Important Guidelines
-
Be Skeptical:
- Question vague requirements
- Identify potential issues early
- Ask "why" and "what about"
- Don't assume - verify with code
-
Be Interactive:
- Don't write the full plan in one shot
- Get buy-in at each major step
- Allow course corrections
- Work collaboratively
-
Be Thorough:
- Read all context files COMPLETELY before planning
- Research actual code patterns using parallel sub-tasks
- Include specific file paths and line numbers
- Write measurable success criteria with clear automated vs manual distinction
- automated steps should use
make whenever possible
-
Be Practical:
- Focus on incremental, testable changes
- Consider migration and rollback
- Think about edge cases
- Include "what we're NOT doing"
-
Track Progress:
- Use TodoWrite to track planning tasks
- Update todos as you complete research
- Mark planning tasks complete when done
-
No Open Questions in Final Plan:
- If you encounter open questions during planning, STOP
- Research or ask for clarification immediately
- Do NOT write the plan with unresolved questions
- The implementation plan must be complete and actionable
- Every decision must be made before finalizing the plan
-
Testing Strategy is MANDATORY:
- Every plan that adds or modifies source files MUST include a
## Testing Strategy section
- For backend source files: spawn
pytest-test-planner for each file and embed the test plan
- For frontend source files: spawn
vitest-test-planner for each file and embed the test plan
- Include the post-implementation command (e.g.,
/ezra-generate-backend-tests <source-files>)
- This applies even for thin/simple modules — no exceptions
- If the plan has no Testing Strategy section, do NOT present it for approval
- Only skip for config-only, migration-only, or documentation-only changes
Success Criteria Guidelines
Always separate success criteria into two categories:
-
Automated Verification (can be run by execution agents):
- Commands that can be run:
make test, npm run lint, etc.
- Specific files that should exist
- Code compilation/type checking
- Automated test suites
-
Manual Verification (requires human testing):
- UI/UX functionality
- Performance under real conditions
- Edge cases that are hard to automate
- User acceptance criteria
Format example:
### Success Criteria:
#### Automated Verification:
- [ ] Database migration runs successfully: `make migrate`
- [ ] All unit tests pass: `go test ./...`
- [ ] No linting errors: `golangci-lint run`
- [ ] API endpoint returns 200: `curl localhost:8080/api/new-endpoint`
#### Manual Verification:
- [ ] New feature appears correctly in the UI
- [ ] Performance is acceptable with 1000+ items
- [ ] Error messages are user-friendly
- [ ] Feature works correctly on mobile devices
Common Patterns
For Database Changes:
- Start with schema/migration
- Add store methods
- Update business logic
- Expose via API
- Update clients
For New Features:
- Research existing patterns first
- Start with data model
- Build backend logic
- Add API endpoints
- Implement UI last
For Refactoring:
- Document current behavior
- Plan incremental changes
- Maintain backwards compatibility
- Include migration strategy
Sub-task Spawning Best Practices
When spawning research sub-tasks:
- Spawn multiple tasks in parallel for efficiency
- Each task should be focused on a specific area
- Provide detailed instructions including:
- Exactly what to search for
- Which directories to focus on
- What information to extract
- Expected output format
- Be EXTREMELY specific about directories:
- If the task involves frontend, specify
frontend/ directory
- If it involves backend, specify
backend/packages/ directory
- Include the full path context in your prompts
- Specify read-only tools to use
- Request specific file:line references in responses
- Wait for all tasks to complete before synthesizing
- Verify sub-task results:
- If a sub-task returns unexpected results, spawn follow-up tasks
- Cross-check findings against the actual codebase
- Don't accept results that seem incorrect
Example of spawning multiple tasks:
tasks = [
Task("Research database schema", db_research_prompt),
Task("Find API patterns", api_research_prompt),
Task("Investigate UI components", ui_research_prompt),
Task("Check test patterns", test_research_prompt)
]
Example Interaction Flow
User: /ezra-create-plan
Assistant: I'll help you create a detailed implementation plan...
User: We need to add a new extraction provider for OpenAI. See the eval pipeline plan.
Assistant: Let me read the plan and explore the existing providers first...
[Reads file fully]
Based on the ticket, I understand we need to track parent-child relationships for Claude sub-task events in the hld daemon. Before I start planning, I have some questions...
[Interactive process continues...]