Agent skill

Git Revert Safety

by ZaxbyHub in ZaxbyHub/opencode-swarm

Apply when reverting commits, undoing merges, or recovering from branch contamination.

MITAuto-check passedDevelopment

Install Git Revert Safety

skills CLI
$ npx skills add ZaxbyHub/opencode-swarm --skill git-revert-safety -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ZaxbyHub/opencode-swarm git-revert-safety --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ZaxbyHub/opencode-swarm.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.opencode/skills/generated/git-revert-safety .claude/skills/git-revert-safety && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
git-revert-safety
GitHub stars
494
Token cost
~2.2k tokens
SKILL.md length
800 words
Files
2
Skills in repo
91
Repo updated
First seen
Licence
MIT

At a glance

Apply when reverting commits, undoing merges, or recovering from branch contamination.

  • Works in 6 steps: Collateral Damage Assessment → Choose Recovery Strategy → Post-Revert Verification → …
  • Tasks that involve Git workflow
  • SKILL.md covers Workflow A — Safe Git Revert, Workflow B — Branch…, Conflict Resolution Gate and Forbidden Shortcuts, plus 1 more section
  • Calls git, bun and gh

What it does

Git Revert Safety is an agent skill from ZaxbyHub/opencode-swarm. Apply when reverting commits, undoing merges, or recovering from branch contamination. Covers collateral damage verification (manifest, package.json, CHANGELOG, lockfiles), cherry-pick vs revert decision matrix, partial-revert detection, merge-parent handling, and post-revert CI verification. Prevents the most common revert failure mode: version metadata regression from git reverse-apply.

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file.

It sits in Development, covering Git workflow, Dependency management and Changelog and release notes. It works with Git and npm. The repository describes itself as: Architect-centric agentic swarm plugin for OpenCode. Hub-and-spoke orchestration with SME consultation, code generation, and QA review. The licence is MIT.

When your agent uses it

  • Tasks that involve Git workflow
  • Tasks that involve Dependency management
  • Tasks that involve Changelog and release notes

Example prompts

  • “/git-revert-safety”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Collateral Damage Assessment
  2. Choose Recovery Strategy
  3. Post-Revert Verification
  4. CI Verification
  5. Assess Contamination Scope
  6. Clean-Slate Recovery

What it can do on your machine

Read from SKILL.md and the folder at commit b63a4bd. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git
    • bun
    • gh
    • node

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git and gh, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Git Revert Safety loads about 2.2k tokens when it runs. Until then it costs about 102 tokens; SKILL.md has 800 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~102
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ZaxbyHub/opencode-swarm at commit b63a4bd, republished under its MIT licence (© ZaxbyHub). 800 words, ~2,164 tokens.

Download SKILL.mdSave it as .claude/skills/git-revert-safety/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
git-revert-safety
description
Apply when reverting commits, undoing merges, or recovering from branch contamination. Covers collateral damage verification (manifest, package.json, CHANGELOG, lockfiles), cherry-pick vs revert decision matrix, partial-revert detection, merge-parent handling, and post-revert CI verification. Prevents the most common revert failure mode: version metadata regression from git reverse-apply.
effort
small
triggers
git revert, revert commit, revert merge, undo merge, reverse-apply, branch contamination, cherry-pick recovery, release-please duplicate tag
source_knowledge_ids
f07c1f4d-9bb0-4219-9804-26aa8efe8146
generated_at
2026-06-14T16:50:00Z
confidence
0.8
status
active
version
4
skill_origin
generated
provenance_note
Re-linked to current knowledge entries (version 4). The original source ID 11f0e8cb... is no longer present in the active knowledge store. The skill body and…

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:

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

Multiple commits (contiguous range):

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

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

