setup-pre-commit is agent-read markdown (skill) from mambo-wang/codewiki-plus: 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..
Indexed from public GitHub and served as immutable, content-addressed versions. Install it pinned to an exact SHA-256 with the mdr CLI, and every file is verified against the hash recorded here before it reaches your agent. The deterministic audit below grades the latest version, and the same file always earns the same grade.
What the file says
# Setup Pre-Commit Hooks
## 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
```bash
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`
```json
{
"*": "prettier --ignore-unknown --write"
}
```
### 6. Create `.prettierrc` (if missing)
Only create if no Prettier config exists. Use these defaults:
```json
{
"useTabs": false,
"tabWidth": 2,
…
Pin to a label to follow the author's releases, or to a sha256 to freeze the exact bytes forever. Either way the resolved hash is written to mdr.lock, and mdr install reproduces it on any machine.
GET https://markdownregistry.com/api/v1/artifacts/art_m2y6byeno2hz4d3m
GET https://markdownregistry.com/api/v1/resolve?ref=mambo-wang/codewiki-plus/setup-pre-commit
GET https://markdownregistry.com/api/v1/blob/c9819d7f1e3b198064edc1faa3154224ed67395e9f07f5d3cea4b67cf0a11a98
Your agent does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
mambo-wang/codewiki-plus · .codebuddy/skills/blog-writing-specialist/SKILL.md · Comprehensive blog writing skill that handles technical blog posts, personal voice writing, brain dump transformation…
mambo-wang/codewiki-plus · .codebuddy/skills/claude-handoff/SKILL.md · Hand the current conversation off to a fresh background agent that picks up the work immediately.
mambo-wang/codewiki-plus · .codebuddy/skills/code-review/SKILL.md · Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes: Standards (does the code…
mambo-wang/codewiki-plus · .codebuddy/skills/codebase-design/SKILL.md · Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find…
mambo-wang/codewiki-plus · .codebuddy/skills/diagnosing-bugs/SKILL.md · Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports…
mambo-wang/codewiki-plus · .codebuddy/skills/domain-modeling/SKILL.md · Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a CONTEXT.md…
mambo-wang/codewiki-plus · .codebuddy/skills/git-guardrails-claude-code/SKILL.md · Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they…
mambo-wang/codewiki-plus · .codebuddy/skills/grill-with-docs/SKILL.md · A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.
mambo-wang/codewiki-plus · .codebuddy/skills/grilling/SKILL.md · Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or…
outlinedriven/odin-claude-plugin · plugins/odin-git/skills/setup-pre-commit/SKILL.md · Use when installing or repairing a repo-local pre-commit hook from the project gates, or when a repo needs…
vodailocz/kilo-kit-mcp · skills/productivity/setup-pre-commit/SKILL.md · Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user…
mambo-wang/codewiki-plus · .codebuddy/skills/setup-pre-commit/SKILL.md · Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user…
kunanonj/ai-skills-hub · .agents/skills/setup-pre-commit/SKILL.md · Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user…
chrislacey89/skills · setup-pre-commit/SKILL.md · Infrastructure skill for setting up commit-time quality gates. Use when a repo needs Lefthook-based pre-commit hooks…