Refactor high-complexity React components in Dify frontend. Use when `pnpm analyze-component...
npx skills add t3chn/codex-skills --skill "vi-prek"
Install specific skill from multi-skill repository
# Description
Set up and configure prek (Rust drop-in replacement for pre-commit) in repositories: create/update `.pre-commit-config.yaml`, install/uninstall git hooks (`uvx prek install` / `uvx prek uninstall`), migrate from `pre-commit`, and add minimal CI (e.g., GitHub Actions). Use when a project needs pre-commit-style hooks wired up via prek.
# SKILL.md
name: vi-prek
description: "Set up and configure prek (Rust drop-in replacement for pre-commit) in repositories: create/update .pre-commit-config.yaml, install/uninstall git hooks (uvx prek install / uvx prek uninstall), migrate from pre-commit, and add minimal CI (e.g., GitHub Actions). Use when a project needs pre-commit-style hooks wired up via prek."
Prek Setup
Set up prek in a repo with minimal, reviewable changes.
Workflow
1) Identify the scenario
- Migration: repo already has
.pre-commit-config.yaml/.pre-commit-config.yml. - New setup: no pre-commit config yet.
2) Ensure prek is available
Always run prek via uvx (so commands look like uvx prek ...).
Verify with uvx prek --version. If uvx is missing, install uv first.
3) Create or keep the config
Prefer .pre-commit-config.yaml at the repo root.
If migrating, keep the existing config unchanged unless the user asks to modify hooks.
Optional generator: uvx prek sample-config -f .pre-commit-config.yaml.
4) Run hooks and wire into git
- Run locally:
uvx prek run(staged files) oruvx prek run --all-files. - Install git hook:
uvx prek install. - Migration from
pre-commit: runuvx prek install -fonce to overwrite the existing hook. - Undo:
uvx prek uninstall.
5) Add minimal CI (GitHub Actions)
If the repo uses GitHub Actions, add a minimal workflow (see references/ci.md).
6) Monorepos (only if relevant)
Use workspace mode (see references/workspace.md).
7) Sanity checks
- Validate config(s):
uvx prek validate-config. - Keep diffs minimal and explicit; do not add extra hooks unless requested.
References (load only if needed)
references/quickstart.md— Migration vs new setup checklistreferences/installation.md— Install/update/completionsreferences/configuration.md— Config patterns + prek-only keysreferences/cli.md— Commands, flags, selectorsreferences/workspace.md— Monorepos + workspace discoveryreferences/ci.md— GitHub Actions + Docker usagereferences/languages.md—language/language_version/ toolchainsreferences/builtin.md—repo: builtinand fast pathreferences/debugging.md— Verbose mode + log filereferences/faq.md—prek install --install-hooksexplanation
Skill maintenance
- Validate this skill locally:
uvx --from pyyaml python /Users/vi/.codex/skills/.system/skill-creator/scripts/quick_validate.py skills/vi-prek
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.