agentsclimarketplace

Git master

Skill UtsavBalar1231/oh-my-claudeagent/skills/git-master

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'.From its SKILL.md

Install
npx -y skills add UtsavBalar1231/oh-my-claudeagent --skill git-master

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 3 stars3 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

11.7 KB, as published. Nobody here has run it

Git Master Agent

Tool Restrictions

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).

Non-Interactive Environment (MANDATORY)

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.

MODE DETECTION (FIRST STEP)

User Request PatternModeJump To
"commit", changes to commitCOMMITPhase 0-5
"rebase", "squash", "cleanup history"REBASEPhase R1-R4
"find when", "who changed", "git blame", "bisect"HISTORY_SEARCHPhase H1-H3
"what changed", "is this clean", "check status", "what's staged" (purely investigative)STATUSSTATUS MODE

CRITICAL: Don't default to COMMIT mode. Parse the actual request.

STATUS MODE (investigate-only)

For requests that only ask to inspect repo state: nothing to commit, rewrite, or search history for. Run read-only commands (git status, git diff, git log --oneline, git branch -vv), report findings, and stop. No git add, git commit, git rebase, git reset, or any command that mutates the working tree, index, or history. If the findings reveal work that plausibly needs a commit or rebase, say so and wait; do not switch modes without the user asking.

CORE PRINCIPLE: ATOMIC COMMITS BY DEFAULT

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:

CriterionAction
Different directories/modulesSPLIT
Different component types (model/service/view)SPLIT
Can be reverted independentlySPLIT
Different concerns (UI/logic/config/test)SPLIT
New file vs modificationSPLIT

ONLY COMBINE when ALL of these are true:

  • EXACT same atomic unit (e.g., function + its test)
  • Splitting would literally break compilation
  • You can justify WHY in one sentence

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.

PHASE 0: Parallel Context Gathering (MANDATORY)

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

PHASE 1: Style Detection (BLOCKING - MUST OUTPUT)

Language/Script Detection

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.

Commit Style Classification

StylePatternExample
SEMANTICtype: message or type(scope): messagefeat: add login
PLAINJust description, no prefixAdd login feature
SHORTMinimal keywordsformat, lint
SENTENCEFull sentence styleImplemented 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"

PHASE 2: Branch Context Analysis

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)

PHASE 3: Atomic Unit Planning (BLOCKING)

Identify Atomic Concerns FIRST

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.

Split by Directory/Module FIRST

RULE: Different directories = Different commits (almost always)

Implementation + Test Pairing (MANDATORY)

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

MANDATORY OUTPUT:

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

MANDATORY JUSTIFICATION

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"

PHASE 4: Commit Execution

Register Task Items

Use TaskCreate to register each commit as a trackable item. Mark each in_progress before executing, completed after.

Precondition: TodoWrite and TaskCreate/TaskGet/TaskUpdate/TaskList are withheld on Opus 5 and Fable 5 era models unless CLAUDE_CODE_ENABLE_TODO_TOOLS=1 is set. When they are absent the mandate still stands, carried in your own response text instead of a task list.

Execute Commits

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

PHASE 5: Verification & Cleanup

# 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

Quick Reference: Style Detection

If git log shows...Use this style
feat: xxx, fix: yyySEMANTIC
Add xxx, Fix yyyPLAIN
Full sentencesSENTENCE
format, lintSHORT
Mix of aboveUse MAJORITY

REBASE MODE (Phase R1-R4)

PHASE R1: Safety Assessment

ConditionRisk LevelAction
On main/masterCRITICALABORT - never rebase main
Dirty working directoryWARNINGStop and ask before stashing. Never hide user changes silently.
Pushed commits existWARNINGRequires explicit permission before rewrite. --force-with-lease only.
All commits localSAFEProceed freely

Pre-history-write safety checklist (BLOCKING)

Before any history rewrite (rebase, amend, reset), confirm all four before running the mutating command:

  1. Current branch is known: git branch --show-current output captured this session, not assumed.
  2. Dirty work is accounted for: git status shows clean, or uncommitted changes are identified and the user has agreed to how they're handled (stash/commit/discard).
  3. Push state is known: has-upstream and ahead/behind checked (Phase 0 Group 3); determines AGGRESSIVE vs CAREFUL rewrite above.
  4. Recovery path is named: state the abort command (git rebase --abort, git reset --hard ORIG_HEAD) and the reflog fallback (git reflog + git reset --hard HEAD@{N}) before executing, so recovery is one command away if the rewrite goes wrong.

If any of the four is unconfirmed, stop and gather it; do not proceed on assumption.

PHASE R2: Rebase Execution

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

HISTORY SEARCH MODE (Phase H1-H3)

Search Commands

GoalCommand
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 historygit log --follow -- path/file.py

PR Evidence Attachment

When a PR body needs visual evidence (screenshots, recordings) of a change:

  • Attach via the platform's own PR-attachment/upload flow, not the repo.
  • Never commit temporary evidence images to the repository: they bloat history and outlive their purpose.
  • Never repurpose release artifacts as PR evidence: releases and PR evidence are different lifecycles; conflating them makes releases untrustworthy as a source of truth.

Anti-Patterns (AUTOMATIC FAILURE)

  1. NEVER make one giant mixed-concern commit - split by atomic concern
  2. NEVER default to semantic commits - detect from git log first
  3. NEVER separate test from implementation - same commit always
  4. NEVER group by file type - group by feature/module
  5. NEVER rewrite pushed history without explicit permission
  6. NEVER use --force - use --force-with-lease only after explicit permission

Keep looking

Skills are one crate of 609,856. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.