{# ============================================================================ #}
{# Template: developer_iteration_continuation_xml.txt                          #}
{# Version: 1.0                                                                #}
{# ============================================================================ #}
{#                                                                             #}
{# PURPOSE:                                                                    #}
{#   Continuation prompt when previous attempt returned "partial" or "failed". #}
{#   Provides context about what was previously done and guides agent to       #}
{#   continue from where work left off.                                        #}
{#                                                                             #}
{# WHEN USED:                                                                  #}
{#   During implementation mode when a previous attempt returned status        #}
{#   "partial" or "failed" - the agent needs to continue the work.             #}
{#                                                                             #}
{# TRIGGER:                                                                    #}
{#   Pipeline runtime: development phase continuation after partial/failed.    #}
{#                                                                             #}
{# VARIABLES:                                                                  #}
{#   PROMPT_PATH              - Path to PROMPT.md (for reference, not inline)  #}
{#   PLAN_PATH                - Path to .agent/PLAN.md (for reference)         #}
{#   PREVIOUS_STATUS          - Status from previous attempt (partial/failed)  #}
{#   PREVIOUS_SUMMARY         - Summary of what was done in previous attempt   #}
{#   PREVIOUS_FILES_CHANGED   - Files changed in previous attempt (optional)   #}
{#   PREVIOUS_NEXT_STEPS      - Agent's recommended next steps (optional)      #}
{#   CONTINUATION_ATTEMPT     - Current continuation attempt number (1+)       #}
{#   DEVELOPMENT_RESULT_XML_PATH - Path to write development result XML        #}
{#   DEVELOPMENT_RESULT_XSD_PATH - Path to XSD schema                          #}
{#                                                                             #}
{# OUTPUT FORMAT:                                                               #}
{#   <ralph-development-result>                                                 #}
{#     <ralph-status>completed|partial|failed</ralph-status>                    #}
{#     <ralph-summary>Brief summary of what was done</ralph-summary>            #}
{#     <ralph-files-changed>Optional list of files modified</ralph-files-changed> #}
{#     <ralph-next-steps>Optional next steps</ralph-next-steps>                 #}
{#   </ralph-development-result>                                                #}
{#                                                                             #}
{# EXTRACTION:                                                                 #}
{#   Parsed by extract_development_result_xml() in xml_extraction_development_result.rs #}
{#   Validated by validate_development_result_xml() in xsd_validation_development_result.rs #}
{# ============================================================================ #}

You are in CONTINUATION MODE. Continue the work from where you left off.

{{> shared/_unattended_mode}}

═══════════════════════════════════════════════════════════════════════════════
CRITICAL: THIS IS A CONTINUATION - DO NOT START OVER
═══════════════════════════════════════════════════════════════════════════════

This is continuation attempt #{{CONTINUATION_ATTEMPT}}. You previously returned
status="{{PREVIOUS_STATUS}}" which means work is incomplete.

**IMPORTANT RULES:**
1. DO NOT modify PROMPT.md or the implementation plan - they define the goal
2. DO NOT repeat work that was already completed
3. DO continue from where the previous attempt left off
4. Review what was done and focus on what remains

IMPORTANT: A full continuation context file may be available at `.agent/tmp/continuation_context.md`.
If it exists, read it first. It contains the authoritative continuation context and may include
content that was too large to inline in this prompt.

═══════════════════════════════════════════════════════════════════════════════
PREVIOUS ATTEMPT SUMMARY
═══════════════════════════════════════════════════════════════════════════════

Status: {{PREVIOUS_STATUS}}

What was accomplished:
{{PREVIOUS_SUMMARY}}

{% if PREVIOUS_FILES_CHANGED %}
Files changed in previous attempt:
{{PREVIOUS_FILES_CHANGED}}
{% endif %}

{% if PREVIOUS_NEXT_STEPS %}
Recommended next steps (from your previous attempt):
{{PREVIOUS_NEXT_STEPS}}
{% endif %}

═══════════════════════════════════════════════════════════════════════════════
REFERENCE FILES (DO NOT MODIFY)
═══════════════════════════════════════════════════════════════════════════════

- Original request: {{PROMPT_PATH}}
- Implementation plan: {{PLAN_PATH}}

Read these files to understand the full context, but do NOT modify them.

═══════════════════════════════════════════════════════════════════════════════
YOUR TASK
═══════════════════════════════════════════════════════════════════════════════

Continue the implementation from where you left off. Focus on:

1. Review the previous attempt's summary and next_steps above
2. Check the current state of files that were modified
3. Complete the remaining work from the implementation plan
4. Return status="completed" when ALL work is done

CRITICAL: Only return status="completed" when the ENTIRE task from PROMPT.md
is finished. If you can only make partial progress, return status="partial"
with detailed next_steps for the next continuation.

═══════════════════════════════════════════════════════════════════════════════
OUTPUT FORMAT
═══════════════════════════════════════════════════════════════════════════════

Write your XML to: `{{DEVELOPMENT_RESULT_XML_PATH}}`
XSD schema at: `{{DEVELOPMENT_RESULT_XSD_PATH}}`

For special characters, use CDATA: <![CDATA[a < b]]>

<ralph-development-result>
<ralph-status>completed|partial|failed</ralph-status>
<ralph-summary>Description of what you accomplished in THIS continuation.</ralph-summary>
<ralph-files-changed>List of files modified in THIS continuation.</ralph-files-changed>
<ralph-next-steps>If status is not completed, what should be done next.</ralph-next-steps>
</ralph-development-result>

Only <ralph-status> and <ralph-summary> are required.
Be as detailed as needed to document your work thoroughly.
