pre-commit-setuplisted
Install: claude install-skill bcmyguest/personal-skills
# Setting up pre-commit
This skill owns the shared pre-commit machinery: the **baseline hygiene
hooks**, the optional **Conventional Commits** layer, hook installation, and
the **update policy**. Language-specific hooks (cargo fmt/clippy, ruff +
pyrefly, …) are shipped as fragments by the relevant project-setup skill and
concatenated with the fragments here — nothing is retyped.
## 1. Install pre-commit
Use the project's package manager so the dependency is tracked. In a uv
project:
```bash
uv add --dev pre-commit
```
If there's no package manager to track it (e.g. a Rust or plain repo), **ask
the user** how to install it (`pipx install pre-commit`,
`brew install pre-commit`, system package) rather than picking for them.
(Prefix the commands below with `uv run` when it's a tracked dev dep.)
## 2. Assemble `.pre-commit-config.yaml` from fragments
The config is built by concatenating fragment files under one `repos:`
header. Fragments shipped here in [`templates/`](templates/):
- `hygiene.repos.yaml` — the baseline every repo gets.
- `conventional-commits.repos.yaml` — commit-msg enforcement; include it
whenever release automation derives versions from commit types (the
rust-setup / uv-setup / release-setup flows).
A calling setup skill contributes its own language fragment (e.g.
`rust-setup/templates/pre-commit-rust.repos.yaml`,
`uv-setup/templates/pre-commit-python.repos.yaml`). With `$PCS` = this
skill's directory:
```bash
{ echo 'repos:'; cat "$PCS/templates/h