Loading...
Loading...
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.
npx skill4agent add paulnsorensen/git-gouda prekprek.tomlprek.toml.pre-commit-config.yaml| Marker file | Language/Framework |
|---|---|
| Rust |
| Python |
| TypeScript/JavaScript |
| Go |
| Ruby |
| Shell |
| Docker |
prek.toml.pre-commit-config.yaml| Hook ID | What it does |
|---|---|
| Trims trailing whitespace. Args: |
| Ensures files end with a newline |
| Validates YAML syntax. Args: |
| Validates TOML syntax |
| Validates JSON syntax (rejects duplicate keys) |
| Validates JSON5 syntax |
| Validates XML syntax |
| Detects unresolved merge conflict markers |
| Catches accidentally committed private keys |
| Blocks large files. Args: |
| Detects filenames that differ only by case |
| Validates symlinks point to existing targets |
| Ensures executable scripts have shebangs |
| Detects mixed line endings (LF vs CRLF) |
| Removes UTF-8 BOM |
| Blocks direct commits to protected branches |
# 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# 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" },
][[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[[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[[repos]]
repo = "https://github.com/shellcheck-py/shellcheck-py"
rev = "a23f6b85d0fdd5bb9d564e2579e678033debbdff"
hooks = [
{ id = "shellcheck" },
]prek.tomltrailing-whitespaceend-of-file-fixercheck-merge-conflictdetect-private-keycheck-added-large-filesprek install
prek run --all-filesprekcargo install prekbrew install prekpre-pushpre-commit[[repos.hooks]]
id = "pytest"
name = "Run tests"
language = "system"
entry = "pytest -x"
pass_filenames = false
always_run = true
stages = ["pre-push"]
priority = 100stages = ["pre-push"]default_install_hook_types = ["pre-commit", "pre-push"]prek installprek run --hook-stage pre-pushexclude = "^(vendor/|generated/|node_modules/)"files = { glob = "src/**/*.py" }
exclude = { glob = ["vendor/**", "dist/**"] }.pre-commit-config.yamlprek.tomlrepo: builtinrepo: https://github.com/pre-commit/pre-commit-hooksrepo: builtin.pre-commit-config.yamlprek.tomlprek run --all-filesprek.tomlprek install.git/hooks/