git-expert

📁 oimiragieo/agent-studio 📅 Jan 27, 2026
33
总安装量
3
周安装量
#11313
全站排名
安装命令
npx skills add https://github.com/oimiragieo/agent-studio --skill git-expert

Agent 安装分布

github-copilot 2
mcpjam 1
claude-code 1
junie 1
windsurf 1
zencoder 1

Skill 文档

Git Expert Skill

Installation

The skill invokes the git CLI. Install Git if not present:

  • Windows: Download from git-scm.com or winget install --id Git.Git -e --source winget
  • macOS: brew install git or Xcode CLI tools: xcode-select --install
  • Linux: apt-get install git (Debian/Ubuntu), dnf install git (Fedora), pacman -S git (Arch)

Verify: git --version

Cheat Sheet & Best Practices

Essential commands (token-efficient):

  • git status -s — short status; git add -p — stage hunks; git diff --cached — review staged
  • git switch -c <branch> or git checkout -b <branch> — new branch; git branch — list
  • git log --oneline -5 — compact history; git log --follow <file> — track renames
  • git restore <file> — discard unstaged; git reset --soft HEAD~1 — undo last commit (keep changes)
  • git fetch then git merge or git pull — prefer fetch+merge over blind pull

Hacks: Set git config --global color.ui auto and user.name/user.email. Use .gitignore aggressively. Prefer git merge --squash for clean history on feature merge. Use git cherry-pick <commit> to bring single commits. Never rebase pushed commits without team agreement.

Certifications & Training

Free / official: Atlassian Git Tutorials (beginner–advanced). Microsoft Learn – GitHub Training (GitHub Foundations path). GitHub Learn (Git + GitHub). No single “Git cert”; GitHub Foundations aligns with fundamentals.

Skill data: Focus on branching, undo (reset/restore/revert), merge vs rebase, remote workflow, and safety (no force-push, no secrets).

Hooks & Workflows

Suggested hooks: Pre-commit: run commit-validator (conventional commits). Pre-push: run tests (reference tdd / verification-before-completion). Post-merge: optional memory/learnings update.

Workflows: Use with developer (primary), devops (always). Flow: branch → edit → add → validate commit message → commit → push; use github-ops or github-mcp for PR/create. See .claude/workflows for feature-development and code-review workflows that use git-expert.

⚡ Token-Efficient Workflow

Do not use git status repeatedly. Use this workflow:

  1. Check State: git status -s (Short format saves tokens)
  2. Diff: git diff --cached (Only check what you are about to commit)
  3. Log: git log --oneline -5 (Context without the noise)

🔄 Common Patterns

Safe Commit

git add <file>
git diff --cached # REVIEW THIS!
git commit -m "feat: description"

Undo Last Commit (Soft)

git reset --soft HEAD~1

Fix Merge Conflict

  1. git status to see conflict files.
  2. Edit file to resolve markers (<<<<, ====, >>>>).
  3. git add <file>
  4. git commit --no-edit

🛡️ Safety Rules

  • NEVER use git push --force.
  • NEVER commit secrets.
  • ALWAYS run tests before pushing.

Related Skills

  • gitflow – Branch workflow patterns (feature, release, hotfix branches)

Memory Protocol (MANDATORY)

Before starting: Read .claude/context/memory/learnings.md

After completing:

  • New pattern -> .claude/context/memory/learnings.md
  • Issue found -> .claude/context/memory/issues.md
  • Decision made -> .claude/context/memory/decisions.md

ASSUME INTERRUPTION: If it’s not in memory, it didn’t happen.