Agent skill

cheat-on-content State Migrator

by XBuilderLAB in XBuilderLAB/cheat-on-content

Upgrades an older .cheat-state.json to the current schema version by applying migration files in order, with dry-run, backup and stop-on-failure behavior.

MITAuto-check: notesDevelopment

SKILL.md written in Chinese; this summary is our English description.

Install cheat-on-content State Migrator

skills CLI
$ npx skills add XBuilderLAB/cheat-on-content --skill cheat-migrate -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install XBuilderLAB/cheat-on-content cheat-migrate --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/XBuilderLAB/cheat-on-content.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/cheat-migrate .claude/skills/cheat-migrate && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
cheat-migrate
GitHub stars
7.2k
Token cost
~1.5k tokens
SKILL.md length
390 words
Files
1
Skills in repo
16
Repo updated
First seen
Licence
MIT

At a glance

Upgrades an older .cheat-state.json to the current schema version by applying migration files in order, with dry-run, backup and stop-on-failure behavior.

  • Works in 6 steps: 确定迁移链 → dry-run → 备份 → …
  • Upgrading an old .cheat-state.json after updating cheat-on-content
  • SKILL.md covers Overview, Constants, Inputs and Workflow, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

This skill upgrades a user's .cheat-state.json from an older schema_version to the version the cheat-on-content tool expects. It reads the state file and a migrations registry, works out the chain of migration steps from the current version to the target, and applies each step in order. Running it twice gives the same result, and a state newer than the target is reported as an error instead of being downgraded.

By default the first run is a dry run that shows the plan without changing files, and a backup copy of the state file is made before any write. Each step's migration file contains natural-language steps that the agent follows, not a script, and the state is written atomically after each step. If a step fails the process stops at the last good intermediate version without rolling back, and a rerun resumes from there. Afterwards the file is parsed again, the schema version checked and the required fields verified. Options let you turn off the dry run or migrate only up to a chosen version.

When your agent uses it

  • Upgrading an old .cheat-state.json after updating cheat-on-content
  • Previewing the migration chain before changing any files
  • Resuming a migration that stopped at an intermediate version

Example prompts

  • “Migrate my state file to the latest schema.”
  • “My state is an old version; show me the migration plan first.”
  • “Migrate only up to version 1.2 and keep the backup.”

Requirements

  • A .cheat-state.json file in the project root
  • The cheat-on-content migrations registry and migration files
  • Pre-approved tools (allowed-tools): Bash(*), Read, Write, Edit, Skill

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. 确定迁移链
  2. dry-run
  3. 备份
  4. 按顺序应用每步
  5. 验证
  6. 报告

What it can do on your machine

Read from SKILL.md and the folder at commit 2d8211e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash(*)
    • Read
    • Write
    • Edit
    • Skill

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are bash).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

cheat-on-content State Migrator loads about 1.5k tokens when it runs. Until then it costs about 46 tokens; SKILL.md has 390 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~46
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Bash(*), Read, Write, Edit, Skill

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from XBuilderLAB/cheat-on-content at commit 2d8211e, republished under its MIT licence (© XBuilderLAB). 390 words, ~1,535 tokens.

