setup-pre-commit

Detect repository ecosystems and install per-language pre-commit hooks.

5|2|Updated Nov 17, 2025
One-click install
npx skills add https://github.com/OutlineDriven/odin-gemini-cli-extension --skill setup-pre-commit-outlinedriven
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: setup-pre-commit
Source: https://github.com/OutlineDriven/odin-gemini-cli-extension/tree/main/skills/setup-pre-commit
Command: npx skills add https://github.com/OutlineDriven/odin-gemini-cli-extension --skill setup-pre-commit-outlinedriven

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill simplifies setting up multi-language pre-commit hooks across ecosystems, ensuring code quality gates are automatically applied before commits.

Core Features & Use Cases

  • Detects the repository's ecosystem and selects the appropriate hook tool (Husky + lint-staged for Node, pre-commit for Python, lefthook for Go, cargo-husky for Rust, and dune hooks for OCaml).
  • Installs and configures the necessary tooling: formatter, type-checker, and test gates per ecosystem.
  • Works with multi-language repositories by applying the appropriate hooks across surfaces or per-language.

Quick Start

Run the setup-pre-commit flow in your repository to detect the ecosystem and install the appropriate pre-commit hooks.

Frequently Asked Questions about setup-pre-commit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up pre-commit hooks for a multi-language repository?

To set up pre-commit hooks for a multi-language repository, you need to detect each language surface and configure the appropriate ecosystem-specific tooling like Husky, pre-commit, or lefthook to gate commits with formatting and type-checking. This ensures code quality gates are automatically applied across all detected languages.

What pre-commit hook tool should I use for my Go or Rust project?

For Go or Rust projects, lefthook and cargo-husky are the respective pre-commit hook tools used to gate commits. They configure formatter and test gates specific to those ecosystems to ensure code quality before changes are committed.

Can I use Husky and pre-commit together in the same repository?

Yes, in a multi-language repository you can apply Husky for Node and pre-commit for Python simultaneously. The setup detects the language surfaces and configures the respective per-ecosystem hook configurations independently.

What is the best way to automate linting and formatting before commits?

The best way to automate linting and formatting before commits is by installing pre-commit hooks that detect your repository's ecosystem and apply formatter, type-checker, and test gates automatically prior to committing changes. This prevents unformatted code from entering your version control history.

Does setting up pre-commit hooks require adding specific configuration files?

Yes, setting up pre-commit hooks requires adding ecosystem-specific configuration files such as .husky/pre-commit, .pre-commit-config.yaml, or lefthook.yml, and ensuring that the generated hook scripts are executable.

Why are my pre-commit hooks not running executable scripts?

Pre-commit hooks fail to run executable scripts when the generated hook files lack execute permissions. You must ensure ecosystem-specific configurations like .husky/pre-commit or Cargo.toml dev-dependencies are properly installed and marked as executable.