Agent skill
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.
Install this agent skill to your Project
npx add-skill https://github.com/craigtkhill/stdd-agents/tree/main/skills/pre-commit-hooks
SKILL.md
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:
- Tests pass (GREEN)
- Run
prek run --all-files← here - Fix any issues raised
- 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
Language-Specific Hooks
- Rust: See RUST.md for Rust-specific hooks including test-first ordering enforcement
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 likecargo deny— run on push
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
test-driven-development
Use when writing tests or implementing code. Defines RED-GREEN-REFACTOR cycle and test execution workflow.
acceptance-test
Use when writing acceptance tests or adding scenarios to spec.yaml. Defines Given/When/Then format and acceptance test patterns.
specifying-requirements
Use when writing or updating spec.yaml files. Defines requirement format and user story structure.
spec-test-driven-development
Use when user requests new features or functionality. Defines complete workflow from specification through testing to implementation.
create-skill
Use when creating or modifying skills. Defines skill file structure, naming conventions, and integration patterns.
write-commit-message
Use when creating git commits. Defines conventional commit format and message structure guidelines.
Didn't find tool you were looking for?