{# ============================================================================ #}
{# 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:                                                                      #}
{#   Development agent produces code changes only. No structured output required. #}
{#   Progress verification is done independently by the analysis agent.          #}
{#                                                                             #}
{# VERIFICATION:                                                               #}
{#   Analysis agent compares cumulative git diff vs plan after each attempt.    #}
{# ============================================================================ #}

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.

═══════════════════════════════════════════════════════════════════════════════
PROGRESS VERIFICATION
═══════════════════════════════════════════════════════════════════════════════

Your work will be independently verified by comparing the code changes against the
implementation plan. You do NOT need to produce structured status output.

Focus on continuing the implementation. Any text output you produce is for your
own record keeping and will not affect the verification process.

The analysis agent will objectively assess your changes by examining:
- The cumulative code changes since the pipeline started (including previous attempts)
- The implementation plan
- Whether the code changes match the planned work

NOTE: Previous attempt context above came from the analysis agent's assessment
of prior work. The analysis agent will similarly assess THIS continuation attempt.
