script-delete

Delete C# script files from Unity projects and wait for recompilation to finish.

Updated Jul 20, 2026
One-click install
npx skills add https://github.com/PMK95/GridSquad --skill script-delete-pmk95
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: script-delete
Source: https://github.com/PMK95/GridSquad/tree/main/GridSquadUnity/.agents/skills/script-delete
Command: npx skills add https://github.com/PMK95/GridSquad --skill script-delete-pmk95

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires unity-mcp-cli.

What problem does it solve? Removing C# scripts from a Unity project requires more than deleting files: the AssetDatabase must refresh and Unity must finish recompiling before the project state is safe to report. This Skill handles that full cycle so deletions never leave the project in an inconsistent state. ## Core Features & Use Cases - Validated Batch Deletion: Accepts an array of .cs file paths, verifying the array is non-empty, every entry ends with .cs, and every file exists on disk before deleting. - Meta File Cleanup: Removes each script's sibling .meta file when present, keeping the Unity asset structure consistent. - Compilation-Aware Response: Calls AssetDatabase.Refresh and delivers the final result only after Unity finishes the recompile triggered by the deletion, using the requestId contract. - Use Case: While refactoring a Unity codebase, delete several obsolete MonoBehaviour scripts in one call and receive confirmation only after the project compiles cleanly without them. ## Quick Start Ask the assistant to delete the script Assets/Scripts/OldPlayerController.cs from the Unity project and confirm once recompilation completes.

Frequently Asked Questions about script-delete

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

FAQPage Schema
How do I delete C# scripts from a Unity project programmatically?▼

Use the script-delete tool via unity-mcp-cli with a files array containing the .cs paths. It deletes each file plus its .meta sibling, refreshes the AssetDatabase, and reports back after Unity finishes recompiling.

How to safely remove multiple Unity scripts at once?▼

Pass all target .cs paths in the files array of a single script-delete call. The tool validates that every entry exists and ends with .cs before deleting anything, so partial or invalid batches are rejected.

Does deleting a .cs file also remove its .meta file in Unity?▼

Yes, this tool deletes the sibling .meta file when present alongside each removed .cs script. This prevents orphaned meta files that would otherwise cause Unity asset warnings.

Why does script deletion wait for Unity compilation to finish?▼

Deleting scripts triggers a recompile, and reporting before it completes could reflect a stale project state. The tool schedules a post-compilation notification so the final response arrives only after Unity settles.

What happens if a file in the deletion list does not exist?▼

Validation fails because every entry in the files array must exist on disk and end with .cs. The deletion is rejected rather than partially executed, so no files are removed.