Generate a Unity C# script based on: $ARGUMENTS
Process
- •Determine script type — MonoBehaviour, ScriptableObject, interface, enum, static class, or system
- •Read project CLAUDE.md for coding conventions, namespace patterns, folder structure
- •Search existing scripts to match project style and avoid duplication
- •Generate the script following Unity best practices:
- •Proper namespace and using statements
- •SerializeField for inspector-visible fields
- •Clear separation of Unity lifecycle methods
- •Event-driven architecture where appropriate
- •Null checks and defensive coding
- •XML documentation for public API
- •Write the file to the appropriate project directory
- •Validate via MCP recompile if available — check for errors
- •Report what was created, where it was saved, and how to use it
Script Conventions
- •One class per file, filename matches class name
- •PascalCase for classes, methods, properties, events
- •camelCase for private fields (with underscore prefix if project convention)
- •SerializeField + private over public fields
- •Use [Header] and [Tooltip] attributes for inspector UX
- •Prefer composition over inheritance
- •Use events/delegates for decoupling