bash
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
ScenarioStrategyCaveat
Single commit that does NOT touch release/build artifactsgit revert <sha>Still verify metadata diff after
Single commit that DOES touch release artifactsVerify post-revert metadata manuallyMay need corrective commit
Multi-commit revert, no releases betweengit revert <sha1> <sha2>...Verify each commit's file scope
Multi-commit revert, releases betweenCherry-pick fix onto fresh branchAvoids collateral damage from reverse-apply
Merge commit revertgit revert -m <parent-number> <merge-sha>Must specify correct parent (usually -m 1 for main)
Branch contamination (wrong code merged)Fresh branch + cherry-pickSee Workflow B
Revert of revert (re-apply feature)git revert <revert-sha>⚠️ Code may have drifted — check for conflicts
Squash merge revertFresh branch + cherry-pick preferredSquash 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

Rule: If commits to revert span across release-please merge commits, ALWAYS prefer cherry-pick over revert.

Step 3 — Post-Revert Verification

After reverting, verify these files match expected state:

  1. .release-please-manifest.json — version must match the latest non-draft, non-prerelease GitHub release

    bash
    # List releases excluding drafts and prereleases
    gh release list --limit 5 --json tagName,isDraft,isPrerelease --jq '.[] | select(.isDraft==false and .isPrerelease==false) | .tagName'
    node -e "console.log(require('./.release-please-manifest.json')['.'])"
  2. package.json version field — must match the manifest

    bash
    node -e "console.log(require('./package.json').version)"
  3. CHANGELOG.md — must still contain entries for all released versions

    bash
    # Cross-platform: count version headings
    node -e "const c=require('fs').readFileSync('CHANGELOG.md','utf8'); console.log((c.match(/^## \[/gm)||[]).length)"
    # Compare against GitHub releases
    gh release list --limit 10
  4. Dependencies — if package.json dependencies changed, verify lockfile is consistent

    bash
    bun install --frozen-lockfile   # Must succeed
  5. Bundle size — if dependencies were added/removed, verify smoke test thresholds still pass. dist/ is generated and NOT committed; run bun run build locally only when you need the bundle to verify.

    bash
    bun run build
    bun test tests/smoke --timeout 120000

If any check fails: Do NOT hand-edit release-please versions. Restore metadata from the known-good state of the latest release commit or re-run release-please. Apply a corrective commit restoring from the last known-good state before pushing.

Show full SKILL.md (382 more words)Show less
Step 4 — CI Verification

After pushing the revert:

  1. Wait for CI to start
  2. Check last-green-CI timestamp against the merge being reverted:
    bash
    gh run list --branch main --limit 10 --json databaseId,conclusion,createdAt --jq '.[] | select(.conclusion=="success")'
  3. Do NOT dismiss any CI failure as "pre-existing" without timestamp evidence comparing the failure to the last known-green run
  4. If release-please fails with "Duplicate release tag", the manifest was regressed — return to Step 3

Workflow B — Branch Contamination Recovery

Use when the wrong code was merged to main and you need a clean recovery.

Step 5 — Assess Contamination Scope
  1. Identify the exact commits that should NOT be on the branch
  2. Identify the commits that SHOULD be there (fix commits, other features merged after)
  3. Check if release-please ran between the bad merge and now — if so, manifest/CHANGELOG/package.json version were all modified
Step 6 — Clean-Slate Recovery
  1. Create a fresh branch from origin/main:

    bash
    git fetch origin main
    git checkout -b fix/<name> origin/main
  2. Cherry-pick ONLY the fix/feature commits that should be on the branch:

    bash
    git cherry-pick <fix-sha>
  3. Verify the cherry-picked branch has exactly the files you expect:

    bash
    git diff --name-only origin/main..HEAD
  4. Run full QA gates before pushing (lint, build, tests, smoke tests). dist/ is generated and NOT committed — do not stage it; run bun run build locally only when you need the bundle to verify.

Do NOT attempt incremental cleanup (removing bad files one by one from a contaminated branch) when release metadata, generated bundles, or dependency graphs are involved. Clean-slate cherry-pick guarantees no contamination leaks.


Conflict Resolution Gate

