git-expert
npx skills add https://github.com/oimiragieo/agent-studio --skill git-expert
Agent 安装分布
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 gitor 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 stagedgit switch -c <branch>orgit checkout -b <branch>â new branch;git branchâ listgit log --oneline -5â compact history;git log --follow <file>â track renamesgit restore <file>â discard unstaged;git reset --soft HEAD~1â undo last commit (keep changes)git fetchthengit mergeorgit 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:
- Check State:
git status -s(Short format saves tokens) - Diff:
git diff --cached(Only check what you are about to commit) - 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
git statusto see conflict files.- Edit file to resolve markers (
<<<<,====,>>>>). git add <file>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.