← ClaudeAtlas

pre-commit-setuplisted

Stand up pre-commit in a repository from shipped config fragments — the standard hygiene hooks (whitespace, EOF newline, YAML/JSON/TOML checks, large-file and merge-conflict guards) plus an optional Conventional Commits layer — then install the git hooks and run across the repo. Also the canonical policy for updating hooks safely (autoupdate --freeze to immutable SHAs). Use when adding pre-commit to a project, asked to "set up pre-commit" or "add commit hooks", when updating/refreshing hook pins, or when called from a project-setup skill (rust-setup, uv-setup, react-ts-setup) that layers its language hooks on top.
bcmyguest/personal-skills · ★ 0 · AI & Automation · score 58
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