From Oh My ClaudeAgent
MUST USE for ANY git operations. Atomic commits, rebase/squash, history search (blame, bisect, log -S). Triggers: 'commit', 'rebase', 'squash', 'who wrote', 'when was X added', 'find the commit that'.
How this skill is triggered — by the user, by Claude, or both
Slash command
/oh-my-claudeagent:git-master [commit | rebase | blame | bisect][commit | rebase | blame | bisect]sonnet.gitignore.gitattributesThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
All changes via git in Bash. No Write/Edit (direct file modification) or Agent (delegation).
All changes via git in Bash. No Write/Edit (direct file modification) or Agent (delegation).
MCP tools: evidence_log (verification), ast_search (code archaeology).
Three specializations: Commit Architect (atomic commits, style detection), Rebase Surgeon (history rewriting, conflicts), History Archaeologist (when and where changes were introduced).
Claude Code cannot interact with spawned processes. ALL git commands must be prefixed:
GIT_EDITOR=: EDITOR=: GIT_SEQUENCE_EDITOR=: GIT_PAGER=cat GIT_TERMINAL_PROMPT=0 git <command>
Prevents editor hangs without user configuration.
| User Request Pattern | Mode | Jump To |
|---|---|---|
| "commit", changes to commit | COMMIT | Phase 0-5 |
| "rebase", "squash", "cleanup history" | REBASE | Phase R1-R4 |
| "find when", "who changed", "git blame", "bisect" | HISTORY_SEARCH | Phase H1-H3 |
CRITICAL: Don't default to COMMIT mode. Parse the actual request.
Each commit should represent one atomic concern: a change that can be reviewed, reverted, and explained independently. Prefer multiple commits when there are multiple concerns; a single commit is acceptable when all changed files are one inseparable concern.
File count is a warning signal, not a formula. More files require stronger justification, but the split is determined by concerns and dependencies, not a fixed threshold.
SPLIT BY:
| Criterion | Action |
|---|---|
| Different directories/modules | SPLIT |
| Different component types (model/service/view) | SPLIT |
| Can be reverted independently | SPLIT |
| Different concerns (UI/logic/config/test) | SPLIT |
| New file vs modification | SPLIT |
ONLY COMBINE when ALL of these are true:
MANDATORY SELF-CHECK before committing:
"I am making N commits from M files."
For each commit:
-> What single concern does it represent?
-> Can it be reverted independently?
-> Are implementation and direct tests together?
If any answer is unclear, split or explain why splitting would break the change.
Execute ALL in parallel:
# Group 1: Current state
git status
git diff --staged --stat
git diff --stat
# Group 2: History context
git log -30 --oneline
git log -30 --pretty=format:"%s"
# Group 3: Branch context
git branch --show-current
git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null
git rev-parse --abbrev-ref @{upstream} 2>/dev/null || echo "NO_UPSTREAM"
git log --oneline $(git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null)..HEAD 2>/dev/null
Inspect git log -30 for the dominant human language/script and tone.
Examples: English, Korean, Japanese, Chinese, mixed, emoji-heavy, terse keywords.
DECISION:
- Use the majority language/script when clear.
- If mixed or unclear, match the most recent relevant commit style.
- Do not force a Korean/English binary.
| Style | Pattern | Example |
|---|---|---|
SEMANTIC | type: message or type(scope): message | feat: add login |
PLAIN | Just description, no prefix | Add login feature |
SHORT | Minimal keywords | format, lint |
SENTENCE | Full sentence style | Implemented the new login flow |
MANDATORY OUTPUT:
STYLE DETECTION RESULT
======================
Language/script: [detected language/script or MIXED]
Style: [SEMANTIC | PLAIN | SHORT]
Reference examples from repo:
1. "actual commit message from log"
2. "actual commit message from log"
BRANCH_STATE:
current_branch: <name>
has_upstream: true | false (from NO_UPSTREAM check in Phase 0)
commits_ahead: N
REWRITE_SAFETY:
- On main/master: NEVER rewrite
- has_upstream=false: AGGRESSIVE_REWRITE allowed
- has_upstream=true, commits pushed: CAREFUL_REWRITE (explicit permission required before rewrite, `--force-with-lease` only if pushing)
Group files by independently reviewable concern. Use file count only to trigger scrutiny: if one planned commit touches many files, write a concrete justification for why those files must land together.
RULE: Different directories = Different commits (almost always)
RULE: Test files MUST be in same commit as implementation
Test patterns to match:
- test_*.py <-> *.py
- *_test.py <-> *.py
- *.test.ts <-> *.ts
- *.spec.ts <-> *.ts
COMMIT PLAN
===========
Files changed: N
Planned commits: K
Status: ATOMIC (PASS) | NEEDS_SPLIT (explain concern overlap)
COMMIT 1: [message in detected style]
- path/to/file1.py
- path/to/file1_test.py
Justification: implementation + its test
For each planned commit with multiple files, write ONE sentence naming the atomic concern. If you cannot write it, SPLIT.
Valid: "implementation file + its direct test", "migration + model that would break without both" Invalid: "all related to feature X", "they were changed together"
Use TaskCreate to register each commit as a trackable item. Mark each in_progress before executing, completed after.
For each new commit group, in dependency order:
# Stage files
git add <file1> <file2> ...
# Verify staging
git diff --staged --stat
# Commit with detected style
git commit -m "<message-matching-detected-style>"
# Verify
git log -1 --oneline
# Check working directory clean
git status
# Review new history
git log --oneline $(git merge-base HEAD main 2>/dev/null || git merge-base HEAD master)..HEAD
| If git log shows... | Use this style |
|---|---|
feat: xxx, fix: yyy | SEMANTIC |
Add xxx, Fix yyy | PLAIN |
| Full sentences | SENTENCE |
format, lint | SHORT |
| Mix of above | Use MAJORITY |
| Condition | Risk Level | Action |
|---|---|---|
| On main/master | CRITICAL | ABORT - never rebase main |
| Dirty working directory | WARNING | Stop and ask before stashing. Never hide user changes silently. |
| Pushed commits exist | WARNING | Requires explicit permission before rewrite. --force-with-lease only. |
| All commits local | SAFE | Proceed freely |
Rebases must be fully non-interactive. Use the mandatory environment prefix for every git command. Do not open editors. If conflicts occur, stop after reporting the conflicted files and exact next commands. Do not guess conflict resolutions unless the user explicitly requested conflict fixing.
# Find merge-base
MERGE_BASE=$(git merge-base HEAD main 2>/dev/null || git merge-base HEAD master)
# For SQUASH (combine all into one):
GIT_EDITOR=: EDITOR=: GIT_SEQUENCE_EDITOR=: GIT_PAGER=cat GIT_TERMINAL_PROMPT=0 git reset --soft $MERGE_BASE
GIT_EDITOR=: EDITOR=: GIT_SEQUENCE_EDITOR=: GIT_PAGER=cat GIT_TERMINAL_PROMPT=0 git commit -m "Combined: <summarize all changes>"
# For AUTOSQUASH (non-interactive editor disabled):
GIT_EDITOR=: EDITOR=: GIT_SEQUENCE_EDITOR=: GIT_PAGER=cat GIT_TERMINAL_PROMPT=0 git rebase -i --autosquash $MERGE_BASE
After any successful rewrite of pushed history, push only when explicitly requested, and use:
GIT_EDITOR=: EDITOR=: GIT_SEQUENCE_EDITOR=: GIT_PAGER=cat GIT_TERMINAL_PROMPT=0 git push --force-with-lease
| Goal | Command |
|---|---|
| When was "X" added? | git log -S "X" --oneline |
| When was "X" removed? | git log -S "X" --all --oneline |
| What commits touched "X"? | git log -G "X" --oneline |
| Who wrote line N? | git blame -L N,N file.py |
| When did bug start? | git bisect start && git bisect bad && git bisect good <tag> |
| File history | git log --follow -- path/file.py |
--force-with-lease only after explicit permissionnpx claudepluginhub utsavbalar1231/oh-my-claudeagent --plugin oh-my-claudeagentProvides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.