git-mastery

git-mastery is a skill for Claude Code, Codex from softspark/ai-toolkit. It costs 51 tokens per session (1,316 once invoked), scanned A, original, Apache-2.0.

A guide to advanced Git operations such as rebase, bisect, reflog, cherry-pick, and worktrees.

In plain words
What is it for?
Use it for commit-history maintenance, bug hunting with git bisect, branch recovery, and moving selected commits between branches.
Why use it?
It helps investigate when a change introduced a bug, clean up history, resolve difficult workflows, and recover lost commits.

Skill for Claude CodeCodex

Part of the ai-toolkit plugin — 114 skills, 44 agents, 14 hooks shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/softspark/ai-toolkit/git-mastery
Any agent
npx skills add softspark/ai-toolkit --skill git-mastery
Clone the repo
git clone --depth 1 https://github.com/softspark/ai-toolkit

Made for: Claude Code, Codex.

Or install ai-toolkit, the plugin that ships this one along with the rest of its 114 skills, 44 agents, 14 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for git-mastery

README.md
[![agentmods](https://agentmods.dev/badge/skills/softspark/ai-toolkit/git-mastery.svg)](https://agentmods.dev/skills/softspark/ai-toolkit/git-mastery)
Your own site
<a href="https://agentmods.dev/skills/softspark/ai-toolkit/git-mastery"><img src="https://agentmods.dev/badge/skills/softspark/ai-toolkit/git-mastery.svg" alt="Measured on agentmods" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,316 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00051 $0.01316
Opus 5 $0.00026 $0.00658
Sonnet 5 $0.00010 $0.00263
Haiku 4.5 $0.00005 $0.00132

Measured yesterday against content hash 251404533d59, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

git-mastery scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

app/skills/git-mastery/SKILL.md · 107 lines

How it starts

The opening of the file, as written. The whole thing — 107 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Git Mastery Skill

🛡️ Safety First Protocol

  • Never force push to main / master / develop.
  • Always use --force-with-lease instead of --force.
  • Always create a backup branch before complex operations: git branch backup/feature-xyz-pre-rebase

Advanced Workflows

1. Automated Bug Hunting (Git Bisect)

Find the specific commit that introduced a bug.

# Start
git bisect start
git bisect bad              # Current version is broken
git bisect good <commit-sha> # Version that worked

# Automate with test script
git bisect run pytest tests/test_failing_feature.py

2. Interactive Interactive Rebase

Clean up commit history before merge.

git rebase -i HEAD~n
  • squash: Combine commits.
  • reword: Fix messages.
  • dropped: Remove junk commits.

3. Log Analysis

Visualize branch topology.

git log --graph --oneline --decorate --all

4. Recovery (Reflog)

Recover "lost" commits after a bad reset/rebase.

git reflog
git reset --hard HEAD@{n}

5. Cherry Picking

Pick specific commits from other branches.

git cherry-pick <commit-sha>
# If valid conflict
git add .
git cherry-pick --continue

Commit Message Standard (Conventional Commits)

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation only
  • style: Formatting (white-space, etc)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Performance improvement
  • test: Adding missing tests
  • chore: Build process/auxiliary tools

Common Rationalizations

Excuse Why It's Wrong
"I'll clean up commits later" Later means never — write clean commits as you go
"Force push is fine on my branch" Others may have fetched your branch — use --force-with-lease
"One big commit is simpler" Big commits are impossible to review, bisect, or revert — keep them atomic
"Merge conflicts mean someone else's problem" Conflicts mean you diverged too long — rebase frequently to stay aligned
"Commit messages don't matter" Messages are documentation — future you needs to understand why, not just what

Read the full file on GitHub · 107 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 107 lines · 51 tokens per session scan A 251404533d59

Subscribe to this mod's changes

git-mastery is a skill published in the GitHub repository softspark/ai-toolkit (168 stars, last pushed yesterday), licensed Apache-2.0. It adds 51 tokens to every session and 1,316 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

commit-with-reflection

Git提交与调试反思报告生成技能。用于分析开发过程中的错误、调试步骤和解决方案,生成结构化的中文反思报告,并创建包含报告引用的Git提交。显式请求词:反思提交、智能提交、生成调试报告、commit with reflection。.

foryourhealth111-pixel/Vibe-Skills · 69 tokens

ac-commit-manager

Manage git commits for autonomous coding. Use when committing feature implementations, creating descriptive commits, managing git workflow, or handling version control.

majiayu000/claude-skill-registry · 31 tokens

pr-workflow

Pull request lifecycle: commit, codex review, sync, review, fix, status, cleanup, and PR mining. Use when user wants to commit changes, get a second-opinion code review from Codex, push changes, create a PR, check PR status, fix review comments, clean up branches after merge, or mine tribal knowledge from PR reviews.…

notque/vexjoy-agent · 125 tokens

utility-pm-changelog-curator

Draft CHANGELOG entries from git log via the pm-changelog-curator sub-agent, applying the repo hygiene rules (describe what changed, public paths only, no attribution trailers). Returns a layered draft with a status summary for maintainer review; refuses a dirty working tree unless --committed-only is passed. Use when…

product-on-purpose/pm-skills · 80 tokens

om-open-pr

Shared PR opener for the auto pipeline — commits the worktree, pushes, reuses an existing PR or opens a ready (non-draft) PR against the configured base branch with the unified body template, applies the full SDLC label set with rationale comments, and for issue-driven runs hands the issue back and releases the lock.…

open-mercato/skills · 83 tokens

om-check-and-commit

Verify that the current branch is ready to publish by running every configured validation command in order, fix straightforward failures (including locale-file drift when the repo checks it), and once everything passes commit and push the current branch. Use when the user asks to check the branch, make CI-style…

open-mercato/skills · 70 tokens