
prek
Onboard prek (Rust-powered pre-commit) into any project and suggest hooks tailored to the language/framework. Use when the user says "add prek", "set up pre-commit hooks", "configure prek", "what hooks should I use", or when you notice a project without a prek.toml that would benefit from pre-commit checks. Also trigger when the user wants to add new hooks to an existing prek.toml, audit their hook config, or migrate from pre-commit to prek. Covers Rust, Python, TypeScript/JavaScript, Go, Ruby, and Shell projects. Do NOT use for husky, lint-staged, or CI pipeline hook configuration — this skill is specifically for prek.
- Installs
- 58
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/paulnsorensen/skillz-that-grillz --skill prek- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads prek automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
prek
Onboard and configure prek — a fast, Rust-powered pre-commit hook manager.
When to use
- Project has no
prek.tomland would benefit from pre-commit hooks - User wants to add/audit/extend hooks in an existing
prek.toml - User is migrating from
.pre-commit-config.yamlto prek's native TOML format
Protocol
1. Detect project type
Scan the repo root for language markers:
| Marker file | Language/Framework |
|---|---|
Cargo.toml | Rust |
pyproject.toml, setup.py, requirements.txt | Python |
package.json | TypeScript/JavaScript |
go.mod | Go |
Gemfile | Ruby |
*.sh, zsh/, bin/ | Shell |
Dockerfile | Docker |
Multiple markers = polyglot project. Suggest hooks for all detected languages.
2. Check existing config
- If
prek.tomlexists, read it and identify what's already configured - If
.pre-commit-config.yamlexists, offer to migrate (prek reads YAML natively, but TOML is the native format with more features like glob patterns)
3. Suggest hooks
Present hooks in categories. Show what each hook does before adding. Use this reference:
Built-in hooks (repo = "builtin")
Fast, offline, zero-setup. Always suggest these as the foundation:
| Hook ID | What it does |
|---|---|
trailing-whitespace | Trims trailing whitespace. Args: --markdown-linebreak-ext=md |
end-of-file-fixer | Ensures files end with a newline |
check-yaml | Validates YAML syntax. Args: --allow-multiple-documents |
check-toml | Validates TOML syntax |
check-json | Validates JSON syntax (rejects duplicate keys) |
check-json5 | Validates JSON5 syntax |
check-xml | Validates XML syntax |
check-merge-conflict | Detects unresolved merge conflict markers |
detect-private-key | Catches accidentally committed private keys |
check-added-large-files | Blocks large files. Args: --maxkb=1024 |
check-case-conflict | Detects filenames that differ only by case |
check-symlinks | Validates symlinks point to existing targets |
check-executables-have-shebangs | Ensures executable scripts have shebangs |
mixed-line-ending | Detects mixed line endings (LF vs CRLF) |
fix-byte-order-marker | Removes UTF-8 BOM |
no-commit-to-branch | Blocks direct commits to protected branches |
Language-specific hooks (community repos)
Rust:
# Local hooks (no external repo needed)
[[repos]]
repo = "local"
[[repos.hooks]]
id = "cargo-fmt"
name = "cargo fmt"
language = "system"
entry = "cargo fmt --"
files = "\\.rs$"
pass_filenames = true
[[repos.hooks]]
id = "cargo-clippy"
name = "cargo clippy"
language = "system"
entry = "cargo clippy --all-targets --all-features -- -D warnings"
files = "\\.rs$"
pass_filenames = false
always_run = true
Python:
# Ruff (linter + formatter)
[[repos]]
repo = "https://github.com/astral-sh/ruff-pre-commit"
rev = "v0.11.6"
hooks = [
{ id = "ruff", args = ["--fix"] },
{ id = "ruff-format" },
]
TypeScript/JavaScript:
[[repos]]
repo = "local"
[[repos.hooks]]
id = "eslint"
name = "eslint"
language = "system"
entry = "npx eslint --fix"
files = "\\.(ts|tsx|js|jsx)$"
pass_filenames = true
[[repos.hooks]]
id = "prettier"
name = "prettier"
language = "system"
entry = "npx prettier --write"
files = "\\.(ts|tsx|js|jsx|json|css|md)$"
pass_filenames = true
Go:
[[repos]]
repo = "local"
[[repos.hooks]]
id = "go-fmt"
name = "go fmt"
language = "system"
entry = "gofmt -w"
files = "\\.go$"
pass_filenames = true
[[repos.hooks]]
id = "go-vet"
name = "go vet"
language = "system"
entry = "go vet ./..."
pass_filenames = false
always_run = true
Shell:
[[repos]]
repo = "https://github.com/shellcheck-py/shellcheck-py"
rev = "a23f6b85d0fdd5bb9d564e2579e678033debbdff"
hooks = [
{ id = "shellcheck" },
]
4. Fetch latest versions
Before writing config, check the community hook repos for their current recommended versions (ruff-pre-commit, shellcheck-py, etc.) — via the Context7 MCP if your harness has it, your harness's doc-lookup tool, or the repos' GitHub releases pages. Fall back to the versions listed above if no lookup is available.
5. Generate or augment prek.toml
New project: Generate a complete prek.toml with:
- Built-in hooks (always include:
trailing-whitespace,end-of-file-fixer,check-merge-conflict,detect-private-key,check-added-large-files) - Language-specific hooks based on detection
- Comments explaining each section
Existing project: Show a diff of what would be added. Don't duplicate hooks already present.
6. Install and verify
After writing config:
prek install
prek run --all-files
If prek isn't installed, tell the user to install it (cargo install prek or brew install prek) and add it to their packages.yaml if one exists.
Advanced options
Stage-specific hooks
Slow checks (tests, full builds) belong on pre-push, not pre-commit:
[[repos.hooks]]
id = "pytest"
name = "Run tests"
language = "system"
entry = "pytest -x"
pass_filenames = false
always_run = true
stages = ["pre-push"]
priority = 100
Global filters
Exclude vendored/generated code from all hooks:
exclude = "^(vendor/|generated/|node_modules/)"
Glob patterns (prek-only)
Prek supports glob patterns as an alternative to regex (not compatible with upstream pre-commit):
files = { glob = "src/**/*.py" }
exclude = { glob = ["vendor/**", "dist/**"] }
Migration from pre-commit
If .pre-commit-config.yaml exists:
- prek reads YAML natively — the existing config works as-is
- Offer to convert to
prek.tomlfor access to prek-only features (glob patterns,repo: builtin) - Replace
repo: https://github.com/pre-commit/pre-commit-hookswithrepo: builtinwhere hooks are supported
What You Don't Do
- Configure CI pipelines, GitHub Actions, or other CI hook systems
- Manage husky, lint-staged, or pre-commit (Python) configs
- Remove existing hooks without user confirmation
- Modify
.pre-commit-config.yamldirectly — only generatesprek.toml
Gotchas
- Context7 may be unavailable — fall back to training data for hook recommendations
prek run --all-filescan fail on first run if auto-fix hooks reformat everything- Rev pinning in
prek.tomlgoes stale — recommend periodic updates prek installneeds write access to.git/hooks/— fails in worktrees with shared hooks
FAQ
What does the prek skill do?
Onboard prek (Rust-powered pre-commit) into any project and suggest hooks tailored to the language/framework. Use when the user says "add prek", "set up pre-commit hooks", "configure prek", "what hooks should I use", or when you notice a project without a prek.toml that would benefit from pre-commit checks. Also trigger when the user wants to add new hooks to an existing prek.toml, audit their hook config, or migrate from pre-commit to prek. Covers Rust, Python, TypeScript/JavaScript, Go, Ruby, and Shell projects. Do NOT use for husky, lint-staged, or CI pipeline hook configuration — this skill is specifically for prek.
How do I install prek?
Run npx skills add https://github.com/paulnsorensen/skillz-that-grillz --skill prek in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/prek/ (personal) or .claude/skills/prek/ (project).
Which AI agents can use prek?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is prek safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains prek?
It is published by paulnsorensen in paulnsorensen/skillz-that-grillz. It has 58 recorded installs.
More from paulnsorensen/skillz-that-grillz
serena-config
paulnsorensen/skillz-that-grillz
Open the skill to read its SKILL.md instructions.
github-copilot-personal-instructions
paulnsorensen/skillz-that-grillz
Open the skill to read its SKILL.md instructions.
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.