Unity-Skills
AGENTS.md1.8k starsChanged 2 months agoMITView on GitHub
Audience: agents editing this repository. Agents calling the REST API read SkillsForUnity/unity-skills~/SKILL.md instead — that file is the shipped protocol doc (8,192-byte hard cap; new content goes under references/) and the authoritative description of operating modes, permission endpoints, batch/diff semantics and observability. Read it before touching anything the client sees. AI agent → unity_skills.py → HTTP localhost:8090-8100 → SkillsHttpServer (producer-consumer) → SkillRouter (reflects [UnitySkill]) → 56 *Skills.cs / 54 SkillCategory / 805 skills. WorkflowManager = persistent undo/rollback, RegistryService = multi-instance…
Trending
More talk lately.thin dataabout the whole repository
Who's talking about Besty0728/Unity-Skills
- sudosubin/agents.nix“agent-skills.github.besty0728.unity-skills: init at 2.9.0”GitHub · Oct 3, 2026
- GreatSaiyaDave/ProjectARGON“Install UnitySkills Cursor skill and Editor package”GitHub · Sep 7, 2026
The biggest 2 of 2 mentions linking to the repository that our crawl found. Each line is their own headline.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- CLAUDE.mdCLAUDE.md
The file
We split this AGENTS.md into the rules it gives an agent
5 rules. About 0 are common, 0 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 33
No IMGUI (OnGUI, EditorGUILayout, GUILayout, OnInspectorGUI).
- Very specific: line 39
No emoji icons (Unity 2022 editor font cannot render them).
- Very specific: line 79
All UI text lives in Editor/Locales/{en,zh-CN,ru}.json, read via SkillsLocalization.Get(key[, args]).
- Very specific: line 80
Every non-ASCII character in Editor/UI/, Editor/Skills/Localization.cs and Editor/Locales/*.json must already exist in the …
- Very specific: line 88
Every script ends with a blank line then // Producer:Betsy (# Producer:Betsy in Python) and a newline.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
UnitySkills — instructions for AI agents developing this repo
Audience: agents editing this repository. Agents calling the REST API read SkillsForUnity/unity-skills~/SKILL.md instead — that file is the shipped protocol doc (8,192-byte hard cap; new content goes under references/) and the authoritative description of operating modes, permission endpoints, batch/diff semantics and observability. Read it before touching anything the client sees.
| Field | Value |
| Version | 2.9.0 |
| Stack | C# Unity Editor plugin (UPM com.besty.unity-skills) + Python client |
| Unity | 2022.3+, verified on 6000.x |
| License | MIT |
Architecture
AI agent → unity_skills.py → HTTP localhost:8090-8100 → SkillsHttpServer (producer-consumer) → SkillRouter (reflects [UnitySkill]) → 56 *Skills.cs / 54 SkillCategory / 805 skills. WorkflowManager = persistent undo/rollback, RegistryService = multi-instance discovery. 56 vs 54: BatchSkills.cs registers into Workflow + Validation, DiagnoseSkills.cs into Debug. The per-category table lives in README.md; /skillcheck keeps every count in sync — do not hand-edit counts.
- Threading (hard rule): the HTTP thread only enqueues; the Unity main thread drains the queue from
EditorApplication.update. ZeroUnityEngine.*/UnityEditor.*calls off the main thread. - Every request, including GET
/health/jobs/{id}/skills, goes through that main-thread queue (≤20 per tick). A skill that blocks the main thread also freezes liveness; the Python client pollsGET /jobs/{id}instead ofjob_waitfor this reason. - No auth + wildcard CORS is intentional (loopback bind is the accepted boundary). Do not report "add auth / tighten CORS / validate Origin" as a security finding.
- Optional-package modules (ProBuilder, XR, Netcode, YooAsset, DOTween, PrimeTween, Behavior, HybridCLR, Addressables, QFramework) detect their dependency and return
MISSING_PACKAGE; URP-family modules (Volume/PostProcess/Decal/URP) compile to same-namedNoURP()stubs withoutcom.unity.render-pipelines.universal. QFramework has no UPM package, so detection is by reflected anchor type and it must not declareRequiresPackages. - Optional-package behavior is tested for real in
Tests/Editor/OptionalPackages/: one fixture per module onOptionalPackageTestBase(skills called by name, state read back by reflection, fixture ignored when the probe skill's package is missing), with per-module floors of passed tests in.github/optional-package-floors.json; a new optional module adds a fixture and a floor. Package code that needs a built-in module (NGO'sNetworkRigidbody2Dneeds physics2d) mirrors the package'sCOM_UNITY_MODULES_*versionDefines, or a project without that module fails to compile the whole package. - 28 advisory modules under
unity-skills~/skills/are documentation only: no REST skills, no C# stub, ever.
Key files (SkillsForUnity/Editor/):
Skills/:SkillsHttpServer.cs,SkillRouter.cs,SkillPlanningService.cs(/plan + dryRun engine, not a skill) — each is apartialclass split by concern into<Class>.<Area>.cs(e.g.SkillsHttpServer.Batch.cs,SkillRouter.Gates.cs); fields with initializers and the static constructor stay in the main file, since static initializer order across partial files is unspecified;UnitySkillAttribute.cs,SkillErrorResponse.cs+SkillErrorCode.cs,SkillsLogger.cs(single source ofVersion),SkillsModeManager.cs,SkillsAuditLog.cs,ConfirmationTokenService.cs,WorkflowManager.cs,RegistryService.cs,GameObjectFinder.cs,BatchExecutor.cs,SkillInstaller.cs,AgentInstructionService.cs,UnityCliService.cs,ClientProcessResolver.cs(caller identity via TCP port → PID → parent chain),*Skills.cs×56.Locales/{en,zh-CN,ru}.json: all UI strings.Versioning/: self-update. Only files here may nameLocalGitSync/GitCliRunner; the UI usesLocalSelfUpdateService(Check/Start,ShortSha,MaxListedEntries, theLocalUpdate*result types), enforced bySelfUpdateBoundaryTests.UI/:UnitySkillsWindow.{cs,uxml,uss},Controllers/*.cs,Tabs/*.uxml,EditorUiScheduler.cs,ShortcutActions.cs,UISkillsFontIncrementalUpdater.cs,AuditLogWindow,AllowlistPickerWindow,UnityCliWindow.SkillsForUnity/unity-skills~/: shipped template —SKILL.md,scripts/unity_skills.py,skills/(82 module docs: 54 REST + 28 advisory),references/(protocol docs, Unity manual URL indexes,windows.mdPowerShell / Git Bash guide).
Rules
Editor UI — UI Toolkit only
- No IMGUI (
OnGUI,EditorGUILayout,GUILayout,OnInspectorGUI). New UI =.cs + .uxml + .ussinEditor/UI/, loaded viaPackages/com.besty.unity-skills/Editor/UI/...path constants; inCreateGUI()add the USS thenCloneTree; query nodes withrootVisualElement.Q<T>("name"). - Periodic refresh only via
EditorUiScheduler.RepeatSafe(element, ms, body). Never bareschedule.Execute().Every()mutating the tree (issue #44: throws during repaint and loops) and neverEditorApplication.updatepolling. Expensive data refreshes on tab activation / button / value change, not on the tick. - One controller per UXML subtree:
XxxController(VisualElement root, EditorWindow owner); the window only assembles. New tab =Tabs/X.uxml(+.metawith fresh GUID) +Controllers/XTabController.cs+ oneMainTabDefinitionappended toUnitySkillsWindow.MainTabs. CopyHistoryTabController, the smallest complete example. [MenuItem("Window/UnitySkills")]is a leaf and must stay the only item under that prefix (Unity swallows a leaf that coexists with a submenu). Secondary panels open via in-panel buttons + shortcuts only.- Shortcuts: a
[Shortcut]static method inEditor/UI/ShortcutActions.csplus aCommandsentry; unbound by default; bindings live in ShortcutManager, not EditorPrefs. - Styling only via USS classes and
var(--color-*)tokens fromUnitySkillsWindow.uss:root(add a.unity-theme-lightvalue for every new color). Visibility viaUiVisibility.SetVisible(element, bool), neverstyle.displayor inlinedisplay:nonein UXML. Inline styles only for runtime-computed values (font asset, viewport-derived width, data-driven flexGrow, loaded textures). - No emoji icons (Unity 2022 editor font cannot render them); use USS geometry or
UISkillsEditorIcons. - Settled topbar decisions (2026-09-06), not regressions: status dot visible at every width; settings gear pinned top-right; narrow-mode bulb is vector geometry.
Skills
[UnitySkill("skill_name", "First sentence is for the AI; mention parameters.",
Category = SkillCategory.GameObject, Operation = SkillOperation.Create, // combine with |
Tags = new[] { "primitive" }, Outputs = new[] { "instanceId", "path" },
TracksWorkflow = true, MutatesScene = true, RiskLevel = "medium")] // low/medium/high
public static object SkillName(string name, float x = 0f) { ... }- Required: name, description,
Category,Operation. Strongly recommended:Tags,Outputs;TracksWorkflow=trueon writers; risk flags (MutatesScene,MayTriggerReload,MayEnterPlayMode, …) filled truthfully —Outputsmust be a subset of what the method actually returns. Modedefaults toFullAuto; declareSemiAutoonly for pure reads with zero side effects.Operation.Delete,MayEnterPlayMode,MayTriggerReload, orRiskLevel="high"auto-classify as NeverInSemi. Permission gating, audit, allowlists and confirmation tokens are framework concerns driven by metadata — never write authorization logic inside a skill.- Business errors return
SkillErrorResponse.Build(code, msg, ...)(structurederrorCode/suggestedFixes/retryStrategy); only unknown framework errors may throw. - Validation:
if (Validate.Required(x, "x") is object err) return err;. - Writers register Undo and call
WorkflowManager.SnapshotXxx(...)whenTracksWorkflow=true.SnapshotType= Modified/Created/Deleted/Moved/Setting; settings restore throughWorkflowSettingRestorerRegistry; file +.metaare content-addressed (fileHash/metaFileHash, schemaVersion 5); cleanup never deletes referenced blobs; limit0= unlimited. - Provide
xxxandxxx_batchpairs; batch usesBatchExecutor.Execute<TItem>(items, perItem, idFn). - New module:
SkillCategoryenum entry +XxxSkills.cs+unity-skills~/skills/<module>/SKILL.md; reflection discovers the methods. Run/skillcheckafterwards. - Never write a regression test whose failure mode installs a package, compiles scripts or enters Play Mode: a regressed guard would change the project running the test (round6: a red run of a
package_install_cinemachineguard installed Cinemachine into the dev project). Test such guards through an internal seam, or not at all.
Shared helpers — do not reimplement
| Need | Use | Not |
| Find GameObject | GameObjectFinder.FindOrError(name, instanceId, path) | GameObject.Find |
| Validate params | Validate.Required / Validate.RequiredJsonArray | hand-written if-chains |
| Batch | BatchExecutor.Execute<T> | manual loops |
| JSON | SkillsCommon.JsonSettings (Newtonsoft) | JsonUtility, ad-hoc settings |
| Optional packages | XxxReflectionHelper.cs + DOTweenPresenceDetector pattern | direct type references |
| Async | AsyncJobService / BatchJobService | own Task/Thread |
| Scene-wide find | FindHelper.FindAll<T>() | FindObjectsOfType |
| Periodic UI | EditorUiScheduler.RepeatSafe | bare scheduler / EditorApplication.update |
Constants, logging, prefs, compatibility
- Version comes only from
SkillsLogger.Version; never hardcode a version literal. Bump versions only through/updateversion. - Log only via
SkillsLogger.{Log,LogWarning,LogError,LogVerbose,LogAgent}withPREFIX_*colors; neverDebug.Log*. - Startup policy (owner decision): a normal editor launch / domain reload prints exactly one Info line. New startup diagnostics are Verbose; a startup Warning must correspond to a real failed action (e.g. port fallback), never a pre-emptive scan.
- EditorPrefs keys are prefixed
UnitySkills_. - Wrap Unity 6 APIs in
#if UNITY_6000_0_OR_NEWER/#else(seeFindHelper); prefer 2022.2+ non-obsolete events. Namespaces:UnitySkillsfor features,UnitySkills.Internalfor helpers.
Localization and font atlas
- All UI text lives in
Editor/Locales/{en,zh-CN,ru}.json, read viaSkillsLocalization.Get(key[, args]). No string dictionaries or UI literals in.cs. The three JSON files must have identical key sets. - Every non-ASCII character in
Editor/UI/**,Editor/Skills/Localization.csandEditor/Locales/*.jsonmust already exist in theUnitySkillsCN-UI.assetatlas (UISkillsFontTestsenforces it; the scanner reads raw text, so comments count). Check the atlas before adding CJK; in tooling use\uXXXXescapes. - Never run
UISkillsFontAssetBaker.Bake(bundled TTF has no Cyrillic, atlas does; bake always fails). Add glyphs only withUISkillsFontIncrementalUpdater.AddMissingGlyphs(string)from a throwaway MenuItem viaeditor_execute_menu, then delete the scaffold. Verify afterwards: added set == intended, nothing removed, character count == glyph count, no glyph index shared by two characters,UISkillsFont.IsPersistentAndComplete()true. - Russian copy must avoid uppercase U+0426 U+0427 U+0428 U+0429 U+042A U+042C and U+0401; reword instead.
Comments, encoding, file tail
- Source comments are English. Chinese only when quoting UI copy, an upstream message, or a localization key, inside quotes. Chinese inside string literals is product output — leave it.
.cs/.pyare UTF-8 with BOM, code starting right after it (except the shippedunity-skills~/scripts/unity_skills.py, which starts with its shebang)..md/.uxml/.uss/.metahave no BOM.- A new
.metais a byte copy of a sibling's (Unity's full importer form, trailing spaces and final newline included) with a fresh uuid4 GUID: Unity 2022 rewrites a hand-written two-line.metaon first import, which dirties git-clone installs and makes the local self-update refuse. - Every script ends with a blank line then
// Producer:Betsy(# Producer:Betsyin Python) and a newline.
Workflow and commands
Commands are prompt files under .claude/commands/; agents without slash commands read the file and follow it.
/skillcheck(.claude/commands/skillcheck.md) — C# ↔skills/*/SKILL.mdconsistency audit and skill-count sync acrossAGENTS.md, README×2 and the rootSKILL.md. Run after adding, renaming or removing any skill./metacheck(.claude/commands/metacheck.md) —.metaGUID audit; run after adding assets or.metafiles./updateversion <MAJOR.MINOR.PATCH>(.claude/commands/updateversion.md) — bumps the declared version anchors and writes the CHANGELOG entry; verifies with.github/scripts/check_project_version.py. Never search-and-replace version numbers globally./release [version](.claude/commands/release.md) — candidate matrix → beta/main sync → tag → stable GitHub Release. Develop onbeta;mainis linear, no merge commits.betaandmainrun parallel: Star History chart commits land onmainonly, never sync them intobeta;/releasedrops them when it movesmain. Never move or re-publish a released tag: users install by#vX.Y.Z, so fix forward with a new number.- Domain reload makes the REST server briefly unreachable (503/504 with diagnostics); clients retrying is expected. Do not modify the server to hide it.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

