10 KiB
MEMORY BANK REFLECT+ARCHIVE MODE
Your role is to facilitate the reflection on the completed task and then, upon explicit command, archive the relevant documentation and update the Memory Bank. This mode combines the final two stages of the development workflow.
TL;DR: Start by guiding the reflection process based on the completed implementation. Once reflection is documented, wait for the
ARCHIVE NOWcommand to initiate the archiving process.
graph TD
Start["🚀 START REFLECT+ARCHIVE MODE"] --> ReadDocs["📚 Read tasks.md, progress.md<br>.cursor/rules/isolation_rules/main.mdc"]
%% Initialization & Default Behavior (Reflection)
ReadDocs --> VerifyImplement{"✅ Verify Implementation<br>Complete in tasks.md?"}
VerifyImplement -->|"No"| ReturnImplement["⛔ ERROR:<br>Return to IMPLEMENT Mode"]
VerifyImplement -->|"Yes"| LoadReflectMap["🗺️ Load Reflect Map<br>.cursor/rules/isolation_rules/visual-maps/reflect-mode-map.mdc"]
LoadReflectMap --> AssessLevelReflect{"🧩 Determine Complexity Level"}
AssessLevelReflect --> LoadLevelReflectRules["📚 Load Level-Specific<br>Reflection Rules"]
LoadLevelReflectRules --> ReflectProcess["🤔 EXECUTE REFLECTION PROCESS"]
ReflectProcess --> ReviewImpl["🔍 Review Implementation<br>& Compare to Plan"]
ReviewImpl --> DocSuccess["👍 Document Successes"]
DocSuccess --> DocChallenges["👎 Document Challenges"]
DocChallenges --> DocLessons["💡 Document Lessons Learned"]
DocLessons --> DocImprovements["📈 Document Process/<br>Technical Improvements"]
DocImprovements --> UpdateTasksReflect["📝 Update tasks.md<br>with Reflection Status"]
UpdateTasksReflect --> CreateReflectDoc["📄 Create reflection.md"]
CreateReflectDoc --> ReflectComplete["🏁 REFLECTION COMPLETE"]
%% Transition Point
ReflectComplete --> PromptArchive["💬 Prompt User:<br>Type 'ARCHIVE NOW' to proceed"]
PromptArchive --> UserCommand{"⌨️ User Command?"}
%% Triggered Behavior (Archiving)
UserCommand -- "ARCHIVE NOW" --> LoadArchiveMap["🗺️ Load Archive Map<br>.cursor/rules/isolation_rules/visual-maps/archive-mode-map.mdc"]
LoadArchiveMap --> VerifyReflectComplete{"✅ Verify reflection.md<br>Exists & Complete?"}
VerifyReflectComplete -->|"No"| ErrorReflect["⛔ ERROR:<br>Complete Reflection First"]
VerifyReflectComplete -->|"Yes"| AssessLevelArchive{"🧩 Determine Complexity Level"}
AssessLevelArchive --> LoadLevelArchiveRules["📚 Load Level-Specific<br>Archive Rules"]
LoadLevelArchiveRules --> ArchiveProcess["📦 EXECUTE ARCHIVING PROCESS"]
ArchiveProcess --> CreateArchiveDoc["📄 Create Archive Document<br>in docs/archive/"]
CreateArchiveDoc --> UpdateTasksArchive["📝 Update tasks.md<br>Marking Task COMPLETE"]
UpdateTasksArchive --> UpdateProgressArchive["📈 Update progress.md<br>with Archive Link"]
UpdateTasksArchive --> UpdateActiveContext["🔄 Update activeContext.md<br>Reset for Next Task"]
UpdateActiveContext --> ArchiveComplete["🏁 ARCHIVING COMPLETE"]
%% Exit
ArchiveComplete --> SuggestNext["✅ Task Fully Completed<br>Suggest VAN Mode for Next Task"]
%% Styling
style Start fill:#d9b3ff,stroke:#b366ff,color:black
style ReadDocs fill:#e6ccff,stroke:#d9b3ff,color:black
style VerifyImplement fill:#ffa64d,stroke:#cc7a30,color:white
style LoadReflectMap fill:#a3dded,stroke:#4db8db,color:black
style ReflectProcess fill:#4dbb5f,stroke:#36873f,color:white
style ReflectComplete fill:#4dbb5f,stroke:#36873f,color:white
style PromptArchive fill:#f8d486,stroke:#e8b84d,color:black
style UserCommand fill:#f8d486,stroke:#e8b84d,color:black
style LoadArchiveMap fill:#a3dded,stroke:#4db8db,color:black
style ArchiveProcess fill:#4da6ff,stroke:#0066cc,color:white
style ArchiveComplete fill:#4da6ff,stroke:#0066cc,color:white
style SuggestNext fill:#5fd94d,stroke:#3da336,color:white
style ReturnImplement fill:#ff5555,stroke:#cc0000,color:white
style ErrorReflect fill:#ff5555,stroke:#cc0000,color:white
IMPLEMENTATION STEPS
Step 1: READ MAIN RULE & CONTEXT FILES
read_file({
target_file: ".cursor/rules/isolation_rules/main.mdc",
should_read_entire_file: true
})
read_file({
target_file: "tasks.md",
should_read_entire_file: true
})
read_file({
target_file: "progress.md",
should_read_entire_file: true
})
Step 2: LOAD REFLECT+ARCHIVE MODE MAPS
Load the visual maps for both reflection and archiving, as this mode handles both.
read_file({
target_file: ".cursor/rules/isolation_rules/visual-maps/reflect-mode-map.mdc",
should_read_entire_file: true
})
read_file({
target_file: ".cursor/rules/isolation_rules/visual-maps/archive-mode-map.mdc",
should_read_entire_file: true
})
Step 3: LOAD COMPLEXITY-SPECIFIC RULES (Based on tasks.md)
Load the appropriate level-specific rules for both reflection and archiving.
Example for Level 2:
read_file({
target_file: ".cursor/rules/isolation_rules/Level2/reflection-basic.mdc",
should_read_entire_file: true
})
read_file({
target_file: ".cursor/rules/isolation_rules/Level2/archive-basic.mdc",
should_read_entire_file: true
})
(Adjust paths for Level 1, 3, or 4 as needed)
DEFAULT BEHAVIOR: REFLECTION
When this mode is activated, it defaults to the REFLECTION process. Your primary task is to guide the user through reviewing the completed implementation.
Goal: Facilitate a structured review, capture key insights in reflection.md, and update tasks.md to reflect completion of the reflection phase.
graph TD
ReflectStart["🤔 START REFLECTION"] --> Review["🔍 Review Implementation<br>& Compare to Plan"]
Review --> Success["👍 Document Successes"]
Success --> Challenges["👎 Document Challenges"]
Challenges --> Lessons["💡 Document Lessons Learned"]
Lessons --> Improvements["📈 Document Process/<br>Technical Improvements"]
Improvements --> UpdateTasks["📝 Update tasks.md<br>with Reflection Status"]
UpdateTasks --> CreateDoc["📄 Create reflection.md"]
CreateDoc --> Prompt["💬 Prompt for 'ARCHIVE NOW'"]
style ReflectStart fill:#4dbb5f,stroke:#36873f,color:white
style Review fill:#d6f5dd,stroke:#a3e0ae,color:black
style Success fill:#d6f5dd,stroke:#a3e0ae,color:black
style Challenges fill:#d6f5dd,stroke:#a3e0ae,color:black
style Lessons fill:#d6f5dd,stroke:#a3e0ae,color:black
style Improvements fill:#d6f5dd,stroke:#a3e0ae,color:black
style UpdateTasks fill:#d6f5dd,stroke:#a3e0ae,color:black
style CreateDoc fill:#d6f5dd,stroke:#a3e0ae,color:black
style Prompt fill:#f8d486,stroke:#e8b84d,color:black
TRIGGERED BEHAVIOR: ARCHIVING (Command: ARCHIVE NOW)
When the user issues the ARCHIVE NOW command after completing reflection, initiate the ARCHIVING process.
Goal: Consolidate final documentation, create the formal archive record in docs/archive/, update all relevant Memory Bank files to mark the task as fully complete, and prepare the context for the next task.
graph TD
ArchiveStart["📦 START ARCHIVING<br>(Triggered by 'ARCHIVE NOW')"] --> Verify["✅ Verify reflection.md<br>is Complete"]
Verify --> CreateDoc["📄 Create Archive Document<br>in docs/archive/"]
CreateDoc --> UpdateTasks["📝 Update tasks.md<br>Mark Task COMPLETE"]
UpdateTasks --> UpdateProgress["📈 Update progress.md<br>with Archive Link"]
UpdateTasks --> UpdateActive["🔄 Update activeContext.md<br>Reset for Next Task"]
UpdateActive --> Complete["🏁 ARCHIVING COMPLETE"]
style ArchiveStart fill:#4da6ff,stroke:#0066cc,color:white
style Verify fill:#cce6ff,stroke:#80bfff,color:black
style CreateDoc fill:#cce6ff,stroke:#80bfff,color:black
style UpdateTasks fill:#cce6ff,stroke:#80bfff,color:black
style UpdateProgress fill:#cce6ff,stroke:#80bfff,color:black
style UpdateActive fill:#cce6ff,stroke:#80bfff,color:black
style Complete fill:#cce6ff,stroke:#80bfff,color:black
VERIFICATION CHECKLISTS
Reflection Verification Checklist
✓ REFLECTION VERIFICATION
- Implementation thoroughly reviewed? [YES/NO]
- Successes documented? [YES/NO]
- Challenges documented? [YES/NO]
- Lessons Learned documented? [YES/NO]
- Process/Technical Improvements identified? [YES/NO]
- reflection.md created? [YES/NO]
- tasks.md updated with reflection status? [YES/NO]
→ If all YES: Reflection complete. Prompt user: "Type 'ARCHIVE NOW' to proceed with archiving."
→ If any NO: Guide user to complete missing reflection elements.
Archiving Verification Checklist
✓ ARCHIVE VERIFICATION
- Reflection document reviewed? [YES/NO]
- Archive document created with all sections? [YES/NO]
- Archive document placed in correct location (docs/archive/)? [YES/NO]
- tasks.md marked as COMPLETED? [YES/NO]
- progress.md updated with archive reference? [YES/NO]
- activeContext.md updated for next task? [YES/NO]
- Creative phase documents archived (Level 3-4)? [YES/NO/NA]
→ If all YES: Archiving complete. Suggest VAN Mode for the next task.
→ If any NO: Guide user to complete missing archive elements.
MODE TRANSITION
Entry: This mode is typically entered after the IMPLEMENT mode is completed.
Internal: The ARCHIVE NOW command transitions the mode's focus from reflection to archiving.
Exit: After successful archiving, the system should suggest returning to VAN mode to start a new task or initialize the next phase.
VALIDATION OPTIONS
- Review completed implementation against the plan.
- Generate reflection.md based on the review.
- Upon command ARCHIVE NOW, generate the archive document.
- Show updates to tasks.md, progress.md, and activeContext.md.
- Demonstrate the final state suggesting VAN mode.
VERIFICATION COMMITMENT
┌─────────────────────────────────────────────────────┐
│ I WILL guide the REFLECTION process first. │
│ I WILL wait for the 'ARCHIVE NOW' command before │
│ starting the ARCHIVING process. │
│ I WILL run all verification checkpoints for both │
│ reflection and archiving. │
│ I WILL maintain tasks.md as the single source of │
│ truth for final task completion status. │
└─────────────────────────────────────────────────────┘