agentleFS
ww-w-aiww-w-ai/bkit-claude-code/skills/rollback/SKILL.md

rollback

Skill605 starsChanged 3 months agoApache-2.0View on GitHub

Manage PDCA checkpoints and rollback — create, list, restore for safe recovery. Rollback events are recorded via lib/audit/audit-logger ACTION_TYPES.rollback_executed. For sprint-level recovery, individual feature rollbacks may be triggered from within sprint phases (sprint itself is forward-only — terminal state is `archived`, not rolled back; v2.1.13). Triggers: rollback, checkpoint, restore, undo

10 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use plan, status and 2 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • BlockSkill

    plan

    Draft a TDD, PRD, or lightweight plan in the conversation without committing it.

    Also in 4 projects that use this

  • AnthropicSkill

    status

    Case status summary by audience — client-facing (plain language), internal (for the professor), or court-ready (formal caption format per local rules). Same facts, different framing and depth. Use when a student needs to update the client, brief the professor, or prepare a court status report.

    Also in 3 projects that use this

  • AWSSkill

    ship

    Finalize dev work on an issue branch — update docs, push, and open a PR.

    Also in 3 projects that use this

  • SentrySkill

    review

    Fixture review skill.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 8 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read checkpoint metadata from .bkit/checkpoints/

    line 45
  2. Distinctive:

    Read the checkpoint metadata and saved state

    line 82
  3. Very specific:

    Read current feature state from .bkit/state/pdca-status.json

    line 100
  4. Very specific:

    If current phase is idle, display: "Already at initial state.

    line 103

“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Rollback Skill

User-invocable skill for checkpoint management and PDCA state rollback.

Arguments

ArgumentDescriptionExample
(none)List available checkpoints (same as list)/rollback
listList all available checkpoints/rollback list
to <checkpoint-id>Restore to a specific checkpoint/rollback to cp-1710842700000
phaseRollback to previous PDCA phase/rollback phase
reset <feature>Reset feature to initial (idle) state/rollback reset user-auth

Action Details

list (Default)

List all available checkpoints for the current or specified feature.

  1. Read checkpoint metadata from .bkit/checkpoints/
  2. Filter by current active feature (or show all if no active feature)
  3. Sort by timestamp (newest first)
  4. Display formatted checkpoint list

Checkpoint Metadata Schema:

{
  "id": "cp-1710842700000",
  "feature": "user-auth",
  "phase": "design",
  "type": "auto",
  "timestamp": "2026-03-19T10:30:00.000Z",
  "description": "Auto-checkpoint before Do phase",
  "pdcaStatus": { "phase": "design", "matchRate": 0, "iterationCount": 0 },
  "files": ["docs/02-design/features/user-auth.design.md"]
}

Output Format:

--- Checkpoints: user-auth ------------------------
ID                    Phase    Type   Date                Description
cp-1710842700000      design   auto   2026-03-19 10:30   Before Do phase
cp-1710839100000      plan     auto   2026-03-19 09:25   Before Design phase
cp-1710835500000      idle     manual 2026-03-19 08:15   Manual save point
---------------------------------------------------
Total: 3 checkpoints

Usage: /rollback to cp-1710842700000

to <checkpoint-id>

Restore state to a specific checkpoint.

  1. Validate the checkpoint ID exists in .bkit/checkpoints/
  2. Read the checkpoint metadata and saved state
  3. Display what will be restored (phase, files, status)
  4. Require user confirmation via AskUserQuestion (always, regardless of automation level)
  5. On confirmation: a. Create a safety checkpoint of current state (before rollback) b. Restore pdca-status.json to the checkpoint's saved state c. Restore any saved file snapshots d. Write audit log: checkpoint_restored e. Display confirmation with restored state
  6. On rejection: Cancel and display current state

Safety Rule: Rollback operations ALWAYS require user confirmation, even at L4 (Full-Auto). This is a destructive operation.

phase

Rollback to the previous PDCA phase.

  1. Read current feature state from .bkit/state/pdca-status.json
  2. Determine previous phase using the PDCA phase order: idle <- pm <- plan <- design <- do <- check <- act <- report <- archived
  3. If current phase is idle, display: "Already at initial state. Nothing to rollback."
  4. Display the phase transition that will occur
  5. Require user confirmation via AskUserQuestion
  6. On confirmation: a. Create auto-checkpoint of current state b. Use state-machine.transition() with ROLLBACK event c. Update pdca-status.json with previous phase d. Write audit log: phase_rollback e. Display: "Rolled back from {current} to {previous}"

Phase Rollback Map:

Current PhaseRolls Back To
pmidle
planpm (or idle if PM was skipped)
designplan
dodesign
checkdo
actcheck
reportcheck
archivedreport

reset <feature>

Reset a feature to its initial (idle) state.

  1. Validate the feature exists in pdca-status.json
  2. Display current feature state and what will be lost
  3. Require user confirmation via AskUserQuestion with warning: "This will reset ALL PDCA progress for {feature}. Documents in docs/ will NOT be deleted."
  4. On confirmation: a. Create auto-checkpoint of current state b. Use state-machine.transition() with RESET event c. Clear feature from active features list d. Reset all metrics (matchRate, iterationCount, etc.) e. Write audit log: feature_reset f. Display: "Feature {feature} reset to idle state. PDCA documents preserved in docs/."

Important: Reset does NOT delete documents from docs/. It only resets the PDCA status tracking. Use /pdca cleanup to remove archived status entries.

Checkpoint Types

TypeTriggerDescription
autoPhase transition (Design->Do)Automatic checkpoint at key transitions
manualUser commandUser-created save point
phase_transitionAny phase changeLightweight state snapshot
pre_rollbackBefore rollbackSafety checkpoint before destructive operation

State Files

FilePurpose
.bkit/checkpoints/cp-{timestamp}.jsonCheckpoint metadata and state snapshot
.bkit/state/pdca-status.jsonCurrent PDCA status (modified on rollback)

Module Dependencies

ModuleFunctionUsage
lib/control/checkpoint-manager.jslistCheckpoints()List available checkpoints
lib/control/checkpoint-manager.jscreateCheckpoint()Create new checkpoint
lib/control/checkpoint-manager.jsrestoreCheckpoint()Restore to checkpoint
lib/pdca/state-machine.jstransition()Execute ROLLBACK/RESET events
lib/audit/audit-logger.jswriteAuditLog()Record rollback operations

Usage Examples

# List checkpoints
/rollback

# Restore to specific checkpoint
/rollback to cp-1710842700000

# Rollback to previous phase
/rollback phase

# Reset feature completely
/rollback reset user-auth

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.