test_workflow
Start a focused workflow to write or improve test coverage by specifying tasks, target files, test types, and coverage goals for disciplined programming practices.
Instructions
Start a focused workflow for writing or improving test coverage
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task | Yes | Description of what to test or test coverage to add | |
| context | No | Additional context (optional) |
Implementation Reference
- src/tools/testWorkflow.ts:47-59 (handler)The handler function that executes the test_workflow tool logic by calling executeWorkflow with workflowType 'test'.export async function handleTestWorkflow( params: { task: string; context?: any }, sessionManager: SessionManager ) { return executeWorkflow( { task: params.task, workflowType: 'test', context: params.context }, sessionManager ); }
- src/tools/testWorkflow.ts:5-45 (schema)Tool factory function defining the test_workflow tool, including its name, description, and detailed input schema for parameters like task and context.export function createTestWorkflowTool(): Tool { return { name: 'test_workflow', description: 'Start a focused workflow for writing or improving test coverage', inputSchema: { type: 'object', properties: { task: { type: 'string', description: 'Description of what to test or test coverage to add' }, context: { type: 'object', description: 'Additional context (optional)', properties: { targetFiles: { type: 'array', items: { type: 'string' }, description: 'Files that need test coverage' }, testType: { type: 'string', enum: ['unit', 'integration', 'e2e', 'all'], description: 'Type of tests to write' }, testFramework: { type: 'string', description: 'Testing framework being used (e.g., jest, mocha, pytest)' }, coverageGoals: { type: 'array', items: { type: 'string' }, description: 'Specific coverage goals or scenarios to test' } } } }, required: ['task'] } }; }
- src/index.ts:137-157 (registration)Registration of the test_workflow tool (via createTestWorkflowTool()) in the main 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:242-248 (registration)In the CallToolRequest handler switch statement, dispatches execution of test_workflow by calling handleTestWorkflow.case 'test_workflow': return { content: [{ type: 'text', text: JSON.stringify(await handleTestWorkflow(args as any, sessionManager), null, 2) }] };