reflect_archive_instructions.mdβ’10.7 kB
# 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 NOW` command to initiate the archiving process.
```mermaid
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 documentation/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.
```mermaid
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 documentation/archive/, update all relevant Memory Bank files to mark the task as fully complete, and prepare the context for the next task.
```mermaid
graph TD
ArchiveStart["π¦ START ARCHIVING<br>(Triggered by 'ARCHIVE NOW')"] --> Verify["β
Verify reflection.md<br>is Complete"]
Verify --> CreateDoc["π Create Archive Document<br>in documentation/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. β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
```