Skip to content
Skillv1.0.0

lefthook

Fast Git hooks manager written in Go. Use when a user asks to set up Git hooks without Node.js dependency, run parallel pre-commit checks, or find a faster alternative to Husky.

by terminalskills(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from terminalskills/skills (skills/lefthook/SKILL.md). Install upstream with npx skills add terminalskills/skills --skill lefthook. Copyright stays with the author (Apache-2.0).

Lefthook

Overview

Lefthook is a fast, polyglot Git hooks manager. Unlike Husky, it doesn't require Node.js — works with any language. Runs hooks in parallel, supports glob patterns, and configures via YAML.

Instructions

Step 1: Install

npm install -D lefthook
npx lefthook install
# Or: brew install lefthook

Step 2: Configure

# lefthook.yml — Git hooks configuration
pre-commit:
  parallel: true
  commands:
    lint:
      glob: "*.{ts,tsx,js,jsx}"
      run: npx eslint --fix {staged_files}
    format:
      glob: "*.{ts,tsx,js,jsx,css,md,json}"
      run: npx prettier --write {staged_files}
    typecheck:
      run: npx tsc --noEmit

pre-push:
  commands:
    test:
      run: npm test

commit-msg:
  commands:
    commitlint:
      run: npx commitlint --edit {1}

Guidelines

  • Lefthook runs commands in parallel by default — faster than sequential Husky hooks.
  • {staged_files} placeholder only passes staged files — no need for lint-staged.
  • Works in polyglot repos (Go, Python, Ruby) without Node.js dependency.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/terminalskills-skills-lefthook/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

terminalskills-skills-lefthook.ocm.jsonjson
{
  "ocm": "1",
  "id": "terminalskills-skills-lefthook",
  "kind": "skill",
  "name": "lefthook",
  "description": "Fast Git hooks manager written in Go. Use when a user asks to set up Git hooks without Node.js dependency, run parallel pre-commit checks, or find a faster alternative to Husky.",
  "publisher": "terminalskills",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding"
    ],
    "tags": [
      "skill-md",
      "lefthook",
      "git-hooks",
      "pre-commit",
      "lint",
      "go",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Fast Git hooks manager written in Go. Use when a user asks to set up Git hooks without Node.js dependency, run parallel pre-commit checks, or find a faster alternative to Husky."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/terminalskills/skills",
      "path": "skills/lefthook/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/terminalskills/skills/blob/HEAD/skills/lefthook/SKILL.md",
      "key": "terminalskills/skills/skills/lefthook/SKILL.md"
    },
    "compatibility": "Any Git repository, any language",
    "license": "Apache-2.0"
  },
  "instructions": "# Lefthook\n\n## Overview\nLefthook is a fast, polyglot Git hooks manager. Unlike Husky, it doesn't require Node.js — works with any language. Runs hooks in parallel, supports glob patterns, and configures via YAML.\n\n## Instructions\n\n### Step 1: Install\n```bash\nnpm install -D lefthook\nnpx lefthook install\n# Or: brew install lefthook\n```\n\n### Step 2: Configure\n```yaml\n# lefthook.yml — Git hooks configuration\npre-commit:\n  parallel: true\n  commands:\n    lint:\n      glob: \"*.{ts,tsx,js,jsx}\"\n      run: npx eslint --fix {staged_files}\n    format:\n      glob: \"*.{ts,tsx,js,jsx,css,md,json}\"\n      run:",
  "cost": {
    "context_tokens": 267
  }
}

Fetch it by URL: GET /api/v1/registry/terminalskills-skills-lefthook/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.

lefthook - Skill - OpenSmartRoute