Download SKILL.mdSave it as .claude/skills/cheat-migrate/SKILL.md (or your agent's skills folder).
name
cheat-migrate
description
把老用户的 .cheat-state.json 升级到当前 schema_version。读 migrations/registry.md 算迁移链,按顺序应用每一步迁移文件。幂等:跑两次结果一样。失败停在中间版本不前进。触发词:"迁移"/"升级 state"/"migrate"/"我的 state 是老版本"/"schema 版本不对"。
allowed-tools
Bash(*), Read, Write, Edit, Skill
argument-hint
[— from: <version>] [— to: <version>] [— dry-run]

/cheat-migrate — Schema 版本迁移

把用户 .cheat-state.json 从旧 schema_version 升级到 cheat-on-content 当前期望的 LATEST_SCHEMA。


Overview

[用户:迁移 / 或 SessionStart 提示后用户跑]
  ↓
[Phase 0: 读 .cheat-state.json + migrations/registry.md → 确定迁移链]
  ↓
[Phase 1: dry-run(默认)展示迁移计划,等用户确认]
  ↓
[Phase 2: 备份 .cheat-state.json → .cheat-state.json.backup-<timestamp>]
  ↓
[Phase 3: 按顺序对每个 step 应用对应迁移文件的 HOW 段]
  ↓
[Phase 4: 验证升级后 state 文件能被解析 + schema_version 已更新]
  ↓
[Phase 5: 报告 + 提示如有备份需要清理]

Constants

  • REGISTRY_PATH = ${SKILL_DIR}/../../migrations/registry.md — 版本链单一来源
  • MIGRATIONS_DIR = ${SKILL_DIR}/../../migrations/ — 迁移文件目录
  • DRY_RUN_BY_DEFAULT = true — 首次跑展示计划,不直接改文件
  • BACKUP_BEFORE_WRITE = true — 写之前必备份;备份文件保留至下次成功 init / 用户手动清理
  • STOP_ON_STEP_FAILURE = true — 任何 step 失败 → 停在中间版本,不前进,不回滚

💡 调用时覆盖:/cheat-migrate — dry-run: false 直接执行 / /cheat-migrate — to: 1.2 仅升到指定版本


Inputs

必填来源
.cheat-state.json用户项目根
migrations/registry.mdLATEST_SCHEMA + 版本链表
migrations/<from>-to-<to>.md每步具体迁移指令

Workflow

Phase 0: 确定迁移链
  1. 读 .cheat-state.json → 解析 current_version = state.schema_version
  2. 读 migrations/registry.md → 解析 LATEST_SCHEMA 字段(行:LATEST_SCHEMA = "X.Y")
  3. 解析 args.to 覆盖(如有);否则 target = LATEST_SCHEMA
  4. 解析 args.from 覆盖(罕见场景:用户的 state 文件 schema 字段坏了,强制指定起点)
  5. 状态判断:
    • current_version == target → 输出"✅ state 已是 {target},无需迁移" → 退出
    • current_version > target(比如用户跑了 dev 版又切回 release)→ 报错"无法降级,请手动调整或重新 init"
    • current_version < target → 继续,从注册表查出迁移链
  6. 从注册表"版本链"表算出 chain = [(from, to, file), ...],按顺序串起 current → target

如果某一步在注册表里缺失(比如 current_version 不在表里)→ 报错并展示"目前已知版本:[1.0, 1.1, ...]",让用户检查。

Phase 1: dry-run

输出迁移计划:

📋 迁移计划

当前版本: 1.0
目标版本: 1.2
将按顺序跑 2 步:

  [1/2] 1.0 → 1.1(MINOR)
       新增字段:typical_duration_seconds, target_publish_cadence_days, ...(共 12 字段)
       删除字段:mode, prediction_complexity, bucket_scheme
       详见: migrations/1.0-to-1.1.md

  [2/2] 1.1 → 1.2(MINOR)
       新增字段:[...]
       详见: migrations/1.1-to-1.2.md

⚠️ 备份位置: .cheat-state.json.backup-<timestamp>

继续吗?回 yes 执行 / no 退出 / dry-run-detail 看每步具体改什么。

如 args["dry-run"] == false 或用户回 yes → 进 Phase 2。

Phase 2: 备份
bash
cp .cheat-state.json .cheat-state.json.backup-$(date +%s)

输出:"📦 备份到 .cheat-state.json.backup-1714838400"

Phase 3: 按顺序应用每步

对 chain 里的每个 (from, to, file):

  1. 输出 "→ [N/M] 应用 {file}..."
  2. 读 migrations/<file> → 找到 ## HOW (Claude steps for /cheat-migrate) 段
  3. 按段内自然语言步骤逐项执行——这是关键:迁移是 Claude 读 markdown 跑的,不是 python 脚本
  4. 每步完成后:
    • 更新内存里的 state.schema_version = to
    • 原子写到磁盘(写 .tmp → rename)
  5. 如某步失败:
    • 输出"❌ {file} 第 N 步失败:{error}"
    • 不前进、不回滚(state 已停在前一步成功的中间版本)
    • 提示:"已停在 schema_version: {last_success_version}。修复后重跑 /cheat-migrate 会从这里继续"
    • 退出
Phase 4: 验证

升完后:

  1. 读 .cheat-state.json → 解析 → 应能成功
  2. 检查 schema_version == target
  3. 检查所有"必填字段"非缺失(参照 shared-references/state-management.md 完整 schema)
  4. 失败 → 报错"迁移完成但验证失败:{detail}。state 文件可能不一致——查看备份恢复"
Phase 5: 报告
✅ 迁移完成

  从: 1.0
  到: 1.2
  应用步骤: 2

state 文件现在含 X 字段,全部通过验证。

📦 备份保留:.cheat-state.json.backup-1714838400
   (确认一切正常后可手动 rm;下次成功 /cheat-init 也会清理过期备份)

下一步建议:
  - 跑 /cheat-status 确认看板正常
  - 如有 hooks 重装需求,跑 bash <skill_repo>/install.sh --reinstall-hooks

Show full SKILL.md (176 more words)Show less

Key Rules

  1. 幂等:在已升过的 state 上重跑应该立刻退出"无需迁移",不重复应用步骤。靠对比 current_version == target 实现
  2. 不跳版:1.0 → 1.3 必须按 1.0→1.1→1.2→1.3 顺序,每步独立可恢复。不允许"直接升 1.0 → 1.3 的合并 migration"
  3. 不静默兼容:state 文件 schema_version 不识别 → 明确报错"未知版本 X,最近已知版本 Y",不假装能继续
  4. 失败停在原地:第 N 步失败时 schema_version 停在 N-1 已成功的版本,不回滚到迁移前。重跑能从断点继续
  5. 备份是硬约束:写之前必有备份。即使用户跑 --dry-run: false,备份动作仍执行
  6. 不动 predictions / rubric / videos:只改 .cheat-state.json。其他用户数据由各自 skill 负责,迁移 skill 不碰
  7. MAJOR vs MINOR 透明:dry-run 输出必标 (MAJOR) / (MINOR)。MAJOR 时额外提示"老 skill 用旧字段读会出问题,迁移完不能回退到老 skill 版本"

Refusals

  • 「跳过 dry-run,立刻覆盖我的 state」 → 允许(--dry-run: false),但备份仍强制执行
  • 「我的 state 损坏了 / schema_version 字段没了,能不能猜一个版本来跑」 → 允许指定 --from: 1.0,但要警告"基于猜测的迁移可能导致字段错位"
  • 「降级到旧版本(current > target)」 → 拒绝。schema 演进单向。要降级请手动 cp 历史 git 快照
  • 「合并多步迁移成一个 atomic」 → 拒绝。每步独立可恢复是设计核心
  • 「在跑 cheat-bump / cheat-predict 中途调 migrate」 → 拒绝。等其他 skill 完成再跑,避免 in_progress_session 状态被破坏

Integration

  • 上游:SessionStart hook 检测 state.schema_version != LATEST_SCHEMA → 输出红色警告 + 建议跑 /cheat-migrate
  • 上游(手动):用户 git pull 拉了新版后,看 CHANGELOG 标 BREAKING → 主动跑
  • 下游:跑完后所有其他 skill 读 state 都能拿到最新字段
  • 与 cheat-init:init 写新 state 时直接用 LATEST_SCHEMA,不需要走 migrate
  • 与 install.sh --reinstall-hooks:迁移不重装 hook 脚本(hook 脚本属于 skill 包代码,不属于用户 state)。这两件事解耦

State 字段读写

本 skill 写:

  • schema_version(每步成功后更新)

本 skill 读:

  • 所有现有字段(取决于具体 migration 文件的 HOW 步骤)

本 skill 绝不写:

  • calibration_samples / pending_retros / shoots 等业务状态(这些是其他 skill 的职责)
  • 例外:迁移文件明确说"派生新字段值时需要扫 predictions/ 算 baseline_plays",那是初始化新字段,不是改老字段

Examples

示例 1:用户从 v0.1.0 升到 v0.2.0(假设 0.2 引入 schema 1.2)
用户:迁移
Claude: [跑 cheat-migrate]
  Phase 0: current=1.1, target=1.2, chain=[(1.1, 1.2)]
  Phase 1: dry-run 输出计划
  用户: yes
  Phase 2: 备份
  Phase 3: 应用 1.1-to-1.2.md(MINOR:新增 platform_metrics_url 等字段)
  Phase 4: 验证 OK
  Phase 5: 报告 ✅
示例 2:用户跳了多版
用户:我从 v0.1.0 升到 v0.5.0,state 还是 1.0
Claude: [跑 cheat-migrate]
  Phase 0: current=1.0, target=1.4 (LATEST), chain=[(1.0, 1.1), (1.1, 1.2), (1.2, 1.3), (1.3, 1.4)]
  Phase 1: dry-run 输出 4 步计划
  ...
示例 3:迁移中途失败
Phase 3:
  → [1/4] 应用 1.0-to-1.1.md ✓
  → [2/4] 应用 1.1-to-1.2.md ✓
  → [3/4] 应用 1.2-to-1.3.md... ❌ 失败:用户 baseline_plays 字段含非数字值,无法转 int
  
state 已停在 schema_version: 1.2。
修复 .cheat-state.json 后重跑 /cheat-migrate 会从 1.2 → 1.3 继续。

© XBuilderLAB, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/cheat-migrate of XBuilderLAB/cheat-on-content.

Open the folder on GitHubat commit 2d8211e

Compare with similar skills

cheat-on-content State Migrator next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

cheat-on-content State Migrator compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
cheat-on-content State Migrator this skillXBuilderLAB/cheat-on-content7.2k—~1.5kAutomated safety check: NotesMIT
Migrate Core Code to Submodulestinyhumansai/openhuman41k—~2.6kAutomated safety check: PassGPL-3.0
Migrate Internal Package into GhostTryGhost/Ghost55k—~3.8kAutomated safety check: PassMIT
ast-grep Structural Searchcode-yeongyu/oh-my-openagent70k—~3.3kAutomated safety check: PassMIT
Deprecate R Functions and Argumentstidyverse/dplyr5.1k1 repos~1.2kAutomated safety check: PassCustom licence
Rust Path Typesopeninterpreter/openinterpreter69k2 repos~605Automated safety check: PassApache-2.0

Similar skills

  • Migrate Core Code to Submodules

    tinyhumansai/openhuman

    Plans and carries out moving non-host-specific code and its tests from the OpenHuman core into vendored tiny submodule libraries, then releases the submodule and re-pins the host.

    41k GitHub stars~2.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Moves a package from another TryGhost repository into Ghost as an internal workspace package while keeping its Git history, with checkpoints for the steps that need an administrator.

    55k GitHub stars~3.8k tokensUpdated today
    DevelopmentAuto-check passed
  • ast-grep Structural Search

    code-yeongyu/oh-my-openagent

    Searches and rewrites code by syntax-tree shape across 25 languages with ast-grep, for codemods, structural queries and YAML lint rules, using a Python wrapper script.

    70k GitHub stars~3.3k tokensUpdated today
    DevelopmentAuto-check passed
  • Walks through deprecating an R function or argument in a package: lifecycle warning, silenced tests, a new snapshot test, documentation badge and NEWS entry.

    5.1k GitHub starsUsed in 1 repo~1.2k tokens
    DevelopmentAuto-check passed
  • Rust Path Types

    openinterpreter/openinterpreter

    Rules for choosing Rust types for filesystem paths in new Codex code, covering protocol types, internal use and model tool arguments.

    69k GitHub starsUsed in 2 repos~605 tokens
    DevelopmentAuto-check passed
  • Moves a legacy internal Ghost package from JavaScript and CommonJS to TypeScript and ESM in three focused commits that keep git file history intact.

    55k GitHub stars~1.2k tokensUpdated today
    DevelopmentAuto-check passed

More from XBuilderLAB/cheat-on-content

All 16 skills in this repo
  • Rubric Bump Proposer

    XBuilderLAB/cheat-on-content

    Proposes and applies upgrades to a content-scoring rubric: a full formula bump with blind re-scoring and a cross-model audit, or a lighter bucket-boundary recalibration.

    7.2k GitHub stars~3.5k tokensUpdated 2 days ago
    Auto-check: notes
  • Cheat-on-Content Setup

    XBuilderLAB/cheat-on-content

    Onboards a new user to the cheat-on-content workflow with a short question flow, creating the project scaffolding and optionally importing past video history.

    7.2k GitHub stars~4.3k tokensUpdated 2 days ago
    Auto-check: notes
  • Benchmark Account Importer

    XBuilderLAB/cheat-on-content

    Imports scripts and engagement numbers from an account you want to emulate, then extracts content patterns and starting scoring signals from them.

    7.2k GitHub stars~2.3k tokensUpdated 2 days ago
    Auto-check: notes
  • Cheat on Content Calibration

    XBuilderLAB/cheat-on-content

    Turns content creation into a calibrated loop of scoring, blind prediction, post-publish review and rubric evolution, with a built-in rubric for opinion videos.

    7.2k GitHub stars~2.7k tokensUpdated 2 days ago
    Auto-check: notes
  • Audience Persona Builder

    XBuilderLAB/cheat-on-content

    Builds or refreshes an account's audience profile from the comments in its post retrospectives and writes it to audience.md for later topic and script work.

    7.2k GitHub stars~1.5k tokensUpdated 2 days ago
    Auto-check: notes
  • Blind Prediction Log

    XBuilderLAB/cheat-on-content

    Writes an immutable blind prediction log for a finished content draft: a seven-dimension score, bucket, probability distribution and counterfactuals, scored blind by a sub-agent.

    7.2k GitHub stars~4k tokensUpdated 2 days ago
    Auto-check: notes

Categories

Questions about cheat-on-content State Migrator

What does cheat-on-content State Migrator do?

Upgrades an older .cheat-state.json to the current schema version by applying migration files in order, with dry-run, backup and stop-on-failure behavior. json from an older schema_version to the version the cheat-on-content tool expects. It reads the state file and a migrations registry, works out the chain of migration steps from the current version to the target, and applies each step in order.

When should I use cheat-on-content State Migrator?

cheat-on-content State Migrator fits situations like: upgrading an old .cheat-state.json after updating cheat-on-content; previewing the migration chain before changing any files; resuming a migration that stopped at an intermediate version.

How do I install cheat-on-content State Migrator in Claude Code?

Run `npx skills add XBuilderLAB/cheat-on-content --skill cheat-migrate -a claude-code`. Or copy the skill folder (skills/cheat-migrate in XBuilderLAB/cheat-on-content) into .claude/skills/cheat-migrate in your project. Claude Code loads it when a task matches its description.

How do I install cheat-on-content State Migrator in Codex?

Run `npx skills add XBuilderLAB/cheat-on-content --skill cheat-migrate -a codex`. Or copy the skill folder (skills/cheat-migrate in XBuilderLAB/cheat-on-content) into .agents/skills/cheat-migrate in your project. Codex loads it when a task matches its description.

Can I use cheat-on-content State Migrator in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add XBuilderLAB/cheat-on-content --skill cheat-migrate -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cheat-migrate, .gemini/skills/cheat-migrate, .github/skills/cheat-migrate and .opencode/skills/cheat-migrate in your project.

What does cheat-on-content State Migrator need to run?

SKILL.md names no scripts, command-line tools or credentials: cheat-on-content State Migrator is instructions for the agent only. Our summary lists: A .cheat-state.json file in the project root; The cheat-on-content migrations registry and migration files. Its frontmatter pre-approves these tools: Bash(*), Read, Write, Edit, Skill.

Does cheat-on-content State Migrator access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is cheat-on-content State Migrator safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does cheat-on-content State Migrator use?

cheat-on-content State Migrator is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does cheat-on-content State Migrator use?

About 1.5k tokens (SKILL.md is roughly 6.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to cheat-on-content State Migrator?

Skills that share tags, products or a category with cheat-on-content State Migrator: Migrate Core Code to Submodules (tinyhumansai/openhuman, 41k stars), Migrate Internal Package into Ghost (TryGhost/Ghost, 55k stars), ast-grep Structural Search (code-yeongyu/oh-my-openagent, 70k stars) and Deprecate R Functions and Arguments (tidyverse/dplyr, 5.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains cheat-on-content State Migrator?

XBuilderLAB (a GitHub organization) maintains it in XBuilderLAB/cheat-on-content, which has 7,225 GitHub stars. The repository holds 16 skills in this directory. The repository was last updated on October 5, 2026.

Source: XBuilderLAB/cheat-on-content on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.