# Rule: Shared pre-commit policy

## Requirement

Every A2C-governed **software** repository must version a shared `.pre-commit-config.yaml` appropriate to its language or stack and install hooks during bootstrap.

Must include **`a2c-pre-commit-hooks`** with **`check-changelog`** — see `rules/12-a2c-pre-commit-hooks.md`.

## Default scope: changed files

- **Local:** hooks run on staged files at commit time
- **CI:** run pre-commit on changed files for the MR or commit — not `--all-files` by default

## Manual full-tree runs

`pre-commit run --all-files` is permitted only as a **deliberate team action** (new hooks, tightened rules, legacy cleanup). It is not default CI behavior.

After a cleanup commit, resume normal changed-file enforcement.

## Fast feedback

Hooks must stay fast: formatting, linting, simple static checks, secret detection, and only very fast tests when appropriate. Heavy suites belong outside the commit path unless explicitly adopted.

## Canonical reference

[docs/workflow/pre-commit-policy.md](../docs/workflow/pre-commit-policy.md) and [ADR-0001](../docs/adr/0001-shared-pre-commit-policy.md).
