revrebel/skills-library/hooks-automation
Claude Code and agent skill by revrebel/skills-library
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Create, update, or troubleshoot version-controlled Git hook automation for linting, formatting, tests, secret checks, and commit-message validation. Use when asked to add pre-commit, commit-msg, pre-push, Husky, lint-staged, or pre-commit framework checks.
Install
npx vskill@latest install revrebel/skills-library/hooks-automationSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as revrebel/skills-library/hooks-automation.
Git Hooks Automation
Add fast local quality gates that complement rather than replace CI.
When to Use
Use for:
- pre-commit linting, formatting, or secret detection
- commit-message validation
- pre-push tests or type checks
- Husky and lint-staged configuration
- Python or polyglot
pre-commitframework setup - troubleshooting hooks that do not run consistently
Do not add hooks merely because they are fashionable. Use them when the repository benefits from fast, deterministic local feedback.
Workflow
1. Inspect the repository
Determine:
- language and package manager
- existing hooks and configuration
- CI checks that should be mirrored locally
- supported operating systems
- acceptable hook runtime
Read existing files such as:
package.json.husky/.lintstagedrc*.pre-commit-config.yaml- commitlint configuration
- contribution documentation
2. Choose the smallest appropriate framework
- Husky + lint-staged: JavaScript or TypeScript repositories
- pre-commit: Python or polyglot repositories
- repository script + core.hooksPath: custom cross-language needs
- local `.git/hooks`: personal-only automation that should not be shared
Do not introduce multiple hook frameworks for the same job without a documented reason.
3. Define the gate
Each hook should have:
- a single clear purpose
- deterministic commands
- bounded runtime
- useful failure messages
- no hidden network or deployment side effects
- a documented bypass policy, when bypass is permitted
Prefer staged-file checks for pre-commit. Keep full test suites in pre-push or CI when they are slow.
4. Implement through repository scripts
Prefer hook files that call existing package or repository scripts rather than duplicating long command sequences.
Example Husky pre-commit:
Example pre-commit configuration:
Pin third-party hook versions and review their source and permissions.
5. Test each hook directly
Run the underlying command first, then test the hook with representative pass and fail cases.
For pre-commit:
For package scripts, run the exact command the hook invokes.
6. Verify team usability
Confirm:
- installation steps are documented
- CI still enforces critical checks
- hook paths work from the repository root
- shell syntax is portable for supported environments
- failure output tells contributors how to fix the problem
Safety Rules
- Never place credentials in hook files or command arguments
- Never auto-commit or auto-push from a quality hook
- Never deploy, publish, or mutate remote state from pre-commit hooks
- Never silently rewrite broad file sets without showing the resulting diff
- Never make a hook depend on an undocumented local path
- Never disable existing hooks to make a commit pass without authorization
Completion
Report:
- hook events configured
- framework and files changed
- commands executed
- pass and fail validation results
- installation or compatibility requirements
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckinglibrary/github-operations/hooks-automation/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/revrebel/skills-library/hooks-automation)