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.
npx agentmods add commands/martybonacci/specswarm/rollbackgit clone --depth 1 https://github.com/MartyBonacci/specswarmWhat 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.
| Model | Per session | Once 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 |
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" 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:
- Reverting all code changes since branch creation
- Cleaning up feature artifacts (spec.md, plan.md, tasks.md)
- Optionally deleting the feature branch
- 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 ""
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.
- 3d ago First seen · 578 lines · 17 tokens per session scan C 08916b5e96b6
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.
Other commands, from other repositories
git
Git operations with intelligent commit messages and workflow optimization.
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.