plan_mode
Generate tailored implementation plans based on project complexity, streamlining software development workflows with structured planning tools.
Instructions
Create detailed implementation plan based on complexity level
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| complexity | No |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"complexity": {
"type": "string"
}
},
"type": "object"
}
Implementation Reference
- src/tools.ts:132-168 (handler)The core handler function for the 'plan_mode' tool. It retrieves current tasks, determines or uses provided complexity level, generates and stores the implementation plan, updates the tasks status, determines the next mode, and returns a success response.handler: async (input: PlanModeInput): Promise<ToolResponse> => { const currentTasks = this.storage.getTasks(); const complexity = input.complexity || this.extractComplexityFromTasks(currentTasks); if (!complexity) { return { content: [{ type: 'text', text: '❌ Error: Complexity level not found. Please run VAN mode first or specify complexity level.' }] }; } const planTemplate = this.generatePlanTemplate(complexity); this.storage.setImplementationPlan(planTemplate); // Update tasks.md const updatedTasks = currentTasks.replace( '- [ ] PLAN Mode: Implementation planning', '- [x] PLAN Mode: Implementation planning ✅' ).replace( 'Current Phase: VAN', 'Current Phase: PLAN' ); this.storage.setTasks(updatedTasks); const requiresCreative = complexity === '3' || complexity === '4'; const nextMode = requiresCreative ? 'CREATIVE' : 'IMPLEMENT'; return { content: [{ type: 'text', text: `✅ PLAN Mode completed!\n\n**Implementation plan created** for Level ${complexity} complexity.\n**Next Mode**: ${nextMode}\n\n${requiresCreative ? 'Creative phases identified - design decisions required before implementation.' : 'Ready for direct implementation.'}` }] }; }
- src/tools.ts:122-131 (schema)JSON Schema definition for the input parameters of the 'plan_mode' tool, specifying the optional 'complexity' field.inputSchema: { type: 'object', properties: { complexity: { type: 'string', enum: ['1', '2', '3', '4'], description: 'Complexity level (optional, will read from tasks.md if not provided)' } } },
- src/server.ts:40-54 (registration)Registration of the 'plan_mode' tool with the MCP server, including title, description, Zod input schema validation, and delegation to the handler from MemoryBankTools instance.this.server.registerTool( 'plan_mode', { title: 'PLAN Mode', description: 'Create detailed implementation plan based on complexity level', inputSchema: { complexity: z.string().refine(val => ['1', '2', '3', '4'].includes(val), { message: 'Complexity must be 1, 2, 3, or 4' }).optional() } }, async (args) => { return await (this.tools.planModeTool.handler as any)(args); } );
- src/tools.ts:371-459 (helper)Key helper method called by the handler to generate complexity-specific implementation plan templates stored in implementation-plan.md.private generatePlanTemplate(complexity: string): string { const timestamp = new Date().toISOString(); if (complexity === '1') { return `# Implementation Plan - Level 1 (Quick Fix) ## Overview Quick bug fix implementation plan. ## Implementation Steps 1. Identify the bug location 2. Implement targeted fix 3. Test the fix 4. Verify no regression ## Files to Modify *List files that need changes* ## Testing Strategy *How to verify the fix works* **Created**: ${timestamp} `; } else if (complexity === '2') { return `# Implementation Plan - Level 2 (Simple Enhancement) ## Overview of Changes *Describe what needs to be enhanced* ## Files to Modify *List files that need changes* ## Implementation Steps 1. *Step 1* 2. *Step 2* 3. *Step 3* ## Potential Challenges *List any anticipated issues* ## Testing Strategy *How to test the enhancement* **Created**: ${timestamp} `; } else { return `# Implementation Plan - Level ${complexity} (Complex Feature) ## Requirements Analysis *Detailed requirements breakdown* ## Components Affected *List all components that will be modified or created* ## Architecture Considerations *High-level architectural decisions* ## Creative Phase Components *Components requiring design decisions:* - [ ] Architecture Design: *Component name* - [ ] Algorithm Design: *Component name* - [ ] UI/UX Design: *Component name* ## Implementation Strategy *Overall approach to implementation* ## Detailed Steps ### Phase 1: Core Components 1. *Step 1* 2. *Step 2* ### Phase 2: Secondary Components 1. *Step 1* 2. *Step 2* ### Phase 3: Integration & Polish 1. *Step 1* 2. *Step 2* ## Dependencies *External and internal dependencies* ## Challenges & Mitigations *Potential issues and solutions* **Created**: ${timestamp} `; } }