Git Hooks
Auto-generate and manage Git hooks for pre-commit, pre-push, commit-msg, and more.
Why use this skill?
Learn how to use OpenClaw to auto-generate and manage Git hooks. Implement pre-commit linting, test automation, and secret detection in your repository.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/sa9saq/git-hooksWhat This Skill Does
The Git Hooks skill allows you to automate critical development tasks by managing Git hooks directly from the OpenClaw interface. It simplifies the setup and maintenance of local scripts that run before and after Git operations like commit and push. Whether you need to enforce coding standards, run test suites, or validate commit messages, this tool provides a robust framework to implement these checks consistently within your Git repository.
Installation
To integrate this skill, run the following command in your terminal: clawhub install openclaw/skills/skills/sa9saq/git-hooks. Once installed, ensure you are operating within the root directory of a initialized Git repository, as the skill validates the presence of a .git/ folder before applying any hooks.
Use Cases
This skill is perfect for teams and individual developers looking to improve code quality. Use cases include:
- Automated Linting: Ensure that your staged code adheres to style guides (e.g., ESLint for JS, pylint for Python) before it enters the commit history.
- Quality Assurance: Automatically trigger your testing suite before code is pushed to remote branches to prevent broken builds.
- Commit Governance: Enforce 'Conventional Commits' standards, which improves history readability and helps generate automated changelogs.
- Security Hardening: Detect accidentally included credentials, such as API keys or secret tokens, before they are uploaded to public or shared repositories.
Example Prompts
- "Setup a pre-commit hook that runs ESLint on all staged JavaScript files to ensure code quality."
- "Add a commit-msg hook that rejects any commit messages that do not follow the conventional commit format."
- "Create a pre-push hook that runs my test suite and aborts the push if any tests fail."
Tips & Limitations
- Bypassing: If you need to make a quick commit without running hooks, use the
--no-verifyflag with your git command. - Performance: Keep your hooks lightweight. Long-running tasks should be kept under 5 seconds to ensure a smooth developer experience. Always target only the staged files rather than the entire directory.
- Compatibility: Always use
/bin/shfor scripts to maximize cross-platform compatibility. - Sharing: Since
.git/hooks/are not tracked in the repo, consider usinggit config core.hooksPathto point to a version-controlled directory if you wish to share these hooks with your team.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-sa9saq-git-hooks": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-write, file-read, code-execution
Related Skills
threat-model
Threat modeling and attack scenario design. Identify risks before they become vulnerabilities. STRIDE, attack trees, risk matrix.
Sns Auto Poster
Schedule and automate social media posts to X/Twitter with cron-based queue management.
security-review
Comprehensive security review for code, configs, and operations. OWASP, prompt injection, crypto security. Auto-triggers on security-related changes.
Process Monitor
Monitor system processes, identify top CPU/memory consumers, and alert on resource thresholds.
Readme Generator
Auto-generate comprehensive README.md files by analyzing project structure and configuration.