rollback-changes

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.

164 stars

Best use case

rollback-changes is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

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.

Teams using rollback-changes should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/rollback-changes/SKILL.md --create-dirs "https://raw.githubusercontent.com/maslennikov-ig/claude-code-orchestrator-kit/main/.claude/skills/rollback-changes/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/rollback-changes/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How rollback-changes Compares

Feature / Agentrollback-changesStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

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.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Rollback Changes

Rollback failed workflow phases by reading changes log and reversing tracked modifications.

## When to Use

- Workflow phase fails and needs state restoration
- Error recovery in worker agents
- Quality gate failures requiring revert

## Input

```json
{
  "changes_log_path": ".bug-changes.json",
  "phase": "bug-fixing",
  "confirmation_required": true
}
```

## Changes Log Format

```json
{
  "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"]
}
```

## Process

### 1. Read & Parse Changes Log
Use Read tool to load JSON. Validate required fields: phase, timestamp, files_modified, files_created, commands_executed, git_commits.

### 2. Request Confirmation (if required)
Show summary of changes to revert. If user declines, return dry run result.

### 3. Restore Modified Files
```bash
cp "{backup}" "{path}"  # For each {path, backup} in files_modified
```

### 4. Delete Created Files
```bash
rm -f "{file}"  # For each file in files_created
```

### 5. Revert Commands
- `pnpm install` → re-run to restore lockfile
- `git add *` → `git restore --staged .`
- `pnpm build` → `rm -rf dist/`
- Other → log warning (cannot auto-revert)

### 6. Revert Git Commits
```bash
git revert --no-edit {sha}  # In reverse order
```

### 7. Cleanup Artifacts
Remove plan files and temporary artifacts.

## Output

```json
{
  "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)"]
}
```

## Error Handling

- **Missing log**: Return error "Changes log not found"
- **Invalid JSON**: Return parsing error
- **Backup not found**: Log warning, continue (partial rollback OK)
- **Git conflicts**: Log error with manual instructions, continue

## Safety Features

- Confirmation by default before any changes
- Partial rollback acceptable (documented in warnings)
- Never delete without verifying backup exists
- All actions logged for audit trail

## Worker Integration

Workers should track changes during operations:
1. Create `.{domain}-changes.json` before modifications
2. Create backups in `.rollback/` for modified files
3. Log all file creates, commands, and commits
4. On failure: invoke rollback-changes with confirmation_required=false

Related Skills

Beads Issue Tracking Skill

164
from maslennikov-ig/claude-code-orchestrator-kit

> **Attribution**: [Beads](https://github.com/steveyegge/beads) by [Steve Yegge](https://github.com/steveyegge)

Workflow & ProductivityClaude

webapp-testing

164
from maslennikov-ig/claude-code-orchestrator-kit

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

validate-report-file

164
from maslennikov-ig/claude-code-orchestrator-kit

Validate that worker-generated reports have all required sections and proper formatting. Use in quality gates, for report completeness checking, or when debugging missing report sections.

validate-plan-file

164
from maslennikov-ig/claude-code-orchestrator-kit

Validate that orchestrator plan files conform to expected JSON schema. Use before workers read plan files or after orchestrators create them to ensure proper structure and required fields.

ux-researcher-designer

164
from maslennikov-ig/claude-code-orchestrator-kit

UX research and design toolkit for Senior UX Designer/Researcher including data-driven persona generation, journey mapping, usability testing frameworks, and research synthesis. Use for user research, persona creation, journey mapping, and design validation.

ui-design-system

164
from maslennikov-ig/claude-code-orchestrator-kit

UI design system toolkit for Senior UI Designer including design token generation, component documentation, responsive design calculations, and developer handoff tools. Use for creating design systems, maintaining visual consistency, and facilitating design-dev collaboration.

theme-factory

164
from maslennikov-ig/claude-code-orchestrator-kit

Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.

systematic-debugging

164
from maslennikov-ig/claude-code-orchestrator-kit

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes

setup-knip

164
from maslennikov-ig/claude-code-orchestrator-kit

Install and configure Knip for dead code detection. Use before running dead-code-hunter or dependency-auditor to ensure Knip is available. Handles installation, configuration creation, and validation.

senior-prompt-engineer

164
from maslennikov-ig/claude-code-orchestrator-kit

World-class prompt engineering skill for LLM optimization, prompt patterns, structured outputs, and AI product development. Expertise in Claude, GPT-4, prompt design patterns, few-shot learning, chain-of-thought, and AI evaluation. Includes RAG optimization, agent design, and LLM system architecture. Use when building AI products, optimizing LLM performance, designing agentic systems, or implementing advanced prompting techniques.

senior-devops

164
from maslennikov-ig/claude-code-orchestrator-kit

Comprehensive DevOps skill for CI/CD, infrastructure automation, containerization, and cloud platforms (AWS, GCP, Azure). Includes pipeline setup, infrastructure as code, deployment automation, and monitoring. Use when setting up pipelines, deploying applications, managing infrastructure, implementing monitoring, or optimizing deployment processes.

senior-architect

164
from maslennikov-ig/claude-code-orchestrator-kit

Comprehensive software architecture skill for designing scalable, maintainable systems using ReactJS, NextJS, NodeJS, Express, React Native, Swift, Kotlin, Flutter, Postgres, GraphQL, Go, Python. Includes architecture diagram generation, system design patterns, tech stack decision frameworks, and dependency analysis. Use when designing system architecture, making technical decisions, creating architecture diagrams, evaluating trade-offs, or defining integration patterns.