reflect_archive_mode
Enable the Reflect or Archive function to review implementation details or organize documentation, streamlining project workflows on the Memory Bank MCP Server.
Instructions
Reflect on implementation and archive documentation
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"action": {
"enum": [
"reflect",
"archive"
],
"type": "string"
}
},
"required": [
"action"
],
"type": "object"
}
Implementation Reference
- src/tools.ts:489-539 (handler)Implements the 'reflect' action of the reflect_archive_mode tool: generates a reflection document template, saves it, updates task status.private handleReflection(): Promise<ToolResponse> { const timestamp = new Date().toISOString(); const reflectionDoc = `# Implementation Reflection ## Implementation Review **Completed**: ${timestamp} ### What Went Well (Successes) - *Document successful aspects of the implementation* ### Challenges Encountered - *Document difficulties and how they were resolved* ### Lessons Learned - *Key insights from this implementation* ### Process Improvements - *Suggestions for improving the development process* ### Technical Improvements - *Technical insights and potential optimizations* ## Comparison to Plan *How did the actual implementation compare to the original plan?* ## Final Status - [ ] Implementation complete - [ ] Testing complete - [ ] Documentation complete - [ ] Ready for archive **Next Step**: Type 'ARCHIVE NOW' to proceed with archiving. `; this.storage.writeFile('reflection.md', reflectionDoc); // Update tasks const currentTasks = this.storage.getTasks(); const updatedTasks = currentTasks.replace( '- [ ] REFLECT+ARCHIVE Mode: Completion and documentation', '- [x] REFLECT+ARCHIVE Mode: Reflection complete ✅' ); this.storage.setTasks(updatedTasks); return Promise.resolve({ content: [{ type: 'text', text: '✅ REFLECTION completed!\n\nReflection document created. Please review and complete the reflection sections, then use action "archive" to create the final archive.' }] }); }
- src/tools.ts:541-608 (handler)Implements the 'archive' action: gathers all project documents, creates comprehensive archive, updates status to completed, resets context.private handleArchiving(): Promise<ToolResponse> { const timestamp = new Date().toISOString(); const tasks = this.storage.getTasks(); const reflection = this.storage.readFile('reflection.md'); const plan = this.storage.readFile('implementation-plan.md'); const progress = this.storage.getProgress(); // Create archive document const archiveDoc = `# Project Archive **Archived**: ${timestamp} ## Project Summary ${this.extractProjectSummary(tasks)} ## Implementation Plan ${plan} ## Implementation Progress ${progress} ## Reflection ${reflection} ## Final Status ✅ Project completed and archived ## Files Included - tasks.md - implementation-plan.md - progress.md - reflection.md - All creative phase documents --- *This archive represents the complete documentation of the project lifecycle.* `; this.storage.writeArchive(archiveDoc); // Update tasks - mark as COMPLETED const finalTasks = tasks.replace( 'REFLECT+ARCHIVE Mode: Reflection complete ✅', 'REFLECT+ARCHIVE Mode: Completed and Archived ✅' ).replace( 'Current Phase: PLAN', 'Current Phase: COMPLETED' ); this.storage.setTasks(finalTasks); // Reset active context for next task this.storage.setActiveContext(`# Active Context ## Status: Ready for New Task Previous task has been completed and archived. **Next Steps**: Use VAN mode to initialize a new task. **Archive Location**: docs/archive/project-archive.md `); return Promise.resolve({ content: [{ type: 'text', text: '✅ ARCHIVING completed!\n\n📦 Project archived successfully\n📁 Archive location: docs/archive/project-archive.md\n\n🎉 Task fully completed! Ready for next task - use VAN mode to initialize.' }] }); }
- src/tools.ts:339-352 (handler)Dispatcher handler for reflect_archive_mode tool: routes to handleReflection or handleArchiving based on input.action.handler: async (input: ReflectArchiveInput): Promise<ToolResponse> => { if (input.action === 'reflect') { return this.handleReflection(); } else if (input.action === 'archive') { return this.handleArchiving(); } return { content: [{ type: 'text', text: '❌ Invalid action. Use "reflect" or "archive".' }] }; }
- src/tools.ts:328-338 (schema)JSON Schema defining the input for the reflect_archive_mode tool, specifying the required 'action' parameter.inputSchema: { type: 'object', properties: { action: { type: 'string', enum: ['reflect', 'archive'], description: 'reflect: Review implementation, archive: Create final documentation (requires ARCHIVE NOW command)' } }, required: ['action'] },
- src/server.ts:93-104 (registration)MCP server registration of the reflect_archive_mode tool, including Zod input schema validation and handler binding.'reflect_archive_mode', { title: 'REFLECT+ARCHIVE Mode', description: 'Reflect on implementation and archive documentation', inputSchema: { action: z.enum(['reflect', 'archive']) } }, async (args) => { return await (this.tools.reflectArchiveTool.handler as any)(args); } );