create_feature_workflow
Start a structured workflow for adding new features with integrated testing, guided by requirements and acceptance criteria.
Instructions
Start a structured workflow for adding new functionality with integrated testing
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task | Yes | Description of the feature to create | |
| context | No | Additional context (optional) |
Implementation Reference
- src/tools/createFeatureWorkflow.ts:43-55 (handler)The handler function that executes the create_feature_workflow tool logic. It delegates to executeWorkflow with workflowType: 'feature'.
export async function handleCreateFeatureWorkflow( params: { task: string; context?: any }, sessionManager: SessionManager ) { return executeWorkflow( { task: params.task, workflowType: 'feature', context: params.context }, sessionManager ); } - src/workflows/WorkflowHandler.ts:21-67 (handler)The core executeWorkflow function called by the handler. It gets the 'feature' preset from WorkflowPresets, starts a session, builds phase details, and returns the full workflow plan.
export async function executeWorkflow( params: WorkflowExecutionParams, sessionManager: SessionManager ) { // Get workflow preset const preset = getWorkflowPreset(params.workflowType); // Use custom phases if provided, otherwise use preset const phases = params.customPhases || preset.phases; // Merge custom iteration limits with preset const iterationLimits = { ...preset.iterationLimits, ...params.customIterationLimits }; // Start a new session with workflow type const session = sessionManager.startSession(params.task, undefined, params.workflowType); // Build phase details based on workflow type const phaseDetails = buildPhaseDetails(phases, params.workflowType); return { sessionId: session.id, task: params.task, workflowType: params.workflowType, workflowName: preset.name, context: params.context || {}, startedAt: new Date(session.startedAt).toISOString(), workflowOverview: { totalPhases: phases.length, estimatedTotalTime: preset.estimatedDuration, philosophy: preset.philosophy, corePhilosophy: 'Guide, Don\'t Gate - All your tools remain available throughout the workflow' }, phases: phaseDetails, keyBenefits: preset.keyBenefits, iterationLimits, criticalGuidance: getCriticalGuidance(params.workflowType), howToBegin: getHowToBegin(phases[0], params.workflowType), availableTools: { workflowTools: getWorkflowTools(phases), yourTools: 'All your standard tools for file operations, searching, editing, terminal commands, etc. remain fully available' }, reminder: `This is the ${preset.name} - optimized for ${preset.description.toLowerCase()}` }; } - The tool definition function that creates the schema/input validation for 'create_feature_workflow'. Defines required 'task' string and optional 'context' object with targetFiles, scope, and requirements.
export function createFeatureWorkflowTool(): Tool { return { name: 'create_feature_workflow', description: 'Start a structured workflow for adding new functionality with integrated testing', inputSchema: { type: 'object', properties: { task: { type: 'string', description: 'Description of the feature to create' }, context: { type: 'object', description: 'Additional context (optional)', properties: { targetFiles: { type: 'array', items: { type: 'string' }, description: 'Files where the feature will be added' }, scope: { type: 'string', enum: ['file', 'directory', 'project'], description: 'The scope of the feature' }, requirements: { type: 'array', items: { type: 'string' }, description: 'Feature requirements and acceptance criteria' } } } }, required: ['task'] } }; - src/index.ts:140-140 (registration)Registration of the tool in the server's tools array (line 140). Also the switch-case handler that routes 'create_feature_workflow' calls to handleCreateFeatureWorkflow (lines 234-239).
createFeatureWorkflowTool(), // Feature creation workflow - The 'feature' workflow preset definition used when create_feature_workflow is invoked. Defines phases (SETUP, PLANNING, QUESTION_DETERMINE, WRITE_OR_REFACTOR, TEST, LINT, ITERATE, PRESENT), iteration limits, and philosophy.
feature: { name: 'Feature Creation Workflow', description: 'Structured approach to adding new functionality with testing', type: 'feature', phases: [ 'SETUP', 'PLANNING', 'QUESTION_DETERMINE', 'WRITE_OR_REFACTOR', 'TEST', 'LINT', 'ITERATE', 'PRESENT' ], iterationLimits: { TEST: 10, // More test iterations for new features LINT: 10, ITERATE: 15 }, estimatedDuration: '60-90 minutes', philosophy: 'Plan thoroughly, implement cleanly, test completely', keyBenefits: [ 'Clear planning before implementation', 'Integrated testing for new functionality', 'Quality assurance built-in' ], when_to_use: [ 'Adding new functionality', 'Implementing new API endpoints', 'Creating new UI components', 'Building new modules or services' ] },