skills/setup-pre-commit/SKILL.md
Install git pre-commit hooks via the project's hook tool — Husky+lint-staged (JS), pre-commit (Python/OCaml), lefthook (Go), cargo-husky (Rust). Use when the user wants commit-time formatting, linting, type-checking, or test gates. Detects ecosystem first.
npx skillsauth add outlinedriven/odin-codex-plugin setup-pre-commitInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Detect the ecosystem, pick the right hook tool, install with formatter + type-check + test gates.
Dispatch Explore agent — or for a single-language repo, probe directly via fd for lockfile / manifest signature. Map the first manifest hit to an ecosystem. Multi-language repos: ask the maintainer which surface to gate, or apply both.
| Ecosystem | Hook tool | Install command |
| -------------------- | -------------------------- | ---------------------------------------------------------------- |
| npm / yarn / pnpm / bun | husky + lint-staged | <pm> add -D husky lint-staged prettier && npx husky init |
| Python (poetry/pip) | pre-commit (framework) | pipx install pre-commit && pre-commit install |
| Go | lefthook (or pre-commit) | go install github.com/evilmartians/lefthook@latest && lefthook install |
| Rust (cargo) | cargo-husky (or pre-commit)| add cargo-husky as [dev-dependencies]; runs on cargo test |
| OCaml (dune) | pre-commit + dune hooks | pipx install pre-commit && pre-commit install |
Node ecosystems — write .husky/pre-commit:
npx lint-staged
<pm> run typecheck
<pm> run test
Drop missing scripts and tell the user. Write .lintstagedrc:
{ "*": "prettier --ignore-unknown --write" }
Formatter policy is out of scope for this skill. Do NOT auto-create .prettierrc. If no Prettier config exists, surface that fact and ask the user.
Python — write .pre-commit-config.yaml:
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.0
hooks:
- id: ruff
- id: ruff-format
- repo: local
hooks:
- id: pyright
name: pyright
entry: pyright
language: system
pass_filenames: false
- id: pytest
name: pytest
entry: pytest -q
language: system
pass_filenames: false
stages: [pre-commit]
Go — write lefthook.yml:
pre-commit:
parallel: true
commands:
fmt: { run: gofmt -l -w {staged_files} }
vet: { run: go vet ./... }
test: { run: go test -race ./... }
Rust — Cargo.toml:
[dev-dependencies]
cargo-husky = { version = "1", default-features = false, features = ["precommit-hook", "run-cargo-test", "run-cargo-clippy", "run-cargo-fmt"] }
OCaml — .pre-commit-config.yaml:
repos:
- repo: local
hooks:
- id: dune-fmt
name: dune fmt
entry: dune fmt
language: system
pass_filenames: false
- id: dune-build
name: dune build
entry: dune build
language: system
pass_filenames: false
- id: dune-test
name: dune runtest
entry: dune runtest
language: system
pass_filenames: false
fd -d 2 -t f '\.husky|\.pre-commit-config\.yaml|lefthook\.yml' shows the expected file.git commit --allow-empty -m "chore: verify hooks") — every gate must run and pass.chore: install pre-commit hooks (<tool>). The commit itself trips the new hook — first-class smoke test.
testing
ODIN's compress-operations dispatcher under the Compressor/Extender role. Invoke on "tidy", "clean up", "tidy this file/memory/workspace/git/docs", or when active context (current file, diff, stack, memory directory) has structural rot to resolve before touching behavior. Detects target domain from context and routes to the sibling skill. Requires explicit target or clear active-context signal — do not invoke speculatively.
development
Cross-domain taste skill — apply distinctive judgment to any artifact (prose, code, design, decisions) instead of converging to AI defaults. Two modes — `audit` (judge work against the two-sided charter and portable anchors) and `anchor` (load register before producing). Auto-detects by phrasing; override via `/taste audit | anchor`. Trigger on "is this slop?", "overkill?", "elegant?", "taste-test this".
tools
One-shot bootstrap of strict-mode tooling per ecosystem plus per-task GOALS.md scaffolding so an agentic loop can self-verify. Writes typechecker/linter/schema-validator config for TS (strict + noUncheckedIndexedAccess + exactOptionalPropertyTypes), Python (Pyright strict, Ruff strict), Rust (Clippy deny-correctness), Go (golangci-lint with staticcheck), OCaml (dune --release); establishes `.agent-tasks/<id>/GOALS.md` per-task convention distinct from project-stable AGENTS.md. C++/Java/Kotlin and framework specifics (Spring Boot, Nest, React-strict) are out of scope. Trigger on new project bootstrap, agentic-task setup, "make this self-verifying", "set the loop's goal", "scaffold goals for this issue". Pairs with `llm-self-loop` runtime.
testing
Adversarial security audit — STRIDE, OWASP Top 10, supply-chain (CVE/SBOM), secrets scan, auth/authz analysis. Use on changes touching auth, input parsing, deserialization, network I/O, dependencies, or secrets; before any production release or external-surface PR.