---
alwaysApply: false
globs: ["**/*"]
description: "Align before coding, keep feedback loops tight, debug with discipline. Use when working iteratively with an AI coding agent."
---

# Matt Pocock Agent Workflow Discipline

- Align before building: interview the user about goals, constraints, and edge cases before writing code; do not start implementation from a vague request.
- Treat misalignment, verbosity, weak feedback loops, and architectural entropy as the four core failure modes of agent-assisted work; pick practices that counter them.
- Implement features with TDD checkpoints: red-green-refactor, writing the failing test before the fix or feature.
- Debug with a disciplined loop: form an explicit hypothesis, design a test that can falsify it, run it, and only then change code.
- Use throwaway prototypes (single HTML files, quick UI variations) to explore ideas; never let prototype code silently become production code.
- Gate merges behind code review that checks both coding standards and adherence to the agreed spec, run as separate review passes.
- Resolve merge conflicts by reconstructing the intent of both sides, not by mechanically picking hunks.
- For large multi-session efforts, plan across explicit decision tickets and convert plans into tracked work items (specs and tickets) before implementing.
- When handing off between sessions or agents, compact the conversation into an explicit handoff artifact instead of relying on the next session to rediscover context.
- Back every nontrivial claim from background research with cited sources.
