# Agent Instructions — Index

Pointer index; bodies in `AGENTS.rules.md`, injected in full by the SessionStart hook on every session (ADR-151 — no change-class conditionality). Do NOT merge the bodies into this file: the index/body split is what keeps per-turn cost at ~5 kB instead of ~42 kB (ADR-151 rejected that as option C-ii).

## Hard Rules

- [id: hr-never-git-stash-in-worktrees]
- [id: hr-mcp-tools-playwright-etc-resolve-paths]
- [id: hr-when-a-command-exits-non-zero-or-prints]
- [id: hr-always-read-a-file-before-editing-it]
- [id: hr-when-a-plan-specifies-relative-paths-e-g]
- [id: hr-the-host-terminal-is-warp]
- [id: hr-the-bash-tool-runs-in-a-non-interactive]
- [id: hr-exhaust-all-automated-options-before]
- [id: hr-never-label-any-step-as-manual-without]
- [id: hr-multi-step-post-merge-bootstrap-script]
- [id: hr-tagged-build-workflow-needs-initial-tag-push]
- [id: hr-ship-message-no-operator-checklist]
- [id: hr-when-triaging-a-batch-of-issues-never]
- [id: hr-all-infrastructure-provisioning-servers]
- [id: hr-fresh-host-provisioning-reachable-from-terraform-apply]
- [id: hr-prod-host-config-change-immutable-redeploy]
- [id: hr-autonomous-loop-skill-api-budget-disclosure]
- [id: hr-every-new-terraform-root-must-include-an]
- [id: hr-tf-variable-no-operator-mint-default]
- [id: hr-new-skills-agents-or-user-facing]
- [id: hr-before-shipping-ship-phase-5-5-runs]
- [id: hr-when-a-workflow-concludes-with-an]
- [id: hr-before-asserting-github-issue-status]
- [id: hr-never-run-commands-with-unbounded-output]
- [id: hr-never-write-to-claude-code-memory-claude]
- [id: hr-when-in-a-worktree-never-read-from-bare]
- [id: hr-github-api-endpoints-with-enum]
- [id: hr-menu-option-ack-not-prod-write-auth]
- [id: hr-ssh-diagnosis-verify-firewall]
- [id: hr-never-git-add-a-in-user-repo-agents]
- [id: hr-dev-prd-distinct-supabase-projects]
- [id: hr-weigh-every-decision-against-target-user-impact]
- [id: hr-never-paste-secrets-via-bang-prefix]
- [id: hr-gdpr-gate-on-regulated-data-surfaces]
- [id: hr-type-widening-cross-consumer-grep]
- [id: hr-write-boundary-sentinel-sweep-all-write-sites]
- [id: hr-bulk-delete-per-item-live-infra-role-check]
- [id: hr-no-dashboard-eyeball-pull-data-yourself]
- [id: hr-observability-as-plan-quality-gate]
- [id: hr-no-ssh-fallback-in-runbooks]
- [id: hr-observability-layer-citation]
- [id: hr-github-app-auth-not-pat]
- [id: hr-monitor-not-run-in-background-for-polling]
- [id: hr-verify-repo-capability-claim-before-assert]
- [id: hr-pipeline-skills-never-inline-after-go-route]
- [id: hr-third-party-content-grep-on-undertaking]

## Workflow Gates

- [id: wg-every-feature-listed-in-a-roadmap-phase]
- [id: wg-when-closing-a-phase-milestone-update]
- [id: wg-when-fixing-a-workflow-gates-detection]
- [id: wg-zero-agents-until-user-confirms]
- [id: wg-verified-work-ships-without-asking]
- [id: wg-never-bump-version-files-in-feature]
- [id: wg-after-marking-a-pr-ready-run-gh-pr-merge]
- [id: wg-ship-push-before-merge]
- [id: wg-cla-signed-author-before-merge]
- [id: wg-after-a-pr-merges-to-main-verify-all]
- [id: wg-dark-launch-deploy-gates]
- [id: wg-at-session-start-run-bash-plugins-soleur]
- [id: wg-at-session-start-after-cleanup-merged]
- [id: wg-when-a-test-runner-crashes-segfault-oom]
- [id: wg-when-tests-fail-and-are-confirmed-pre]
- [id: wg-when-an-audit-identifies-pre-existing]
- [id: wg-when-deferring-a-capability-create-a]
- [id: wg-defer-only-after-inline-triage]
- [id: wg-when-a-workflow-gap-causes-a-mistake-fix]
- [id: wg-every-session-error-must-produce-either]
- [id: wg-use-closes-n-in-pr-body-not-title-to]
- [id: wg-after-merging-a-pr-that-adds-or-modifies]
- [id: wg-plan-prescribed-skills-must-run-inline]
- [id: wg-architecture-decision-is-a-plan-deliverable]
- [id: wg-end-of-work-emit-resume-prompt]
- [id: wg-block-pr-ready-on-undeferred-operator-steps]
- [id: wg-pm-class-followthrough-for-operator-dogfood]
- [id: wg-record-recurring-vendor-expense-before-ready]
- [id: wg-ui-feature-requires-pen-wireframe]

## Code Quality

- [id: cq-write-failing-tests-before]
- [id: cq-before-pushing-package-json-changes]
- [id: cq-rule-ids-are-immutable]
- [id: cq-agents-md-why-single-line]
- [id: cq-agents-md-tier-gate]
- [id: cq-nextjs-route-files-http-only-exports]
- [id: cq-silent-fallback-must-mirror-to-sentry]
- [id: cq-ref-removal-sweep-cleanup-closures]
- [id: cq-union-widening-grep-three-patterns]
- [id: cq-pg-security-definer-search-path-pin-pg-temp]
- [id: cq-eleventy-critical-css-screenshot-gate]
- [id: cq-skill-description-budget-headroom]
- [id: cq-test-fixtures-synthesized-only]
- [id: cq-regex-unicode-separators-escape-only]
- [id: cq-cite-content-anchor-not-line-number]
- [id: cq-assert-anchor-not-bare-token]

## Review & Feedback

- [id: rf-after-merging-read-files-from-the-merged]
- [id: rf-never-skip-qa-review-before-merging]
- [id: rf-before-spawning-review-agents-push-the]
- [id: rf-before-shipping-verify-1-review-comments]
- [id: rf-when-a-reviewer-or-user-says-to-keep-a]
- [id: rf-review-finding-default-fix-inline]

## Passive Domain Routing

- [id: pdr-when-a-user-message-contains-a-clear]
- [id: pdr-do-not-route-on-trivial-messages-yes]

## Communication

- [id: cm-challenge-reasoning-instead-of]
- [id: cm-delegate-verbose-exploration-3-file]
- [id: cm-when-proposing-to-clear-context-or]
