---
description: Visual process map for REFLECT mode (Task Reflection)
globs: "**/reflect*/**", "**/review*/**", "**/retrospect*/**"
alwaysApply: false
---
# REFLECT MODE: TASK REVIEW PROCESS MAP
> **TL;DR:** This visual map guides the REFLECT mode process, focusing on structured review of the implementation, documenting lessons learned, and preparing insights for future reference.
## 🧭 REFLECT MODE PROCESS FLOW
```mermaid
graph TD
Start["START REFLECT MODE"] --> ReadTasks["Read tasks.md
and progress.md"]
%% Initial Assessment
ReadTasks --> VerifyImplement{"Implementation
Complete?"}
VerifyImplement -->|"No"| ReturnBuild["Return to
BUILD Mode"]
VerifyImplement -->|"Yes"| AssessLevel{"Determine
Complexity Level"}
%% Level-Based Reflection
AssessLevel -->|"Level 1"| L1Reflect["LEVEL 1 REFLECTION
Level1/reflection-basic.md"]
AssessLevel -->|"Level 2"| L2Reflect["LEVEL 2 REFLECTION
Level2/reflection-standard.md"]
AssessLevel -->|"Level 3"| L3Reflect["LEVEL 3 REFLECTION
Level3/reflection-comprehensive.md"]
AssessLevel -->|"Level 4"| L4Reflect["LEVEL 4 REFLECTION
Level4/reflection-advanced.md"]
%% Level 1 Reflection (Quick)
L1Reflect --> L1Review["Review
Bug Fix"]
L1Review --> L1Document["Document
Solution"]
L1Document --> L1Update["Update
tasks.md"]
%% Level 2 Reflection (Standard)
L2Reflect --> L2Review["Review
Enhancement"]
L2Review --> L2WWW["Document
What Went Well"]
L2WWW --> L2Challenges["Document
Challenges"]
L2Challenges --> L2Lessons["Document
Lessons Learned"]
L2Lessons --> L2Update["Update
tasks.md"]
%% Level 3-4 Reflection (Comprehensive)
L3Reflect & L4Reflect --> L34Review["Review Implementation
& Creative Phases"]
L34Review --> L34Plan["Compare Against
Original Plan"]
L34Plan --> L34WWW["Document
What Went Well"]
L34WWW --> L34Challenges["Document
Challenges"]
L34Challenges --> L34Lessons["Document
Lessons Learned"]
L34Lessons --> L34ImproveProcess["Document Process
Improvements"]
L34ImproveProcess --> L34Update["Update
tasks.md"]
%% Completion & Transition
L1Update & L2Update & L34Update --> CreateReflection["Create
reflection.md"]
CreateReflection --> UpdateSystem["Update System
Documentation"]
UpdateSystem --> Transition["NEXT MODE:
ARCHIVE MODE"]
```
## 📋 REFLECTION STRUCTURE
The reflection should follow this structured format:
```mermaid
graph TD
subgraph "Reflection Document Structure"
Header["# TASK REFLECTION: [Task Name]"]
Summary["## SUMMARY
Brief summary of completed task"]
WWW["## WHAT WENT WELL
Successful aspects of implementation"]
Challenges["## CHALLENGES
Difficulties encountered during implementation"]
Lessons["## LESSONS LEARNED
Key insights gained from the experience"]
ProcessImp["## PROCESS IMPROVEMENTS
How to improve for future tasks"]
TechImp["## TECHNICAL IMPROVEMENTS
Better approaches for similar tasks"]
NextSteps["## NEXT STEPS
Follow-up actions or future work"]
end
Header --> Summary --> WWW --> Challenges --> Lessons --> ProcessImp --> TechImp --> NextSteps
```
## 📊 REQUIRED FILE STATE VERIFICATION
Before reflection can begin, verify file state:
```mermaid
graph TD
Start["File State
Verification"] --> CheckTasks{"tasks.md has
implementation
complete?"}
CheckTasks -->|"No"| ErrorBuild["ERROR:
Return to BUILD Mode"]
CheckTasks -->|"Yes"| CheckProgress{"progress.md
has implementation
details?"}
CheckProgress -->|"No"| ErrorProgress["ERROR:
Update progress.md first"]
CheckProgress -->|"Yes"| ReadyReflect["Ready for
Reflection"]
```
## 🔍 IMPLEMENTATION REVIEW APPROACH
```mermaid
graph TD
subgraph "Implementation Review"
Original["Review Original
Requirements"]
Plan["Compare Against
Implementation Plan"]
Actual["Assess Actual
Implementation"]
Creative["Review Creative
Phase Decisions"]
Changes["Identify Deviations
from Plan"]
Results["Evaluate
Results"]
end
Original --> Plan --> Actual
Plan --> Creative --> Changes
Actual --> Results
Changes --> Results
```
## 📝 REFLECTION DOCUMENT TEMPLATES
### Level 1 (Basic) Reflection
```
# Bug Fix Reflection: [Bug Name]
## Summary
[Brief description of the bug and solution]
## Implementation
[Description of the fix implemented]
## Testing
[Description of testing performed]
## Additional Notes
[Any other relevant information]
```
### Levels 2-4 (Comprehensive) Reflection
```
# Task Reflection: [Task Name]
## Summary
[Brief summary of the task and what was achieved]
## What Went Well
- [Success point 1]
- [Success point 2]
- [Success point 3]
## Challenges
- [Challenge 1]: [How it was addressed]
- [Challenge 2]: [How it was addressed]
- [Challenge 3]: [How it was addressed]
## Lessons Learned
- [Lesson 1]
- [Lesson 2]
- [Lesson 3]
## Process Improvements
- [Process improvement 1]
- [Process improvement 2]
## Technical Improvements
- [Technical improvement 1]
- [Technical improvement 2]
## Next Steps
- [Follow-up task 1]
- [Follow-up task 2]
```
## 📊 REFLECTION QUALITY METRICS
```mermaid
graph TD
subgraph "Reflection Quality Metrics"
Specific["Specific
Not general or vague"]
Actionable["Actionable
Provides clear direction"]
Honest["Honest
Acknowledges successes and failures"]
Forward["Forward-Looking
Focuses on future improvement"]
Evidence["Evidence-Based
Based on concrete examples"]
end
```
## 📋 TASKS.MD UPDATE FORMAT
During reflection, update tasks.md with:
```
## Status
- [x] Initialization complete
- [x] Planning complete
[For Level 3-4:]
- [x] Creative phases complete
- [x] Implementation complete
- [x] Reflection complete
- [ ] Archiving
## Reflection Highlights
- **What Went Well**: [Key successes]
- **Challenges**: [Key challenges]
- **Lessons Learned**: [Key lessons]
- **Next Steps**: [Follow-up actions]
```
## 📊 REFLECTION VERIFICATION CHECKLIST
```
✓ REFLECTION VERIFICATION
- Implementation thoroughly reviewed? [YES/NO]
- What Went Well section completed? [YES/NO]
- Challenges section completed? [YES/NO]
- Lessons Learned section completed? [YES/NO]
- Process Improvements identified? [YES/NO]
- Technical Improvements identified? [YES/NO]
- Next Steps documented? [YES/NO]
- reflection.md created? [YES/NO]
- tasks.md updated with reflection status? [YES/NO]
→ If all YES: Reflection complete - ready for ARCHIVE mode
→ If any NO: Complete missing reflection elements
```
## 🔄 MODE TRANSITION NOTIFICATION
When reflection is complete, notify user with:
```
## REFLECTION COMPLETE
✅ Implementation thoroughly reviewed
✅ Reflection document created
✅ Lessons learned documented
✅ Process improvements identified
✅ tasks.md updated with reflection status
→ NEXT RECOMMENDED MODE: ARCHIVE MODE
```