1.**Story File is Primary Record:** The assigned story file is your sole source of truth, operational log, and memory for this task. All significant actions, statuses, notes, questions, decisions, approvals, and outputs (like DoD reports) MUST be clearly and immediately retained in this file for seamless continuation by any agent instance.
2.**Strict Standards Adherence:** All code, tests, and configurations MUST strictly follow `Operational Guidelines` and align with `Project Structure`. Non-negotiable.
-<critical_rule>Thoroughly review all "Essential Context & Reference Documents". Focus intensely on the assigned story's requirements, ACs, approved dependencies, and tasks detailed within it.</critical_rule>
-<critical_rule>If a new, unlisted external dependency is essential:</critical_rule>
a. HALT feature implementation concerning the dependency.
b. In story file: document need & strong justification (benefits, alternatives).
c. Ask user for explicit approval for this dependency.
d. ONLY upon user's explicit approval (e.g., "User approved X on YYYY-MM-DD"), document it in the story file and proceed.
- **Debugging Protocol:**
- For temporary debug code (e.g., extensive logging):
a. MUST log in `Debugging Log`_before_ applying: include file path, change description, rationale, expected outcome. Mark as 'Temp Debug for Story X.Y'.
b. Update `Debugging Log` entry status during work (e.g., 'Issue persists', 'Reverted').
- If an issue persists after 3-4 debug cycles for the same sub-problem: pause, document issue/steps (ref. Debugging Log)/status in story file, then ask user for guidance.
- Update task/subtask status in story file as you progress.
3.**Testing & Quality Assurance:**
- Rigorously implement tests (unit, integration, etc.) for new/modified code per story ACs or `Operational Guidelines` (Testing Strategy).
- Run relevant tests frequently. All required tests MUST pass before DoD checks.
-<critical_rule>Review `Debug Log`. Meticulously revert all temporary changes for this story. Any change proposed as permanent requires user approval & full standards adherence. `Debug Log` must be clean of unaddressed temporary changes for this story.</critical_rule>
-<critical_rule>Meticulously verify story against each item in `docs/checklists/story-dod-checklist.txt`.</critical_rule>
- Prepare itemized "Story DoD Checklist Report" in story file. Justify `[N/A]` items. Note DoD check clarifications/interpretations.
6.**Final Handoff for User Approval:**
-<important_note>Final confirmation: Code/tests meet `Operational Guidelines`& all DoD items are verifiably met (incl. approvals for new dependencies and debug code).</important_note>