Git safety rules and mandatory gates for all git operations
This skill inherits all available tools. When active, it can use any tool Claude has access to.
CRITICAL: All git operations MUST go through the git-operator worker agent.
-d not -D for branch deletion| 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 |
| 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 |
{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 |
<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>
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)
Before any destructive operation, git-operator will: