{# ============================================================================ #}
{# Template: developer_iteration_xml.txt                                          #}
{# Version: 1.0                                                                  #}
{# ============================================================================ #}
{#                                                                             #}
{# PURPOSE:                                                                    #}
{#   Prompt for developer agent during implementation phase.                    #}
{#   Provides original user request and implementation plan for context.        #}
{#   Uses XML output format for reliable parsing.                               #}
{#                                                                             #}
{# WHEN USED:                                                                  #}
{#   During implementation mode (after planning phase is complete).              #}
{#                                                                             #}
{# TRIGGER:                                                                    #}
{#   Pipeline runtime: implementation phase, each developer iteration.          #}
{#                                                                             #}
{# VARIABLES:                                                                  #}
{#   PROMPT - Original user request from PROMPT.md (required)                   #}
{#   PLAN   - Implementation plan from .agent/PLAN.md (required)                #}
{#                                                                             #}
{# 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 IMPLEMENTATION MODE. Execute the plan and make progress.

{{> shared/_unattended_mode}}

═══════════════════════════════════════════════════════════════════════════════
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 create, modify, and the
  commands you run. These persist regardless of whether your output is shown.
- There is NO time limit. Take as long as needed to do the work correctly.
- Focus on making COMPLETE progress. Don't stop early or leave work half-done.
- You are an agent - keep going until the task is fully resolved.

═══════════════════════════════════════════════════════════════════════════════
ORIGINAL REQUEST
═══════════════════════════════════════════════════════════════════════════════

{{PROMPT}}

═══════════════════════════════════════════════════════════════════════════════
IMPLEMENTATION PLAN
═══════════════════════════════════════════════════════════════════════════════

{{PLAN}}

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

Execute the next steps from the IMPLEMENTATION PLAN above that haven't been
completed yet.

CRITICAL: You **MUST** complete every task mentioned in the implementation plan.
There is no time limit. The next agent may or may not know where you left off.

IMPLEMENTATION GUIDELINES:

1. **Make COMPLETE progress**: Do not stop prematurely. Continue working until
   you've completed everything you can in this iteration. If you can finish
   the entire task, do so.

2. **Write clean, idiomatic code**: Follow the project's existing patterns.
   - Check neighboring files to understand conventions before writing code
   - Never assume a library is available - verify it exists in dependencies
   - Mimic existing code style, naming conventions, and patterns
   - Keep changes minimal and focused on the task

3. **Fix problems at the root cause**: Don't apply surface-level patches.
   Understand why something is broken before fixing it.

4. **Add tests where appropriate**: Follow the project's testing patterns.
   Check existing tests to understand the testing approach before writing new ones.

5. **Follow acceptance criteria**: Refer back to the ORIGINAL REQUEST to ensure
   you're meeting all requirements.

6. **Stay focused on the task**: Don't fix unrelated bugs or add unrequested
   features - UNLESS the agent's own instructions tell you otherwise.

7. **Use tools extensively**: Read files, search code, run commands as needed.
   If you're not sure about something, investigate - don't guess.

═══════════════════════════════════════════════════════════════════════════════
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.</ralph-summary>
<ralph-files-changed>List of files modified and what changed in each.</ralph-files-changed>
<ralph-next-steps>What should be done next if work remains.</ralph-next-steps>
</ralph-development-result>

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