script-update-or-create

Writes C# script files in Unity with Roslyn syntax validation before saving.

Updated May 27, 2026
One-click install
npx skills add https://github.com/AdielMag/ClashUp --skill script-update-or-create-adielmag
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: script-update-or-create
Source: https://github.com/AdielMag/ClashUp/tree/main/client/ClashUp.Unity/.claude/skills/script-update-or-create
Command: npx skills add https://github.com/AdielMag/ClashUp --skill script-update-or-create-adielmag

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires unity-mcp-cli.

What problem does it solve? Writing or updating Unity C# scripts blindly risks saving syntactically invalid code that breaks compilation and leaves the project in a broken state. This Skill validates C# syntax via Roslyn before writing, so invalid code is rejected with error details and the existing file is left untouched. ## Core Features & Use Cases - Validated Script Writing: Creates or overwrites .cs files only after the content passes ScriptUtils.IsValidCSharpSyntax checks. - Automatic Directory Creation: Creates any missing parent directories for the target file path. - Post-Compilation Notification: Calls AssetDatabase.Refresh() and delivers the final result via requestId after Unity finishes recompiling. - Use Case: When refactoring a Unity gameplay script, provide the new C# content and receive compilation error details if the code is invalid, or confirmation once Unity finishes the recompile. ## Quick Start Ask the assistant to update the file Assets/Scripts/PlayerController.cs with your new C# code using the script-update-or-create tool.

Frequently Asked Questions about script-update-or-create

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create or update a Unity C# script from the command line?▼

Run unity-mcp-cli with the script-update-or-create tool, passing a filePath like Assets/Scripts/MyScript.cs and the C# content as JSON. The tool validates syntax, writes the file, and refreshes the Unity AssetDatabase.

What happens if the C# code has syntax errors?▼

The code is validated with Roslyn via ScriptUtils.IsValidCSharpSyntax before writing. If validation fails, the write is rejected, error details are returned, and the existing file on disk is left untouched.

Does the tool wait for Unity to finish compiling?▼

Yes. After writing the file it calls AssetDatabase.Refresh and schedules a post-compilation notification, delivering the final result through the requestId once Unity completes the recompile.

What should I do if unity-mcp-cli is not found?▼

Install it globally with npm install -g unity-mcp-cli, or invoke it through npx unity-mcp-cli. The unity-initial-setup skill contains detailed installation instructions.

Can it create scripts in folders that do not exist yet?▼

Yes. The tool automatically creates any missing parent directories for the specified filePath before writing the .cs file, so nested folder structures under Assets are supported.