Automatically rollback changes from failed workflow phases using changes log files. Use when workflows fail and need to restore previous state, including file restoration, artifact cleanup, and command reversal. Use for error recovery after failed bug fixes, security patches, or refactoring operations.
65
82%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Rollback failed workflow phases by reading changes log and reversing tracked modifications.
{
"changes_log_path": ".bug-changes.json",
"phase": "bug-fixing",
"confirmation_required": true
}{
"phase": "bug-fixing",
"timestamp": "2025-10-18T14:30:00Z",
"files_modified": [{"path": "src/app.ts", "backup": ".rollback/src-app.ts.backup"}],
"files_created": ["src/new-file.ts"],
"commands_executed": ["pnpm install", "pnpm build"],
"git_commits": ["abc123"],
"artifacts": [".bug-fixing-plan.json"]
}Use Read tool to load JSON. Validate required fields: phase, timestamp, files_modified, files_created, commands_executed, git_commits.
Show summary of changes to revert. If user declines, return dry run result.
cp "{backup}" "{path}" # For each {path, backup} in files_modifiedrm -f "{file}" # For each file in files_createdpnpm install → re-run to restore lockfilegit add * → git restore --staged .pnpm build → rm -rf dist/git revert --no-edit {sha} # In reverse orderRemove plan files and temporary artifacts.
{
"success": true,
"phase": "bug-fixing",
"actions_taken": ["Restored src/app.ts", "Deleted src/new-file.ts", "Reverted abc123"],
"files_restored": 1,
"files_deleted": 1,
"git_commits_reverted": 1,
"errors": [],
"warnings": ["Backup not found: .rollback/file.backup (skipped)"]
}Workers should track changes during operations:
.{domain}-changes.json before modifications.rollback/ for modified files8c3b576
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.