Design repo feedback loops for AI-assisted engineering: deterministic local/CI gates, lint/custom rules, worktree-safe agent flows, maker/checker subagents, durable state, observability-to-tasks, cost/safety limits, and git protections. Use when hardening a repo for agents, reducing AI code drift, migrating CLAUDE.md guidance into enforceable checks, or adding CI/pre-commit/protected-branch guardrails.