| name | git-safety |
| description | Git safety rules and mandatory gates for all git operations |
Git Safety Skill
CRITICAL: All git operations MUST go through the git-operator worker agent.
Mandatory Gates (Cannot Be Bypassed)
- MUST verify not on main/master before ANY commit
- MUST check for uncommitted changes before checkout
- MUST restore stashes after workflow completion
- MUST use
-d not -D for branch deletion
How to Perform Git Operations
- Orchestrators spawn git-operator automatically
- Specialists should spawn git-operator if needed
- NEVER run git commands directly in agents
git-operator Operations
| Operation |
Description |
preflight |
Check for uncommitted changes, offer stash |
branch-create |
Create and checkout new branch |
branch-checkout |
Switch to existing branch |
commit |
Stage, commit, verify not on main |
push |
Push to origin with tracking |
merge |
Squash merge, delete source branch |
restore-workflow |
Return to original branch, pop stash |
health-check |
Diagnose repository state |
Workspace Operations (Parallel Execution)
| Operation |
Purpose |
workspace-create |
Create isolated git worktree |
workspace-status |
Poll all workspace states |
workspace-commit |
Commit in workspace context |
workspace-push |
Push workspace branch |
workspace-merge |
Merge with AI conflict resolution |
workspace-cleanup |
Remove completed workspaces |
Branch Naming Convention
{type}/{short-description}
| Type |
Use Case |
feat/ |
New features |
fix/ |
Bug fixes |
refactor/ |
Code refactoring |
docs/ |
Documentation only |
test/ |
Test additions/changes |
chore/ |
Maintenance tasks |
Commit Message Format
<type>(<scope>): <short description>
<longer description if needed>
- Bullet points for specific changes
- Include test summary if applicable
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Spawning git-operator
Example prompt for spawning:
subagent_type: git-operator
prompt: |
[DEPTH: 2/5]
operation: commit
files:
- src/feature.py
- tests/test_feature.py
message: |
feat(feature): Add new feature implementation
- Core logic implementation
- Unit tests added (5 tests, all passing)
Safety Verification
Before any destructive operation, git-operator will:
- Check current branch (abort if main/master)
- Check for uncommitted changes (offer stash)
- Verify remote tracking branch exists
- Confirm operation with user if high-risk