{# ============================================================================ #}
{# Template: developer_iteration_xsd_retry.txt                                   #}
{# Version: 4.0 - STRICT XML-only fix mode                                       #}
{# ============================================================================ #}
{#                                                                             #}
{# PURPOSE:                                                                    #}
{#   Retry prompt when XML validation fails during development iteration.      #}
{#   This is STRICTLY for fixing malformed XML - NO other actions allowed.     #}
{#                                                                             #}
{# VARIABLES:                                                                  #}
{#   {{XSD_ERROR}} - XSD validation error message (required)                   #}
{#                                                                             #}
{# FILES TO READ:                                                               #}
{#   .agent/tmp/development_result.xsd - The XSD schema your output must conform to #}
{#   .agent/tmp/last_output.xml        - Your previous invalid output          #}
{#                                                                             #}
{# OUTPUT FORMAT:                                                               #}
{#   Valid <ralph-development-result> XML conforming to the XSD schema         #}
{# ============================================================================ #}

{{> shared/_unattended_mode}}

═══════════════════════════════════════════════════════════════════════════════
XSD VALIDATION FAILED - FIX XML ONLY
═══════════════════════════════════════════════════════════════════════════════

Your XML output at `{{DEVELOPMENT_RESULT_XML_PATH}}` failed XSD validation.

ERROR: {{XSD_ERROR}}

═══════════════════════════════════════════════════════════════════════════════
CRITICAL INSTRUCTIONS - READ CAREFULLY
═══════════════════════════════════════════════════════════════════════════════

You MUST:
1. Read the XSD schema at `{{DEVELOPMENT_RESULT_XSD_PATH}}`
2. Read your previous invalid output at `.agent/tmp/last_output.xml`
3. Fix ONLY the XML structure/format issues
4. Write the corrected XML to `{{DEVELOPMENT_RESULT_XML_PATH}}`

You MUST NOT:
- Write any new code
- Modify any source files
- Run any commands
- Do ANY development work
- Change the content/meaning of your response - ONLY fix the XML format

This is a PURE XML SYNTAX FIX. Your development work is done. The only problem
is that your XML output doesn't conform to the schema. Fix the XML structure,
nothing else.

═══════════════════════════════════════════════════════════════════════════════
COMMON XML MISTAKES TO FIX
═══════════════════════════════════════════════════════════════════════════════

1. Missing required elements (status, summary, etc.)
2. Wrong element order (check XSD for correct sequence)
3. Invalid status value (must be: completed, partial, or failed)
4. Unescaped special characters (use &lt; &gt; &amp; or CDATA)
5. Missing closing tags
6. Text before/after root element
7. Markdown code fences around XML (remove ```)

After reading the XSD schema, fix ONLY the XML validation error.
DO NOT do any other work.
