unity-script
Create, read and analyze C# scripts
How do I install this agent skill?
npx skills add https://github.com/besty0728/unity-skills --skill unity-scriptIs this agent skill safe to install?
- Gen Agent Trust Hubpass
The skill provides comprehensive tools for managing Unity C# scripts, including reading, writing, and compilation monitoring. It includes an indirect prompt injection surface typical for code-editing tools and uses local shell commands for integration with the Unity Editor.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
- Runlayerpass
1 file scanned · No issues
What does this agent skill do?
When to use
- Authoring or editing C# code
- Searching across scripts
- Refactoring file layout
- Checking compile errors
Unity Script Skills
Create, edit, move and inspect C# scripts and get their compile result. Parameters come from the schema (recommend includeSchema=true or /skills/schema?names=), which notes the non-obvious ones — never from a skill's name. Execution and dryRun rules: root SKILL.md.
Rules
- All seven writers (
script_create,script_create_batch,script_replace,script_append,script_rename,script_move,script_delete) trigger a domain reload and are high-risk, so Approval and Auto refuse them withMODE_FORBIDDEN. Do not request a grant for them.
Compile and reload
- Every write returns at once:
{success, status: "accepted", path, jobId, waitUrl, serverAvailability}; compilation follows, and the server is briefly unreachable during the domain reload. - One call gets the compile result: GET the returned
waitUrl(/jobs/<jobId>?wait=90&expectInstance=<instanceId>, already pinned to this Editor), addingexpectProject, e.g.curl -s --retry 20 --retry-connrefused --retry-all-errors --retry-delay 2 "http://localhost:<port><waitUrl>&expectProject=<project>". It answers once compilation settles: jobstatuscompleted, orfailedon compile errors, with diagnostics inresultData.compilation(isCompiling,hasErrors,errorCount,errors: [{type, message, file, line}]). During the reload it may refuse or return503: repeat the same URL;waitTimedOut: truemeans GET it again. script_get_compile_feedback(scriptPath)returns the same diagnostics on demand. Fix errors first:component_addfinds a new MonoBehaviour only after a clean compile.checkCompile: falseskips the diagnostics;diagnosticLimitcaps them (default 20).
Shared rules
scriptNameis the file and class name, without.csor path separators. Paths (folder,scriptPath,newFolder) are project-relative, starting withAssets/orPackages/; a missing folder is created. An existing file is never overwritten (Script already exists).script_createwritescontentverbatim when given (thentemplate/namespaceNameare ignored, with a warning); otherwise it fills a template —MonoBehaviour(default),ScriptableObject,Editor,EditorWindow(the last two default toAssets/Editor) — wrapped innamespaceNameif set. Any other bare name is rejected (validValueslists these four); text containing code stays a literal template with{CLASS}/{NAMESPACE}filled, but usecontentfor custom classes. A MonoBehaviour or ScriptableObject binds to its file only when the class name equals the file name; content declaring no such type gets a warning.- 2+ new scripts →
script_create_batch: one domain reload instead of N.
Skills Overview
- Write:
script_create,script_create_batch,script_replace(find/replace, plain or regex),script_append(insert lines),script_rename(file only; the class inside is not renamed),script_move(creates the destination folder),script_delete. - Read:
script_read,script_list,script_find_in_file(plain or regex, per line),script_get_info(class, base class, public members),script_get_compile_feedback.
Per-skill tables and return shapes: reference/<skill_name>.md — rarely needed, the schema notes the parameters.
Pitfalls
script_editandscript_updatedo not exist. Usescript_replacefor find and replace.script_writedoes not exist. Usescript_createfor a new file, orscript_replaceto modify one.- API analysis of a compiled script is
script_analyzein the perception module.
Errors
| Error | Trigger → fix |
|---|---|
MISSING_PARAM | e.g. scriptName, pattern, find, newName → supply it; the error (or a dryRun) lists all parameters. |
SEMANTIC_INVALID | Path separators in scriptName / newName, a path outside Assets/ / Packages/, or the script already exists → fix the name or path, or rename/move the existing file. |
TARGET_NOT_FOUND | Script, MonoScript or folder missing → find the right scriptPath with script_list / asset_find. |
SKILL_ERROR | A filesystem or AssetDatabase move/rename/delete failed → read the message, resolve it, retry. |
Transport codes (COMPILING, RATE_LIMIT, ...) → error codes.
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/besty0728/unity-skills/unity-script">View unity-script on skillZs</a>