Agent Skills: Pre-Commit Hooks

Use when running pre-commit hooks manually (e.g. before committing or after implementing). This project uses prek, not pre-commit. Defines the correct commands for running hooks.

UncategorizedID: craigtkhill/stdd-agents/pre-commit-hooks

Install this agent skill to your local

pnpm dlx add-skill https://github.com/craigtkhill/stdd-agents/tree/HEAD/skills/pre-commit-hooks

Skill Files

Browse the full folder contents for pre-commit-hooks.

Download Skill

Loading file tree…

skills/pre-commit-hooks/SKILL.md

Skill Metadata

Name
pre-commit-hooks
Description
Use when running pre-commit hooks manually (e.g. before committing or after implementing). This project uses prek, not pre-commit. Defines the correct commands for running hooks.

Pre-Commit Hooks

This project uses prek as the pre-commit hook runner. Do NOT use pre-commit run — always use prek run.

Running Hooks

Run all hooks across all files:

prek run --all-files

Run hooks on specific files:

prek run --files path/to/file.rs

Run hooks on files changed since last commit:

prek run --last-commit

When to Run

Always run prek run --all-files after implementing code and before committing, as part of the STDD workflow:

  1. Tests pass (GREEN)
  2. Run prek run --all-files ← here
  3. Fix any issues raised
  4. Commit

Installing Hooks

On a fresh checkout, install the git hooks with:

just setup

Which runs:

prek install
prek install --hook-type commit-msg
prek install --hook-type pre-push

Hook Stages

Hooks are split across two stages:

  • pre-commit (prek install): formatting, linting, style checks — run on every commit
  • pre-push (prek install --hook-type pre-push): heavier checks like cargo deny — run on push