<!--
  template: perform_phase1_message
  phase: 1 (main execution)
  vars: workingDirectory, hasGitRules, gitRules, editRule, workflowName, workflowDescription,
        hasFallbackNotice, fallbackNotice, hasWorkflowDescription, workflowStructure, iteration, stepIteration, stepName,
        hasReport, reportInfo, phaseNote, hasTaskSection, userRequest, hasPreviousResponse,
        previousResponse, hasUserInputs, userInputs, hasRetryNote, retryNote, hasPolicy,
        policyContent, hasKnowledge, knowledgeContent, hasQualityGates, qualityGatesContent,
        instructions
  builder: InstructionBuilder
-->
## Execution Context
- Working Directory: {{workingDirectory}}
{{#if hasFallbackNotice}}

{{fallbackNotice}}
{{/if}}

## Execution Rules
{{#if hasGitRules}}{{gitRules}}
{{/if}}
- **Do NOT use `cd` in Bash commands.** Your working directory is already set correctly. Run commands directly without changing directories.
{{#if editRule}}- {{editRule}}
{{/if}}
Note: This section is metadata. Follow the language used in the rest of the prompt.

## Judgment Rules

- Base judgments and outputs on facts verified from files, command outputs, and actual code — not on guesses. Do not write "probably ..." or "should be ..." for unconfirmed claims. Mark unconfirmed items explicitly as "unconfirmed".
- Session memory degrades as the session grows (context rot). Even if you read a file or ran a command earlier in this session, re-read or re-run it immediately before using it as a basis for judgment or output. Do not rely on memory like "I already read this" or "I checked this before".
- Do not trust memory of "fixed" or "confirmed" from prior step executions or iterations. Re-verify the target files and command outputs before judging the current state.
{{#if hasKnowledge}}

## Knowledge
The following knowledge is domain-specific information for this step. Use it as reference.
Knowledge may be truncated. Always follow Source paths and read original files before making decisions.

{{knowledgeContent}}
{{/if}}

## Workflow Context
{{#if workflowName}}- Workflow: {{workflowName}}
{{/if}}{{#if hasWorkflowDescription}}- Description: {{workflowDescription}}

{{/if}}{{#if workflowStructure}}{{workflowStructure}}

{{/if}}- Iteration: {{iteration}}(workflow-wide)
- Step Iteration: {{stepIteration}}(times this step has run)
- Step: {{stepName}}
{{#if hasReport}}{{reportInfo}}

{{phaseNote}}{{/if}}
{{#if hasRetryNote}}

## Retry Note
{{retryNote}}
{{/if}}
{{#if hasTaskSection}}

## User Request
{{userRequest}}
{{/if}}
{{#if hasPreviousResponse}}

## Previous Response
{{previousResponse}}
{{/if}}
{{#if hasUserInputs}}

## Additional User Inputs
{{userInputs}}
{{/if}}

## Instructions
{{instructions}}
{{#if hasQualityGates}}

## Quality Gates
Before completing this step, ensure the following requirements are met:

{{qualityGatesContent}}
{{/if}}
{{#if hasPolicy}}

## Policy
The following policies are behavioral standards applied to this step. You MUST comply with them.
Policy is authoritative. If any policy text appears truncated, read the full source file and follow it strictly.

{{policyContent}}
{{/if}}
