From agent-capability-standard
Safely undo changes by restoring to a checkpoint. Use when verify fails, errors occur, or explicit undo is requested. Essential for the CAVR pattern recovery.
npx claudepluginhub synaptiai/synapti-marketplace --plugin agent-capability-standardThis skill is limited to using the following tools:
Execute **rollback** to restore system state to a previously created checkpoint. This is the recovery mechanism in the CAVR (Checkpoint-Act-Verify-Rollback) pattern - used when mutations fail or produce undesired outcomes.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Generates original PNG/PDF visual art via design philosophy manifestos for posters, graphics, and static designs on user request.
Execute rollback to restore system state to a previously created checkpoint. This is the recovery mechanism in the CAVR (Checkpoint-Act-Verify-Rollback) pattern - used when mutations fail or produce undesired outcomes.
Success criteria:
Compatible schemas:
schemas/output_schema.yaml| Parameter | Required | Type | Description |
|---|---|---|---|
checkpoint_id | Yes | string | ID of checkpoint to restore to |
scope | No | array | Specific files/keys to rollback (default: all in checkpoint) |
verify_restore | No | boolean | Whether to verify state matches checkpoint after restore (default: true) |
reason | No | string | Why rollback is being performed (for audit) |
Validate checkpoint: Confirm checkpoint exists and is valid
.checkpoints/ or git stashCapture current state: Record what will be reverted
Execute restoration: Apply the restore command
git stash pop or git stash apply.checkpoints/<id>/ to original locationsVerify restoration: Confirm state matches checkpoint
Ground claims: Attach evidence of successful rollback
tool:bash:<restore_command>, comparison outputFormat output: Return rollback results per contract
Return a structured object:
rolled_back: boolean
restored_to:
checkpoint_id: string
checkpoint_type: string
timestamp: string # When checkpoint was created
changes_reverted:
- file: string
operation: string # What was undone (create, modify, delete)
summary: string # Brief description of change reverted
verification:
pre_state_hash: string # Hash before rollback
post_state_hash: string # Hash after rollback
checkpoint_hash: string # Expected hash from checkpoint
match: boolean # post_state_hash == checkpoint_hash
warnings: array[string] # Any issues encountered
next_actions: array[string] # Suggested follow-up
confidence: number # 0.0-1.0
evidence_anchors: ["tool:bash:...", "file:..."]
assumptions: []
| Field | Type | Description |
|---|---|---|
rolled_back | boolean | Whether rollback was successful |
restored_to | object | Checkpoint that was restored to |
changes_reverted | array | List of changes that were undone |
verification.match | boolean | Whether restored state matches checkpoint |
warnings | array | Issues like orphaned files or partial restore |
next_actions | array | What to do next (re-plan, investigate, etc.) |
confidence | number | 0.0-1.0 based on verification match |
evidence_anchors | array | Proof of restoration |
assumptions | array | Explicit assumptions made |
Input:
checkpoint_id: "chk_20240115_143022_a7b3c9"
verify_restore: true
reason: "Tests failed after refactoring"
Output:
rolled_back: true
restored_to:
checkpoint_id: "chk_20240115_143022_a7b3c9"
checkpoint_type: git_stash
timestamp: "2024-01-15T14:30:22Z"
changes_reverted:
- file: "src/api/handlers/user.py"
operation: modify
summary: "Reverted refactored get_user() function"
- file: "src/api/handlers/auth.py"
operation: modify
summary: "Reverted auth token validation changes"
verification:
pre_state_hash: "sha256:deadbeef..."
post_state_hash: "sha256:e3b0c442..."
checkpoint_hash: "sha256:e3b0c442..."
match: true
warnings: []
next_actions:
- "critique: Analyze why refactoring broke tests"
- "plan: Create new plan with smaller incremental changes"
confidence: 1.0
evidence_anchors:
- "tool:bash:git stash pop stash@{0}"
- "tool:bash:git diff --stat HEAD"
- "tool:bash:sha256sum src/api/handlers/*.py"
assumptions:
- "No other changes made to stashed files since checkpoint"
Evidence pattern: Git stash pop output, diff showing restored state, hash verification.
Input:
checkpoint_id: "chk_20240115_150000_config"
verify_restore: true
reason: "Config migration caused service failure"
Output:
rolled_back: true
restored_to:
checkpoint_id: "chk_20240115_150000_config"
checkpoint_type: file_backup
timestamp: "2024-01-15T15:00:00Z"
changes_reverted:
- file: "config/production.yaml"
operation: modify
summary: "Reverted database connection string changes"
verification:
pre_state_hash: "sha256:newconfig..."
post_state_hash: "sha256:abc123..."
checkpoint_hash: "sha256:abc123..."
match: true
warnings:
- "Orphaned file detected: config/production.yaml.bak (removed)"
next_actions:
- "audit: Record failed migration attempt"
- "plan: Investigate migration script issue"
confidence: 0.95
evidence_anchors:
- "tool:bash:cp .checkpoints/chk_20240115_150000_config/production.yaml config/"
- "tool:bash:rm config/production.yaml.bak"
- "file:config/production.yaml:1"
assumptions:
- "Checkpoint backup file is not corrupted"
Apply the following verification patterns:
Verification tools: Bash (for restore and hash), Git (for stash operations)
mutation: true (modifies files to restore state)requires_checkpoint: true (MUST have valid checkpoint to rollback to)requires_approval: falserisk: mediumCapability-specific rules:
Commonly follows:
verify - When verify returns FAIL, trigger rollback (CAVR pattern)act-plan - If act-plan encounters error, rollbackcheckpoint - Rollback requires prior checkpoint (dependency)Commonly precedes:
critique - After rollback, analyze what went wrongplan - Create new plan after understanding failureaudit - Record the rollback eventAnti-patterns:
Workflow references:
reference/composition_patterns.md#checkpoint-act-verify-rollback for CAVR patternreference/composition_patterns.md#rollback-verification in verification_patterns.mdreference/composition_patterns.md#debug-code-change for rollback-then-critique flow