script-update-or-create

Creates or updates Unity C# script files and reports compilation errors.

Updated May 28, 2026
One-click install
npx skills add https://github.com/ishaansingh-ai/Mechanical-2D --skill script-update-or-create-ishaansingh-ai
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: script-update-or-create
Source: https://github.com/ishaansingh-ai/Mechanical-2D/tree/main/.claude/skills/script-update-or-create
Command: npx skills add https://github.com/ishaansingh-ai/Mechanical-2D --skill script-update-or-create-ishaansingh-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires unity-mcp-cli.

What problem does it solve? Editing Unity C# scripts from an AI assistant normally requires manual file writes and a separate editor refresh to surface compile errors. This Skill writes the script file, triggers AssetDatabase.Refresh(), and returns compilation error details in one step. ## Core Features & Use Cases - Script Creation and Update: Write new C# files or overwrite existing ones at any path under the Unity project, such as Assets/Scripts/MyScript.cs. - Automatic Asset Refresh: Runs AssetDatabase.Refresh() after writing so Unity immediately recompiles the changed code. - Compilation Feedback: Returns syntax and compilation error details so the AI can fix issues iteratively. - Use Case: Ask the assistant to implement a new MonoBehaviour for player movement; it writes the .cs file, refreshes the Unity AssetDatabase, and reports any compile errors for correction. ## Quick Start Use the script-update-or-create tool to write my C# code to Assets/Scripts/PlayerController.cs and show any compilation errors.

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 a C# script in Unity from the command line?▼

Run unity-mcp-cli run-tool script-update-or-create with a JSON input containing filePath and content. The tool writes the file, refreshes the Unity AssetDatabase, and reports any compilation errors.

How do I pass multi-line C# code as tool input?▼

Save the JSON payload to a file and use --input-file args.json, or pipe it via stdin with --input-file - and a heredoc. This avoids shell escaping problems with multi-line code strings.

Does the tool detect C# syntax errors after writing the file?▼

Yes. After writing the file it runs AssetDatabase.Refresh(), which triggers Unity compilation, and the tool returns compilation error details if the code has syntax errors.

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.

Should I read an existing script before updating it?▼

Yes. The documentation recommends using the script-read tool to read existing script files first, so updates preserve current logic instead of blindly overwriting content.