skills/forge-rollback/SKILL.md
Undo pipeline changes — revert worktree, restore state, or rollback specific commits. Use when a pipeline run produced unwanted changes, you need to undo work, or a merge introduced regressions. Trigger: /forge-rollback, undo changes, revert pipeline, go back
npx skillsauth add quantumbitcz/dev-pipeline forge-rollbackInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Safely undo pipeline changes when something goes wrong.
Before any action, verify:
git rev-parse --show-toplevel 2>/dev/null. If fails: report "Not a git repository. Navigate to a project directory." and STOP..claude/forge.local.md exists. If not: report "Forge not initialized. Run /forge-init first." and STOP..forge/worktree exists (Mode 1 available).forge/state.json exists with complete: true (Mode 2 available)Ask the user which type of rollback they need, then execute:
Before presenting rollback options, detect the current state:
git status --porcelain. If there are uncommitted changes, warn:
"Warning: You have uncommitted changes. Rollback operations (especially git reset --hard or git revert) may affect your working tree. Consider committing or stashing first.".forge/worktree exists -> Mode 1 available (pre-merge rollback).forge/state.json exists and complete: true -> Mode 2 available (post-merge revert)If the pipeline's worktree has unwanted changes:
Option A -- Delete the worktree entirely (main tree unaffected):
git worktree remove .forge/worktree --force
Option B -- Reset worktree to a specific commit:
cd .forge/worktree
git log --oneline -10 # show recent commits
git reset --hard {commit-sha}
The main working tree is NEVER affected by worktree rollback.
If the worktree branch was already merged to your branch:
# Find the merge commit
git log --oneline -10
# Revert the merge (creates a new commit that undoes the changes)
git revert {merge-commit-sha}
If Linear tickets were created but the pipeline failed:
If you want to keep code changes but reset pipeline state:
/forge-reset
This removes .forge/ (state, checkpoints, notes) but preserves code changes and learnings.
| Condition | Action |
|-----------|--------|
| Prerequisites fail | Report specific error message and STOP |
| Worktree removal fails | Report error, suggest git worktree prune to clean up dangling entries |
| Git revert fails (merge conflicts) | Report the conflict and suggest manual resolution |
| User provides invalid commit SHA | Report "Commit not found" and re-prompt |
| Linear API unavailable | Report that Linear tickets cannot be modified. Suggest manual cleanup in the Linear UI |
| State corruption | Use /forge-reset (Mode 4) which handles corrupt state |
git log --oneline -5 before any git reset/revert so the user can verify/forge-reset -- Clear pipeline state without reverting code changes/forge-abort -- Stop an active pipeline before it produces changes to rollback/forge-resume -- Resume a pipeline instead of rolling back/forge-status -- Check current pipeline state before deciding to rollbackdevelopment
[writes] Build, fix, deploy, review, or modify code in this project. Universal entry for the forge pipeline. Auto-bootstraps on first run; brainstorms before planning when given a feature description. Use when you want to take any productive action: implementing features, fixing bugs, reviewing branches, deploying, committing, running migrations.
tools
[writes] Manage forge state and configuration: recovery, abort, config edits, session handoff, automations, playbooks, output compression, knowledge graph maintenance. Use when you need to recover from broken pipeline state, edit settings, or manage long-lived state.
development
[writes] Create, list, show, resume, or search forge session handoffs. Use when context is getting heavy and you want to transfer a forge run or conversation into a fresh Claude Code session, or to resume from a prior handoff artefact. Subcommands - no args (write), list, show, resume, search.
development
[writes] Manage the Neo4j knowledge graph. Subcommands: init, rebuild (writes); status, query <cypher>, debug (read-only). Requires Docker. No default — an explicit subcommand is required. Use when setting up the graph for the first time, rebuilding after major refactors, checking graph health, or running ad-hoc Cypher diagnostics.