.claude/skills/git-expert/SKILL.md
Advanced Git operations wrapper. Optimizes token usage by guiding complex git workflows into efficient CLI commands.
npx skillsauth add oimiragieo/agent-studio git-expertInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The skill invokes the git CLI. Install Git if not present:
winget install --id Git.Git -e --source wingetbrew install git or Xcode CLI tools: xcode-select --installapt-get install git (Debian/Ubuntu), dnf install git (Fedora), pacman -S git (Arch)Verify: git --version
Essential commands (token-efficient):
git status -s — short status; git add -p — stage hunks; git diff --cached — review stagedgit switch -c <branch> or git 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 fetch then git merge or git pull — prefer fetch+merge over blind pullHacks: 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.
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).
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.
Do not use git status repeatedly. Use this workflow:
git status -s (Short format saves tokens)git diff --cached (Only check what you are about to commit)git log --oneline -5 (Context without the noise)git add <file>
git diff --cached # REVIEW THIS!
git commit -m "feat: description"
git reset --soft HEAD~1
git status to see conflict files.<<<<, ====, >>>>).git add <file>git commit --no-editgit 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.| 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 |
The reftable backend completely replaces the legacy files reference format with a binary format that is faster, atomic, and storage-efficient:
Benefits:
Enable for a new repository:
git init --ref-format=reftable my-repo
Check current backend:
git rev-parse --show-ref-format
# outputs: files OR reftable
Migration 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.
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 start
Multi-pack reachability bitmaps extend MIDX with precomputed reachability data, dramatically speeding up git clone, git fetch, and garbage collection on large repositories.
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 disable
One-command clone (Git 2.25+):
git clone --filter=blob:none --sparse https://github.com/org/monorepo.git
cd monorepo
git sparse-checkout set services/payments
Cone 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 |
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 list
What Scalar configures automatically:
--filter=blob:none)core.fsmonitor)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 HEAD
Set up an allowed-signers file for team verification:
# ~/.config/git/allowed_signers
[email protected] ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAA...
[email protected] ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAA...
git config --global gpg.ssh.allowedSignersFile ~/.config/git/allowed_signers
git log --show-signature
GitHub 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.pub
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 zdiff3
# 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 status
gitflow - Branch workflow patterns (feature, release, hotfix branches)Before starting:
Read .claude/context/memory/learnings.md
After completing:
.claude/context/memory/learnings.md.claude/context/memory/issues.md.claude/context/memory/decisions.mdASSUME INTERRUPTION: If it's not in memory, it didn't happen.
tools
Comprehensive biosignal processing toolkit for analyzing physiological data including ECG, EEG, EDA, RSP, PPG, EMG, and EOG signals. Use this skill when processing cardiovascular signals, brain activity, electrodermal responses, respiratory patterns, muscle activity, or eye movements. Applicable for heart rate variability analysis, event-related potentials, complexity measures, autonomic nervous system assessment, psychophysiology research, and multi-modal physiological signal integration.
tools
Comprehensive toolkit for creating, analyzing, and visualizing complex networks and graphs in Python. Use when working with network/graph data structures, analyzing relationships between entities, computing graph algorithms (shortest paths, centrality, clustering), detecting communities, generating synthetic networks, or visualizing network topologies. Applicable to social networks, biological networks, transportation systems, citation networks, and any domain involving pairwise relationships.
data-ai
Molecular featurization for ML (100+ featurizers). ECFP, MACCS, descriptors, pretrained models (ChemBERTa), convert SMILES to features, for QSAR and molecular ML.
development
Run Python code in the cloud with serverless containers, GPUs, and autoscaling. Use when deploying ML models, running batch processing jobs, scheduling compute-intensive tasks, or serving APIs that require GPU acceleration or dynamic scaling.