Skills Explorer Add Skills

setup-pre-commit

An agent skill by mattpocock, from mattpocock/skills. Tags: ci-cd, github, setup, validation, workflow.

What it does

Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.

Install

With the skills CLI, which installs into Claude Code, Codex, Cursor and other agents:

npx skills add mattpocock/skills --skill setup-pre-commit

Or copy the skill folder into Claude Code's skills directory by hand (~/.claude/skills for every project, or .claude/skills inside one):

git clone --depth 1 https://github.com/mattpocock/skills
cp -r skills/skills/misc/setup-pre-commit ~/.claude/skills/setup-pre-commit

Safety box score

Grade B, low risk: 25 of 100 risk points, rated 2026-10-16. The grade rates what the skill and its scripts can reach on the machine of whoever installs it, across eight categories from shell execution to secrets access. How the score works.

This skill sets up Husky pre-commit hooks that install npm packages, create hook/config files, and run formatting, typechecking, and tests on every commit. The main risks are registry-fetched code execution during setup, automatic commits of generated changes, and repo scripts being run implicitly by the new hook.

Category levels, from 0 (none) to 3 (high)
CategoryLevelWhy
Code & shell execution2 (moderate)It bootstraps and runs commands like `npx husky init`, `npx lint-staged`, `npm run typecheck`, and `npm run test`, so it executes code during setup and on every commit.
Network access2 (moderate)It installs `husky lint-staged prettier` and uses `npx`, which downloads packages from the npm registry.
Filesystem reach1 (low)It only writes within the current repo (`.husky/pre-commit`, `.lintstagedrc`, optional `.prettierrc`, and `package.json`).
Secrets & credentials0 (none)No secret stores, token files, env files, or logins are referenced.
Privilege & persistence0 (none)It does not request sudo, global installs, services, or OS/shell configuration changes.
Instruction hijack surface0 (none)There is no prompt-injection content or instruction to ignore safeguards or follow remote text.
Irreversible actions1 (low)It tells the agent to stage all changes and commit them locally, but it does not push, deploy, or act outside the repo.
Transparency1 (low)The exact code run at setup time comes from unpinned registry packages invoked via `npx`, not from files included in the skill.

Before installing

Rated 2026-10-16 by an automated review of 2 files from the skill's repository.

Source

Repository
mattpocock/skills (all skills from this repository)
Path
skills/misc/setup-pre-commit/SKILL.md
Branch
main
Updated
2026-10-05