pre-commit-authoring

Audits .pre-commit-config.yaml files for hook misconfigurations and violations of staged-scope invariants.

Updated Nov 24, 2025
One-click install
npx skills add https://github.com/ByronWilliamsCPA/.claude --skill pre-commit-authoring
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pre-commit-authoring
Source: https://github.com/ByronWilliamsCPA/.claude/tree/main/.claude/skills/pre-commit-authoring
Command: npx skills add https://github.com/ByronWilliamsCPA/.claude --skill pre-commit-authoring

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill resolves common pain points of misconfigured pre-commit hooks: slow commits that disrupt developer flow, false positive failures blocking work on unrelated changes, full-git-history scans surfacing issues from remote branches, and missing enforcement of critical code quality and security checks.

Core Features & Use Cases

  • Hook Authoring Decision Tree: Guides selection between pre-commit and pre-push stages based on runtime, scope, and enforcement timing requirements.
  • Staged-Scope Invariant Enforcement: Prevents full-history scans that cause false positives, with concrete corrected examples for TruffleHog, gitleaks, and detect-secrets.
  • Performance Tier Placement: Groups hooks into fast (<2s), file-scoped (<10s), and pre-push tiers to keep commit latency low.
  • Audit Patterns & Checklists: Provides grep commands and step-by-step validation for .pre-commit-config.yaml files to catch unpinned refs, missing stages, inline configs, and silent-skip wrappers.
  • Common Gotchas Reference: Documents high-impact failure modes including formatter-breaking suppression pragmas, infinite recursion from nested pre-commit runs, and directory-walking validators that violate staged scope.
  • Use Case: A team experiencing 30-second pre-commit runs can use this Skill to reclassify slow dependency audits to pre-push, scope secret scanners to staged files only, and eliminate silent-skip wrappers that provide zero enforcement.

Quick Start

Use the pre-commit-authoring skill to audit your existing .pre-commit-config.yaml file and identify hooks that scan full git history, lack explicit stage assignments, or use silent-skip wrappers that provide no enforcement.

Frequently Asked Questions about pre-commit-authoring

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

FAQPage Schema
Why does my pre-commit hook scan full git history and trigger false positives?

Pre-commit hook false positives often occur when secret scanners like TruffleHog or gitleaks scan full git history instead of staged files. Enforcing the staged-scope invariant restricts checks to local changes, eliminating irrelevant failures from remote branches.

How do I fix slow pre-commit hooks that disrupt my development flow?

Fix slow pre-commit hooks by applying performance tier placement to reclassify checks into fast (<2s), file-scoped (<10s), and pre-push tiers. Moving slow dependency audits to pre-push stages keeps commit latency low and restores developer flow.

How do I audit a .pre-commit-config.yaml file for missing code quality enforcement?

Audit a .pre-commit-config.yaml file using targeted grep commands and validation checklists to identify unpinned refs, missing stage assignments, inline configs, and silent-skip wrappers that bypass critical code quality and security enforcement.

When should I use pre-commit stages versus pre-push stages in git hooks?

Use a hook authoring decision tree to select between pre-commit and pre-push stages based on runtime, scope, and enforcement timing requirements. Fast checks belong in pre-commit, while heavy dependency audits fit pre-push to maintain commit speed.

What are common gotchas when configuring pre-commit hooks for secret scanning?

Common pre-commit hook gotchas include formatter-breaking suppression pragmas, infinite recursion from nested pre-commit runs, and directory-walking validators that violate staged scope. Correcting these ensures secret scanners enforce rules without causing silent no-ops.

How do I validate fail-vs-warn semantics in a pre-commit hook fleet?

Validate fail-vs-warn semantics in a pre-commit hook fleet by applying audit pattern validation to the .pre-commit-config.yaml. This enforces explicit stage assignments and ensures hooks block commits on critical violations rather than silently skipping.