rollback

A command for safely undoing work on a feature branch, a separate Git line used for one change.

In plain words
What is it for?
Use it to revert feature changes, clean up feature documents, optionally delete the feature branch, and return to its parent branch.
Why use it?
It helps remove unwanted code and related planning files while protecting important branches and checking for unsafe conditions first.

Command

Part of the ss plugin — 10 skills, 34 commands, 6 agents, 4 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 commands/martybonacci/specswarm/rollback
Clone the repo
git clone --depth 1 https://github.com/MartyBonacci/specswarm

Or install ss, the plugin that ships this one along with the rest of its 10 skills, 34 commands, 6 agents, 4 hooks.

Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,266 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00017 $0.04266
Opus 5 $0.00009 $0.02133
Sonnet 5 $0.00003 $0.00853
Haiku 4.5 $0.00002 $0.00427

Measured 3d ago against content hash 08916b5e96b6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

rollback scanned grade C with 1 finding 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 3d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf "$FEATURE_DIR"
plugins/ss/commands/rollback.md · 578 lines

How it starts

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

User Input

$ARGUMENTS

Goal

Safely rollback a feature that failed or is no longer wanted, including:

  1. Reverting all code changes since branch creation
  2. Cleaning up feature artifacts (spec.md, plan.md, tasks.md)
  3. Optionally deleting the feature branch
  4. Switching back to the parent branch

Provides two rollback strategies with comprehensive safety checks.


Execution Steps

Step 1: Safety Checks

echo "🔍 Performing safety checks..."
echo ""

# Check 1: Get current branch
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)

if [ -z "$CURRENT_BRANCH" ]; then
  echo "❌ Error: Not in a git repository"
  exit 1
fi

# Check 2: Prevent rollback of main/master/develop
PROTECTED_BRANCHES=("main" "master" "develop" "production")

for protected in "${PROTECTED_BRANCHES[@]}"; do
  if [ "$CURRENT_BRANCH" = "$protected" ]; then
    echo "❌ Error: Cannot rollback protected branch '$CURRENT_BRANCH'"
    echo ""
    echo "💡 Rollback is designed for feature branches only."
    echo "   If you need to revert changes on $CURRENT_BRANCH, use:"
    echo "   git revert <commit-hash>"
    exit 1
  fi
done

# Check 3: Check for uncommitted changes
DIRTY=$(git status --porcelain 2>/dev/null)

if [ -n "$DIRTY" ]; then
  echo "❌ Error: Uncommitted changes detected"
  echo ""
  echo "You have uncommitted changes. Please commit or stash them first:"
  git status --short
  echo ""
  echo "To commit:"
  echo "  git add ."
  echo "  git commit -m \"WIP: save before rollback\""
  echo ""
  echo "To stash:"
  echo "  git stash push -m \"Before rollback\""
  exit 1
fi

# Check 4: Detect parent branch
# First try git config
PARENT_BRANCH=$(git config "branch.$CURRENT_BRANCH.parent" 2>/dev/null)

# Fallback to common parent branches
if [ -z "$PARENT_BRANCH" ]; then
  for candidate in "develop" "development" "dev" "main" "master"; do
    if git show-ref --verify --quiet "refs/heads/$candidate"; then
      PARENT_BRANCH="$candidate"
      break
    fi
  done
fi

# Last resort: ask user
if [ -z "$PARENT_BRANCH" ]; then
  echo "⚠️  Could not auto-detect parent branch"
  PARENT_BRANCH="main"  # default
fi

echo "✅ Safety checks passed"
echo ""

Read the full file on GitHub · 578 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. 3d ago First seen · 578 lines · 17 tokens per session scan C 08916b5e96b6

Subscribe to this mod's changes

rollback is a command published in the GitHub repository MartyBonacci/specswarm (65 stars, last pushed 1mo ago), licensed MIT. It adds 17 tokens to every session and 4,266 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.