Agent Skills: Git Master (Safe Mode)

Auto-apply when the user asks for any git version control operations, including commit, push, pull, branch, merge, rebase, squash, reset, revert, cherry-pick, stash, tag, undo, amend, diff, log, or blame.

UncategorizedID: plutowang/term.conf/git

Install this agent skill to your local

pnpm dlx add-skill https://github.com/plutowang/term.conf/tree/HEAD/opencode/skills/global/git

Skill Files

Browse the full folder contents for git.

Download Skill

Loading file tree…

opencode/skills/global/git/SKILL.md

Skill Metadata

Name
git
Description
Auto-apply when the user asks for any git version control operations, including commit, push, pull, branch, merge, rebase, squash, reset, revert, cherry-pick, stash, tag, undo, amend, diff, log, or blame.

Git Master (Safe Mode)

Security Protocol

  1. NEVER EXECUTE write commands (commit, push, rebase, branch).
  2. ONLY EXECUTE read-only commands (status, log, diff).
  3. ALWAYS OUTPUT commands in bash code blocks for user execution.

1. Standards

  • Commit Format: <type>(<scope>): <description>
  • Types: feat, fix, docs, style, refactor, perf, test, chore, ci.
  • Branch Format: <type>/<kebab-case-description> (e.g., feat/auth-login).

2. Workflows

  • Commit: Analyze diff -> Generate git commit -m "type: desc".
  • Push: Generate git push -u origin <branch>.
  • Sync: Suggest git fetch origin && git rebase origin/main.
  • Squash:
    1. Identify count $N$.
    2. Output git rebase -i HEAD~N.
    3. Instruct: "Change pick to squash (or s) for the bottom $N-1$ commits."

3. Recovery: "Wrong Push"

Identify if branch is Public (shared/main) or Private (feature).

A. Public (Safe / No Force Push)

  1. Undo on wrong: git checkout wrong && git revert <hashes> && git push.
  2. Move to right: git checkout right && git cherry-pick <hashes> && git push.

B. Private (Clean / Force Push OK)

  1. Copy first: git checkout right && git cherry-pick <hashes>.
  2. Reset wrong: git checkout wrong && git reset --hard <good-hash> && git push -f.

C. Local/Recent ("Soft Reset")

For simple, recent moves: git reset --soft HEAD~N -> git checkout right -> git commit.