unity-script

unity-script is a skill for Claude Code, Codex from batihandev/unity-mcp-skills. It costs 25 tokens per session (665 once invoked), scanned A, original, MIT.

A set of Unity tools for managing C# scripts, the files that contain much of a Unity project’s game or editor logic.

In plain words
What is it for?
It is for creating, listing, searching, editing, validating, hashing, and deleting C# scripts under a Unity project’s Assets folder.
Why use it?
It helps make structured script changes and catch compile errors while handling Unity’s reload and diagnostic steps correctly.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/batihandev/unity-mcp-skills/script
Any agent
npx skills add batihandev/unity-mcp-skills --skill script
Clone the repo
git clone --depth 1 https://github.com/batihandev/unity-mcp-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for unity-script

README.md
[![agentmods](https://agentmods.dev/badge/skills/batihandev/unity-mcp-skills/script.svg)](https://agentmods.dev/skills/batihandev/unity-mcp-skills/script)
Your own site
<a href="https://agentmods.dev/skills/batihandev/unity-mcp-skills/script"><img src="https://agentmods.dev/badge/skills/batihandev/unity-mcp-skills/script.svg" alt="Measured on agentmods" height="20"></a>
Per session 25 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 665 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00025 $0.00665
Opus 5 $0.00013 $0.00332
Sonnet 5 $0.00005 $0.00133
Haiku 4.5 $0.00003 $0.00067

Measured 3d ago against content hash 168dc0eba2b5, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

unity-script scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/script/SKILL.md · 48 lines

How it starts

The opening of the file, as written. The whole thing — 48 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Script Management

Do not use Unity_RunCommand for script operations. The Unity MCP server exposes dedicated tools for every common script operation. Use them directly — they handle Domain Reload coordination and diagnostics natively.

Routing

Operation Tool Typical use
Create a new C# script Unity_CreateScript Writes a new file under Assets/; sets up the MonoBehaviour/ScriptableObject/Editor template.
Delete a C# script Unity_DeleteScript By URI (unity://path/...) or by Assets/... path.
List script files Unity_ListResources Commonly filtered to *.cs under Assets/.
Search inside a script Unity_FindInFile Regex-level matches with line numbers.
Structured edits Unity_ScriptApplyEdits Method-level replace / insert / remove. Prefer this over raw text edits.
Syntax + diagnostics check Unity_ValidateScript Call before and after edits; surfaces compile errors before they trigger a Domain Reload.
Hash for concurrency Unity_GetSha Compare against your expected hash to detect conflicting edits before writing.

Install-once Editor scripts (screenshot helpers, custom Editor windows, build steps, exporters): check ../tooling/SKILL.md for ready-to-paste templates before writing one from scratch.

Filename must match class name

The .cs filename (without extension) must exactly match the top-level class name. Unity's asset database relies on the 1:1 mapping — mismatches silently break MonoBehaviour attachment and asset references.

  • When creating a script, pass the scriptName without .cs.
  • When renaming a class, rename the file in the same operation.

Domain Reload coordination

After any script create / edit / delete, Unity triggers a Domain Reload (compilation + assembly swap). Tools return a compilation block where applicable — check it before issuing the next operation.

  1. If the response reports isCompiling: true, wait for it to settle before the next script edit.
  2. Once compilation completes, call Unity_ValidateScript on the affected file to surface any errors.
  3. Group related edits in a single task where possible — fewer edits = fewer Domain Reloads.

Read the full file on GitHub · 48 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 48 lines · 25 tokens per session scan A 168dc0eba2b5

Subscribe to this mod's changes

unity-script is a skill published in the GitHub repository batihandev/unity-mcp-skills (5 stars, last pushed 1mo ago), licensed MIT. It adds 25 tokens to every session and 665 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

unity-csharp

写 Unity C# 时使用。生命周期、协程、GC、性能、序列化的实战规范。.

Wade-DevCode/awesome-coding-skills-cn · 28 tokens

google-mobile-ads-banner

Provides instructions to implement, integrate, or configure Google Mobile Ads (GMA) banner ads in Android, iOS, or Unity mobile applications. Use when the task involves setting up banner ads in a mobile application. Don't use for other ad formats like interstitial or rewarded ads.

google/skills · 62 tokens

google-mobile-ads-interstitial

Provides instructions for implementing, integrating, or configuring Google Mobile Ads (GMA) SDK interstitial ads in Android, iOS, or Unity mobile applications. Use when the task involves setting up interstitial ads. Don't use for "rewarded interstitial" ads.

google/skills · 60 tokens

google-mobile-ads-rewarded

Provides instructions for implementing, integrating, or configuring Google Mobile Ads (GMA) SDK rewarded ads in Android, iOS, or Unity mobile applications. Use when the task involves setting up rewarded ads. Don't use for "rewarded interstitial" ads.

google/skills · 59 tokens

google-mobile-ads-get-started

Provides instructions for integrating the Google Mobile Ads (GMA) SDK. Use this skill when the user wants to get started with, install, integrate, set up, or configure the SDK for AdMob or Ad Manager, GMA Next-Gen SDK or mobile ads framework in an Android, iOS, or Unity application.

google/skills · 73 tokens

ai-navigation

Use when implementing AI movement — NavigationAgent2D/3D, steering behaviors, behavior trees, and patrol patterns.

jame581/GodotPrompter · 26 tokens