Version

From 5throck/ai-workspace-standards · View interactive version

Version is an AI agent skill from the GitHub repository 5throck/ai-workspace-standards. Manages version snapshots of lecture files. Auto-backs up files before edits and restores prior versions on demand. Must be called before any file modification by any agent. Responds to "go back to previous version", "show version list". Cross-cutting — applies to all workflow stages.

How to use this skill

Skill file

Context

Tracks every file change and manages snapshots so any prior state can be restored at any time. This is a cross-cutting skill — it must be called before any file modification by any other agent, without exception. PM Agent enforces this order automatically.

When to Use


Execution Steps

Step 1: Create Snapshot (before any edit)

Always create a snapshot before editing a file. --workspace is required.

# Single file
bun scripts/co-deck/snapshot.ts slide_deck.md \
  --workspace deliverables/<project> \
  --desc "shrink chapter 3 slide count" \
  --agent content

# Multiple files
bun scripts/co-deck/snapshot.ts slide_deck.md storyline.md \
  --workspace deliverables/<project> \
  --desc "full chapter restructure" \
  --agent content

# HTML file (large — snapshot only when layout changes)
bun scripts/co-deck/snapshot.ts lecture_v1.html \
  --workspace deliverables/<project> \
  --desc "backup before image swap" \
  --agent build

# Diagram assets (shared pool)
bun scripts/co-deck/snapshot.ts ../assets/diagrams/ \
  --workspace deliverables/<project> \
  --desc "backup before diagram regeneration" \
  --agent build

File paths are relative to --workspace.

--agent value rules:

| Agent | --agent value |

|-------|----------------|

| PM Agent | pm |

| Research Agent | research |

| Storyline Agent | storyline |

| Design Agent | design |

| Build Agent | build |

| Measure Agent | measure |

| Export Agent | export |

| Manual backup | manual |


Step 2: List Versions

bun scripts/co-deck/snapshot.ts --workspace deliverables/<project> --list

Example output:

──────────────────────────────────────────────────────────
  Stored versions (5, newest first)
──────────────────────────────────────────────────────────
  [ 1] 2026-06-17_16-00_build_image-swap-backup
        Files: 3 / Size: 2.4MB
  [ 2] 2026-06-17_14-30_content_chapter-adjust
        Files: 2 / Size: 45KB

Step 3: Restore a Version

# Full version ID
bun scripts/co-deck/snapshot.ts \
  --workspace deliverables/<project> \
  --restore 2026-06-17_14-30_content_chapter-adjust

# Partial version ID (if uniquely matched)
bun scripts/co-deck/snapshot.ts \
  --workspace deliverables/<project> \
  --restore 2026-06-17_14-30

Restore automatically backs up the current file before restoring. If you regret the restore, run --restore again on the new backup.


Output Format

Snapshots are stored under deliverables/<project>/_versions/:

deliverables/<project>/
└── _versions/
    └── 2026-06-17_14-30_content_chapter-adjust/
        ├── slide_deck.md
        └── storyline.md

Each snapshot auto-appends an entry to deliverables/<project>/VERSIONS.md with date, agent, description, file sizes, and restore command.

Caveats:

Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.