2.5k
GitHub Stars
6
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 openclaw/skills --skill husky-config-gen- _meta.json296 B
- package-lock.json30.2 KB
- package.json599 B
- README.md566 B
- SKILL.md1.8 KB
- tsconfig.json217 B
Overview
This skill sets up project-specific Git hooks using Husky with minimal friction. It inspects your repository, detects linters, formatters, and test runners, then generates sensible pre-commit, pre-push, and commit-msg hooks. One command installs and configures hooks tailored to your workflow so you get consistent checks without manual wiring.
How this skill works
The tool scans package.json and your codebase to identify installed tools (ESLint, Prettier, Jest, etc.). It then generates Husky configuration and hook scripts that run linting on staged files, run tests on push, and enforce conventional commit messages. Options include a dry-run preview and automatic installation using npx.
When to use it
- Initializing a new repo and wanting automated Git checks
- Adding pre-commit linting or formatting to an existing project
- Enforcing conventional commit messages across a team
- Standardizing pre-push test runs before opening pull requests
- Quickly generating Husky hooks without writing scripts manually
Best practices
- Lint only staged files to keep hooks fast and relevant
- Run tests on push rather than every commit to balance speed and safety
- Keep each hook lightweight so developers don’t bypass checks
- Allow emergency bypass with --no-verify, but document when it’s acceptable
- Use the dry-run option to preview changes before applying them
Example use cases
- Set up pre-commit ESLint and Prettier for a JavaScript project in one command
- Add a pre-push step to run unit tests on CI-like conditions locally
- Enforce conventional commit format with a commit-msg hook to enable changelog automation
- Migrate an older repository to Husky hooks without handcrafting scripts
- Preview the generated hook scripts with --dry-run before committing to the repo
FAQ
No. Run the tool with npx; it will handle Husky installation. Node 18+ is recommended.
Will it run linters on the whole repository?
No. Hooks are configured to lint staged files by default to keep checks fast.
Can I preview what will be installed?
Yes. Use the --dry-run flag to see generated hook scripts without applying changes.
Does it require API keys or subscriptions?
No paywalls or sign-ups are required. The tool may expect an OPENAI_API_KEY for certain features, but core hook generation works without subscriptions.