PrekSAFE
⚡ A fast Git hook manager written in Rust, designed as a drop-in alternative to pre-commit, reimagined.
Overview
⚡ A fast Git hook manager written in Rust, designed as a drop-in alternative to pre-commit, reimagined.
bb6969f8b8a8OBSERVED · 2026-10-20What it tells the agent
The instruction file, verbatim from the audited commit — this is the text the model reads, and the surface the audit's instruction layer examines. Quoted here so you can judge it without cloning anything.
---
name: prek
description: Use when setting up or running hooks with prek in any repository. prek is a Rust drop-in alternative to pre-commit for running Git hooks that check, format, lint, and validate code and repository files. Prefer it when speed, workspace mode, built-in hooks, shared toolchains, or native TOML configuration matter.
---
# prek
Use this skill when the user wants to set up or run Git hooks with `prek`.
`prek` is a Rust reimplementation of `pre-commit`. Its main job is to run hooks that check code and repository files before commit or on demand: formatters, linters, validators, security checks, and custom project checks.
## Start with the public docs
Use the LLM-oriented index first:
- [llms.txt](https://prek.j178.dev/llms.txt)
Per that file, prefer explicit markdown docs when you need details:
- [Introduction](https://prek.j178.dev/index.md)
- [Installation](https://prek.j178.dev/installation/index.md)
- [Quickstart](https://prek.j178.dev/quickstart/index.md)
- [Running Hooks](https://prek.j178.dev/running-hooks/index.md)
- [Cookbook](https://prek.j178.dev/cookbook/index.md)
- [Configuration](https://prek.j178.dev/configuration/index.md)
- [Monorepos](https://prek.j178.dev/monorepos/index.md)
- [Language Support](https://prek.j178.dev/reference/language-support/index.md)
- [Built-in Hooks](https://prek.j178.dev/built-in-hooks/index.md)
- [CLI Reference](https://prek.j178.dev/reference/cli/index.md)
- [Configuration Reference](https://prek.j178.dev/reference/configuration/index.md)
- [Environment Variable Reference](https://prek.j178.dev/reference/environment-variables/index.md)
- [Differences from pre-commit](https://prek.j178.dev/diff/index.md)
- [Benchmark](https://prek.j178.dev/benchmark/index.md)
## What prek is for
Use `prek` to:
- run hooks that check source code and repo contents
- install Git hook shims such as `pre-commit`, `pre-push`, and `commit-msg`
- run the same hook ecosystem used by `pre-commit`
- manage hook runtimes and toolchains for supported languages
- validate configs, update pinned hook revisions, and inspect configured hooks
Typical jobs for hooks run by `prek`:
- formatting and linting code
- validating YAML, JSON, TOML, XML, and similar files
- preventing merge-conflict markers, private keys, oversized files, and bad line endings
## Authoring configs
For new configs, prefer `prek.toml`.
Important repo types:
- remote repo: normal hook repository such as `https://github.com/astral-sh/ruff-pre-commit`
- `repo = "local"`: hooks defined in the current repository
- `repo = "meta"`: config-checking hooks like `check-hooks-apply`, `check-useless-excludes`, and `identity`
- `repo = "builtin"`: `prek`'s offline Rust-native hooks
Minimal examples:
```toml
[[repos]]
repo = "https://github.com/astral-sh/ruff-pre-commit"
rev = "v0.14.3"
hooks = [
{ id = "ruff" },
{ id = "ruff-format" },
]
```
```toml
[[repos]]
repo = "local"
hooks = [
{
id = "cargo-fmt",
name = "cargo fmt",
language = "system",
entry = "cargo fmt --",
files = "\\.rs$",
},
]
```
```toml
[[repos]]
repo = "builtin"
hooks = [
{ id = "trailing-whitespace" },
{ id = "check-yaml" },
]
```
These examples use TOML 1.1 multiline inline tables. Use `[[repos.hooks]]` array-of-tables if an editor or parser in the toolchain does not support that syntax yet, or when a hook has many fields such as `env`, `pass_filenames = false`, or `priority`.
Filtering patterns:
- regex is the most portable choice: `files = "\\.rs$"`
- `prek` also supports globs: `files = { glob = "src/**/*.rs" }`
- use glob lists for multiple roots: `exclude = { glob = ["target/**", "dist/**"] }`
Scheduling:
- smaller `priority` values run earlier
- hooks with the same `priority` can run concurrently
- top-level `priorities` can declare configuration-local aliases for numeric priorities
- hook `priority` accepts either a non-negative integer or a declared alias
- `priority` is evaluated within one config file, not across workspace projects
Useful `prek`-specific hook/config fields when editing TOML:
- `env` for per-hook environment variables
- `priorities` for readable, reusable priority aliases
- `priority` for hook ordering and concurrency
- `minimum_prek_version` for gating newer config features
- `orphan = true` to isolate a nested workspace project from parent configs
## Default workflow
When adopting `prek` in a repository:
1. Check whether the repo already has `.pre-commit-config.yaml` or `.pre-commit-config.yml`.
2. If it does, usually keep that config and switch the commands from `pre-commit` to `prek`.
3. If migrating from `pre-commit`, reinstall the Git shims with `prek install -f`.
4. If it does not, prefer creating `prek.toml` for a fresh setup.
5. Install `prek`.
6. Validate the config with `prek validate-config`.
7. Install the Git shims and prepare hook environments with `prek install --prepare-hooks`.
8. Run everything once with `prek run --all-files`.
9. For monorepos, consider nested configs, `.prekignore`, and `orphan: true`.
If the user explicitly wants maximum upstream portability, stay with `.pre-commit-config.yaml` and avoid `prek`-only keys.
## Install and run
Common install methods:
- `uv tool install prek`
- `brew install prek`
- `mise use prek`
- `cargo binstall prek`
- `cargo install --locked prek`
### Command guide
- `prek install`: install Git hook shims into the repo's effective hooks directory
- `prek prepare-hooks`: prepare hook environments without installing Git shims
- `prek install --prepare-hooks`: install shims and prepare environments in one step
- `prek run`: run hooks for the current staged file selection
- `prek run --all-files`: run hooks across the whole repository
- `prek run <hook-id>`: run only one hook
- `prek list`: list discovered hooks and projects
- `prek validate-config`: validate `prek.toml` or `.pre-commit-config.yaml`
- `prek update`: update pinned hook revisions
- `prek util yaml-to-toml`: convert an existiTrust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | NA |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- none-observed
- Shell
- none-observed
- Dependencies
- pinned
- Secrets in source
- none-found
Findings (0)
No findings outside the package's declared scope.
Gates applied: no_behavioural_pass.
bb6969f8b8a8full audit observations/trust-audit/skill/j178__prek.json · Report an issue / request a re-scanAudit history
Every audit this skill has had.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-20 | bb6969f8b8a8 | SAFE | B | 89 | first audit |
Questions
What does the prek — j178/prek skill do?
⚡ A fast Git hook manager written in Rust, designed as a drop-in alternative to pre-commit, reimagined.
Is prek — j178/prek safe to install?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean skill reads B.
What can prek — j178/prek access on my machine?
The audit observed no filesystem, network or shell use at all in its source.
What do I need installed to use prek — j178/prek?
Its own instructions reference commit-msg, pre-commit and pre-push. Dependencies are pinned to exact versions.
How current is this page?
The grade is for one exact copy of the source (bb6969f8b8a8), read on 2026-10-20. The repository is watched, and a new audit runs when it changes — this is the first audit.
Add this badge to your README
Shows this page's audit result and links back to it. It updates when the audit does.
[](https://modelsatlas.com/skills/j178/prek/)
Not your listing, or something out of date? Claim or update your listing.