Skip to main content
SAICA-KG

Tools

pre-commit

Multi-language framework that runs configurable hooks before commits land — denies the commit on hook failure.

PreventionPost-generationGraduated HITLStableTier 3EnvironmentHuman
Maturity tier details

Computed tier: 3(raw score 3). Effective tier: 3.

Facets:documented_in=0evaluated_on=0integration_surfaces=1paper_citations=0recent_commit=2stars=0

Source of truth:pipeline/maturity/score.py

Description

pre-commit is the canonical git-hook orchestrator: developers declare a `.pre-commit-config.yaml` listing hook repositories (semgrep, ruff, black, custom shell scripts, etc.), and the framework runs them on every `git commit`, blocking the commit if any hook returns non-zero. This makes pre-commit the *prevention* primitive: bad code never lands in the repository, so downstream supervisors (CI gates, code review) see less noise. Hooks compose — pre-commit itself is paradigm-agnostic; the failure modes it addresses depend on which hooks are installed. This entry credits pre-commit with the failure modes its standard hook ecosystem most reliably guards against.

Why it's included

Occupies prevention × post_generation × graduated_hitl in the canonical 3-axis grid. Distinct from CI-gate tools (semgrep, snyk) because the block point is the local commit, not the central CI run — so feedback is faster and bad code never enters the shared history. Distinct from IDE-level prevention (Cursor rules, CLAUDE.md) because the gate is language-agnostic and works across whichever agent generated the code. Standardised supply chain (every hook is a pinned upstream repo) makes pre-commit the closest thing the agentic-coding stack has to a hook-framework "kernel".

Security notes

Hooks pull from upstream repositories pinned by SHA in `.pre-commit-config.yaml`; supply-chain risk is bounded to whatever the developer pins. `--no-verify` allows bypass per-commit (humans can override; visible in `git log`). Default config does not run hooks against `.git/`-tracked secrets — pair with `detect-private-key` hook for that surface.

Addresses failure modes

  • Scope creep — Actions outside declared task boundary.
  • Security vulnerability — Insecure patterns, injection flaws, weak cryptography, secret leakage.
  • Dependency blindness — Reimplementing functionality that already exists in reachable code.
  • Fabrication — Generating reference to non-existent APIs, packages, or symbols.

Techniques

git-hook-orchestrationhook-version-pinningparallel-hook-executionconfigurable-stage-gating

View raw YAML on GitHub →