Setup Pre-Commit skill: what it does and how to install it
Sets up Husky pre-commit hooks to format staged files with Prettier and run the repository's type checks and tests.
Summary generated from the skill's documentation.
Install
$ npx skills add vinvcn/mattpocock-skills-zh-CN --skill setup-pre-commitRun it in a terminal. If your agent is already running, start a new session so it picks the skill up.
About this skill
What it does. Detects the repository's package manager, installs Husky, lint-staged and Prettier, then configures a pre-commit hook to format staged files and run available type-check and test scripts. It adds a default Prettier configuration only if one is missing, verifies the setup and commits the changes.
When to use it. When adding Husky hooks or configuring formatting, type checks and tests to run before commits.
History
Repo stars
4.6k
Tracking since . A chart appears once there are 7 days of data.
Stars are counted for the whole repository, which holds 3 skills.
Installs
5.1k
Tracking since . A chart appears once there are 7 days of data.
Installs via skills.sh
Similar skills
- Setup Pre-CommitSets up Husky pre-commit hooks with lint-staged, type checking and tests in the current repo.
- Git Guardrails for Claude CodeSets up Claude Code hooks that block dangerous git commands such as push, reset --hard and clean before they run.
- Migrate to ShoehornMigrates test files from as-type assertions to @total-typescript/shoehorn.