git-revert-safety

git-revert-safety is a skill for Claude Code, OpenCode from ZaxbyHub/opencode-swarm. It costs 79 tokens per session (2,083 once invoked), scanned A, original, MIT.

A procedure for safely undoing Git commits and recovering from unwanted merges or branch changes. It includes checking affected files, choosing between reverting and cherry-picking, and verifying the result.

In plain words
What is it for?
Use it when reverting commits, undoing merges, handling contaminated branches, or checking the changes after a revert.
Why use it?
It reduces the chance that an undo operation will accidentally remove release data, dependencies, changelog entries, or other unrelated work.

Skill for Claude CodeOpenCode

Written for Claude Code and OpenCode: effort in frontmatter, but also installed under .opencode/. Also seen: mentions OpenCode.

Good fit Use it when reverting commits, undoing merges, handling contaminated branches, or checking the changes after a revert.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zaxbyhub/opencode-swarm/git-revert-safety
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 ZaxbyHub/opencode-swarm --skill git-revert-safety
Clone the repo
git clone --depth 1 https://github.com/ZaxbyHub/opencode-swarm

Made for: Claude Code, OpenCode.

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-revert-safety

README.md
[![agentmods](https://agentmods.dev/badge/skills/zaxbyhub/opencode-swarm/git-revert-safety.svg)](https://agentmods.dev/skills/zaxbyhub/opencode-swarm/git-revert-safety)
Your own site
<a href="https://agentmods.dev/skills/zaxbyhub/opencode-swarm/git-revert-safety"><img src="https://agentmods.dev/badge/skills/zaxbyhub/opencode-swarm/git-revert-safety.svg" alt="Measured on agentmods" height="20"></a>
Per session 79 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,083 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 pass 7 Sept 2026
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.00079 $0.02083
Opus 5 $0.00039 $0.01042
Sonnet 5 $0.00016 $0.00417
Haiku 4.5 $0.00008 $0.00208

Measured 4d ago against content hash ff89776998a7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

git-revert-safety 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 4d 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.

.opencode/skills/generated/git-revert-safety/SKILL.md · 199 lines

How it starts

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

Git Revert Safety Protocol

Two internal workflows: Safe Git Revert (Steps 1-4) and Branch Contamination Recovery (Steps 5-6). Use the first when reverting known commits. Use the second when the wrong code was merged and you need a clean slate.


Workflow A — Safe Git Revert

Step 1 — Collateral Damage Assessment

Before reverting, list ALL files touched by each commit being reverted. Use the correct command for the situation:

Single commit:

git show --name-only --format= <sha>

Multiple commits (contiguous range):

git diff --name-only <commit-before-first>..<last-commit-sha>

Merge commit — inspect all parents (handles octopus merges with 3+ parents):

git show --format="%H %P" <merge-sha>   # Shows ALL parent SHAs
git log --oneline <merge-sha>^1         # First parent (usually main)
git log --oneline <merge-sha>^2         # Second parent (feature branch)
# For octopus merges: also inspect ^3, ^4, etc.

Identify which files in the diff are NOT part of the feature being reverted:

  • .release-please-manifest.json — version state
  • package.json — version field + dependency additions/removals
  • CHANGELOG.md — release history
  • Lockfiles (bun.lock, package-lock.json) — dependency graph
  • Any config files modified by release PRs between the feature and now

dist/ is generated and NOT committed, so it never appears in a revert diff and needs no rebuild+commit as part of a revert — reverting the source is enough.

Gate: If ANY version metadata or dependency file appears in the diff, you MUST verify post-revert state (Step 3).

Step 2 — Choose Recovery Strategy

Scenario Strategy Caveat
Single commit that does NOT touch release/build artifacts git revert <sha> Still verify metadata diff after
Single commit that DOES touch release artifacts Verify post-revert metadata manually May need corrective commit
Multi-commit revert, no releases between git revert <sha1> <sha2>... Verify each commit's file scope
Multi-commit revert, releases between Cherry-pick fix onto fresh branch Avoids collateral damage from reverse-apply
Merge commit revert git revert -m <parent-number> <merge-sha> Must specify correct parent (usually -m 1 for main)
Branch contamination (wrong code merged) Fresh branch + cherry-pick See Workflow B
Revert of revert (re-apply feature) git revert <revert-sha> ⚠️ Code may have drifted — check for conflicts
Squash merge revert Fresh branch + cherry-pick preferred Squash merges have no merge-parent metadata
Octopus merge (3+ parents) Fresh branch + cherry-pick unless parent is unambiguous -m parent selection is error-prone; prefer clean slate

Read the full file on GitHub · 199 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 4d ago First seen · 199 lines · 79 tokens per session scan A ff89776998a7

Subscribe to this mod's changes

git-revert-safety is a skill published in the GitHub repository ZaxbyHub/opencode-swarm (463 stars, last pushed yesterday), licensed MIT. It adds 79 tokens to every session and 2,083 once invoked, about $0.0004 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.