Automated summary
Automatically fixes pre-commit hook failures and retries the commit.
Strengths
- Reduces manual fix-commit-retry cycles
- Targets each error category with a specialized subagent
- Handles both auto-fixable errors and complex code analysis
Limitations
- Requires full error output as input
- May fail if hook requires complex human judgment
- Only covers specified error categories
Use this skill when a git commit fails due to ESLint errors, pattern compliance violations, missing document headers, cross-document dependencies, or stale documentation index.
Do not use this skill if the commit failure is not one of the supported error categories or if a more specialized skill exists.
Security analysis
SafeThe skill uses standard git commands and spawns subagents for fixing pre-commit issues. No external network calls, destructive commands, or security bypass instructions. It explicitly warns against using SKIP_* variables unless user-requested. No risk of data exfiltration or system damage.
No concerns found
How this analysis is madeExamples
My commit failed with ESLint errors. Here's the output: [paste output]. Fix the errors and recommit.The commit failed because DOCUMENTATION_INDEX.md is not updated. Run the docs:index script and recommit.Commit failed due to missing required headers on new .md files. Add the standard header template to all new files and recommit.name: pre-commit-fixer description: | Automatically fix pre-commit hook failures and retry the commit. Use when a git commit fails due to ESLint errors, pattern compliance violations, missing document headers, cross-document dependency issues, or documentation index staleness. Spawns a targeted subagent to fix each category of failure, then re-stages and re-commits. Reduces context waste from manual fix-commit-retry cycles.
<!-- prettier-ignore-start -->Document Version: 1.1 Last Updated: 2026-02-14 Status: ACTIVE
<!-- prettier-ignore-end -->Pre-Commit Fixer
When NOT to Use
- When the task doesn't match this skill's scope -- check related skills
- When a more specialized skill exists for the specific task
Purpose
Eliminate the context-heavy fix-commit-retry loop that happens when pre-commit hooks fail. Instead of manually reading errors, fixing files, re-staging, and re-committing (burning 500+ tokens per cycle), delegate the fix to a focused subagent that works in bounded context.
When to Use
Use this skill when git commit fails with any of these pre-commit errors:
| Error Category | Detection Pattern |
| ------------------------- | ------------------------------------------------ |
| ESLint failures | ESLint passed (N errors) or eslint in output |
| Pattern compliance | Pattern compliance failed |
| Document headers | Missing required header in output |
| Cross-doc dependencies | not staged or cross-document in output |
| Documentation index stale | DOCUMENTATION_INDEX.md not updated in output |
| Skill validation | Skill validation failed |
Workflow
Step 1: Capture the Error
When a commit fails, capture the FULL error output. The error output contains the exact information needed for the fix.
Step 2: Classify the Failure
Read the error output and classify into one of these categories:
Category A: Auto-fixable (no subagent needed)
These can be fixed inline without spawning an agent:
- Documentation index stale → Run
npm run docs:index && git add DOCUMENTATION_INDEX.md - Cross-doc dependency → Stage the missing file:
git add <missing-file> - Lint-staged formatting → Already auto-fixed by lint-staged, just re-commit
Category B: Targeted fix (spawn subagent)
These need code analysis and changes:
- ESLint errors → Spawn
debuggeragent with error list and file paths - Pattern compliance → Spawn
code-revieweragent with violation details - Document headers → Add headers directly (template below)
- Skill validation → Spawn
general-purposeagent with skill file path
Step 3: Execute Fix
For Category A (inline fix):
# Documentation index
npm run docs:index && git add DOCUMENTATION_INDEX.md
# Cross-doc dependency (example)
git add .claude/COMMAND_REFERENCE.md
# Re-commit using the original message (preserved by git after hook failure)
git commit -F .git/COMMIT_EDITMSG
For Category B (subagent fix):
Spawn a focused subagent using the Task tool:
Task({
subagent_type: "debugger",
description: "Fix N pre-commit ESLint errors",
prompt: "Fix these ESLint errors and stage the fixes:\n\n<paste error output>\n\nFiles to fix: <list>\n\nDo NOT create new files. Only fix the listed errors."
})
After the subagent returns, re-stage and re-commit.
Step 4: Document Header Template
For new .md files missing headers, add this block after the YAML frontmatter
(if any) or at the top of the file:
<!-- prettier-ignore-start -->
**Document Version:** 1.0
**Last Updated:** YYYY-MM-DD
**Status:** ACTIVE
<!-- prettier-ignore-end -->
Step 5: Re-commit
After all fixes are applied and staged:
git add <fixed-files>
git commit -m "original commit message"
If the commit fails again, repeat from Step 1. Cap at 3 retry cycles — if it still fails after 3 attempts, report the remaining errors to the user.
Anti-Patterns
- Do NOT use
SKIP_*environment variables to bypass checks unless the user explicitly requests it - Do NOT suppress ESLint rules with
// eslint-disableunless the rule is genuinely a false positive - Do NOT add files to pathExcludeList in check-pattern-compliance.js unless they are verified false positives
- Do NOT commit partial fixes — fix ALL reported errors before re-committing
Input/Output Format
Input: The full stderr/stdout from a failed git commit command.
Output: After all fixes are applied and committed, report a structured summary:
PRE-COMMIT FIX RESULT:
Status: SUCCESS | PARTIAL | FAILED
Attempt: N/3
Failures fixed:
- [category]: [description] ([file])
Remaining (if any):
- [category]: [description]
Commit: [hash] (if successful)
Expected Behavior Per Failure Type
| Failure Type | Fix Strategy | Auto-fixable? |
| ---------------------- | --------------------------------------------------------------------- | ------------- |
| ESLint errors | Read error list, fix each in source, re-stage | Subagent |
| Pattern compliance | Read violation, apply pattern from CODE_PATTERNS.md | Subagent |
| Cross-doc dependencies | git add the unstaged dependency file | Inline |
| Doc index stale | npm run docs:index && git add DOCUMENTATION_INDEX.md | Inline |
| Doc headers missing | Add standard header block (template in Step 4) | Inline |
| Skill validation | Read error, fix SKILL.md frontmatter or structure | Subagent |
| S0/S1 audit failure | Check if real or false positive; fix or set SKIP_AUDIT_VALIDATION=1 | Subagent |
| Schema validation | Fix JSONL schema issues in the flagged file | Subagent |
Context Efficiency
This skill saves context by:
- Avoiding multiple round-trips of reading error → thinking → fixing → retrying
- Delegating ESLint/pattern fixes to bounded subagents
- Using deterministic templates for doc headers instead of researching format
- Capping retry cycles to prevent unbounded loops
Version History
| Version | Date | Description | | ------- | ---------- | ---------------------- | | 1.0 | 2026-02-25 | Initial implementation |
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/pre-commit-fixer-mm5t8a3a/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/pre-commit-fixer-mm5t8a3a' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/pre-commit-fixer-mm5t8a3a/download' --output '.skill-downloads/pre-commit-fixer-mm5t8a3a/SKILL.md.part' && mv '.skill-downloads/pre-commit-fixer-mm5t8a3a/SKILL.md.part' '.skill-downloads/pre-commit-fixer-mm5t8a3a/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/pre-commit-fixer-mm5t8a3a/SKILL.md' && test -s '.skill-downloads/pre-commit-fixer-mm5t8a3a/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/pre-commit-fixer' && cp -R '.skill-downloads/pre-commit-fixer-mm5t8a3a' '.claude/skills/pre-commit-fixer'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/pre-commit-fixer-mm5t8a3a'openskills read 'pre-commit-fixer-mm5t8a3a'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/pre-commit-fixer-mm5t8a3a/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
React Hook Form Best Practices
Development
Master React Hook Form: avoid anti-patterns, manage subscriptions, and handle reset, dirty state, and controlled inputs correctly.
Emotion to Mantine Migration
Development
Migrate Emotion styled-components to Mantine components with style props and CSS modules. Use when converting .styled.tsx files or removing @emotion imports.
Scope Creep Detector
Development
Analyzes git diffs against a stated intent to detect scope creep, unrelated files, broad PRs, and oversized changes, then suggests keep, split, or justify actions.