skills/prek/SKILL.md
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 skillsauth add paulnsorensen/dotfiles prekInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Onboard and configure prek — a fast, Rust-powered pre-commit hook manager.
prek.toml and would benefit from pre-commit hooksprek.toml.pre-commit-config.yaml to prek's native TOML formatScan 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.
prek.toml exists, read it and identify what's already configured.pre-commit-config.yaml exists, offer to migrate (prek reads YAML natively, but TOML is the native format with more features like glob patterns)Present hooks in categories. Show what each hook does before adding. Use this reference:
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 |
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" },
]
Before writing config, use Context7 MCP to check for current recommended versions of community hook repos (ruff-pre-commit, shellcheck-py, etc.). Fall back to the versions listed above if Context7 is unavailable.
New project: Generate a complete prek.toml with:
trailing-whitespace, end-of-file-fixer, check-merge-conflict, detect-private-key, check-added-large-files)Existing project: Show a diff of what would be added. Don't duplicate hooks already present.
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.
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
Exclude vendored/generated code from all hooks:
exclude = "^(vendor/|generated/|node_modules/)"
Prek supports glob patterns as an alternative to regex (not compatible with upstream pre-commit):
files = { glob = "src/**/*.py" }
exclude = { glob = ["vendor/**", "dist/**"] }
If .pre-commit-config.yaml exists:
prek.toml for access to prek-only features (glob patterns, repo: builtin)repo: https://github.com/pre-commit/pre-commit-hooks with repo: builtin where hooks are supported.pre-commit-config.yaml directly — only generates prek.tomlprek run --all-files can fail on first run if auto-fix hooks reformat everythingprek.toml goes stale — recommend periodic updatesprek install needs write access to .git/hooks/ — fails in worktrees with shared hookstools
Reconstruct what a past coding-agent session was doing so you can resume it — goal, files touched, last verified state, and the next step — by querying the session logs. Use when the user says "what was I working on", "recover that session", "reconstruct where I left off", "resume my last session", "what did that session change", "rebuild context from logs", or invokes /work-recovery. Report-only — it never scores or judges. Do NOT use for usage scoring (that is /skill-improver, /tool-efficiency, /prompt-analytics) or one-off interactive log queries (that is /session-analytics).
development
Curate this repo's hallouminate wiki (.hallouminate/wiki/, the repo:dotfiles:wiki corpus) — add or update architecture pages, per-harness docs, and gotchas. Use when the user says "update the wiki", "document this in the wiki", "refresh the harness docs", "add a wiki page", "curate the wiki", "the wiki is stale", or invokes /wiki-curator. Also use at session end to write back a non-obvious decision or gotcha worth preserving. Grounds the existing wiki first, follows one-topic-per-file conventions, verifies every external doc URL before writing, and reindexes. Do NOT use for general code search (that is cheez-search) or for editing AGENTS.md command reference.
tools
Audit how a tool, command, or MCP server is actually used across coding-agent sessions and produce calibrated recommendations — tool-vs-task fit, error forensics, fix recommendations, permission friction, MCP health, and token economics. Use when the user says "tool efficiency", "am I using X efficiently", "audit tool usage", "why does X keep failing", "how do I fix this error", "what should I change", "permission friction", "is this MCP worth it", "tool error rate", "fix recommendations", or invokes /tool-efficiency. Do NOT use for auditing a skill or agent definition (that is /skill-improver) or for one-off interactive log queries (that is /session-analytics).
tools
Analyze how prompts and skill routing behave across coding-agent sessions and produce calibrated recommendations — prompt-pattern analysis, routing accuracy, and knowledge gaps. Use when the user says "analyze my prompts", "prompt patterns", "is routing working", "which skill should have fired", "knowledge gaps", "what do I keep asking", or invokes /prompt-analytics. Do NOT use for auditing a single skill/agent definition (that is /skill-improver), tool/MCP efficiency (that is /tool-efficiency), or one-off interactive log queries (that is /session-analytics).