plan_task
Creates structured plans for coding tasks by breaking work into steps with dependencies, validation criteria, and complexity estimates. Use before starting significant coding work.
Instructions
Creates a structured plan for completing a coding task. Breaks down the work into steps with dependencies, validation criteria, and estimated complexity. Use before starting any significant coding work.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task | Yes | Description of the task to plan | |
| context | No | Current project context, tech stack, constraints | |
| scope | No | Expected scope of the task |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"context": {
"description": "Current project context, tech stack, constraints",
"type": "string"
},
"scope": {
"description": "Expected scope of the task",
"enum": [
"small",
"medium",
"large"
],
"type": "string"
},
"task": {
"description": "Description of the task to plan",
"type": "string"
}
},
"required": [
"task"
],
"type": "object"
}
Implementation Reference
- src/tools/cognitive.ts:17-74 (handler)The main handler function for the 'plan_task' tool. It generates a structured markdown plan based on the input task, optional context, and scope. Returns a text content block with the plan.export function planTaskHandler(args: any) { const { task, context = "", scope = "medium" } = args; const plan = `# Task Plan: ${task} ## Context ${context || "No additional context provided."} ## Scope Assessment **Estimated Scope**: ${scope} ## Pre-Implementation Checklist - [ ] Understand requirements fully - [ ] Identify affected files/components - [ ] Consider edge cases - [ ] Plan for testing ## Implementation Steps ### Step 1: Analysis - Review existing codebase - Identify integration points - Document assumptions ### Step 2: Design - Define interfaces/types - Plan component structure - Consider error handling ### Step 3: Implementation - Write core functionality - Follow coding standards - Add inline documentation ### Step 4: Testing - Write unit tests - Test edge cases - Integration testing ### Step 5: Review - Self-review code - Check for security issues - Validate performance ## Validation Criteria - [ ] All tests pass - [ ] No linting errors - [ ] Documentation updated - [ ] Code reviewed ## Rollback Plan If issues arise, revert to previous state and reassess approach. `; return { content: [{ type: "text", text: plan }] }; }
- src/tools/cognitive.ts:7-15 (schema)The Zod schema definition for the 'plan_task' tool, defining input parameters: task (required string), context (optional string), scope (optional enum).export const planTaskSchema = { name: "plan_task", description: "Creates a structured plan for completing a coding task. Breaks down the work into steps with dependencies, validation criteria, and estimated complexity. Use before starting any significant coding work.", inputSchema: z.object({ task: z.string().describe("Description of the task to plan"), context: z.string().optional().describe("Current project context, tech stack, constraints"), scope: z.enum(["small", "medium", "large"]).optional().describe("Expected scope of the task") }) };
- src/server.ts:89-89 (registration)Registration of the 'plan_task' tool in the toolRegistry Map used by the HTTP server in src/server.ts.["plan_task", { schema: planTaskSchema, handler: planTaskHandler }],
- src/index.ts:79-79 (registration)Registration of the 'plan_task' tool in the toolRegistry Map used by the stdio MCP server in src/index.ts.["plan_task", { schema: planTaskSchema, handler: planTaskHandler }],