Skip to content
Agent Orchestration
Skill

/hook-commits

Set up 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.

From plugin
bigpowers
29280 skills1 hook1 MCP

Claude Code

$ npx -y skills add danielvm-git/bigpowers --skill hook-commits --agent claude-code

SKILL.md

hook-commits.SKILL.md
name: hook-commits
model: haiku
effort: standard
description: Set up 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.

Hook Commits

> **HARD GATE** — **HARD GATE** — Pre-commit and commit-msg hooks must run before any commit lands. Skipping hooks (`--no-verify`) is forbidden unless explicitly authorized for a specific commit and documented.

What This Sets Up

  • **Husky** pre-commit hook
  • **lint-staged** running Prettier on all staged files
  • **Prettier** config (if missing)
  • **typecheck** and **test** scripts in the pre-commit hook

Steps

1. Detect package manager

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.

2. Install dependencies

Install as devDependencies:

husky lint-staged prettier

3. Initialize Husky

npx husky init

This creates `.husky/` dir and adds `prepare: "husky"` to package.json.

4. Create `.husky/pre-commit`

Write this file (no shebang needed for Husky v9+):

npx lint-staged
npm run typecheck
npm run test

**Adapt**: Replace `npm` with detected package manager. If repo has no `typecheck` or `test` script in package.json, omit those lines and tell the user.

5. Create `.lintstagedrc`

{
  "*": "prettier --ignore-unknown --write"
}

6. Create `.prettierrc` (if missing)

Only create if no Prettier config exists. Use these defaults:

{
  "useTabs": false,
  "tabWidth": 2,
  "printWidth": 80,
  "singleQuote": false,
  "trailingComma": "es5",
  "semi": true,
  "arrowParens": "always"
}

7. Verify

  • [ ] `.husky/pre-commit` exists and is executable
  • [ ] `.lintstagedrc` exists
  • [ ] `prepare` script in package.json is `"husky"`
  • [ ] `prettier` config exists
  • [ ] Run `npx lint-staged` to verify it works

8. Commit

Stage all changed/created files and commit with message: `chore: add pre-commit hooks (husky + lint-staged + prettier)`

This will run through the new pre-commit hooks — a good smoke test that everything works.

Notes

  • Husky v9+ doesn't need shebangs in hook files
  • `prettier --ignore-unknown` skips files Prettier can't parse (images, etc.)
  • The pre-commit runs lint-staged first (fast, staged-only), then full typecheck and tests
Read more
@danielvm-git
Ships withbigpowers

Agent skills synthesizing 17 years of software engineering discipline — from Clean Code to AI-native architecture — into a single, prescriptive methodology for solo developers.

29280 skills1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
292
Star history of danielvm-git/bigpowers on GitHub, a chart by star-history.com

Other skills on bigpowers.

align-grid

align-grid

Build editorial/magazine/report webpages on a GENUINE Müller-Brockmann modular grid (International Typographic Style) — not a…

assess-impact

assess-impact

Analyze the blast radius of a proposed change before any code is written. Maps dependents, affected stories, and test coverage.…

audit-code

audit-code

Self-review checklist for the coding agent to run before dispatching a reviewer. Checks CONVENTIONS.md compliance, Boy Scout…

audit-plan

audit-plan

Evaluate an incoming project plan against bigpowers principles and conventions, surface gaps, and produce a READY/NOT READY…

build-epic

build-epic

Eight-step epic build cycle — reads state.yaml, execution-status.yaml, and one epic capsule; updates status via bp-yaml-set or…

change-request

change-request

Add a new requirement or reorder epics by WSJF against specs/release-plan.yaml and epic capsule directories. Modes Add and…

More skills from other plugins.

1password

1password

Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.

openclaw6d395k
@steipete@steipeteInstall Skill
jira-tickets

jira-tickets

Read and update Jira tickets through Orca's saved Jira connections. Use when a task comes from Jira or the user asks for Jira…

orca4d128k
@stablyai@stablyaiInstall Skill
agentmail

agentmail

Use your assigned AgentMail inbox to read email tasks, explicitly send or reply, and check delivery. Provided automatically by…

paperclip5d114k
@paperclipai@paperclipaiInstall Skill
adr-create

adr-create

Create a new Architecture Decision Record with sequential numbering and AgentDB registration

@ruvnet@ruvnetInstall Skill

Questions about hook-commits.

Which coding agents can use hook-commits?
hook-commits installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.