polyglot-git-hooks

Configure Lefthook Git hooks for polyglot monorepos with staged-file checks.

1|1|Updated May 24, 2026
One-click install
npx skills add https://github.com/bm629/agent-skills --skill polyglot-git-hooks-bm629
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: polyglot-git-hooks
Source: https://github.com/bm629/agent-skills/tree/main/skills/polyglot-git-hooks
Command: npx skills add https://github.com/bm629/agent-skills --skill polyglot-git-hooks-bm629

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Setting up Git hooks in a mixed-language repo usually means juggling husky plus lint-staged for JavaScript and the Python pre-commit framework for Python, with split configs and duplicated setups. This Skill produces a single root lefthook.yml that runs fast format/lint checks on staged files at pre-commit and slower type-check/test gates at pre-push, across every language subtree, in parallel. ## Core Features & Use Cases - Single polyglot config: Authors one lefthook.yml at the repo root covering TypeScript and Python subtrees, scoped per language with glob and root. - Correct hook layering: Places fast staged-file checks (biome, ruff) at pre-commit with stage_fixed, and slow gates (tsc, ty, pytest) at pre-push, keeping hooks complementary to CI rather than duplicating it. - Activation and bypass handling: Wires lefthook install via npm postinstall or prepare scripts so fresh clones self-activate, and documents the --no-verify bypass and CI-as-enforcement model. - Use Case: A team with a TypeScript frontend and a Python API in one repo needs consistent pre-commit formatting and pre-push type-checks; this Skill generates the complete lefthook.yml plus the activation wiring. ## Quick Start Use polyglot-git-hooks to set up Lefthook pre-commit and pre-push hooks for my monorepo with a TypeScript app and a Python services/api subtree.

Frequently Asked Questions about polyglot-git-hooks

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

FAQPage Schema
How do I set up Git hooks for a monorepo with multiple languages?

Use Lefthook with a single lefthook.yml at the repo root. Define pre-commit commands scoped per language with glob and root, run fast format and lint checks on staged files, and put slower type-check and test gates at pre-push.

Lefthook vs husky and lint-staged for pre-commit hooks?

Lefthook is a single dependency-free Go binary with one config file and native staged-file filtering, while husky is Node-only and needs lint-staged bolted on, splitting config across multiple files. For mixed-language repos, Lefthook avoids maintaining two separate hook setups.

Why don't Git hooks run after a fresh clone?

Hooks live in .git/hooks, which is not committed, so a fresh clone has no hooks until lefthook install runs. For npm projects the lefthook package postinstall wires them automatically; for pnpm, add lefthook to onlyBuiltDependencies, otherwise document lefthook install as a setup step.

Does Lefthook stage_fixed work at pre-push?

No, stage_fixed only works at pre-commit. It re-stages auto-fixed files with git add after the command runs; at pre-push and other hooks it is ignored, so formatter fixes must be applied during pre-commit.

Can developers bypass Lefthook hooks with --no-verify?

Yes, git commit --no-verify and git push --no-verify skip all hooks, and LEFTHOOK=0 disables Lefthook per invocation. Because hooks are bypassable, CI should remain the enforced gate rather than relying on local hooks for enforcement.