Logo von Unity Batch

Unity Batch

CommunityBeliebt
Besty0728
unity-batch

Unified batch and async-job orchestration

Übersicht

HerausgeberBesty0728
RepositoryUnity-Skills
Skill-Nameunity-batch
Sterne
1.8K
Forks
164
Mitgelieferte Dateien
Nur Anweisungen
LizenzMIT
Links
  • Anweisungen in Markdown

    Eine SKILL.md-Datei, die das Modell bei Bedarf lädt. So werden nur dann Token verbraucht, wenn eine Anfrage tatsächlich dazu passt.

  • Funktioniert mit jedem LLM

    KI-Skills bestehen aus reinem Markdown, nicht aus anbieterspezifischem Code. Daher funktionieren sie mit GPT, Claude, Gemini, Grok oder einem lokalen Modell.

  • In sich abgeschlossen

    Alles, was das Modell braucht, steht in den Anweisungen — keine zusätzlichen Dateien zum Synchronisieren.

  • Open Source

    Von Besty0728 auf GitHub veröffentlicht. Prüfen Sie den Quellinhalt vor der Installation.

Installation

Installieren Sie den KI-Skill Unity Batch in TypingMind, um ihn mit jedem LLM zu nutzen, oder fügen Sie ihn einem anderen Agenten hinzu, der SKILL.md lesen kann.

1

In TypingMind installieren

TypingMind installiert einen Skill direkt aus seinem GitHub-Ordner — liest SKILL.md, bündelt die Ressourcendateien und speichert das Ergebnis lokal.

  1. Öffnen Sie die App und gehen Sie zu Plugins → Skills.
  2. Wählen Sie „Von GitHub installieren“.
  3. Fügen Sie die unten angegebene URL des Skill-Ordners ein und bestätigen Sie.
    https://github.com/Besty0728/Unity-Skills/tree/main/SkillsForUnity/unity-skills~/skills/batch
  4. Aktivieren Sie den Skill in jedem Chat, in dem er verfügbar sein soll.
Plugins → Skills → Skill anlegen → Über GitHub-URL. Fügen Sie dann die Ordner-URL ein und klicken Sie auf „Weiter“.

In TypingMind verwenden

Aktivieren Sie Unity Batch in einem beliebigen Chat in TypingMind. Den Rest übernimmt das Modell. Name und Beschreibung des Skills stehen im System-Prompt. Sobald eine Anfrage passt, lädt das Modell selbstständig die vollständigen Anweisungen — Sie müssen den Skill nie manuell aufrufen, und er verbraucht erst Token, wenn er tatsächlich genutzt wird.

Das Modell lädt Unity Batch automatisch, sobald eine passende Anfrage gestellt wird.

Funktioniert mit jedem KI-Modell

KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher ist Unity Batch nicht an das Modell gebunden, für das der Skill geschrieben wurde. Installieren Sie ihn einmal in TypingMind und nutzen Sie ihn mit GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder einem selbst betriebenen lokalen Modell — alles mit Ihren eigenen API-Keys.

  • Wird nur bei Bedarf geladen

    Der System-Prompt enthält nur den Namen und die Beschreibung. Die Anweisungen werden bei der ersten passenden Anfrage geladen. Ein ungenutzter Skill verursacht daher keine Kosten.

  • Modell im laufenden Chat wechseln

    Da der Skill aus Anweisungen statt aus Code besteht, funktioniert er auch nach einem Modellwechsel — das nächste Modell liest dieselbe SKILL.md-Datei.

Skill-Anweisungen

Dies ist der Inhalt von SKILL.md, den das Modell lädt. Lesen Sie ihn vor der Installation — ein Skill besteht aus Anweisungen, denen Ihr Modell folgt.

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 all — totalCount: 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
reportIdstringYes—Prior 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.

Häufig gestellte Fragen

Was macht der KI-Skill Unity Batch?

Unified batch and async-job orchestration

Warum Unity Batch in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. Unity Batch besteht aus reinem Markdown statt aus anbieterspezifischem Code. So funktioniert derselbe Skill mit GPT-5, Claude, Gemini, Grok oder einem lokalen Modell – und Sie können das Modell mitten im Chat wechseln, ohne dass der Skill seine Funktion verliert. TypingMind verwendet Ihre eigenen API-Schlüssel. Sie bezahlen die Anbieter daher direkt statt über ein Abonnement pro Nutzerplatz, und Ihre Skills und Chats bleiben in Ihrem eigenen Speicher.

Wie installiere ich Unity Batch in TypingMind?

Öffnen Sie in TypingMind Plugins → Skills → Von GitHub installieren und fügen Sie https://github.com/Besty0728/Unity-Skills/tree/main/SkillsForUnity/unity-skills~/skills/batch ein. TypingMind liest die Datei SKILL.md und installiert den Skill, den Sie für jeden Chat einzeln aktivieren können.

Welche KI-Modelle können Unity Batch nutzen?

Jedes Modell, das Sie in TypingMind verbinden. KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher können GPT, Claude, Gemini, Grok und lokale Modelle diesen Skill laden, wenn eine Anfrage dazu passt.

Wie viele KI-Modelle kann ich mit Unity Batch verwenden?

So viele Sie möchten. Solange ein Modell Skills unterstützt, können Sie Unity Batch damit verwenden – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama und weitere – alles in TypingMind mit Ihren eigenen API-Schlüsseln.

Ist der KI-Skill Unity Batch kostenlos?

Ja. Der Skill wird von Besty0728 auf GitHub unter der Lizenz MIT veröffentlicht. Sie bezahlen nur Ihren eigenen KI-Anbieter für die verwendeten Token.

Was sind KI-Skills?

Ein KI-Skill ist ein wiederverwendbares Anweisungspaket, das einem KI-Modell vermittelt, wie es eine bestimmte Aufgabe erledigt. Es folgt dem offenen Format Agent Skills: eine Datei namens SKILL.md mit einem Namen und einer Beschreibung sowie allen Skripten, Vorlagen oder Referenzdateien, die das Modell möglicherweise benötigt. Das Modell liest die Anweisungen nur, wenn Ihre Anfrage zum Skill passt. Ein installierter Skill verursacht daher erst Kosten, wenn er verwendet wird.

Wie unterscheiden sich KI-Skills von Plugins oder MCP-Servern?

Ein Plugin oder MCP-Server stellt einem Modell neue aufrufbare Tools bereit – Code, der auf einem System ausgeführt wird und ein Ergebnis zurückgibt. Ein KI-Skill vermittelt dem Modell stattdessen Wissen und Vorgehensweisen: wie es eine Aufgabe angeht, welche Schritte es befolgt und wie eine gute Ausgabe aussieht. Skills bestehen aus reinem Markdown und benötigen daher weder Server noch API-Schlüssel oder Laufzeitumgebung. Sie funktionieren mit jedem Modell.

Alle

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