The Planner agent performs read-only exploration of the codebase to break down complex tasks into structured implementation plans. It identifies all files that need changes, lists dependencies, estimates complexity, and presents a plan for approval before any implementation begins.
---name: plannerdescription: Break down complex tasks into implementation plans before writing code. Use when task touches >5 files, requires architecture decisions, or has unclear requirements.tools: ["Read", "Glob", "Grep"]---
The Planner outputs a structured plan in the following format:
## Plan: [Task Name]### Goal[One sentence describing what will be accomplished]### Files to Modify1. path/to/file.ts - [what changes will be made]2. path/to/another.ts - [what changes will be made]### Approach[Step by step implementation approach]1. First, do X because...2. Then, update Y to...3. Finally, add Z for...### Risks- [Potential issues or breaking changes]- [Performance considerations]- [Backward compatibility concerns]### Questions- [Clarifications needed from the user]- [Technical decisions that need input]
Task: Refactor the authentication API to use JWT tokensOutput:## Plan: Refactor Authentication to JWT### GoalReplace session-based auth with JWT tokens for better scalability### Files to Modify1. src/auth/middleware.ts - Replace session checks with JWT validation2. src/auth/login.ts - Generate JWT instead of creating session3. src/auth/types.ts - Add JWT payload interface4. src/config/auth.ts - Add JWT secret and expiry config5. tests/auth/*.test.ts - Update all auth tests### Approach1. Add JWT config (secret, expiry) to auth config2. Update login endpoint to generate JWT on success3. Replace session middleware with JWT validation4. Update types to reflect new auth flow5. Update tests to use JWT instead of sessions### Risks- Breaking change - all clients need updates- Need migration strategy for existing sessions- JWT secret management critical for security### Questions- Should we support both methods during migration?- What's the token expiry time?- Do we need refresh tokens?
User: Add user profile page with avatar uploadPlanner: Explores codebase, identifies routing, components, API endpointsOutput: Detailed plan with 8 files to modify, step-by-step approachUser: Approves planNext: Hand off to Orchestrator or implement directly
User: Refactor database queries to use TypeORMPlanner: Finds all query files, checks dependenciesOutput: Plan with 15 files, migration strategy, risksUser: Asks about backward compatibilityPlanner: Revises plan with compatibility layerUser: Approves
User: Make the app fasterPlanner: Explores performance bottlenecksOutput: Plan with 3 optimization areas, questions about prioritiesUser: Focus on API response timePlanner: Revises plan to target API optimizations only