tdd_workflow
Implement features using Test-Driven Development by following Red-Green-Refactor cycles to write tests before code and ensure quality through structured validation.
Instructions
Start a Test-Driven Development workflow with Red-Green-Refactor cycles
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task | Yes | Description of the feature to develop using TDD | |
| context | No | Additional context (optional) |
Implementation Reference
- src/tools/tddWorkflow.ts:47-59 (handler)Core handler function for tdd_workflow tool. Delegates to executeWorkflow with 'tdd' workflowType.export async function handleTddWorkflow( params: { task: string; context?: any }, sessionManager: SessionManager ) { return executeWorkflow( { task: params.task, workflowType: 'tdd', context: params.context }, sessionManager ); }
- src/tools/tddWorkflow.ts:9-43 (schema)Input schema defining parameters for tdd_workflow tool including task (required) and optional context.inputSchema: { type: 'object', properties: { task: { type: 'string', description: 'Description of the feature to develop using TDD' }, context: { type: 'object', description: 'Additional context (optional)', properties: { targetFiles: { type: 'array', items: { type: 'string' }, description: 'Files where tests and implementation will be added' }, testFirst: { type: 'boolean', default: true, description: 'Always write the test first (TDD principle)' }, acceptanceCriteria: { type: 'array', items: { type: 'string' }, description: 'Clear acceptance criteria for the feature' }, testFramework: { type: 'string', description: 'Testing framework to use' } } } }, required: ['task'] }
- src/index.ts:137-157 (registration)Registration of tdd_workflow tool via createTddWorkflowTool() in the server tools array used for ListToolsRequest.const tools = [ // Workflow entry points createRefactorWorkflowTool(), // Refactoring workflow createFeatureWorkflowTool(), // Feature creation workflow createTestWorkflowTool(), // Test writing workflow createTddWorkflowTool(), // TDD workflow createBuildCustomWorkflowTool(), // Custom workflow builder // Phase guidance tools ...createPhaseGuidanceTools(), // Handles both suggestive and directive modes createTestGuidanceTool(), // TEST phase guidance // Validation tools ...createValidationTools(), // Both validate_action and validate_phase_completion // Workflow management createUserInputRequiredTool(), // Escalation handling createWorkflowStatusTool(), // Workflow status createPhaseOutputTool(), // Phase output recording createDiscoverWorkflowToolsTool() // Tool discovery ];
- src/index.ts:250-256 (handler)Server-side dispatch handler for tdd_workflow tool calls in the MCP CallToolRequest handler switch statement.case 'tdd_workflow': return { content: [{ type: 'text', text: JSON.stringify(await handleTddWorkflow(args as any, sessionManager), null, 2) }] };
- src/tools/tddWorkflow.ts:5-45 (registration)Tool factory function that creates and returns the Tool object spec for tdd_workflow, including name, description, and schema.export function createTddWorkflowTool(): Tool { return { name: 'tdd_workflow', description: 'Start a Test-Driven Development workflow with Red-Green-Refactor cycles', inputSchema: { type: 'object', properties: { task: { type: 'string', description: 'Description of the feature to develop using TDD' }, context: { type: 'object', description: 'Additional context (optional)', properties: { targetFiles: { type: 'array', items: { type: 'string' }, description: 'Files where tests and implementation will be added' }, testFirst: { type: 'boolean', default: true, description: 'Always write the test first (TDD principle)' }, acceptanceCriteria: { type: 'array', items: { type: 'string' }, description: 'Clear acceptance criteria for the feature' }, testFramework: { type: 'string', description: 'Testing framework to use' } } } }, required: ['task'] } }; }