After resolving any revert or cherry-pick conflicts:

  1. Run git diff to review ALL resolved files — not just the conflicted ones
  2. For CHANGELOG/manifest conflicts — restore from known-good state, do NOT merge both versions
  3. Verify build succeeds before committing: bun run build (dist/ is generated and NOT committed — do not stage it)

Forbidden Shortcuts

  • NEVER assume version metadata survived a multi-commit revert unchanged — always verify
  • NEVER dismiss CI failures as pre-existing without comparing timestamps against last-green-CI
  • NEVER attempt incremental cleanup of contaminated branches when release metadata or dependency graphs are involved
  • NEVER hand-invent release-please version numbers — restore from known-good state or re-run release-please
  • NEVER trust stale local SHAs after force-pushes — refetch and compare against remote before recovery

Delegation Template

SKILLS: file:.opencode/skills/generated/git-revert-safety/SKILL.md

© ZaxbyHub, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in .opencode/skills/generated/git-revert-safety of ZaxbyHub/opencode-swarm.

  • SKILL.md
  • retired.marker

Open the folder on GitHubat commit b63a4bd

Compare with similar skills

Git Revert Safety next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Git Revert Safety compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Git Revert Safety this skillZaxbyHub/opencode-swarm494—~2.2kAutomated safety check: PassMIT
Hunk Release Workflowmodem-dev/hunk9.6k—~3.8kAutomated safety check: PassMIT
AionUi Version BumpiOfficeAI/AionUi33k—~2.1kAutomated safety check: PassApache-2.0
ZCF Release AutomationUfoMiao/zcf6.1k—~3.4kAutomated safety check: PassMIT
Git Changes ReporterNo-Trade-No-Life/Yuan352—~1.2kAutomated safety check: PassMIT
ClawRouter Release ChecklistBlockRunAI/ClawRouter6.6k—~1.4kAutomated safety check: PassMIT

Similar skills

  • Hunk Release Workflow

    modem-dev/hunk

    Maintainer workflow for preparing, publishing, verifying and curating Hunk releases, with confirmation gates before tags, publishes and public edits.

    9.6k GitHub stars~3.8k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • AionUi Version Bump

    iOfficeAI/AionUi

    Automates an AionUi release: checks the latest AionCore release and its artifacts, updates package.json, writes the changelog, opens a PR and tags the release.

    33k GitHub stars~2.1k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Automates a version release with changesets: analyzes code changes, writes a bilingual CHANGELOG, bumps the version and commits through a release branch and pull request.

    6.1k GitHub stars~3.4k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Git Changes Reporter

    No-Trade-No-Life/Yuan

    生成结构化 git 变更报告(JSON + Markdown)。使用此技能当用户提到"git 变更"、"commit 摘要"、"代码审查"、"release note"、"近期改动"、"每日摘要",或需要分析指定 commit 区间的代码变更。包含三元组结构(设计意图、核心代码、影响范围)的语义化报告,适用于代码审查、发布说明、团队同步、CI/CD 等场景。

    352 GitHub stars~1.2k tokensUpdated 5 mo ago
    DevelopmentAuto-check passed
  • ClawRouter Release Checklist

    BlockRunAI/ClawRouter

    Walks the agent through every ClawRouter release step in order, from the version bump and changelog entry to build, tests, npm publish, git tag and GitHub release.

    6.6k GitHub stars~1.4k tokensUpdated 5 days ago
    DevelopmentAuto-check passed
  • Release

    dcb/homeassistant-claude-kit

    Cut a new homeassistant-claude-kit version. An agent skill from dcb/homeassistant-claude-kit.

    123 GitHub stars~3.1k tokensUpdated yesterday
    DevelopmentAuto-check passed

More from ZaxbyHub/opencode-swarm

