Rollback Skill
Create, list, and restore checkpoints for safe recovery
Commands
| Command | Description | Example |
|---|---|---|
/rollback create |
Create a new checkpoint | /rollback create "before refactor" |
/rollback list |
List all checkpoints | /rollback list |
/rollback restore [id] |
Restore to a checkpoint | /rollback restore chk-20260409-143000 |
/rollback diff [id] |
Show changes since checkpoint | /rollback diff chk-20260409-143000 |
MCP Integration
This skill uses the bkit_checkpoint MCP tool to manage checkpoints.
How to Execute
Create Checkpoint
- Call
bkit_checkpointwith actioncreate - Optionally include a label for easy identification
- The tool snapshots the current state of tracked files
- Returns a checkpoint ID (format:
chk-YYYYMMDD-HHMMSS) - Display confirmation with the checkpoint ID
List Checkpoints
- Call
bkit_checkpointwith actionlist - Display checkpoints in reverse chronological order
- Show: ID, timestamp, label, file count, size
Restore Checkpoint
- Call
bkit_checkpointwith actionrestoreand the checkpoint ID - Important: Automatically create a new checkpoint before restoring (safety net)
- Restore files to the checkpoint state
- Display list of files changed/restored
- Warn about any files that were added after the checkpoint (they will remain)
Show Diff
- Call
bkit_checkpointwith actiondiffand the checkpoint ID - Compare current state against the checkpoint
- Show added, modified, and deleted files
- Display line-level diff for modified files
Checkpoint Storage
Checkpoints are stored in .bkit/checkpoints/:
.bkit/checkpoints/
chk-20260409-143000/
manifest.json # List of files and their hashes
label.txt # Optional label
files/ # Snapshot of tracked files
Manifest Format
{
"id": "chk-20260409-143000",
"timestamp": "2026-04-09T14:30:00Z",
"label": "before refactor",
"files": [
{
"path": "src/api/auth.js",
"hash": "sha256:abc123...",
"size": 2456
}
],
"totalFiles": 12,
"totalSize": 34567
}
Auto-Checkpoint Triggers
Checkpoints are automatically created by hooks in these situations:
- Before deployment (
/deploy) - Before PDCA iterate phase
- Before bulk file operations (10+ files)
Output Format
## Checkpoint Created
- **ID**: chk-20260409-143000
- **Label**: before refactor
- **Files**: 12 tracked files
- **Size**: 34.5 KB
Use `/rollback restore chk-20260409-143000` to restore.
Safety Rules
- Always create backup before restoring (double safety net)
- Never delete checkpoints automatically - user must manage
- Warn on old checkpoints - flag if restoring to a checkpoint older than 24 hours
- Show diff first - recommend
/rollback diffbefore/rollback restore