stolinski/s-stack/setup-pre-commit
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Set up Husky pre-commit hooks with lint-staged, Prettier, type checking, and tests in the current repo. Use when adding pre-commit hooks, configuring lint-staged, or adding commit-time formatting/typechecking/testing.
Install
npx vskill@latest install stolinski/s-stack/setup-pre-commitSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
Setup Pre-Commit Hooks
Set up a repo-appropriate Husky pre-commit hook using the existing package manager and scripts. Prefer the smallest change that fits the repo.
What This Sets Up
- Husky pre-commit hook.
lint-stagedrunning Prettier on staged files.- Prettier config only if the repo does not already have one.
- Existing typecheck/check and test scripts in the pre-commit hook when available.
Process
1. Inspect The Repo
Read package.json and check for lockfiles:
package-lock.json- npm.pnpm-lock.yaml- pnpm.yarn.lock- yarn.bun.lockorbun.lockb- bun.
Use the package manager already used by the repo. Default to npm only if unclear.
Check existing scripts before writing the hook. Prefer, in order:
- Type checking:
typecheck,check. - Tests:
test,test:unit. - Formatting:
format, otherwiselint-stagedwith Prettier.
2. Install Dependencies
Install these as dev dependencies using the detected package manager:
Skip dependencies already present.
3. Initialize Husky
Use the package-manager equivalent of Husky init. For npm:
This creates .husky/ and usually adds prepare: "husky" to package.json.
4. Write .husky/pre-commit
Use the detected package manager's runner. Example for npm:
Adapt the script names to what actually exists in package.json. If the repo has no typecheck/check or test script, omit that line and mention it in the final response.
Husky v9+ hook files do not need a shebang.
5. Configure Lint-Staged
Create .lintstagedrc only if no lint-staged config already exists:
If a lint-staged config already exists, preserve it and make the smallest needed edit.
6. Configure Prettier
Create .prettierrc only if no Prettier config exists. Use these defaults:
If the repo already has a Prettier config, do not replace it.
7. Verify
Verify the setup before finishing:
.husky/pre-commitexists and is executable.preparescript inpackage.jsonis present.- lint-staged config exists.
- Prettier config exists or the repo intentionally relies on defaults.
- Run the package-manager equivalent of
lint-stagedif feasible.
Rules
- Do not create a commit unless the user explicitly asks.
- Do not overwrite an existing formatting, lint-staged, or hook setup.
- If the hook would be too slow because the repo has expensive tests, ask before adding the full test command.
- Keep the final response factual: files changed, scripts added, and verification run.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/setup-pre-commit/SKILL.md
Popularity
- Repository stars
- 62
- Repository forks
- 2
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 7 Aug 2026, 2 months ago.
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/stolinski/s-stack/setup-pre-commit)