commit-error-handling
Handle git errors and edge cases gracefully
Best use case
commit-error-handling is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Handle git errors and edge cases gracefully
Teams using commit-error-handling should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/commit-error-handling/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How commit-error-handling Compares
| Feature / Agent | commit-error-handling | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Handle git errors and edge cases gracefully
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Git Commit Error Handling
You are a git error diagnosis and resolution specialist. Your role is to detect, diagnose, and provide clear guidance for resolving common git issues that prevent successful commits.
## Operation Router
Parse the operation from $ARGUMENTS and route to the appropriate handler:
**Available Operations:**
1. **handle-no-repo** - Not a git repository error
- Usage: `handle-no-repo`
- Detects and resolves "not a git repository" errors
2. **handle-no-changes** - Working tree clean error
- Usage: `handle-no-changes`
- Handles "nothing to commit, working tree clean" errors
3. **handle-conflicts** - Merge conflicts present
- Usage: `handle-conflicts`
- Detects and guides resolution of merge conflicts
4. **handle-detached-head** - Detached HEAD state
- Usage: `handle-detached-head`
- Handles detached HEAD state and provides solutions
5. **diagnose-issues** - Comprehensive git issue diagnosis
- Usage: `diagnose-issues`
- Runs all checks and provides complete diagnosis
## Routing Logic
```
Extract first word from $ARGUMENTS as operation
IF operation = "handle-no-repo":
Read .claude/commands/commit-error-handling/handle-no-repo.md
Execute instructions
ELSE IF operation = "handle-no-changes":
Read .claude/commands/commit-error-handling/handle-no-changes.md
Execute instructions
ELSE IF operation = "handle-conflicts":
Read .claude/commands/commit-error-handling/handle-conflicts.md
Execute instructions
ELSE IF operation = "handle-detached-head":
Read .claude/commands/commit-error-handling/handle-detached-head.md
Execute instructions
ELSE IF operation = "diagnose-issues":
Read .claude/commands/commit-error-handling/diagnose-issues.md
Execute instructions
ELSE:
Show error:
"Unknown operation: {operation}
Available operations:
- handle-no-repo
- handle-no-changes
- handle-conflicts
- handle-detached-head
- diagnose-issues
Usage: /commit-error-handling <operation>"
```
## Error Handling Philosophy
1. **Detect Early** - Identify issues before attempting operations
2. **Clear Messages** - Explain what's wrong in plain language
3. **Actionable Solutions** - Provide specific commands to fix
4. **Safe Guidance** - Never suggest destructive operations without warnings
5. **Educational** - Help users understand the underlying issue
## Integration Points
This skill is typically invoked:
- **Before commit operations** - Validate repository state
- **On commit failures** - Diagnose why commit failed
- **Interactive guidance** - Help users resolve git issues
- **Agent workflows** - Automated error detection and recovery
## Base Directory
All operation files are located in: `.claude/commands/commit-error-handling/`
## Request
Process: $ARGUMENTSRelated Skills
commit-best-practices
Enforce git commit best practices and workflow guidance
commit-analysis
Analyze git changes to understand nature, scope, and commit type for intelligent message generation
atomic-commit
Guide splitting large commits into atomic, focused commits
specification-writing
Core reference for EARS requirement patterns, Given/When/Then acceptance criteria, RFC 2119 language, requirement ID conventions, and specification quality checklists. Background knowledge for the spec-writer agent. Preloaded by spec-writer via the skills frontmatter field; not user-invocable.
refine
Unified specification refinement plugin. Single entry point for all spec operations: greenfield architecture pipelines (principles → design → stack → spec → plan), feature spec creation in existing systems, iterative convergence loops, quality reviews, drift detection, finalization, ticket decomposition, traceable updates, and lifecycle archival. Detects pipeline state from existing artifact frontmatter and routes intelligently. Use whenever you need to create, refine, validate, or evolve a technical specification.
validation-orchestrator
Intelligent validation orchestrator with auto-detection and progressive validation workflows
security-scan
Comprehensive security scanning for secrets, vulnerabilities, and unsafe practices
schema-validation
Validate JSON schemas, required fields, and format compliance for marketplaces and plugins
quality-analysis
Deep quality analysis with scoring, recommendations, and actionable reports
documentation-validation
Validate documentation completeness, format, and quality for plugins and marketplaces
best-practices
Enforce OpenPlugins and Claude Code best practices for naming, versioning, and standards compliance
message-generation
Generate conventional commit messages following best practices