All 91 skills in this repo
  • Codebase Review Swarm

    ZaxbyHub/opencode-swarm

    Runs an evidence-gated, quote-grounded audit of a codebase for security, QA, accessibility, performance and more, and writes a verified report without changing source files.

    496 GitHub stars~2.8k tokensUpdated today
    Auto-check passed
  • Issue Tracer

    ZaxbyHub/opencode-swarm

    Drives a bug report from validation and root-cause tracing through a critic-reviewed plan, an approved minimal fix and a PR-ready closure, never merging without recorded human approval.

    496 GitHub stars~4.4k tokensUpdated today
    Auto-check passed
  • Commit and PR Publishing for Codex

    ZaxbyHub/opencode-swarm

    Codex adapter for opencode-swarm that governs commits, pushes, draft PRs, PR body updates and CI closeout, deferring to the repo's canonical commit-pr protocol.

    496 GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Durable Session State

    ZaxbyHub/opencode-swarm

    Keeps plans, decisions, evidence and reviewer verdicts in small files so long multi-phase tasks survive context compaction and session resumes.

    496 GitHub stars~896 tokensUpdated today
    Auto-check passed
  • Swarm PR Feedback Closer

    ZaxbyHub/opencode-swarm

    Ingests existing pull request feedback such as review comments and CI failures, verifies each claim, fixes confirmed issues and reports closure status for every item.

    496 GitHub stars~14k tokensUpdated today
    Auto-check passed
  • Swarm PR Subscribe

    ZaxbyHub/opencode-swarm

    Monitor a pull request after creation and act autonomously on pushed PR activity.

    496 GitHub stars~2.2k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Git Revert Safety

What does Git Revert Safety do?

Apply when reverting commits, undoing merges, or recovering from branch contamination. Git Revert Safety is an agent skill from ZaxbyHub/opencode-swarm. Apply when reverting commits, undoing merges, or recovering from branch contamination.

When should I use Git Revert Safety?

Git Revert Safety fits situations like: tasks that involve Git workflow; tasks that involve Dependency management; tasks that involve Changelog and release notes.

How do I install Git Revert Safety in Claude Code?

Run `npx skills add ZaxbyHub/opencode-swarm --skill git-revert-safety -a claude-code`. Or copy the skill folder (.opencode/skills/generated/git-revert-safety in ZaxbyHub/opencode-swarm) into .claude/skills/git-revert-safety in your project. Claude Code loads it when a task matches its description.

How do I install Git Revert Safety in Codex?

Run `npx skills add ZaxbyHub/opencode-swarm --skill git-revert-safety -a codex`. Or copy the skill folder (.opencode/skills/generated/git-revert-safety in ZaxbyHub/opencode-swarm) into .agents/skills/git-revert-safety in your project. Codex loads it when a task matches its description.

Can I use Git Revert Safety in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ZaxbyHub/opencode-swarm --skill git-revert-safety -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/git-revert-safety, .gemini/skills/git-revert-safety, .github/skills/git-revert-safety and .opencode/skills/git-revert-safety in your project.

What does Git Revert Safety need to run?

Going by SKILL.md and its folder, Git Revert Safety needs the command-line tools its instructions call (git, bun, gh and node).

Does Git Revert Safety access the network?

SKILL.md contains no URLs. Its commands use git and gh, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Git Revert Safety safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Git Revert Safety use?

Git Revert Safety is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Git Revert Safety use?

About 2.2k tokens (SKILL.md is roughly 8.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Git Revert Safety?

Skills that share tags, products or a category with Git Revert Safety: Hunk Release Workflow (modem-dev/hunk, 9.6k stars), AionUi Version Bump (iOfficeAI/AionUi, 33k stars), ZCF Release Automation (UfoMiao/zcf, 6.1k stars) and Git Changes Reporter (No-Trade-No-Life/Yuan, 352 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Git Revert Safety?

ZaxbyHub (a GitHub organization) maintains it in ZaxbyHub/opencode-swarm, which has 494 GitHub stars. The repository holds 91 skills in this directory. The repository was last updated on October 10, 2026.

Source: ZaxbyHub/opencode-swarm on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.