git-operations

git-operations is a skill for Claude Code from komluk/scaffolding. It costs 58 tokens per session (764 once invoked), scanned A, original, MIT.

A guide to using Git, the version-control system that records code changes and supports branches for separate lines of work. It covers common commands, branching, merges, and conflict handling.

In plain words
What is it for?
Use it when creating or managing branches, preparing safety backups, merging work, resolving merge conflicts, or cherry-picking selected commits.
Why use it?
It reduces the risk of losing work or damaging a repository during commits, merges, pushes, and other changes. It also gives a consistent way to handle conflicting edits.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the scaffolding plugin — 39 skills, 9 commands, 13 agents shipped together

Good fit Use it when creating or managing branches, preparing safety backups, merging work, resolving merge conflicts, or cherry-picking selected commits.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/komluk/scaffolding/git-operations
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 komluk/scaffolding --skill git-operations
Clone the repo
git clone --depth 1 https://github.com/komluk/scaffolding

Made for: Claude Code.

Or install scaffolding, the plugin that ships this one along with the rest of its 39 skills, 9 commands, 13 agents.

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-operations

README.md
[![agentmods](https://agentmods.dev/badge/skills/komluk/scaffolding/git-operations/github.svg)](https://agentmods.dev/skills/komluk/scaffolding/git-operations)
Your own site
<a href="https://agentmods.dev/skills/komluk/scaffolding/git-operations"><img src="https://agentmods.dev/badge/skills/komluk/scaffolding/git-operations/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-operations

Your own site · 80×15
<a href="https://agentmods.dev/skills/komluk/scaffolding/git-operations"><img src="https://agentmods.dev/badge/skills/komluk/scaffolding/git-operations.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 764 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.
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.00058 $0.00764
Opus 5.5 $0.00023 $0.00306
Sonnet 5.5 $0.00012 $0.00153
Haiku 4.5 $0.00006 $0.00076

Measured 1mo ago against content hash ba6798c183f5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

git-operations 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.

skills/git-operations/SKILL.md · 115 lines

How it starts

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

Git Operations Skill

Purpose

Core git command patterns, branching strategies, and safety protocols for a project.

Current branch: !git branch --show-current 2>/dev/null || true

Branching Convention

Branch Pattern Purpose
main Production branch, always stable
scaffolding/{task_id[:12]} Worktree task branches (auto-created)
backup/{task_id[:12]} Safety backup before destructive ops

Safe Operation Patterns

Before Any Destructive Operation

git status
git stash list
git log --oneline -5
git branch backup/$(date +%s) HEAD

Merge Strategy

git merge --no-commit --no-ff branch_name
git diff --cached --stat
git merge --continue  # or --abort

Conflict Resolution

git diff --name-only --diff-filter=U
git checkout --ours path/to/file    # keep ours
git checkout --theirs path/to/file  # keep theirs

Cherry-Pick

git cherry-pick --no-commit <commit>
git diff --cached --stat
git cherry-pick --continue

Common Error Patterns

Error Fix
fatal: not a git repository Verify path, check .git exists
CONFLICT (content) Use conflict resolution protocol
cannot lock ref Wait and retry, check stale locks
worktree is not clean Stage+commit or stash

Push Operations

Standard Push (after workflow)

# 1. Verify unpushed commits exist
git log --oneline origin/main..HEAD

# 2. Push to remote
git push origin main

# 3. Verify push succeeded
git log --oneline origin/main..HEAD  # should be empty

Push Safety Rules

  • NEVER use --force or --force-with-lease without explicit user confirmation
  • Always verify unpushed commits BEFORE push
  • Always verify push success AFTER push
  • If push fails due to divergence, report to user -- do NOT auto-rebase

Finishing Flow

After work is complete on a branch, execute one of these four actions based on context.

Merge to Main

git checkout main
git merge --ff-only <branch>  # try fast-forward first
# if ff fails: git merge --no-ff <branch>
git branch -d <branch>
git worktree remove .scaffolding/worktrees/<task_id> 2>/dev/null
git worktree prune

Read the full file on GitHub · 115 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 · 115 lines · 58 tokens per session scan A ba6798c183f5

Subscribe to this mod's changes

git-operations is a skill published in the GitHub repository komluk/scaffolding (15 stars, last pushed 4d ago), licensed MIT. It adds 58 tokens to every session and 764 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-08-30.

Related

Other skills, from other repositories

branch-and-worktree-workflow

Isolates feature work in its own branch or worktree and integrates it cleanly when done. Use this when starting work that should not disturb the current workspace, when several efforts must proceed in parallel on one repository, or when implementation is finished and the change needs merging, rebasing, or splitting…

cbrock84/headcount · 70 tokens

cad-reviewer-contract

Role contract preloaded at spawn by the cad-reviewer, cad-reviewer-low, cad-reviewer-medium, cad-reviewer-xhigh and cad-reviewer-max agents. Not for direct use: do not invoke it from a conversation.

crenshawdev/cadence · 52 tokens

cad-plan-checker-contract

Role contract preloaded at spawn by the cad-plan-checker, cad-plan-checker-medium, cad-plan-checker-high, cad-plan-checker-xhigh and cad-plan-checker-max agents. Not for direct use: do not invoke it from a conversation.

crenshawdev/cadence · 58 tokens

agile-ledger-workspace

Owns the Agile-Ledger ledger repository — the separate repo that holds one folder per code repo, so code repos stay clean. Create the ledger repo, register repositories into it, migrate a pre-2.0 in-repo Agile-Ledger/ folder, discover repositories on a GitHub org (including ones nobody told you about), run a single…

nunoamorim99/agile-ledger · 208 tokens

loop-on-ci

Monitor PR checks and fix failures until green. Uses gh pr checks as the source of truth for PR-attached checks.

Kripu77/software-factory · 28 tokens

dockerized-service-release-deployment-workflow

Create a Dockerized-service release contract with clean GitHub Actions builds, main-anchored tags, immutable digest manifests, published-release deployments, production approval, health checks, and exact-digest rollback.

gaelic-ghost/socket · 49 tokens