plan-feature
Plan feature implementation with step-by-step approach using AI to break down tasks, define requirements, and establish scope for development projects.
Instructions
Plan feature implementation with step-by-step approach
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task | Yes | What to plan (e.g., 'add user profiles', 'implement payment system') | |
| requirements | No | Specific requirements or constraints | |
| scope | No | Planning scope | standard |
| provider | No | AI provider to use | gemini |
Implementation Reference
- src/server.ts:314-322 (registration)Registration of the 'plan-feature' MCP tool, specifying title, description, input schema, and handler delegation to AIToolHandlers.handlePlanFeature// Register plan-feature tool server.registerTool("plan-feature", { title: "Plan Feature", description: "Plan feature implementation with step-by-step approach", inputSchema: PlanFeatureSchema.shape, }, async (args) => { const aiHandlers = await getHandlers(); return await aiHandlers.handlePlanFeature(args); });
- src/handlers/ai-tools.ts:450-501 (handler)Core handler implementation in AIToolHandlers class. Selects AI provider, constructs specialized system prompt for feature planning based on scope, generates response via provider.generateText, and formats output for MCP protocol.async handlePlanFeature(params: z.infer<typeof PlanFeatureSchema>) { // Use provided provider or get the preferred one (Azure if configured) const providerName = params.provider || (await this.providerManager.getPreferredProvider(['openai', 'gemini', 'azure', 'grok'])); const provider = await this.providerManager.getProvider(providerName); const scopePrompts = { minimal: "Provide a basic implementation plan with essential components only", standard: "Provide a detailed implementation plan with proper architecture and considerations", comprehensive: "Provide an extensive implementation plan with full architecture, testing, documentation, and deployment considerations" }; const systemPrompt = `You are an expert software architect and project planner. Create detailed implementation plans for features. ${scopePrompts[params.scope]} Include in your plan: - Feature breakdown and components - Implementation steps and timeline - Technical considerations and dependencies - Testing and validation approach - Potential challenges and mitigation strategies Be practical and actionable in your planning.`; let prompt = `Plan the following feature: ${params.task}`; if (params.requirements) { prompt += `\n\nRequirements: ${params.requirements}`; } const response = await provider.generateText({ prompt, systemPrompt, temperature: 0.6, // Moderate temperature for creative planning reasoningEffort: providerName === "openai" || providerName === "azure" ? "medium" : undefined, useSearchGrounding: providerName === "gemini", }); return { content: [ { type: "text", text: response.text, }, ], metadata: { provider: providerName, model: response.model, scope: params.scope, usage: response.usage, ...response.metadata, }, }; }
- src/server.ts:55-60 (schema)Zod input schema definition for 'plan-feature' tool used in server.registerTool inputSchema: PlanFeatureSchema.shapeconst PlanFeatureSchema = z.object({ task: z.string().describe("What to plan (e.g., 'add user profiles', 'implement payment system')"), requirements: z.string().optional().describe("Specific requirements or constraints"), scope: z.enum(["minimal", "standard", "comprehensive"]).default("standard").describe("Planning scope"), provider: z.enum(["openai", "gemini", "azure", "grok"]).optional().default("gemini").describe("AI provider to use"), });
- src/handlers/ai-tools.ts:56-61 (schema)Zod schema used for TypeScript typing of handlePlanFeature params (z.infer<typeof PlanFeatureSchema>)const PlanFeatureSchema = z.object({ task: z.string().describe("What to plan (e.g., 'add user profiles', 'implement payment system')"), requirements: z.string().optional().describe("Specific requirements or constraints"), scope: z.enum(["minimal", "standard", "comprehensive"]).default("standard").describe("Planning scope"), provider: z.enum(["openai", "gemini", "azure", "grok"]).optional().default("gemini").describe("AI provider to use"), });
- src/server.ts:195-235 (helper)getHandlers function lazily initializes and returns AIToolHandlers instance (containing handlePlanFeature), used by all tool registrations including plan-featureasync function getHandlers() { if (!handlers) { const { ConfigManager } = require("./config/manager"); const { ProviderManager } = require("./providers/manager"); const { AIToolHandlers } = require("./handlers/ai-tools"); const configManager = new ConfigManager(); // Load config and set environment variables const config = await configManager.getConfig(); if (config.openai?.apiKey) { process.env.OPENAI_API_KEY = config.openai.apiKey; } if (config.openai?.baseURL) { process.env.OPENAI_BASE_URL = config.openai.baseURL; } if (config.google?.apiKey) { process.env.GOOGLE_API_KEY = config.google.apiKey; } if (config.google?.baseURL) { process.env.GOOGLE_BASE_URL = config.google.baseURL; } if (config.azure?.apiKey) { process.env.AZURE_API_KEY = config.azure.apiKey; } if (config.azure?.baseURL) { process.env.AZURE_BASE_URL = config.azure.baseURL; } if (config.xai?.apiKey) { process.env.XAI_API_KEY = config.xai.apiKey; } if (config.xai?.baseURL) { process.env.XAI_BASE_URL = config.xai.baseURL; } providerManager = new ProviderManager(configManager); handlers = new AIToolHandlers(providerManager); } return handlers; }