prek skill for agents

prek skill

The prek skill teaches an agent to set up Git hooks with prek, a Rust replacement for pre-commit: config, shims, priorities, built-in hooks and monorepos

  • 8,673 ★ on the repository
  • Last commit
  • MIT
SkillOfficial

Broad access

Why this level

  • The `prek install` command puts shims into the Git hooks directory, and they run on every commit and push
  • prek downloads hooks from remote repositories, builds their environments and runs them, so it executes third-party code
  • Formatters and fixing hooks edit files in the working tree, and `prek update` goes to the network for new revisions
All reasons and checks

j178/prek

Install

In your terminal, with SkillFoxx CLI

npx skillfoxx add skills/prek-skill

Detects the agents on your machine, shows the access level and pins the version.

Other ways to install

Access and checks

How we review

Broad accessThe tool can change data, run commands or handle secrets.

  • The `prek install` command puts shims into the Git hooks directory, and they run on every commit and push
  • prek downloads hooks from remote repositories, builds their environments and runs them, so it executes third-party code
  • Formatters and fixing hooks edit files in the working tree, and `prek update` goes to the network for new revisions

This is third-party code. Review the repository files before installing.

What it does

The `prek` skill from the prek repository explains to an agent how to set up and run Git hooks with prek, a Rust implementation of pre-commit. The agent first opens the `llms.txt` documentation index at prek.j178.dev and takes details from the pages in Markdown. For a new project the skill recommends a `prek.toml` config, and where a `.pre-commit-config.yaml` already exists it keeps that file and only switches the command from `pre-commit` to `prek`. It describes four kinds of hook repositories: remote, `local`, `meta` and `builtin`, regex and glob filters, the `priority` field for order and parallel runs, and the fields `env`, `priorities`, `minimum_prek_version` and `orphan`. The workflow is: check for an old config, install prek, validate the config with `prek validate-config`, install the Git shims and prepare hook environments with `prek install --prepare-hooks`, then run `prek run --all-files`. When moving from pre-commit the shims are reinstalled with the `-f` flag, and `prek util yaml-to-toml` converts YAML to TOML. For monorepos the skill suggests workspace mode, nested configs, `.prekignore` and `orphan`. It lists 24 built-in hooks that need no network, from `trailing-whitespace` and `check-yaml` to `detect-private-key` and `check-signed-commit`.

Who it is for. For developers who run pre-commit checks through pre-commit or want to move to the fast single-binary prek, and for agents asked to set up hooks in a repository.

Good fit when

  • The repository has no hooks and you need formatting, linters and file checks before a commit
  • The project already uses `.pre-commit-config.yaml` and you want to move to prek without changing the config
  • You need a `prek.toml` config with hook priorities and parallel runs
  • A monorepo with nested projects needs separate configs, `.prekignore` and isolation through `orphan`
  • You need hooks that do not download repositories: built-in hooks with `repo: builtin` work offline

Not a fit when

  • You need the config to stay portable to upstream pre-commit: the skill then advises keeping `.pre-commit-config.yaml` without the keys that exist only in prek
  • You need to stop the agent's own commands before they run: prek hooks fire on Git events, and the catalog has HOL Guard for intercepting agent actions
  • A hook's language is missing from the Language Support reference: the skill asks you to check support before promising compatibility

Example request

Set up prek in this repository: reuse the existing .pre-commit-config.yaml, install the Git hooks and run them on all files

Limitations

  • The skill does not hold a full command reference: it points to the online documentation at prek.j178.dev and to the `llms.txt` index. Without access to the site the agent gets only a short digest.
  • The config examples use TOML 1.1 multiline inline tables. If an editor or parser in the toolchain does not understand them, the skill suggests writing hooks as `[[repos.hooks]]`.
  • prek downloads and runs hooks from remote repositories such as `ruff-pre-commit`, and `prek update` refreshes the pinned `rev` revisions. Third-party code therefore runs on your machine.
  • `priority` applies inside one config file and is not compared across workspace projects.
  • The skill installs with `gh skill install`, which needs GitHub CLI 2.90.0 or newer. The documentation names no agent clients. The author notes that prek is still a young project. MIT license.

How to disable. Delete the `prek` skill folder from the agent's skills directory. The shims installed by `prek install` live in the repository's hooks directory: delete the `pre-commit`, `pre-push` and `commit-msg` files that prek created. The `prek.toml` or `.pre-commit-config.yaml` file stays in the project.

FAQ

How do I install the prek skill?

Run `gh skill install j178/prek prek`: the command needs GitHub CLI 2.90.0 or newer. The prek documentation gives this command in its block about the skill for agents.

Do I have to rewrite my pre-commit config?

No. When migrating the skill advises keeping `.pre-commit-config.yaml`, replacing `pre-commit` commands with `prek` and reinstalling the shims with `prek install -f`. If you want the new format, `prek util yaml-to-toml` converts YAML to `prek.toml`, and the skill does not recommend converting by hand.

Which built-in hooks does prek have?

The skill names 24 built-in hooks with `repo: builtin`: checks for JSON, JSON5, JSONC, TOML, YAML and XML, trailing whitespace, merge conflicts, private keys, large files, branches closed to commits and commit signature checks. They work offline and need no environment setup.

How do I set the order hooks run in?

Hooks with a smaller `priority` run earlier, and hooks with the same value may run in parallel. The top-level `priorities` field gives readable names to the numbers. The value applies inside one config file.

How do I use prek in a monorepo?

The skill suggests workspace mode instead of one giant root config: nested configs in subprojects, a `.prekignore` file for exclusions and the `orphan: true` field, which isolates a nested project from parent configs.

How do I debug a failing hook?

Run `prek run -vvv` for verbose output or `PREK_NO_FAST_PATH=1 prek run` to compare the built-in fast path with the standard one. The variables `PREK_HOME`, `PREK_SKIP` and the concurrency limits are described in the environment variable reference.

Discussion

No questions or reviews yet.

Skills

KubeShark skill: the agent finds the failure mode first, then writes manifests, Helm and Kustomize to official practice with a rollback plan

SkillMinimal access465Repository stars

A local gate in front of git push: the branch goes through review, tests, docs and lint in a separate worktree before it reaches the remote with a PR

CLIBroad access8.9KRepository stars
Official

Vercel's skill for Turborepo monorepos: turbo.json setup, caching, filters and CI, driven by the docs bundled in the installed package

SkillMinimal access31.2KRepository stars

A pattern library and skill set for recurring agent loops: issue triage, dependency cleanup, PR babysitting

PluginBroad access11.6KRepository stars
Official

The official Grafana skill set: PromQL, Loki, Tempo, Alloy, k6, dashboards and alerting for Claude Code, Cursor and Codex

SkillExtended access290Repository stars
Editors’ pick

Official HashiCorp skills for Terraform and Packer: HCL style, modules, tests, imports, Stacks, provider development and image builds

SkillMinimal access903Repository stars

README in short

The repository holds prek's Rust source, the site documentation in `docs/`, the skill in `skills/prek/SKILL.md` and an `AGENTS.md` with rules for contributors and agents. The front page opens with a description and a feature list: a single binary with no dependencies, compatibility with pre-commit configs, workspace mode, integration with `uv`. Next come install methods (a script for Linux and Windows, PyPI, Homebrew and others), a quick start, a list of projects such as CPython, Apache Airflow and FastAPI, GitHub Actions setup and a block about the skill.

README badge

Original SKILL.md

---
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`:

Report a problem

Foxx AIprek skill for agents
Foxx AI

I am Foxx AI and I have already vetted this tool. Ask about install, setup or anything else, and I will keep it simple.