---
description: Visual process map for PLAN mode (Code Implementation)
globs: plan-mode-map.mdc
alwaysApply: false
---
# PLAN MODE: TASK PLANNING PROCESS MAP
> **TL;DR:** This visual map guides the PLAN mode process, focusing on creating detailed implementation plans based on the complexity level determined during initialization, with mandatory technology validation before implementation.
## 🧭 PLAN MODE PROCESS FLOW
```mermaid
graph TD
Start["START PLANNING"] --> ReadTasks["Read tasks.md
Core/task-tracking.md"]
%% Complexity Level Determination
ReadTasks --> CheckLevel{"Determine
Complexity Level"}
CheckLevel -->|"Level 2"| Level2["LEVEL 2 PLANNING
Level2/enhancement-planning.md"]
CheckLevel -->|"Level 3"| Level3["LEVEL 3 PLANNING
Level3/feature-planning.md"]
CheckLevel -->|"Level 4"| Level4["LEVEL 4 PLANNING
Level4/system-planning.md"]
%% Level 2 Planning
Level2 --> L2Review["Review Code
Structure"]
L2Review --> L2Document["Document
Planned Changes"]
L2Document --> L2Challenges["Identify
Challenges"]
L2Challenges --> L2Checklist["Create Task
Checklist"]
L2Checklist --> L2Update["Update tasks.md
with Plan"]
L2Update --> L2Tech["TECHNOLOGY
VALIDATION"]
L2Tech --> L2Verify["Verify Plan
Completeness"]
%% Level 3 Planning
Level3 --> L3Review["Review Codebase
Structure"]
L3Review --> L3Requirements["Document Detailed
Requirements"]
L3Requirements --> L3Components["Identify Affected
Components"]
L3Components --> L3Plan["Create Comprehensive
Implementation Plan"]
L3Plan --> L3Challenges["Document Challenges
& Solutions"]
L3Challenges --> L3Update["Update tasks.md
with Plan"]
L3Update --> L3Tech["TECHNOLOGY
VALIDATION"]
L3Tech --> L3Flag["Flag Components
Requiring Creative"]
L3Flag --> L3Verify["Verify Plan
Completeness"]
%% Level 4 Planning
Level4 --> L4Analysis["Codebase Structure
Analysis"]
L4Analysis --> L4Requirements["Document Comprehensive
Requirements"]
L4Requirements --> L4Diagrams["Create Architectural
Diagrams"]
L4Diagrams --> L4Subsystems["Identify Affected
Subsystems"]
L4Subsystems --> L4Dependencies["Document Dependencies
& Integration Points"]
L4Dependencies --> L4Plan["Create Phased
Implementation Plan"]
L4Plan --> L4Update["Update tasks.md
with Plan"]
L4Update --> L4Tech["TECHNOLOGY
VALIDATION"]
L4Tech --> L4Flag["Flag Components
Requiring Creative"]
L4Flag --> L4Verify["Verify Plan
Completeness"]
%% Technology Validation Gate - NEW
L2Tech & L3Tech & L4Tech --> TechGate["⛔ TECHNOLOGY
VALIDATION GATE"]
TechGate --> TechSelection["Document Technology
Stack Selection"]
TechSelection --> TechHelloWorld["Create Hello World
Proof of Concept"]
TechHelloWorld --> TechDependencies["Verify Required
Dependencies"]
TechDependencies --> TechConfig["Validate Build
Configuration"]
TechConfig --> TechBuild["Complete Test
Build"]
TechBuild --> TechVerify["⛔ TECHNOLOGY
CHECKPOINT"]
%% Verification & Completion
L2Verify & L3Verify & L4Verify & TechVerify --> CheckCreative{"Creative
Phases
Required?"}
%% Mode Transition
CheckCreative -->|"Yes"| RecCreative["NEXT MODE:
CREATIVE MODE"]
CheckCreative -->|"No"| RecBuild["NEXT MODE:
BUILD MODE"]
%% Style for Technology Gate
style TechGate fill:#ff5555,stroke:#dd3333,color:white,stroke-width:3px
style TechVerify fill:#ff5555,stroke:#dd3333,color:white,stroke-width:3px
style TechSelection fill:#4da6ff,stroke:#0066cc,color:white
style TechHelloWorld fill:#4da6ff,stroke:#0066cc,color:white
style TechDependencies fill:#4da6ff,stroke:#0066cc,color:white
style TechConfig fill:#4da6ff,stroke:#0066cc,color:white
style TechBuild fill:#4da6ff,stroke:#0066cc,color:white
```
## 📋 LEVEL-SPECIFIC PLANNING APPROACHES
```mermaid
graph TD
subgraph "Level 2: Enhancement"
L2A["Basic Requirements
Analysis"]
L2B["Simple Component
Identification"]
L2C["Linear Implementation
Plan"]
L2D["Basic Checklist
Creation"]
end
subgraph "Level 3: Feature"
L3A["Detailed Requirements
Analysis"]
L3B["Component Mapping
with Dependencies"]
L3C["Multi-Phase
Implementation Plan"]
L3D["Comprehensive
Checklist"]
L3E["Creative Phase
Identification"]
end
subgraph "Level 4: System"
L4A["Architectural
Requirements Analysis"]
L4B["System Component
Mapping"]
L4C["Subsystem
Integration Plan"]
L4D["Phased Implementation
Strategy"]
L4E["Risk Assessment
& Mitigation"]
L4F["Multiple Creative
Phase Requirements"]
end
L2A --> L2B --> L2C --> L2D
L3A --> L3B --> L3C --> L3D --> L3E
L4A --> L4B --> L4C --> L4D --> L4E --> L4F
```
## 🔧 TECHNOLOGY VALIDATION WORKFLOW
```mermaid
graph TD
Start["Technology
Validation Start"] --> Select["Technology
Stack Selection"]
Select --> Document["Document Chosen
Technologies"]
Document --> POC["Create Minimal
Proof of Concept"]
POC --> Build["Verify Build
Process Works"]
Build --> Dependencies["Validate All
Dependencies"]
Dependencies --> Config["Confirm Configuration
Files Are Correct"]
Config --> Test["Complete Test
Build/Run"]
Test --> Success{"All Checks
Pass?"}
Success -->|"Yes"| Ready["Ready for
Implementation"]
Success -->|"No"| Fix["Fix Technology
Issues"]
Fix --> Document
style Start fill:#4da6ff,stroke:#0066cc,color:white
style POC fill:#4da6ff,stroke:#0066cc,color:white
style Success fill:#ff5555,stroke:#dd3333,color:white
style Fix fill:#ff5555,stroke:#dd3333,color:white
style Ready fill:#10b981,stroke:#059669,color:white
```
## 📊 REQUIRED FILE STATE VERIFICATION
Before planning can begin, verify the file state:
```mermaid
graph TD
Start["File State
Verification"] --> CheckTasks{"tasks.md
initialized?"}
CheckTasks -->|"No"| ErrorTasks["ERROR:
Return to VAN Mode"]
CheckTasks -->|"Yes"| CheckActive{"activeContext.md
exists?"}
CheckActive -->|"No"| ErrorActive["ERROR:
Return to VAN Mode"]
CheckActive -->|"Yes"| ReadyPlan["Ready for
Planning"]
```
## 📝 TASKS.MD UPDATE FORMAT
During planning, update tasks.md with this structure:
```
# Task: [Task name]
## Description
[Detailed description]
## Complexity
Level: [2/3/4]
Type: [Enhancement/Feature/Complex System]
## Technology Stack
- Framework: [Selected framework]
- Build Tool: [Selected build tool]
- Language: [Selected language]
- Storage: [Selected storage mechanism]
## Technology Validation Checkpoints
- [ ] Project initialization command verified
- [ ] Required dependencies identified and installed
- [ ] Build configuration validated
- [ ] Hello world verification completed
- [ ] Test build passes successfully
## Status
- [x] Initialization complete
- [x] Planning complete
- [ ] Technology validation complete
- [ ] [Implementation steps]
## Implementation Plan
1. [Step 1]
- [Subtask 1.1]
- [Subtask 1.2]
2. [Step 2]
- [Subtask 2.1]
- [Subtask 2.2]
## Creative Phases Required
- [ ] [Component 1] Design
- [ ] [Component 2] Architecture
- [ ] [Component 3] Data Model
## Dependencies
- [Dependency 1]
- [Dependency 2]
## Challenges & Mitigations
- [Challenge 1]: [Mitigation strategy]
- [Challenge 2]: [Mitigation strategy]
```
## 📋 CREATIVE PHASE IDENTIFICATION
For Level 3-4 tasks, identify components requiring creative phases:
```mermaid
graph TD
Start["Creative Phase
Identification"] --> CheckComp{"Component
Analysis"}
CheckComp --> UI["UI/UX
Components"]
CheckComp --> Data["Data Model
Components"]
CheckComp --> Arch["Architecture
Components"]
CheckComp --> Algo["Algorithm
Components"]
UI & Data & Arch & Algo --> Decision{"Design Decisions
Required?"}
Decision -->|"Yes"| Flag["Flag for
Creative Phase"]
Decision -->|"No"| Skip["Standard
Implementation"]
Flag --> Document["Document in
tasks.md"]
```
## 📊 TECHNOLOGY VALIDATION CHECKLIST
```
✓ TECHNOLOGY VALIDATION CHECKLIST
- Technology stack clearly defined? [YES/NO]
- Project initialization command documented? [YES/NO]
- Required dependencies identified? [YES/NO]
- Minimal proof of concept created? [YES/NO]
- Hello world build/run successful? [YES/NO]
- Configuration files validated? [YES/NO]
- Test build completes successfully? [YES/NO]
→ If all YES: Technology validation complete - ready for next phase
→ If any NO: Resolve technology issues before proceeding
```
## 📊 PLAN VERIFICATION CHECKLIST
```
✓ PLAN VERIFICATION CHECKLIST
- Requirements clearly documented? [YES/NO]
- Technology stack validated? [YES/NO]
- Affected components identified? [YES/NO]
- Implementation steps detailed? [YES/NO]
- Dependencies documented? [YES/NO]
- Challenges & mitigations addressed? [YES/NO]
- Creative phases identified (Level 3-4)? [YES/NO/NA]
- tasks.md updated with plan? [YES/NO]
→ If all YES: Planning complete - ready for next mode
→ If any NO: Complete missing plan elements
```
## 🔄 MODE TRANSITION NOTIFICATION
When planning is complete, notify user with:
```
## PLANNING COMPLETE
✅ Implementation plan created
✅ Technology stack validated
✅ tasks.md updated with plan
✅ Challenges and mitigations documented
[✅ Creative phases identified (for Level 3-4)]
→ NEXT RECOMMENDED MODE: [CREATIVE/BUILD] MODE