script_skill
- C#
44
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill besty0728/unity-skills --skill script- SKILL.md4.1 KB
Overview
This skill provides automated creation and management of Unity C# scripts, with special support for batch creation to reduce Unity Domain Reloads. It includes single-file operations (create, read, delete, append, find) and a batch API optimized for creating two or more scripts in one call. Use templates for MonoBehaviour, ScriptableObject, Editor, and EditorWindow to get correct base classes and boilerplate.
How this skill works
script_create generates a single C# file from a chosen template and returns the file path and class name. script_create_batch accepts a list of script definitions and creates multiple files in one operation to trigger a single Domain Reload. Other utilities let you read file contents, delete scripts, append code, and search files with optional regex and limits.
When to use it
- Create a single helper, component, or editor script quickly with script_create.
- Create two or more scripts at once to avoid multiple Domain Reloads with script_create_batch.
- Inspect or modify existing script contents with script_read and script_append.
- Locate usages or patterns across the project with script_find_in_file (supports regex).
- Remove obsolete scripts with script_delete.
Best practices
- Prefer script_create_batch whenever creating 2+ scripts to minimize Domain Reloads and save time.
- Name scripts to match their class name exactly to prevent compile errors.
- Organize scripts into logical folders (e.g., Assets/Scripts/Player) to keep the project tidy.
- Choose the appropriate template (MonoBehaviour, ScriptableObject, Editor, EditorWindow) to get correct boilerplate.
- After creating scripts, wait 3–5 seconds for Unity to recompile before calling other APIs.
Example use cases
- Scaffold a set of gameplay scripts (PlayerController, EnemyAI, GameManager) in one batch call.
- Generate data containers as ScriptableObject assets for configuration in a single operation.
- Search the Assets folder for all occurrences of a deprecated API using script_find_in_file with regex.
- Append initialization code to an existing script at a specific line using script_append.
- Read script content to programmatically verify class definitions or attributes before runtime usage.
FAQ
Use script_create_batch when creating two or more scripts to trigger only one Domain Reload and reduce wait time.
What templates are available?
MonoBehaviour, ScriptableObject, Editor, and EditorWindow are provided to generate appropriate boilerplate.