Unity Batch logo

Unity Batch

CommunityPopular
Besty0728
unity-batch

Unified batch and async-job orchestration

Overview

PublisherBesty0728
RepositoryUnity-Skills
Skill nameunity-batch
Stars
1.8K
Forks
164
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by Besty0728 on GitHub. Read the source before you install it.

Installation

Install the Unity Batch AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.

Use it in TypingMind

Enable Unity Batch in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Unity Batch on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Unity Batch is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Before calling any skill in this module: if you are about to call a skill with parameters guessed from its name or description, STOP — read this file (or fetch its schema via GET /skills/recommend?includeSchema=true) first. If you already have the parameter definitions from recommend/schema, you may proceed straight to dryRun.

Triggers

  • Operating on many objects at once
  • Running or polling long async jobs
  • Preview-then-commit bulk edits
  • 一次性操作大量对象、运行或轮询长时异步任务、先预览后提交的批量编辑

Unity Batch Skills

Batch workflow orchestration for query, preview, execution, reports, and async jobs.

POST /skills/batch — several skills, one HTTP call

This is an HTTP endpoint, not a skill: do not send skills_batch to POST /skill/<name>. It runs a sequence of ordinary skills inside one main-thread job, which removes one round-trip and one main-thread wakeup per step — the single largest efficiency lever in this protocol when you have more than two writes to make.

json
POST /skills/batch
{
  "steps": [
    {"skill": "gameobject_create", "args": {"name": "Cube", "primitiveType": "Cube"}},
    {"skill": "component_add", "args": {"instanceId": {"$ref": "$0.instanceId"}, "componentType": "Rigidbody"}}
  ],
  "continueOnError": false
}
Body fieldTypeDefaultMeaning
stepsarrayrequired{skill, args} objects, executed in order. Max 50 — more returns 400 + SEMANTIC_INVALID; split into several calls.
continueOnErrorboolfalsefalse = fail-fast; true = record the failure and keep going.
paramsobjectnoneFills {"$param":"name"} placeholder nodes in step args (static substitution, resolved before $ref).

Query: ?mode=dryRun validates every step without executing anything and never interrupts (the batch counterpart of the dryRun gate); ?mode=transactional is all-or-nothing with Undo rollback; ?diff=1 adds a net sceneDiff. ?mode=plan is not supported. Inter-step $ref ({"$ref":"$0.instanceId"}) and transactional details → SKILL_FULL.md.

mode/dryRun may equally be set in the body ("mode":"dryRun"|"transactional", "dryRun":true) — each of the two keys is resolved independently, query-first per key, so a query ?mode= and a body "dryRun" never fight over the same slot. The response always echoes what actually ran: top-level mode ("dryRun"|"transactional"|"execute") and dryRun (bool). An unrecognized query key or body top-level key (anything outside mode/dryRun/diff/steps/params/continueOnError) is rejected with 400 UNKNOWN_PARAM; a blank value on a recognized key (?mode=, ?dryRun=, ?diff=) is treated as if that key were simply omitted — it falls through to the other location or the default, it is not itself a rejection.

Reading the response. Whenever the batch ran at all the status is HTTP 200 and the verdict is in the body — only a rejected request (malformed body, >50 steps, unknown ?mode=) is a 4xx.

json
{"status":"partial","dryRun":false,"executed":2,"failed":1,
 "results":[{"index":0,"skill":"...","status":"success","result":{...}},
            {"index":1,"skill":"...","status":"error","error":{"errorCode":"...","error":"..."}},
            {"index":2,"skill":"...","status":"skipped"}]}
  • Top-level status: completed (nothing failed), partial (some step failed), or rolled_back (transactional mode reverted everything).
  • Every step carries its index and skill, so a failure is locatable without diffing your input array. status:"skipped" means the batch had already halted before that step ran — it was never attempted, not "ran and did nothing".
  • Fail-fast (continueOnError:false) stops at the first error and reports the rest as skipped. With continueOnError:true failures are recorded and later steps still run.
  • Authorization always interrupts, continueOnError notwithstanding: a step answering MODE_RESTRICTED / CONFIRMATION_REQUIRED halts the batch and returns that step's full payload (grant token included) so you can complete the grant flow and resubmit the remaining steps.

Not the same thing as batch_execute. batch_execute(confirmToken) commits one previewed bulk operation produced by a batch_preview_* skill (one verb over N objects, via a confirm token). POST /skills/batch composes N different skills over whatever targets you name, and takes no token. They do not substitute for each other, and POST /skills/batch is not a way to skip the preview/confirm gate — a batch_execute step inside a batch still needs its own confirmToken.

