# Setup Pre Commit (agent skill)

> Setup Pre Commit is an agent skill (a SKILL.md file) from mattpocock/skills. Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. It works with Claude Code and Codex and has 278,361 GitHub stars across a repository of 15 listed skills.

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. Check for package-lock.json (npm), pnpm-lock.yaml (pnpm), yarn.lock (yarn), bun.lockb (bun). Use whichever is present. Default to npm if unclear.

## Key facts

| Fact | Value |
|---|---|
| Repository | https://github.com/mattpocock/skills |
| Skill path | skills/misc/setup-pre-commit/SKILL.md |
| Skill name | setup-pre-commit |
| GitHub stars | 278,361 |
| Installs on skills.sh | 426,055 |
| License | MIT |
| Skills in repo | 15 |
| Plugin marketplace | mattpocock |
| Official | no |
| Works with | Claude Code, Codex |
| Category | Testing & QA |
| Last commit | Oct 6, 2026 |

## When it triggers

- Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.

## Add this skill

### Claude Code

```sh
/plugin marketplace add mattpocock/skills
/plugin install mattpocock-skills@mattpocock
```

In the Claude apps, zip the skill folder and upload it under Customize > Skills > + > Upload a skill (code execution must be on).

### ChatGPT / Codex

```sh
git clone --depth 1 https://github.com/mattpocock/skills.git
cp -r skills/skills/misc/setup-pre-commit .agents/skills/setup-pre-commit   # repo; ~/.agents/skills for all projects
```

### Cursor

```sh
git clone --depth 1 https://github.com/mattpocock/skills.git
cp -r skills/skills/misc/setup-pre-commit .cursor/skills/setup-pre-commit   # project; ~/.cursor/skills for all projects
```

Sources (checked 2026-10-07): https://code.claude.com/docs/en/skills, https://support.claude.com/en/articles/12512180-using-skills-in-claude, https://learn.chatgpt.com/docs/build-skills, https://cursor.com/docs/context/skills

skills.sh listing: https://www.skills.sh/mattpocock/skills/setup-pre-commit

---

Canonical page: https://appsgit.com/skills/mattpocock-setup-pre-commit
Source: appsgit (https://appsgit.com), the app store for github. Data from the GitHub API, refreshed nightly.
Machine access: JSON API https://appsgit.com/api/v1/apps (OpenAPI: https://appsgit.com/openapi.json), MCP server https://mcp.appsgit.com/mcp, full index https://appsgit.com/llms-full.txt.
