rollback

A command-line tool action that restores a previously installed version of a coding-agent skill. A skill is a reusable set of instructions or tools for an agent.

In plain words
What is it for?
Use it to list available previous versions, preview the files that would be restored, or restore a skill to its earlier version.
Why use it?
It provides a way to recover from an unwanted update or reinstall, using saved file backups and version history.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/rolecraft-sh/rolecraft/rollback
Clone the repo
git clone --depth 1 https://github.com/rolecraft-sh/rolecraft
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 678 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00678
Opus 5 $0.00000 $0.00339
Sonnet 5 $0.00000 $0.00136
Haiku 4.5 $0.00000 $0.00068

Measured 3d ago against content hash 432273141150, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

rollback scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/commands/rollback.md · 87 lines

How it starts

The opening of the file, as written. The whole thing — 87 lines — stays where its author put it; the contents beside it link to each section on GitHub.

rolecraft rollback

Restore a skill to its previous version. Requires a history entry — created automatically when you use rolecraft update or re-install over an existing skill.

Requirement: v2.1.0+

Rollback history is stored in two places:

  • Lockfile history (~/.agents/.skill-lock.json) — metadata about each previous version
  • File backups (~/.agents/.backups/<slug>/) — snapshot of the actual skill files

History is kept for the last 5 updates. Older entries are automatically trimmed.

Usage

rolecraft rollback <slug> [options]

Options

Option Description
--list Show available rollback versions without restoring
--dry-run Preview which files would be restored
--help, -h Show help

Examples

Restore a skill to its previous version

rolecraft rollback my-skill

List rollback history

rolecraft rollback my-skill --list

📜 Rollback history for "my-skill":
   Current: a1b2c3d4e5f6
           v1: f6e5d4c3b2a1 (2026-07-28T10:30:00.000Z)
           v2: 9a8b7c6d5e4f (2026-07-27T14:15:00.000Z)

Preview what would be restored

rolecraft rollback my-skill --dry-run

🔄 Dry-run: rollback "my-skill"
   Files to restore: SKILL.md, helper.js, config.json
   Targets: cursor, claude, opencode
   Previous version: f6e5d4c3b2a1

Node.js API

import { rollback } from 'rolecraft'

const result = await rollback('my-skill')
console.log(result)
// { slug: 'my-skill', files: ['SKILL.md', ...], targets: [...], prevContentSha: '...' }

// List history only
const history = await rollback('my-skill', { list: true })
// { slug: 'my-skill', currentVersion: '...', history: [{ version: 1, ... }] }

// Preview without restoring
const preview = await rollback('my-skill', { dryRun: true })
// { dryRun: true, slug: 'my-skill', files: [...], targets: [...], prevContentSha: '...' }

Read the full file on GitHub · 87 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 87 lines · 0 tokens per session scan A 432273141150

Subscribe to this mod's changes

rollback is a command published in the GitHub repository rolecraft-sh/rolecraft (75 stars, last pushed 5d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 678 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.