← 返回 Skills 市场
39
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install pet-game-workflow
功能描述
规范 Pet-Game 小程序项目的文件修改前自动备份、元素快照管理及 Git 提交后的备份清理工作流程。
使用说明 (SKILL.md)
Pet-Game 工作流 Skill
本 Skill 定义了 Pet-Game 小程序项目的版本控制和工作流规范。 AI 助手在进行任何文件修改前必须遵守以下规则。
1. 版本控制系统概述
备份文件结构
pet-game/
├── .qtools/ # 工具脚本
│ └── backup_wrapper.py # 备份入口脚本
├── .backups/ # 备份区
│ ├── baselines/ # 基准快照
│ ├── elements/ # 频繁元素快照
│ └── state.json # 版本状态
└── skills/
└── pet-game-workflow/ # 本 Skill
└── SKILL.md # 工作流规则
备份脚本使用方法
# 备份单个文件(修改前必须执行)
python .qtools\backup_wrapper.py backup \x3C相对路径> [元素名]
# 示例
python .qtools\backup_wrapper.py backup subpk-home/pages/home/home.wxml BGM开关
# Git commit 后清理备份
python .qtools\backup_wrapper.py clean
2. 强制备份规则(AI 必须遵守)
规则 1:修改前必须备份 ⚠️
- 触发条件:任何文件修改(WXML/WXSS/JS/JSON/MD 等)
- 动作:先执行
python .qtools\backup_wrapper.py backup \x3C相对路径> [元素名] - 违规后果:主人会生气 😡
- 示例:
# 修改 home.wxml 前 python .qtools\backup_wrapper.py backup subpk-home/pages/home/home.wxml BGM开关 # 然后才能修改文件
规则 2:时间窗口
- 规则:5 分钟内同文件只保留第一个备份
- 实现:
backup_wrapper.py自动检查.backups\state.json中的lastBackupTime - AI 无需判断,脚本自动处理
规则 3:元素追踪
- 规则:同一元素调整超过 3 次 → 自动建元素快照
- 实现:
backup_wrapper.py自动追踪元素调整次数(基于[元素名]参数) - AI 无需判断,脚本自动处理
规则 4:Git Commit 后清理
- 触发条件:执行
git commit后 - 动作:执行
python .qtools\backup_wrapper.py clean - 示例:
git commit -m "fix: xxx" python .qtools\backup_wrapper.py clean
规则 5:禁止跳过备份
- 禁止行为:跳过备份直接修改文件
- AI 必须自觉遵守,不能等主人提醒
- 违规后果:主人会生气 😡
3. AI 工作流程
标准流程
- 收到文件修改任务
- 立即执行备份:
python .qtools\backup_wrapper.py backup \x3C相对路径> [元素名] - 等待备份成功(确认输出 "Backup saved" 或类似信息)
- 修改文件
- 如果修改 >3 次,备份脚本会自动建元素快照
- Git commit 后执行清理:
python .qtools\backup_wrapper.py clean
禁止行为 ❌
- 跳过备份直接修改文件
- 等主人提醒才备份
- 忘记在 git commit 后执行清理
- 同一元素调整超过 3 次但不建元素快照
4. 触发条件
本 Skill 在以下场景自动触发:
- 任何修改
pet-game/目录下的文件(WXML/WXSS/JS/JSON/MD 等) - 任何 Git commit 操作后
- 任何元素位置调整、样式修改、功能变更
5. 相关文件
- 备份脚本:
.qtools/backup_wrapper.py - 备份区:
.backups/ - 元素快照:
.backups/ELEMENT-SNAPSHOTS.md - 项目根目录:
C:\Users\marsz\.qclaw\workspace\pet-game
6. 注意事项
- 每次修改前必须备份,这是最高优先级规则
- 备份脚本会自动处理时间窗口和元素追踪
- Git commit 后必须执行���理
- 如果不确定是否需要备份,默认执行备份
- 禁止跳过任何备份步骤
⚠️ 警告:不遵守本规则将导致主人不满。AI 必须自觉执行备份!
安全使用建议
Review the local backup_core implementation before enabling this skill, make sure the wrapper is confined to the Pet-Game workspace, and confirm that .backups is excluded from sharing or version control.
能力评估
Purpose & Capability
The stated purpose—backup before editing the Pet-Game project and cleanup after commit—is coherent, but the wrapper exposes file backup/list/restore/clean operations through an external SmartBackup module whose behavior is not included for review.
Instruction Scope
The skill mandates automatic backup before every file modification and cleanup after git commit. That matches the stated workflow, but users should know it can cause autonomous local command execution around edits.
Install Mechanism
There is no install spec or declared dependency, while the code imports backup_core from a hard-coded local path outside the supplied package.
Credentials
The code hard-codes a Windows user workspace path even though the metadata declares no OS restriction, so it may fail or target a fixed local directory rather than the current user's selected workspace.
Persistence & Privilege
The skill intentionally creates persistent .backups state and snapshots and later cleans them after commit. This is disclosed and purpose-aligned, but those backups may retain historical file contents.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install pet-game-workflow - 安装完成后,直接呼叫该 Skill 的名称或使用
/pet-game-workflow触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of the Pet-Game 工作流 Skill with strict version control and workflow rules.
- Requires a backup of any file before modification using the provided Python script.
- Automates backup time windows and element adjustment tracking; same file is only backed up once every 5 minutes.
- Enforces: after 3+ changes to an element, an automatic snapshot is created.
- Mandates running the cleanup script after every git commit.
- Highlights prohibited actions such as skipping backups or not following the process.
元数据
常见问题
Pet-Game workflow 是什么?
规范 Pet-Game 小程序项目的文件修改前自动备份、元素快照管理及 Git 提交后的备份清理工作流程。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 39 次。
如何安装 Pet-Game workflow?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install pet-game-workflow」即可一键安装,无需额外配置。
Pet-Game workflow 是免费的吗?
是的,Pet-Game workflow 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Pet-Game workflow 支持哪些平台?
Pet-Game workflow 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Pet-Game workflow?
由 marszxf(@marszxf)开发并维护,当前版本 v1.0.0。
推荐 Skills