When a step returns a jobId (async batch execution, tests, compiles), poll it with GET /jobs/{id} rather than the job_status skill: it runs in the light lane instead of the main-thread skill queue, and its payload is far smaller than a skill response — an order of magnitude cheaper per poll on a long job.

Operating Mode

本模块共 22 个 skill,按 Operation 区分为两类:

  • 18 个 SemiAuto(query / preview / report / job 查询类):batch_query_gameobjects / batch_query_components / batch_query_assets / batch_preview_rename / batch_preview_set_property / batch_preview_replace_material / batch_report_get / batch_report_list / job_status / job_progress / job_logs / job_list / batch_fix_missing_scripts / batch_standardize_naming / batch_set_render_layer / batch_replace_material / batch_validate_scene_objects / batch_cleanup_temp_objects。Approval 模式下可直接执行。
  • 4 个 FullAuto(Execute 类,C# 未标 Mode 走默认 SkillMode.FullAuto):batch_execute / job_wait / job_cancel / batch_retry_failed。Approval 模式下首次调用返 MODE_RESTRICTED,走 grant 协议。
  • Auto / Bypass:两类都直接执行。不含 NeverInSemi 高危 skill(无 Delete/MayEnterPlayMode/MayTriggerReload 标记)。

注意:batch_execute(confirmToken) 本身放行,但它执行的 preview 内容可能包括对场景对象的删除/改属性等高影响动作 —— 请确保 batch_preview_* 返回的 sample/risk 字段已审阅。confirmToken 一次性消费、过期需重新 preview。

Surface profile (guide tier): batch_preview_* stays callable under every profile — a preview is read-only. When the operation a preview minted its confirmToken for lands in a category the active profile withdraws (GameObject / Component / Material under guide), the preview still succeeds and still returns its diff, but adds a surfaceExclusion object (manualDoc, hint, plus blockedSkill/blockedBy/surfaceProfile/category) warning that execute will be refused. At that point batch_execute / batch_retry_failed return SURFACE_EXCLUDED with surfaceProfile/category/operation/manualDoc/userControlled/hint at the top level of the response (not nested under details). The refusal does not consume the confirmToken — switch the profile back to full and the same token still executes, no new preview needed.

DO NOT (common hallucinations):

  • Always call a batch_preview_* skill first — batch_execute requires a confirmToken from a preview, it cannot be called directly
  • batch_run does not exist → use batch_execute(confirmToken)
  • job_poll / job_result do not exist → job_status (or the cheaper GET /jobs/{id}) for state, then the skill named in its resultHint for the payload
  • batch_delete / batch_move do not exist → use asset module for asset-level operations

Routing:

  • For running several different skills in one call → POST /skills/batch (section above), not batch_execute
  • For asset-level bulk operations (move, copy, delete) → asset module
  • For workflow session/task undo tracking → workflow module
  • For scene object validation → batch_validate_scene_objects (this module)
  • For async job polling → job_status / job_wait (this module)

Skills

batch_query_gameobjects

Query GameObjects with unified batch filters. queryJson supports name/path/instanceId/tag/layer/active/componentType/sceneName/parentPath/prefabSource/includeInactive/limit.

ParameterTypeRequiredDefaultDescription
queryJsonstringNonullJSON query filter envelope
sampleLimitintNo20Max sample objects returned

batch_query_components

Query components with unified batch filters. Optional componentType narrows the result.

ParameterTypeRequiredDefaultDescription
queryJsonstringNonullJSON query filter envelope
componentTypestringNonullOptional component type constraint
sampleLimitintNo20Max sample objects returned

batch_query_assets

Query project assets by type, path pattern, and labels. Read-only.

ParameterTypeRequiredDefaultDescription
searchFilterstringNonullRaw Unity AssetDatabase filter string
folderstringNo"Assets"Search root folder
typeFilterstringNonullAsset type (prefix t: optional, e.g. Texture2D)
namePatternstringNonullCase-insensitive regex for filename
labelFilterstringNonullAsset label (prefix l: optional)
maxResultsintNo200Max results returned

batch_preview_rename

Preview batch renaming. mode supports prefix / suffix / replace / regex_replace.

ParameterTypeRequiredDefaultDescription
queryJsonstringNonullJSON query filter envelope
modestringNo"prefix"Rename mode
prefixstringNonullPrefix to add
suffixstringNonullSuffix to add
searchstringNonullPlain text search term
replacementstringNonullPlain text replacement
regexPatternstringNonullRegex search pattern
regexReplacementstringNonullRegex replacement text
sampleLimitintNoDefaultSampleLimitMax preview items

batch_preview_set_property

Preview setting a component property or field across queried targets.

ParameterTypeRequiredDefaultDescription
queryJsonstringNonullJSON query filter envelope
componentTypestringYes-Target component type
propertyNamestringYes-Property or field name
valuestringNonullLiteral value
referencePathstringNonullScene reference path
referenceNamestringNonullScene reference object name
assetPathstringNonullAsset reference path
sampleLimitintNoDefaultSampleLimitMax preview items

batch_preview_replace_material

Preview replacing Renderer materials across queried targets.

ParameterTypeRequiredDefaultDescription
queryJsonstringNonullJSON query filter envelope
materialPathstringYes-Replacement material asset path
sampleLimitintNoDefaultSampleLimitMax preview items

batch_execute

Execute a previously previewed batch operation by confirmToken. Large operations return a jobId.

ParameterTypeRequiredDefaultDescription
confirmTokenstringYes-Preview confirmation token
runAsyncboolNotrueRun as async job
chunkSizeintNo100Batch execution chunk size
progressGranularityintNo10Emit a progressEvent every N items processed

runAsync: true (the default) or an item count above chunkSize returns status: "accepted" plus a jobId — poll it like any other job. Only the inline path (runAsync: false and items ≤ chunkSize) blocks, and its wait is bounded: 50ms per item with a 5s floor and a hard 30s ceiling (the shared main-thread wait cap — the inline wait spin-sleeps on the main thread, so it can never be allowed to freeze the Editor for as long as the item count would imply). When that ceiling hits first, the job is still running: you get success: false with a non-completed status and the jobId, not a frozen Editor. That is not a failure — carry on with job_status / GET /jobs/{id}, and prefer runAsync: true for anything big enough to risk it.

batch_report_get

Get a batch execution report by reportId.

ParameterTypeRequiredDefaultDescription
reportIdstringYes-Batch report identifier

batch_report_list

List recent batch reports.

ParameterTypeRequiredDefaultDescription
limitintNo20Max reports returned

job_status

Get status for an asynchronous UnitySkills job. Built for repeated polling, so the job's result payload is not inlined by default (v2.7+) — a completed test or compile job can carry tens of KB, and polling used to resend all of it every call.

Instead you get two fields:

  • resultAvailable (bool) — whether a payload exists at all.
  • resultHint (string, null when resultAvailable is false) — where to fetch it: test_get_result(jobId) for kind: "test", test_discover_get_result(jobId) for kind: "test_discovery", batch_report_get(reportId=...) for any job that produced a reportId (the hint quotes the id), and for every other kind a note to re-call with includeDetails=true, which is then the only route to that payload.

The details key is still present either way — it is simply null unless you asked for it, so a client reading response["details"] gets null rather than a missing-key error. Set includeDetails=true on the one call where you actually want the data, never on the polling loop.

ParameterTypeRequiredDefaultDescription
jobIdstringYes-Job identifier
includeDetailsboolNofalseInline the full result payload as details instead of resultAvailable / resultHint

job_progress

Get fine-grained progress events for a job via incremental polling. Use offset to fetch only new events since the last call (pass previous totalCount as next offset).

Note: Also exposed as HTTP GET /jobs/{id}/progress and Python client.get_job_progress(job_id, offset) — all three paths share the same response shape.

ParameterTypeRequiredDefaultDescription
jobIdstringYes-Job identifier
offsetintNo0Skip first N events (use previous totalCount for incremental polling)

Response fields: jobId, status, totalCount, offset, events[] (timestamp ms, progress, stage, description), terminal.

An empty events[] is not a malfunction. Fine-grained, per-item progress exists only for batch-executor jobs (rename / set_property / replace_material / set_render_layer / cleanup_temp_objects / fix_missing_scripts / standardize_naming), which emit one event every progressGranularity items because only they own a countable item list. Other kinds emit at most coarse lifecycle events (queued → stage change → terminal), and test_discovery emits none at alltotalCount: 0 there means "this kind has no progress stream", not "the job is stuck". For those, poll status via GET /jobs/{id} instead of watching for events.

job_logs

Get structured logs for a UnitySkills job.

ParameterTypeRequiredDefaultDescription
jobIdstringYes-Job identifier
limitintNo100Max log entries returned

Note: Also exposed as HTTP GET /jobs/{id}/logs?limit=N (server clamps limit to [1, 500]) and Python client.get_job_logs(job_id, limit) — both are the lightweight route (bypasses the skill router and the main-thread skill queue), preferred over the job_logs skill for repeated polling. Response fields: jobId, count, totalCount, logs[] (timestamp, level, stage, message, code).

job_list

List recent UnitySkills jobs.

ParameterTypeRequiredDefaultDescription
limitintNo20Max jobs returned

job_wait

Wait for a UnitySkills job to finish or until timeoutMs elapses. Blocks the Unity main thread while waiting, so timeoutMs is clamped server-side to [0, 2000] regardless of the value you pass — a 10000/60000 request will actually wait at most 2s.

For job kinds whose progress depends on Unity's own engine loop rather than this plugin's own pump (compile, package, test, playmode, play_capture, build_player), blocking this thread cannot make them advance — Unity's compiler/domain-reload, PackageManager Request resolution, TestRunner callbacks, PlayMode state machine, and BuildPipeline all need the main thread free to tick. For those kinds job_wait does not enter a wait loop: it returns the current snapshot immediately with waitNotSupported: true and a hint pointing at the non-blocking alternatives below. Self-driven kinds (batch executor jobs such as rename / set_property / replace_material / set_render_layer / cleanup_temp_objects / fix_missing_scripts / standardize_naming, and test_smoke) still block up to the clamped timeout since each job_wait tick genuinely advances their state.

Recommended pattern for compile/package/test/playmode/play_capture/build_player jobs: poll GET /jobs/{id} every 200-500ms, or long-poll GET /events. GET /jobs/{id} skips the main-thread skill queue (it runs in the light lane, drained every frame and exempt from the frame budget), but it is still answered by the Editor main thread between frames — while a long operation holds that thread, polling stalls and resumes once the thread ticks again. To stay responsive throughout a long job, use GET /events: it is a true HTTP-thread long-poll that never enters the main-thread queue at all.

ParameterTypeRequiredDefaultDescription
jobIdstringYes-Job identifier
timeoutMsintNo2000Wait timeout in milliseconds; clamped to [0, 2000]
includeDetailsboolNofalseInline the full result payload as details instead of resultAvailable / resultHint

Response adds terminal (bool) and waitNotSupported (bool) to the fields listed under job_status; hint is populated only when waitNotSupported is true. Like job_status it reports resultAvailable + resultHint and leaves details null unless you pass includeDetails=true — same semantics, same key set.

job_cancel

Cancel a UnitySkills job if the job supports cancellation.

ParameterTypeRequiredDefaultDescription
jobIdstringYes-Job identifier

batch_fix_missing_scripts

Preview batch removal of missing scripts. Execute with batch_execute(confirmToken).

ParameterTypeRequiredDefaultDescription
queryJsonstringNonullJSON query filter envelope
sampleLimitintNoDefaultSampleLimitMax preview items

batch_standardize_naming

Preview standardizing names by trimming whitespace and normalizing separators. Execute with batch_execute(confirmToken).

ParameterTypeRequiredDefaultDescription
queryJsonstringNonullJSON query filter envelope
separatorstringNo"_"Replacement separator
sampleLimitintNoDefaultSampleLimitMax preview items

batch_set_render_layer

Preview setting GameObject layers in batch. Execute with batch_execute(confirmToken).

ParameterTypeRequiredDefaultDescription
queryJsonstringNonullJSON query filter envelope
layerstringYes-Target layer name (must already exist in Tags & Layers)
recursiveboolNofalseApply recursively to children
sampleLimitintNoDefaultSampleLimitMax preview items

batch_replace_material

Preview replacing materials in batch. Execute with batch_execute(confirmToken).

ParameterTypeRequiredDefaultDescription
queryJsonstringNonullJSON query filter envelope
materialPathstringYes-Replacement material asset path
sampleLimitintNoDefaultSampleLimitMax preview items

batch_validate_scene_objects

Analyze scene objects for missing scripts, missing references, duplicate names, and empty objects.

ParameterTypeRequiredDefaultDescription
issueLimitintNo100Max issues returned

batch_cleanup_temp_objects

Preview deleting temporary helper objects by common temp-name patterns. Execute with batch_execute(confirmToken).

ParameterTypeRequiredDefaultDescription
queryJsonstringNonullJSON query filter envelope
patternsCsvstringNonullComma-separated temp-name patterns
sampleLimitintNoDefaultSampleLimitMax preview items

batch_retry_failed

Re-run only the failed items from a previous batch execution report. Returns a new jobId and originalReportId.

ParameterTypeRequiredDefaultDescription
reportIdstringYesPrior batch report ID to resume from
runAsyncboolNotrueWhether to run asynchronously (returns jobId)
chunkSizeintNo100Chunk size per retry batch

Exact Signatures

Exact names, parameters, defaults, and returns are defined by GET /skills/schema or unity_skills.get_skill_schema(), not by this file.

Frequently asked questions

What does the Unity Batch AI skill do?

Unified batch and async-job orchestration

Why use Unity Batch on TypingMind?

Because you install it once and use it with any model. Unity Batch is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Unity Batch in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Besty0728/Unity-Skills/tree/main/SkillsForUnity/unity-skills~/skills/batch. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Unity Batch?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Unity Batch?

As many as you like. As long as a model supports skills, you can use Unity Batch with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Unity Batch AI skill free?

Yes. It is published on GitHub by Besty0728 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