iterate_guidance
Obtain structured guidance for resolving issues during the ITERATE phase, ensuring disciplined programming practices and verified outputs in development workflows.
Instructions
Get guidance for the ITERATE phase - fixing issues
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:215-223 (handler)Switch case dispatcher that handles 'iterate_guidance' tool call by invoking handlePhaseGuidance with the phase name and session manager.case 'lint_guidance': case 'iterate_guidance': case 'present_guidance': return { content: [{ type: 'text', text: JSON.stringify(await handlePhaseGuidance(name, sessionManager), null, 2) }] };
- src/tools/phaseGuidance.ts:52-65 (handler)Core handler function for all phase guidance tools, including 'iterate_guidance'. Determines mode (directive/suggestive) and routes to appropriate guidance generator.export async function handlePhaseGuidance( phaseName: string, sessionManager: SessionManager ): Promise<PhaseGuidance> { const session = sessionManager.getSession(); const isDirectiveMode = session?.workflowConfig !== undefined; // Route to appropriate guidance based on mode if (isDirectiveMode) { return getDirectiveGuidance(phaseName, sessionManager); } else { return getSuggestiveGuidance(phaseName, sessionManager); } }
- src/tools/phaseGuidance.ts:301-326 (handler)Specific implementation logic (guidance configuration) for 'iterate_guidance' in suggestive mode, defining objectives, instructions, approach, expected output, and next steps.iterate_guidance: { phase: 'ITERATE', objective: 'Fix issues discovered during the LINT phase', instructions: [ 'Address errors first, then warnings', 'Fix one issue at a time', 'Re-run linters after each fix', 'Don\'t introduce new issues while fixing', 'Document what you changed and why' ], suggestedApproach: [ 'Start with syntax/type errors', 'Then fix logical errors', 'Address style issues last', 'Test after each significant fix', 'Consider if the fix reveals a design issue' ], expectedOutput: { fixesApplied: 'List of all fixes made', fixDescription: 'What each fix addressed', remainingIssues: 'Any issues you couldn\'t fix', verificationStatus: 'Results after fixes', lessonsLearned: 'Insights from the issues found' }, nextPhase: 'Re-run lint_guidance or proceed to present_guidance when clean' },
- src/tools/phaseGuidance.ts:763-807 (handler)Specific implementation logic (guidance configuration) for 'iterate_guidance' in directive mode, including stricter instructions, required outputs, and validation.iterate_guidance: { phase: 'ITERATE', objective: 'Fix issues systematically - PROBLEM RESOLUTION PHASE', directiveInstructions: [ '🔴 MANDATORY: You MUST fix errors before warnings', '📝 REQUIRED: You MUST fix one issue at a time', '🔄 CRITICAL: You MUST re-run linters after each fix', '📊 ESSENTIAL: You MUST document all fixes applied', '📁 BLOCKING: You MUST create iteration progress report' ], instructions: [ 'Address errors in priority order (compilation, then logic, then style)', 'Fix one issue at a time to avoid introducing new problems', 'Re-run relevant linters after each fix', 'Document what was fixed and how', 'Track progress toward clean code state' ], requiredOutputFiles: [ { path: 'structured-workflow/{task-name}/07-iterate-progress.md', description: 'Documentation of all iteration fixes and adjustments', required: true, format: 'markdown', validationRules: [ 'Must list each issue addressed', 'Must describe how each issue was fixed', 'Must include verification results after fixes', 'Must note any remaining issues' ] } ], expectedOutput: { fixesApplied: 'List of all issues resolved', fixDescription: 'How each issue was addressed', verificationStatus: 'Results after fixes applied', remainingIssues: 'Any issues not yet resolved', outputFiles: '1 required documentation file created' }, nextPhase: 'Re-run lint_guidance to verify fixes, or present_guidance when clean' },
- src/tools/phaseGuidance.ts:38-41 (schema)Tool schema definition: name, description, and empty input schema object for 'iterate_guidance'.name: 'iterate_guidance', description: 'Get guidance for the ITERATE phase - fixing issues', inputSchema: { type: 'object', properties: {} } },
- src/tools/phaseGuidance.ts:5-50 (registration)Function that creates and returns the array of Tool objects for registration, including 'iterate_guidance'.export function createPhaseGuidanceTools(): Tool[] { const phaseTools: Tool[] = [ { name: 'setup_guidance', description: 'Get guidance for the SETUP phase - initialize workflow and establish patterns', inputSchema: { type: 'object', properties: {} } }, { name: 'audit_inventory_guidance', description: 'Get guidance for the AUDIT_INVENTORY phase - analyze code and catalog changes', inputSchema: { type: 'object', properties: {} } }, { name: 'compare_analyze_guidance', description: 'Get guidance for the COMPARE/ANALYZE phase - evaluating approaches', inputSchema: { type: 'object', properties: {} } }, { name: 'question_determine_guidance', description: 'Get guidance for the QUESTION_DETERMINE phase - clarify and finalize plan', inputSchema: { type: 'object', properties: {} } }, { name: 'refactor_guidance', description: 'Get guidance for the WRITE/REFACTOR phase - implementing changes', inputSchema: { type: 'object', properties: {} } }, { name: 'lint_guidance', description: 'Get guidance for the LINT phase - verifying code quality', inputSchema: { type: 'object', properties: {} } }, { name: 'iterate_guidance', description: 'Get guidance for the ITERATE phase - fixing issues', inputSchema: { type: 'object', properties: {} } }, { name: 'present_guidance', description: 'Get guidance for the PRESENT phase - summarizing work', inputSchema: { type: 'object', properties: {} } } ]; return phaseTools; }
- src/index.ts:137-158 (registration)Main tool registration array in index.ts that includes the phase guidance tools via spread of createPhaseGuidanceTools().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 ];