Logo di Prek

Prek

Organizzazione
bastani-inc
prek

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.

Add to TypingMind

Panoramica

Pubblicato dabastani-inc
Repositoryatomic
Nome della skillprek
Stelle
856
Fork
115
File inclusi
Solo istruzioni
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • Tutto nelle istruzioni

    Tutto ciò che serve al modello è nelle istruzioni: nessun file aggiuntivo da sincronizzare.

  • Open source

    Pubblicata da bastani-inc su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Prek in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/bastani-inc/atomic/tree/main/.agents/skills/prek
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/bastani-inc/atomic.git /tmp/atomic
mkdir -p .claude/skills
cp -r /tmp/atomic/.agents/skills/prek .claude/skills/prek
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Prek in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Prek non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Prek non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

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:

Per that file, prefer explicit markdown docs when you need details:

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
  • 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
  • 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 auto-update: update pinned hook revisions
  • prek util yaml-to-toml: convert an existing YAML config to prek.toml
  • prek util identify <path>: inspect file tags when types, types_or, or exclude_types do not match as expected

Useful quality-of-life commands and options mentioned in the docs:

  • prek run --dry-run
  • prek run --directory <dir>
  • prek run --last-commit
  • prek run --skip <hook-or-project>
  • prek -C <dir> ...

For debugging:

  • prek run -vvv
  • PREK_NO_FAST_PATH=1 prek run: compare builtin fast-path behavior against the standard execution path
  • Check the Environment Variable Reference for PREK_* controls such as PREK_HOME, PREK_SKIP, and concurrency limits.

Built-in hook guidance

prek has two important builtin paths:

  • automatic fast path for supported hooks from https://github.com/pre-commit/pre-commit-hooks
  • explicit repo: builtin for offline, zero-setup built-in hooks

Reach for repo: builtin when speed, no-network setup, or minimal bootstrapping matters more than upstream pre-commit compatibility.

Builtin hooks called out by the docs include:

  • trailing-whitespace
  • check-added-large-files
  • check-case-conflict
  • check-illegal-windows-names
  • end-of-file-fixer
  • file-contents-sorter
  • fix-byte-order-marker
  • check-json
  • check-json5
  • pretty-format-json
  • check-toml
  • check-vcs-permalinks
  • check-yaml
  • check-xml
  • mixed-line-ending
  • check-symlinks
  • destroyed-symlinks
  • check-merge-conflict
  • detect-private-key
  • no-commit-to-branch
  • check-shebang-scripts-are-executable
  • check-executables-have-shebangs

Practical guidance for agents

  • Prefer prek.toml for new setups.
  • Prefer existing .pre-commit-config.yaml for migrations unless the user asks for TOML.
  • Reach for workspace mode in monorepos instead of forcing one giant root-only config.
  • Consider repo: builtin when offline or zero-setup hooks are useful.
  • If the repo already uses pre-commit-hooks, remember that prek can use built-in Rust implementations for some common hooks.
  • Start with a small default hook set, then add language-specific hooks the project already uses.
  • Use prek util yaml-to-toml instead of hand-converting YAML when migrating.
  • Before promising parity for a specific hook language, verify it in Language Support.

Domande frequenti

Cosa fa la skill IA Prek?

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.

Perché usare Prek su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Prek è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Prek in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/bastani-inc/atomic/tree/main/.agents/skills/prek. TypingMind legge il file SKILL.md e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Prek?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Prek?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Prek: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Prek è gratuita?

È pubblicata su GitHub da bastani-inc. Consulta il repository per i termini di licenza. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