{# ============================================================================ #}
{# Template: fix_mode_xml.txt #}
{# Version: 1.2 #}
{# ============================================================================ #}
{# #}
{# PURPOSE: #}
{# Prompt for fix mode to address issues found during review. #}
{# Uses XML output format for reliable parsing. #}
{# #}
{# VARIABLES: #}
{# {{PROMPT}} - Original user requirements (required) #}
{# {{PLAN}} - Implementation plan (required) #}
{# {{ISSUES}} - Issues from review (required) #}
{# {{FILES_TO_MODIFY}} - Files that may be modified (required) #}
{# #}
{# OUTPUT FORMAT: #}
{# <ralph-fix-result> #}
{# <ralph-status>all_issues_addressed|issues_remain|no_issues_found</ralph-status> #}
{# <ralph-summary>Optional summary of fixes</ralph-summary> #}
{# </ralph-fix-result> #}
{# #}
{# EXTRACTION: #}
{# Parsed by extract_fix_result_xml() in xml_extraction_fix_result.rs #}
{# Validated by validate_fix_result_xml() in xsd_validation_fix_result.rs #}
{# ============================================================================ #}
You are in FIX MODE. Address issues found during review.
{{> shared/_unattended_mode}}
{{> shared/_no_git_commit}}
═══════════════════════════════════════════════════════════════════════════════
IMPORTANT: EXECUTION CONTEXT
═══════════════════════════════════════════════════════════════════════════════
- Your text output may or may not be shown to the user - it may be discarded.
- What matters is the WORK you do: the files you modify and commands you run.
These persist regardless of whether your output is shown.
- There is NO time limit. Take as long as needed to fix the issues correctly.
- Focus on making COMPLETE progress. Fix all issues you can, don't leave work half-done.
═══════════════════════════════════════════════════════════════════════════════
REVIEW FINDINGS AND RELATED DEFECTS
═══════════════════════════════════════════════════════════════════════════════
{{ISSUES}}
═══════════════════════════════════════════════════════════════════════════════
FILES YOU SHOULD LOOK AT AS STARTING POINT
═══════════════════════════════════════════════════════════════════════════════
{{FILES_TO_MODIFY}}
═══════════════════════════════════════════════════════════════════════════════
CONTEXT
═══════════════════════════════════════════════════════════════════════════════
ORIGINAL REQUEST:
{{PROMPT}}
IMPLEMENTATION PLAN:
{{PLAN|default="(no plan available)"}}
═══════════════════════════════════════════════════════════════════════════════
YOUR TASK
═══════════════════════════════════════════════════════════════════════════════
Address the listed review findings and any additional concrete defects discovered during investigation or validation. For each finding/defect you address:
1. Read the relevant file(s) to understand the context
2. Implement the fix following project patterns
3. Verify your fix addresses the root cause, not just the symptom
CRITICAL CONSTRAINTS:
- You MUST read files before editing them
- If specific files are listed above, use them as a starting point, it's possible
you may have to edit a completely different file
- You MUST NOT modify the ISSUES content - it is provided for reference only
INVESTIGATION GUIDANCE:
- If a finding lacks file references, explore as needed (focused, evidence-driven)
to locate the relevant code (for example: grep for function/class names mentioned)
- stop exploring once you have enough evidence to identify root cause and fix path.
FIX GUIDELINES:
- Fix problems at the root cause, not with surface-level patches
- Follow existing code patterns and conventions
- Add tests if the issue was a missed test case
- If getting rid of tech debt is necessary to fix a bug, you **MUST** do so.
Do **NOT** leave the code in a worse state from a bug fix.
- Run relevant unit/integration tests for the areas you changed and for the reported issues.
- If tests or investigation reveal additional real bugs, fix them in this pass.
- Do not stay narrowly scoped to only the listed issue text when concrete related defects are discovered.
- DO NOT ONLY FIX the listed issues if you discover other concrete bugs while validating your changes.
VALIDATION AND COMPLETION DISCIPLINE:
- Ensure your final changes are validated with relevant checks (tests/lint/build as applicable).
- Before finishing, verify the fixed behavior and confirm no regressions in touched areas.
- If validation uncovers more defects, continue fixing until the touched scope is stable.
- Relevant checks may be defined in project instruction files (for example `AGENTS.md`, `CLAUDE.md`, or `.agent/` directory configuration); follow those required verification steps.
═══════════════════════════════════════════════════════════════════════════════
OUTPUT FORMAT
═══════════════════════════════════════════════════════════════════════════════
Write your XML to: `{{FIX_RESULT_XML_PATH}}`
XSD schema at: `{{FIX_RESULT_XSD_PATH}}`
For special characters, use CDATA: <![CDATA[a < b]]>
<ralph-fix-result>
<ralph-status>all_issues_addressed|issues_remain|no_issues_found</ralph-status>
<ralph-summary>Summary of what was fixed and how.</ralph-summary>
</ralph-fix-result>
Only <ralph-status> is required. Be thorough in documenting your fixes.