← ClaudeAtlas

setup-pre-commitlisted

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.
OutlineDriven/odin-claude-plugin · ★ 27 · Code & Development · score 82
Install: claude install-skill OutlineDriven/odin-claude-plugin
Detect the ecosystem, pick the right hook tool, install with formatter + type-check + test gates. ## Detection (run first) 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 | 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` | ## Per-ecosystem hook contents **Node ecosystems** — write `.husky/pre-commit`: ``` npx lint-staged <pm> run typecheck <pm> run test ``` Drop missing scripts and tell the user. Write `.lintstagedrc`: ```json { "*": "prettier --ignore-unknown --write"