- Home
- Skills
- Snowmead
- Guardrail Agent Skills
- Guardrail Commit Hooks Skill
guardrail-commit-hooks-skill_skill
- Shell
0
GitHub Stars
2
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill snowmead/guardrail-agent-skills --skill guardrail-commit-hooks-skill- LICENSE.txt1.0 KB
- SKILL.md16.6 KB
Overview
This skill helps you create, analyze, and manage prek (pre-commit replacement) commit hooks to enforce code quality guardrails. It guides detection of project languages, recommends context-aware hooks, and runs a full setup or update workflow to install and test hooks. Use it to prevent formatting, linting, and secret-leak issues before they reach version control.
How this skill works
The skill inspects the repository for language indicators (package.json, pyproject.toml, go.mod, Cargo.toml, etc.), existing hook tools (.pre-commit-config.yaml, .husky/, lefthook.yml) and monorepo patterns. It fetches the latest prek documentation and release metadata to avoid hardcoded versions, then builds a recommended config that always includes universal safety hooks and selectively includes file-type and language-specific hooks. It can also run install, initial scans, and automated updates.
When to use it
- Initializing a new git repo and you want automated guardrails
- You encounter formatting, linting, or secret-detection failures during commits
- You want to migrate husky or lefthook setups to prek
- You need a fast, dependency-free alternative to pre-commit
- You want to keep hook versions up-to-date across the project
Best practices
- Always fetch the latest hook versions from upstream APIs instead of hardcoding tags
- Include universal hooks (trailing-whitespace, end-of-file-fixer, detect-private-key) for every project
- Only add file-type validators (check-yaml, check-json, check-toml) when matching files are present
- Ask the team before enabling branch-blocking hooks like no-commit-to-branch
- Run prek install and then prek run --all-files to surface existing issues immediately
Example use cases
- Analyze a JS monorepo, detect multiple package.json files, and recommend biome/eslint hooks where relevant
- Set up prek for a new Python project with ruff and universal safety hooks, then run initial fixes
- Migrate an existing husky setup to prek and preserve equivalent checks
- Update external hook revs (ruff, biome, gitleaks) to the latest releases and run the updated checks
- Add gitleaks for comprehensive secret detection across a repository
FAQ
It checks for prek and offers installation options (uv, pip, or shell). You choose the method, then it runs the chosen install command.
Will it change my existing .pre-commit-config.yaml without asking?
No. If a config exists the skill asks whether to keep, update, or replace it and requires confirmation before writing changes.