gamedev-unity/skills/unity-skills/skills/workflow/SKILL.md
Persistent operation history and orchestration — snapshots, task/session undo, bookmarks, and batch planning/retry/rollback. Use when undoing a whole task or session, snapshotting before risky changes, planning or previewing batch operations, or rolling back, even if the user just says "撤销整个操作" or "回滚". 持久化操作历史与编排(快照、任务/会话级撤销、书签、批量规划/重试/回滚);当用户要撤销整个任务或会话、在高危改动前快照、规划或预览批量操作、或回滚时使用。
npx skillsauth add bernatmv/ai-rules unity-workflowInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Persistent history and rollback system for AI operations ("Time Machine"). Allows tagging tasks, snapshotting objects before modification, and undoing specific tasks even after Editor restarts.
NEW: Session-level undo - Group all changes from a conversation and undo them together.
SkillMode.SemiAuto(bookmark / history / task / session 系列 + workflow_plan,后者 ReadOnly=true 仅生成聚合计划),可直接执行。少数写类 skill (workflow_snapshot_object / workflow_snapshot_created / batch_retry_failed) 走默认 SkillMode.FullAuto,需 grant。bookmark_delete / workflow_delete_task(标 Operation.Delete,删除书签/任务记录)。这些在 Approval/Auto 下返 MODE_FORBIDDEN,仅 Bypass 或 Allowlist 命中可调。注意:
workflow_undo_task/workflow_session_undo不是 Delete operation(标的是 Modify/Execute),它们能在 Approval/Auto 直接撤销已记录任务。
DO NOT (common hallucinations):
workflow_save does not exist → use workflow_task_end to end and save a taskworkflow_rollback does not exist → use workflow_undo_task (by taskId) or workflow_session_undo (by sessionId)workflow_create does not exist → use workflow_task_startworkflow_revert_task is deprecated → use workflow_undo_taskRouting:
editor_undo / editor_redo (editor module)history_undo with steps parameter (this module)workflow_session_undo (this module)bookmark_setSave current selection and scene view position as a bookmark.
| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | bookmarkName | string | Yes | - | Name for the bookmark | | note | string | No | null | Optional note for the bookmark |
Returns: { success, bookmark, selectedCount, hasSceneView, note }
bookmark_gotoRestore selection and scene view from a bookmark.
| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | bookmarkName | string | Yes | - | Name of the bookmark to restore |
Returns: { success, bookmark, restoredSelection, note }
bookmark_listList all saved bookmarks.
No parameters.
Returns: { success, count, bookmarks: [{ name, selectedCount, hasSceneView, note, createdAt }] }
bookmark_deleteDelete a bookmark.
| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | bookmarkName | string | Yes | - | Name of the bookmark to delete |
Returns: { success, deleted }
history_undoUndo the last operation (or multiple steps).
| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | steps | int | No | 1 | Number of undo steps to perform |
Returns: { success, undoneSteps }
history_redoRedo the last undone operation (or multiple steps).
| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | steps | int | No | 1 | Number of redo steps to perform |
Returns: { success, redoneSteps }
history_get_currentGet the name of the current undo group.
No parameters.
Returns: { success, currentGroup, groupIndex }
workflow_planGenerate a combined execution plan for multiple skills on the server side.
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| skillsJson | string | Yes | - | JSON array of { "name": "...", "params": { ... } } entries |
Returns: { totalSteps, totalRisk, steps, dependencies, warnings, mayDisconnect }
batch_query_assetsQuery project assets with filters that are useful before batch cleanup or migration work.
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| searchFilter | string | No | - | Extra AssetDatabase.FindAssets filter text |
| folder | string | No | Assets | Search root |
| typeFilter | string | No | - | Asset type filter such as t:Material or Prefab |
| namePattern | string | No | - | Regex applied to file name without extension |
| labelFilter | string | No | - | Asset label filter such as l:Addressable |
| maxResults | int | No | 200 | Max assets returned |
Returns: { count, totalMatched, summary, assets }
batch_retry_failedRetry only the failed items from an earlier batch execution report. This now reuses the original operation context stored in the report.
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| reportId | string | Yes | - | Source report ID from batch_report_get / batch_report_list |
| runAsync | bool | No | true | Return a jobId immediately or wait for completion |
| chunkSize | int | No | 100 | Chunk size for retry execution |
Returns: { status, jobId?, retryCount, originalReportId, reportId? }
workflow_session_startStart a new session (conversation-level). All changes will be tracked and can be undone together. Call this at the beginning of each conversation.
| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | tag | string | No | null | Label for the session |
Returns: { success, sessionId, message }
workflow_session_endEnd the current session and save all tracked changes. Call this at the end of each conversation.
No parameters.
Returns: { success, sessionId, message }
workflow_session_undoUndo all changes made during a specific session (conversation-level undo).
| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | sessionId | string | No | null | The UUID of the session to undo. If not provided, undoes the most recent session |
Returns: { success, sessionId, message }
workflow_session_listList all recorded sessions (conversation-level history).
No parameters.
Returns: { success, count, currentSessionId, sessions: [{ sessionId, taskCount, totalChanges, startTime, endTime, tags }] }
workflow_session_statusGet the current session status.
No parameters.
Returns: { success, hasActiveSession, currentSessionId, isRecording, currentTaskId, currentTaskTag, currentTaskDescription, snapshotCount }
workflow_task_startStart a new persistent workflow task to track changes for undo. Call workflow_task_end when done.
| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | tag | string | Yes | - | Short label for the task (e.g., "Create NPC") | | description | string | No | "" | Detailed description or prompt |
Returns: { success, taskId, message }
workflow_task_endEnd the current workflow task and save it. Requires an active task (call workflow_task_start first).
No parameters.
Returns: { success, taskId, snapshotCount, message }
workflow_snapshot_objectManually snapshot an object's state before modification. Requires an active task (call workflow_task_start first).
Call this BEFORE component_set_property, gameobject_set_transform, etc.
| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | name | string | No | null | Name of the Game Object | | instanceId | int | No | 0 | Instance ID of the object (preferred) |
Returns: { success, objectName, type }
workflow_snapshot_createdRecord a newly created object for undo tracking. Requires an active task (call workflow_task_start first).
Note: component_add and gameobject_create automatically record created objects, so you typically don't need to call this manually.
| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | name | string | No | null | Name of the Game Object | | instanceId | int | No | 0 | Instance ID of the object (preferred) |
Returns: { success, objectName, type }
workflow_listList persistent workflow history.
No parameters.
Returns: { success, count, history: [{ id, tag, description, time, changes }] }
workflow_undo_taskUndo changes from a specific task (restore to previous state). The undone task is saved and can be redone later.
| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | taskId | string | Yes | - | The UUID of the task to undo |
Returns: { success, taskId }
workflow_redo_taskRedo a previously undone task (restore changes).
| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | taskId | string | No | null | The UUID of the task to redo. If not provided, redoes the most recently undone task |
Returns: { success, taskId }
workflow_undone_listList all undone tasks that can be redone.
No parameters.
Returns: { success, count, undoneStack: [{ id, tag, description, time, changes }] }
workflow_revert_task(deprecated) Alias for workflow_undo_task. Use workflow_undo_task instead.
| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | taskId | string | Yes | - | The UUID of the task to undo |
Returns: { success, taskId }
workflow_delete_taskDelete a task from history (does not revert changes, just removes the record).
| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | taskId | string | Yes | - | The UUID of the task to delete |
Returns: { success, deletedId }
import unity_skills
# Session-level: wrap entire conversation for bulk undo
unity_skills.call_skill("workflow_session_start", tag="Build Player")
unity_skills.call_skill("gameobject_create", name="Player", primitiveType="Capsule")
unity_skills.call_skill("component_add", name="Player", componentType="Rigidbody")
unity_skills.call_skill("workflow_session_end")
# Later: undo entire session
sessions = unity_skills.call_skill("workflow_session_list")
unity_skills.call_skill("workflow_session_undo", sessionId=sessions["sessions"][0]["sessionId"])
The following operations are automatically tracked for undo when a session/task is active:
gameobject_create / gameobject_create_batchgameobject_duplicate / gameobject_duplicate_batchcomponent_add / component_add_batchui_create_* (canvas, button, text, image, etc.)light_createprefab_instantiate / prefab_instantiate_batchmaterial_create / material_duplicateterrain_createcinemachine_create_vcamFor modification operations, the system auto-snapshots target objects before changes when possible.
Exact names, parameters, defaults, and returns are defined by GET /skills/schema or unity_skills.get_skill_schema(), not by this file.
development
Keyword research and validation with real search-demand data — never ship keywords from intuition alone. Probes Google Autocomplete per language (free, no account) to prove demand and discover the exact phrasing people type, checks SERPs for winnability, and uses Keyword Planner/Ahrefs/Semrush exports when the user has access. Activates when: choosing or reviewing SEO keywords, meta keywords, page titles, article topics or slugs, landing page copy targeting search, App Store/ASO keyword fields, multilingual keyword sets, 'what should we rank for', 'keyword analysis', or auditing why a page doesn't rank. Also invoke it as a validation pass whenever another skill or task produces a keyword list.
development
Automate YooAsset hot-update and asset bundles — build bundles, run Editor simulate builds, manage Collector groups, analyze BuildReport, and validate runtime. Use when building or simulating YooAsset bundles, configuring collectors, or validating hot-update assets, even if the user just says "热更" or "打AB包". 自动化 YooAsset 热更新与资源包(构建 bundle、编辑器模拟构建、管理 Collector 分组、分析 BuildReport、运行时校验);当用户要构建或模拟 YooAsset 资源包、配置 collector、或校验热更资源时使用。
development
Source-anchored design rules for YooAsset v2.3.18 — initialization, default-package shortcuts, play modes, asset handles, loading, updates, filesystem, build, and pitfalls. Use when writing or reviewing YooAsset code, initializing packages, loading assets via handles, setting up hot-update/download, or choosing a play mode, even if the user just says "热更" or "资源包". 为 YooAsset v2.3.18 提供源码锚定的设计规则(初始化、默认包快捷方式、运行模式、资源句柄、加载、更新、文件系统、构建、陷阱);当用户要编写或审查 YooAsset 代码、初始化 package、用句柄加载资源、配置热更/下载、或选择运行模式时使用。
data-ai
Last-resort guidance for safely hand-editing Unity serialized YAML (.unity/.prefab/.asset/.meta/ProjectSettings) — reference/fileID repair, GUID safety, and merge-conflict fixes. Use when REST cannot reach the change and YAML must be hand-edited — fixing m_Script GUIDs, broken fileID references, .meta files, or merge conflicts, even if the user just says "场景文件打不开" or "引用丢了". 安全手编 Unity 序列化 YAML(.unity/.prefab/.asset/.meta/ProjectSettings)的最后手段(引用/fileID 修复、GUID 安全、合并冲突修复);当 REST 无法触达、必须手编 YAML 时使用——修复 m_Script GUID、断裂 fileID 引用、.meta 文件或合并冲突。