plan
The `/plan` command invokes a planner agent to generate a structured implementation plan before coding begins. Use it when starting new features, making significant architectural changes, tackling complex refactoring, affecting multiple files, or when requirements are unclear, as it restates requirements, identifies risks, breaks work into phases, and requires explicit user confirmation before proceeding.
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/sangrokjung/claude-forge/HEAD/commands/plan.md -o ~/.claude/commands/plan.mdplan.md
# Plan Command This command invokes the **planner** agent to create a comprehensive implementation plan before writing any code. ## What This Command Does 1. **Restate Requirements** - Clarify what needs to be built 2. **Identify Risks** - Surface potential issues and blockers 3. **Create Step Plan** - Break down implementation into phases 4. **Wait for Confirmation** - MUST receive user approval before proceeding ## When to Use Use `/plan` when: - Starting a new feature - Making significant architectural changes - Working on complex refactoring - Multiple files/components will be affected - Requirements are unclear or ambiguous ## How It Works The planner agent will: 1. **Analyze the request** and restate requirements in clear terms 2. **Break down into phases** with specific, actionable steps 3. **Identify dependencies** between components 4. **Assess risks** and potential blockers 5. **Estimate complexity** (High/Medium/Low) 6. **Present the plan** and WAIT for your explicit confirmation ## Example Usage ``` User: /plan I need to add real-time notifications when markets resolve Agent (planner): # Implementation Plan: Real-Time Market Resolution Notifications ## Requirements Restatement - Send notifications to users when markets they're watching resolve - Support multiple notification channels (in-app, email, webhook) - Ensure notifications are delivered reliably - Include market outcome and user's position result ## Implementation Phases ### Phase 1: Database Schema - Add notifications table with columns: id, user_id, market_id, type, status, created_at - Add user_notification_preferences table for channel preferences - Create indexes on user_id and market_id for performance ### Phase 2: Notification Service - Create notification service in lib/notifications.ts - Implement notification queue using BullMQ/Redis - Add retry logic for failed deliveries - Create notification templates ### Phase 3: Integration Points - Hook into market resolution logic (when status changes to "resolved") - Query all users with positions in market - Enqueue notifications for each user ### Phase 4: Frontend Components - Create NotificationBell component in header - Add NotificationList modal - Implement real-time updates via Supabase subscriptions - Add notification preferences page ## Dependencies - Redis (for queue) - Email service (SendGrid/Resend) - Supabase real-time subscriptions ## Risks - HIGH: Email deliverability (SPF/DKIM required) - MEDIUM: Performance with 1000+ users per market - MEDIUM: Notification spam if markets resolve frequently - LOW: Real-time subscription overhead ## Estimated Complexity: MEDIUM - Backend: 4-6 hours - Frontend: 3-4 hours - Testing: 2-3 hours - Total: 9-13 hours **WAITING FOR CONFIRMATION**: Proceed with this plan? (yes/no/modify) ``` ## Important Notes **CRITICAL**: The planner agent will **NOT** write any code until you explicitly confirm the plan with "yes" or "proceed" or similar affirmative response. If you want changes, respond with: - "modify: [your changes]" - "different approach: [alternative]" - "skip phase 2 and do phase 3 first" ## Integration with Other Commands After planning: - Use `/tdd` to implement with test-driven development - Use `/build-and-fix` if build errors occur - Use `/code-review` to review completed implementation ## Related Agents This command invokes the `planner` agent located at: `~/.claude/agents/planner.md` --- ## 후처리: 계획 저장 사용자가 계획을 확인하면, 확정된 계획을 `prompt_plan.md`에 저장한다: 1. 프로젝트 루트의 `prompt_plan.md`에 계획 내용을 기록 2. 기존 `prompt_plan.md`가 있으면 이전 내용을 "## 이전 계획" 섹션으로 아카이브 후 덮어쓰기 3. 저장 후 안내: "계획이 prompt_plan.md에 저장되었습니다." 이렇게 하면 다음 세션에서 `/sync`로 계획을 불러올 수 있다. ## 다음 단계 | 계획이 확정되면 | 커맨드 | |:---------------|:-------| | 테스트하면서 구현 | `/tdd` | | 한 번에 자동 실행 | `/auto` | | 문서 동기화 | `/sync` (다른 세션에서 이어서 작업 시) |
Software architecture specialist for system design, scalability, and technical decision-making. Use PROACTIVELY when planning new features, refactoring large systems, or making architectural decisions.
Build and TypeScript error resolution specialist. Use PROACTIVELY when build fails or type errors occur. Fixes build/type errors only with minimal diffs, no architectural edits. Focuses on getting the build green quickly.
Expert code review specialist. Proactively reviews code for quality, security, and maintainability. Use immediately after writing or modifying code. MUST BE USED for all code changes.
PostgreSQL database specialist for query optimization, schema design, security, and performance. Use PROACTIVELY when writing SQL, creating migrations, designing schemas, or troubleshooting database performance. Incorporates Supabase best practices.
Documentation and codemap specialist. Use PROACTIVELY for updating codemaps and documentation. Runs /update-codemaps and /update-docs, generates docs/CODEMAPS/*, updates READMEs and guides.
End-to-end testing specialist using Vercel Agent Browser (preferred) with Playwright fallback. Use PROACTIVELY for generating, maintaining, and running E2E tests. Manages test journeys, quarantines flaky tests, uploads artifacts (screenshots, videos, traces), and ensures critical user flows work.
Expert planning specialist for complex features and refactoring. Use PROACTIVELY when users request feature implementation, architectural changes, or complex refactoring. Automatically activated for planning tasks.
Dead code cleanup and consolidation specialist. Use PROACTIVELY for removing unused code, duplicates, and refactoring. Runs analysis tools (knip, depcheck, ts-prune) to identify dead code and safely removes it.