git-mastery

git-mastery is a skill for Claude Code 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 Code

Written for Claude Code: allowed-tools in frontmatter.

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

Good fit Use it for commit-history maintenance, bug hunting with git bisect, branch recovery, and moving selected commits between branches.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/softspark/ai-toolkit/git-mastery
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.

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.

Or install ai-toolkit, the plugin that ships this one along with the rest of its 115 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/github.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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for git-mastery

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Tool Misuse · line 50
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
How audits are shown
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.1 $0.00051 $0.01316
Opus 5.5 $0.00020 $0.00526
Sonnet 5.5 $0.00010 $0.00263
Haiku 4.5 $0.00005 $0.00132

Measured 1mo ago against content hash 251404533d59, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo ago.

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. 1mo ago 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 (180 stars, last pushed 4d ago), licensed Apache-2.0. It adds 51 tokens to every session and 1,316 once invoked, about $0.0002 per session on Opus 5.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

git-advanced-workflows

Master advanced Git workflows including rebasing, cherry-picking, bisect, worktrees, and reflog to maintain clean history and recover from any situation. Use when managing complex Git histories, collaborating on feature branches, or troubleshooting repository issues.

wshobson/agents · 54 tokens

git-commit

Safely create a git commit by validating repository state, staging intended changes, scanning for secrets/conflicts, generating a Conventional Commits message (repository convention first, else an English Angular default) from the staged diff, and committing without amend.

johnqtcg/awesome-skills · 52 tokens

git-workflow-helper

Guide pour les opérations Git complexes, résolution de conflits et bonnes pratiques de workflow. À utiliser quand l'utilisateur est bloqué avec Git ou veut mettre en place un workflow. Se déclenche aussi avec "git merge conflict", "comment revert", "git rebase", "branching strategy", "j'ai cassé mon git", ou toute…

khalilbenaz/claude-skills-collection · 96 tokens

github-readme

Generate, audit, or update GitHub READMEs with project-type-aware structure, voice calibration, and SEO/AEO discoverability guidance. Three modes: generate (new), audit (check existing), update (patch). Detects repo type and adapts sections, tone, and badges accordingly.

thatrebeccarae/claude-marketing · 63 tokens

git-advanced-workflows

Advanced Git workflows - rebase, cherry-pick, bisect, worktrees, reflog - for clean history and recovery. Use when managing complex histories, collaborating on branches, or troubleshooting a repo.

HigorAlves/orc · 47 tokens

history

In D&D, History recalls significant past events, legendary figures, and ancient knowledge. The real-world version is temporal investigation: git blame across the entire project, reading changelogs to understand why a decision was made, reconstructing the sequence of events that led to a production incident, or…

Hmbown/Wizards-of-the-Ghosts · 74 tokens