Version-Master 2.1.0 is a single-file level version management skill. Unlike full-workspace snapshots, it maintains independent version history for each file, so users can clearly see what changes each document has gone through.
Activate this skill when the user's request involves any of these scenarios:
After loading this skill, the AI uses version management features by calling scripts/version_tool.py.
# Save a specific file
save_version(file_path="ai_news_20260324.md", message="Added 11th news item")
Key Parameters:
file_path: File path (relative to workspace). Optional, but AI should auto-detect from context.
message: Version description. AI should auto-generate meaningful descriptions based on user actions.
AI Auto-Detection Rules / AI 自动判断规则:
# List all files with version history
list_versions()
# List version history of a specific file
list_versions(file_path="ai_news_20260324.md")
Output Example:
ai_news_20260324.md (3 versions)
v3 - Added 11th news item | 2026-03-25 08:08
v2 - Added 6 tech news items | 2026-03-25 08:05
v1 - Initial version, 10 AI news items | 2026-03-25 08:03
interesting_news.md (1 version)
v1 - Tech, sports, military highlights | 2026-03-25 08:10
# Restore to a specific version
restore_version(file_path="ai_news_20260324.md", version=2, confirm=True)
# Restore to the latest version
restore_version(file_path="ai_news_20260324.md", confirm=True)
Restoration Features:
.version_backup/
# Compare two versions of the same file
diff_versions(file_path="ai_news_20260324.md", version1=1, version2=3)
# Compare current file with a historical version
diff_versions(file_path="ai_news_20260324.md", version2=2)
# Delete all versions of a file
clean_versions(file_path="test.txt", confirm=True)
# Delete a specific version of a file
clean_versions(file_path="test.txt", version=1, confirm=True)
The following operations require explicit user confirmation:
Before calling these operations, the AI must:
confirm=True parameter / 设置 confirm=True 参数
Path Security / 路径安全:
All file_path parameters are validated server-side to stay within the workspace boundary. Paths containing ../ or absolute paths outside the workspace are rejected with an error. The AI must never pass system-level paths (e.g., ../../etc/passwd, C:\Windows\...) as file_path.
~/.workbuddy/versions/version-master/
├── index.json # Global index (file → version mapping)
├── 20260325084235_ai_news_20260324-md/ # One directory per file (prefixed with workspace ID)
│ ├── v1.json # Version 1 (text content embedded in JSON)
│ ├── v1.md # Version 1 binary reference file (if any)
│ ├── v2.json # Version 2
│ └── v3.json # Version 3
└── 20260325084235_interesting_news-md/
└── v1.json
Design Notes:
20260325084235) for readability and disambiguation
. in filenames is replaced with -, path separators replaced with _ to ensure unique keys
v1.png), JSON stores only a file reference (no base64)
index.json can be auto-rebuilt from disk v*.json files if corrupted or lost
Global Index Structure (index.json):
{
"files": {
"20260325084235_ai_news_20260324-md": {
"rel_path": "ai_news_20260324.md",
"next_version": 4,
"versions": [
{
"version": 1,
"timestamp": "2026-03-25T08:03:00",
"content_hash": "abc123...",
"file_size": 2928,
"summary": "Initial version, 10 AI news items",
"version_file": "20260325084235_ai_news_20260324-md/v1.json"
}
]
}
}
}
{
"version": 1,
"timestamp": "2026-03-25T08:03:00",
"content_hash": "abc123...",
"file_size": 2928,
"summary": "Initial version, 10 AI news items",
"message": "Initial version",
"content": {
"type": "text",
"content": "# AI News Briefing\n\n..."
}
}
version-master/
├── SKILL.md # Skill documentation
├── requirements.txt # Dependencies
└── scripts/
├── __init__.py
└── version_tool.py # Core implementation
User: "帮我把 ai_news.md 保存一下" / "Save ai_news.md for me"
AI:
1. Call list_versions(file_path="ai_news.md") to check existing versions
2. Analyze current file content changes
3. Call save_version(file_path="ai_news.md", message="Added 3 new news items")
4. Show result: "ai_news.md saved as v3"
User: "恢复到上一个版本" / "Restore to previous version"
AI:
1. Check version history, confirm current is v3, previous is v2
2. Prompt user: "About to restore ai_news.md to v2 (Added 3 news items → Initial version). Confirm?"
3. After user confirms, call restore_version(file_path="ai_news.md", version=2, confirm=True)
共 1 个版本