
Git Expert
- 75 installs
- 36 repo stars
- Updated July 14, 2026
- oimiragieo/agent-studio
Helps with ai & agent building tasks.
About
git-expert is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted development.
- git-expert
- AI & Agent Building
- AI-coding skill
Git Expert by the numbers
- 75 all-time installs (skills.sh)
- Ranked #5,460 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/oimiragieo/agent-studio --skill git-expertAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 75 |
|---|---|
| repo stars | ★ 36 |
| Last updated | July 14, 2026 |
| Repository | oimiragieo/agent-studio ↗ |
What it does
Helps with ai & agent building tasks.
Files
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:
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~1Fix Merge Conflict
1. git status to see conflict files. 2. Edit file to resolve markers (<<<<, ====, >>>>). 3. git add <file> 4. git commit --no-edit
Iron Laws
1. NEVER use git push --force on shared branches — force-pushing rewrites history for all collaborators, causes lost commits, and breaks in-progress rebases silently; use --force-with-lease when truly necessary. 2. NEVER commit secrets, credentials, or tokens to the repository — once pushed, secrets are visible in all forks and clones forever even after deletion from HEAD. 3. ALWAYS run the test suite and verify it passes before pushing to shared branches — broken code in shared branches blocks everyone and triggers emergency rollbacks. 4. ALWAYS rebase feature branches onto the base branch before merging — merging with a stale base creates avoidable conflicts and produces noisy merge commits in shared history. 5. NEVER rebase or rewrite history on commits that have already been pushed to a shared remote — teammates' local branches will diverge and produce duplicate commits on next pull.
Anti-Patterns
| Anti-Pattern | Why It Fails | Correct Approach |
|---|---|---|
git push --force on shared branches | Overwrites teammates' commits; destroys in-progress rebase branches | Use --force-with-lease for personal branches only; never on main/develop |
Committing .env or credentials | Permanently visible in history even after deletion; requires key rotation | Add sensitive files to .gitignore; use pre-commit secret-scanning hooks |
| Long-lived feature branches (>5 days) | Massive merge conflicts; integration bugs discovered too late | Use short-lived branches with daily rebases onto main (trunk-based dev) |
git commit -m "fix" or wip messages | Makes git log useless for bisect and changelog generation | Use conventional commits: fix: resolve null pointer in user auth |
| Merging without pulling latest base | Stale merge base; CI catches conflicts only after the merge lands | git fetch && git rebase origin/main before any merge or PR |
Git 2.45–2.50 Features (2024–2025)
Reftable Backend (Git 2.45+)
The reftable backend completely replaces the legacy files reference format with a binary format that is faster, atomic, and storage-efficient:
Benefits:
- Atomic multi-ref updates (all-or-nothing transactions)
- Faster single-ref lookup and iteration over ref ranges
- Consistent reads — never reads a partial update state
- More efficient reflog storage
Enable for a new repository:
git init --ref-format=reftable my-repoCheck current backend:
git rev-parse --show-ref-format
# outputs: files OR reftableMigration note: Converting an existing repo from files to reftable requires re-cloning or using git clone --ref-format=reftable. Clients using files repos are unaffected — the backend is server/local only.
Incremental Multi-Pack Indexes (Git 2.47+)
Multi-pack indexes (MIDXs) allow Git to maintain a single index across multiple packfiles without repacking. Git 2.47 adds incremental MIDX updates — only newly added packs are indexed rather than rebuilding the full MIDX:
# Generate or update multi-pack index
git multi-pack-index write --stdin-packs
# Verify the MIDX
git multi-pack-index verify
# Enable via maintenance
git maintenance startMulti-pack reachability bitmaps extend MIDX with precomputed reachability data, dramatically speeding up git clone, git fetch, and garbage collection on large repositories.
Sparse Checkout for Monorepos (Git 2.25+ cone mode)
Sparse checkout lets you check out only the directories you need from a large monorepo:
# Clone without checking out any files
git clone --no-checkout --filter=blob:none https://github.com/org/monorepo.git
cd monorepo
# Initialize in cone mode (recommended — uses fast prefix matching)
git sparse-checkout init --cone
# Check out only specific directories
git sparse-checkout set frontend docs shared/utils
# See what is currently checked out
git sparse-checkout list
# Add more directories without losing current ones
git sparse-checkout add backend/api
# Disable sparse checkout (restore full working tree)
git sparse-checkout disableOne-command clone (Git 2.25+):
git clone --filter=blob:none --sparse https://github.com/org/monorepo.git
cd monorepo
git sparse-checkout set services/paymentsCone mode vs. non-cone mode:
| Mode | Pattern Matching | Performance |
|---|---|---|
| Cone (recommended) | Directory prefix only | Fast (O(log n) path matching) |
| Non-cone | Full gitignore-style patterns | Slow on large trees |
Git Scalar — Large Repository Optimization
Scalar is a repository management tool bundled with Git (since Git 2.38) that configures and maintains all recommended performance settings automatically:
# Clone a large repo with all performance features enabled
scalar clone https://github.com/org/large-monorepo.git
# Register an existing repo with Scalar
scalar register
# Run all maintenance tasks manually
scalar run all
# View configured enlistments
scalar listWhat Scalar configures automatically:
- Partial clone (
--filter=blob:none) - Sparse checkout (cone mode)
- File system monitor (
core.fsmonitor) - Commit graph generation
- Background maintenance (hourly fetch, daily gc)
- Multi-pack index
Sign Commits with SSH Keys (Git 2.34+)
SSH key signing is simpler than GPG and works with keys you already use for authentication:
# Configure SSH signing globally
git config --global gpg.format ssh
git config --global user.signingKey ~/.ssh/id_ed25519.pub
# Sign all commits automatically
git config --global commit.gpgSign true
# Or sign a single commit manually
git commit -S -m "feat: add payment service"
# Verify a commit
git verify-commit HEADSet up an allowed-signers file for team verification:
# ~/.config/git/allowed_signers
alice@example.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAA...
bob@example.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAA...git config --global gpg.ssh.allowedSignersFile ~/.config/git/allowed_signers
git log --show-signatureGitHub verification: Add your SSH signing key to GitHub under Settings > SSH and GPG keys > New SSH key > Signing Key. Commits signed with that key will show "Verified" on GitHub.
FIDO2 / hardware security key signing:
# Generate a resident key on a FIDO2 security key (e.g., YubiKey)
ssh-keygen -t ed25519-sk -O resident -f ~/.ssh/id_ed25519_sk_fido2
git config --global user.signingKey ~/.ssh/id_ed25519_sk_fido2.pubImproved Merge Strategies (Git 2.38+ ort)
The ort merge strategy has been the default since Git 2.34. It is significantly faster than recursive for large trees and more deterministic:
# ort is the default; explicitly select if needed
git merge -s ort feature/my-feature
# Rename detection threshold (default 50%)
git merge -X rename-threshold=80 feature/rename-heavy-branch
# Conflict style: diff3 (shows common ancestor) — strongly recommended
git config --global merge.conflictStyle diff3
# Or zdiff3 (even cleaner context in conflicts, Git 2.35+)
git config --global merge.conflictStyle zdiff3Performance Commands for Large Repos
# Enable file system monitor (avoids scanning entire tree for status)
git config core.fsmonitor true
git config core.untrackedCache true
# Precompute commit graph for faster log/blame
git commit-graph write --reachable --changed-paths
git config fetch.writeCommitGraph true
# Partial clone — skip large blobs on clone, fetch on demand
git clone --filter=blob:none <url>
# Shallow clone (CI use case — last N commits only)
git clone --depth=1 <url>
# Check repository health and performance
GIT_TRACE_PERFORMANCE=1 git statusRelated 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.
Invoke the git-expert skill and follow it exactly as presented to you
#!/usr/bin/env node
/**
* git-expert - Post-Execute Hook
* Runs after the skill executes for cleanup, logging, or follow-up actions.
*/
const fs = require('fs');
const path = require('path');
const { safeParseJSON } = require('../../../lib/utils/safe-json.cjs');
// Parse hook input
const result = safeParseJSON(process.argv[2] || '{}');
console.log('📝 [GIT-EXPERT] Post-execute processing...');
/**
* Process execution result
*/
function processResult(_result) {
// TODO: Add your post-processing logic here
return { success: true };
}
// Run post-processing
const outcome = processResult(result);
if (outcome.success) {
console.log('✅ [GIT-EXPERT] Post-processing complete');
process.exit(0);
} else {
console.error('⚠️ [GIT-EXPERT] Post-processing had issues');
process.exit(0);
}
#!/usr/bin/env node
/**
* git-expert - Pre-Execute Hook
* Runs before the skill executes to validate input or prepare context.
*/
const fs = require('fs');
const path = require('path');
const { safeParseJSON } = require('../../../lib/utils/safe-json.cjs');
// Parse hook input
const input = safeParseJSON(process.argv[2] || '{}');
console.log('🔍 [GIT-EXPERT] Pre-execute validation...');
/**
* Validate input before execution
*/
function validateInput(_input) {
const errors = [];
// TODO: Add your validation logic here
return errors;
}
// Run validation
const errors = validateInput(input);
if (errors.length > 0) {
console.error('❌ Validation failed:');
errors.forEach(e => console.error(' - ' + e));
process.exit(1);
}
console.log('✅ [GIT-EXPERT] Validation passed');
process.exit(0);
git-expert Research Requirements
Generated: 2026-02-28
Skill Description
Advanced Git operations wrapper. Optimizes token usage by guiding complex git workflows into efficient CLI commands.
Research Areas
- Current best practices for git-expert
- Industry standards and tooling
- Integration patterns
Source References
- To be populated by skill-updater research phase
git-expert Rules
Purpose
Advanced Git operations wrapper. Optimizes token usage by guiding complex git workflows into efficient CLI commands.
Best Practices
- Never use git push --force
- Never commit secrets
- Always run tests before pushing
- Use SSH key signing instead of GPG for commit verification
- Use sparse-checkout cone mode for monorepo workflows
- Use Git Scalar for large repository performance optimization
- Prefer reftable backend for new repositories (Git 2.45+)
Integration Points
See SKILL.md for complete documentation.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "git-expert Input Schema",
"description": "Input validation schema for git-expert skill",
"type": "object",
"required": [],
"properties": {},
"additionalProperties": true
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "git-expert Output Schema",
"description": "Output validation schema for git-expert skill",
"type": "object",
"required": ["success"],
"properties": {
"success": {
"type": "boolean",
"description": "Whether the skill executed successfully"
},
"result": {
"type": "object",
"description": "The skill execution result",
"additionalProperties": true
},
"error": {
"type": "string",
"description": "Error message if execution failed"
}
},
"additionalProperties": true
}
#!/usr/bin/env node
/**
* Git Expert - Main Script
* Advanced Git operations wrapper. Optimizes token usage by guiding complex git workflows into efficient CLI commands.
*
* Usage:
* node main.cjs [options]
*
* Options:
* --help Show this help message
*/
const fs = require('fs');
const path = require('path');
// Find project root
function findProjectRoot() {
let dir = __dirname;
while (dir !== path.parse(dir).root) {
if (fs.existsSync(path.join(dir, '.claude'))) {
return dir;
}
dir = path.dirname(dir);
}
return process.cwd();
}
const PROJECT_ROOT = findProjectRoot();
// Parse command line arguments
const args = process.argv.slice(2);
const options = {};
for (let i = 0; i < args.length; i++) {
if (args[i].startsWith('--')) {
const key = args[i].slice(2);
const value = args[i + 1] && !args[i + 1].startsWith('--') ? args[++i] : true;
options[key] = value;
}
}
/**
* Main execution
*/
function main() {
if (options.help) {
console.log(`
Git Expert - Main Script
Usage:
node main.cjs [options]
Options:
--help Show this help message
`);
process.exit(0);
}
const { spawn } = require('child_process');
const child = spawn(
'git',
args.filter(a => a !== '--help'),
{
stdio: 'inherit',
cwd: PROJECT_ROOT,
shell: false,
windowsHide: true,
}
);
child.on('close', (code, signal) => {
if (code === 127) {
console.error('Git not found. Install: see this skill\'s SKILL.md, section "Installation".');
}
if (code !== null && code !== undefined) process.exit(code);
if (signal) process.exit(1);
process.exit(0);
});
}
main();
git-expert Implementation Template
Goal
- Define target outcome and acceptance criteria.
TDD
1. Red 2. Green 3. Refactor
Verification
- lint
- format
- targeted tests