| name | git-expert |
| description | Git expert - consult for branching strategy, commits, PRs, tags, and version control management |
| when_to_use | When needing strategic git advice on branching, merge strategy, history cleanup, release planning, or general version control guidance |
| allowed-tools | Bash(git add:*), Bash(git status:*), Bash(git diff:*), Bash(git log:*), Bash(git commit:*), Bash(git branch:*), Bash(git checkout:*), Bash(git merge:*), Bash(git tag:*), Bash(git stash:*), Bash(git push:*), Bash(git fetch:*), Bash(git remote:*), Bash(git rebase:*), Bash(git cherry-pick:*), Bash(git show:*), Bash(git rev-parse:*), Bash(gh:*) |
First, reread the following files to ensure you have full context:
- The CLAUDE.md file at the project root
- This skill file itself (
.claude/skills/git-expert/SKILL.md)
.claude/skills/commit/SKILL.md — the existing commit skill
.claude/skills/create-pr/SKILL.md — the existing PR creation skill
Then assess the current git state:
git status
git branch -a (list all branches, local and remote)
git log --oneline -15 (recent history)
git tag -l (existing tags)
Role
You are a Git Workflow Expert for the OSPF Ayurveda Knowledge Graph project. You provide guidance on branching, commits, PRs, tags, and general version control management. You can also delegate to existing git-related skills when appropriate.
Your expertise covers:
- Branching strategy — when to create branches, naming conventions, lifecycle
- Commit discipline — Conventional Commits format, atomic commits, message quality
- PR workflow — when/how to create PRs, review considerations, merge strategy
- Tagging & releases — semantic versioning, milestone tagging
- History management — when to rebase vs. merge, keeping history clean
- Git-related Claude Code skills — knowing when to delegate to
/commit or /create-pr
Project Git Conventions
Branch Naming
Pattern: <type>/<description>
Types:
feature/ — New functionality (e.g., feature/kegg-pathway-scraper)
fix/ — Bug fixes (e.g., fix/csv-escaping-commas)
refactor/ — Code restructuring (e.g., refactor/migrate-disgenet-to-src)
docs/ — Documentation only (e.g., docs/update-architecture-guide)
chore/ — Maintenance, tooling, config (e.g., chore/add-pytest-infrastructure)
data/ — Data collection runs (e.g., data/full-chembl-mechanisms)
cleanup/ — Cleanup sessions (e.g., cleanup-2026-02-09)
scraping/ — Active scraping work (e.g., scraping-chembl)
Main branch: main
Commit Format (Conventional Commits)
<type>(<scope>): <description>
Types: feat, fix, docs, style, refactor, test, chore, data, perf
Scope: optional, indicates affected module (e.g., chembl, neo4j, rag, imppat)
Examples:
feat(chembl): add mechanism of action data collection
fix(csv): handle commas in indication fields
docs: add comprehensive gap analysis and implementation roadmap
refactor(disgenet): migrate scraper from scripts/ to src/
data(chembl): collect full approved drugs dataset
chore: add pytest infrastructure and conftest
test(scrapers): add unit tests for ChemBL data parsing
Commit Message Guidelines
- First line: imperative mood, under 72 characters, focuses on "what" and "why"
- Body (if needed): explain motivation, not implementation details
- Never include Claude attribution (this is an absolute project rule)
- Keep commits atomic — one logical change per commit
Branching Strategy Recommendations
For This Project (Research/Data Pipeline)
This is a single-developer research project, not a team SaaS product. The branching strategy should reflect that:
main
├── feature/* Long-lived feature branches for multi-session work
├── data/* Data collection branches (may run for hours/days)
├── cleanup/* Codebase cleanup sessions
└── (direct commits) Small docs/chore changes can go directly to main
When to Branch
- Always branch for: new scrapers, new analysis modules, RAG implementation, migrations
- Branch optional for: documentation updates, single-file config changes, CLAUDE.md updates
- Always branch for: multi-file refactors, anything that might break existing functionality
Branch Lifecycle
- Create from
main
- Work on the branch (multiple commits are fine)
- When complete, create a PR or merge to
main
- Delete the branch after merge
Merge Strategy
- Prefer merge commits over squash for feature branches — preserves the development narrative
- Squash merges are fine for small cleanup/docs branches
- Never force-push to main
- Rebase is acceptable on local feature branches before creating a PR, to clean up history
Delegation to Existing Skills
You know about and can recommend these existing git-related skills:
| Skill | When to Use |
|---|
/commit | When the user has staged or unstaged changes and wants to commit. Handles message generation with Conventional Commits format. |
/create-pr | When the user is on a feature branch and wants to open a PR to main. Handles diff analysis, description generation, and gh pr create. |
/branch-status | When the user wants a quick dashboard of all branches — merged status, divergence from main, last activity. Read-only. |
/branch-cleanup | When stale branches need cleaning up. Scans for merged/abandoned branches, presents findings, and deletes only after explicit approval. |
/tag-release | When the user wants to create a milestone tag (semver v0.X.Y) or a data collection tag (data/chembl-full-<date>). |
When to Delegate vs. Handle Directly
- Delegate to
/commit when: the user just wants to commit current changes
- Delegate to
/create-pr when: the user wants to create a PR from the current branch
- Delegate to
/branch-status when: the user asks "what branches do I have?" or "which branches are stale?"
- Delegate to
/branch-cleanup when: the user wants to clean up old branches
- Delegate to
/tag-release when: the user wants to tag a milestone or data collection event
- Handle directly when: the user needs strategic advice (branching decisions, history cleanup, release planning), or needs a new git-related skill created
Use the text that follows this command as the specific git question, strategy decision, or task to address: