Claude-skill-registry agent-ops-git
Manage git operations safely. Includes stale state detection, branch/commit management. Never pushes without explicit user confirmation.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/agent-ops-git" ~/.claude/skills/majiayu000-claude-skill-registry-agent-ops-git && rm -rf "$T"
manifest:
skills/data/agent-ops-git/SKILL.mdsafety · automated scan (low risk)
This is a pattern-based risk scan, not a security review. Our crawler flagged:
- git push --force
Always read a skill's source content before installing. Patterns alone don't mean the skill is malicious — but they warrant attention.
source content
Git Workflow (active-safe)
Works with or without
CLI installed. Issue tracking can be done via direct file editing.aoc
Git Commands
| Operation | Command | Notes |
|---|---|---|
| Check current branch | | |
| Check current commit | | |
| Check uncommitted changes | | |
| Create branch | | From constitution branch policy |
| Stage changes | | |
| Commit | | Use structured message format |
| Stash work | | |
| Unstash work | | |
| View stash | | |
| Revert commit | | Requires confirmation |
Issue Integration (File-Based — Default)
| Operation | How to Do It |
|---|---|
| Start work | Edit issue in : set |
| Close issue | Set , add log entry with commit hash |
CLI Integration (when aoc is available)
When
aoc CLI is detected in .agent/tools.json:
# Update issue when starting work aoc issues update <ID> --status in-progress --log "Started work" # Close issue when committing aoc issues close <ID> --log "Fixed in commit abc123"
Never Auto-Execute
# These require explicit user confirmation: git push # Never auto-push git push --force # Never force push git branch -D # Never delete branches
Scope
- ✅ Detect stale state (authoritative source)
- ✅ Create feature branches
- ✅ Commit checkpoints with structured messages
- ✅ Detect uncommitted changes
- ✅ Stash/unstash work in progress
- ✅ Revert agent's own commits (with confirmation)
- ❌ Never push without explicit user request
- ❌ Never force push
- ❌ Never delete remote branches
Stale State Detection (authoritative)
Called by
agent-ops-state at session start. This is the single source of truth for staleness.
Procedure
-
Read
session info:.agent/focus.md
: expected branch namebranch
: expected HEAD commit (short hash)last_commit
: timestamplast_updated
-
Get current git state:
git branch --show-current # current branch git rev-parse --short HEAD # current commit git status --porcelain # uncommitted changes -
Compare and categorize:
Check Mismatch Severity Action Branch changed focus says
, now onmainfeature-x⚠️ WARN Ask user Commit changed focus says
, HEAD isabc123def456⚠️ WARN Ask user Uncommitted changes
shows changesgit statusℹ️ INFO Note, may continue All match — ✅ OK Continue -
If any WARN:
⚠️ State may be stale. - Expected branch: X, actual: Y - Expected commit: A, actual: B Options: A) Continue anyway (I made these changes) B) Update focus.md to current state C) Stop and investigate
Branch Strategy
Read
.agent/constitution.md for project-specific rules:
- Branch naming pattern
- When to create branches
- Whether to work on main directly
Commit Message Format
Follow constitution format. Default:
[AgentOps] <type>: <short summary> <body - what and why> Task: T-XXXX
Types:
feat, fix, docs, refactor, test, chore
Issue Reference in Commits
Every commit should reference an issue ID:
[AgentOps] fix: Resolve login timeout Fixed the session expiry logic that was causing premature logouts. Issue: BUG-0023@efa54f
If no issue exists for the work being committed:
⚠️ No issue found for this commit. Create an issue first? [Y]es / [N]o, commit without issue Note: All work should be tracked for auditability.
Checkpoint Commits
Create commits at these moments:
- Before risky changes (labeled
)[checkpoint] - After each implementation step completes successfully
- Before switching tasks
Rollback Procedure
When rolling back:
- List commits made by agent (search for
prefix)[AgentOps] - Show user what will be reverted
- Ask for confirmation
- Use
(not reset) to preserve historygit revert