---
slug: "claude-unity-dev-plugin"
source_type: "readme"
source_url: "https://cdn.jsdelivr.net/gh/cryptorabea/claude_unity_dev_plugin@main/README.md"
repo: "https://github.com/cryptorabea/claude_unity_dev_plugin"
source_file: "README.md"
branch: "main"
---
# Unity Dev - Claude Code Plugin

Comprehensive Unity and game development expertise for Claude Code across all Unity projects.

## Features

### 🎓 Skills (Auto-activating Knowledge)
- **unity-fundamentals** - MonoBehaviour lifecycle, serialization, component references, prefabs
- **unity-performance** - Caching, pooling, GC optimization, Update loop best practices
- **unity-architecture** - Manager patterns, ScriptableObjects, component design, events
- **unity-workflows** - Editor scripting, Input System, UI systems, asset management

### ⚡ Commands
- `/unity-dev:generate-script` - Generate MonoBehaviour, ScriptableObject, or Editor script templates
- `/unity-dev:create-editor-tool` - Scaffold EditorWindow or CustomEditor tools

### 🤖 Agents
- **unity-code-reviewer** - Proactive code review for Unity best practices and performance

## Installation

### From Marketplace (Coming Soon)
```bash
cc plugin install unity-dev
```

### Local Development
```bash
# Clone or copy to Claude plugins directory
cp -r unity-dev ~/.claude/plugins/

# Use in Claude Code
cc --plugin-dir ~/.claude/plugins/unity-dev
```

## Usage

### Skills

Skills activate automatically when you ask Unity-related questions or work on Unity code. They provide comprehensive guidance on Unity development best practices.

#### unity-fundamentals
Covers core Unity concepts:
- **MonoBehaviour Lifecycle**: Awake, Start, OnEnable, Update, FixedUpdate, LateUpdate patterns
- **Serialization**: [SerializeField], ScriptableObjects, Inspector organization
- **Component Architecture**: GetComponent patterns, RequireComponent, composition
- **Prefab Workflows**: Creating, variants, nesting, programmatic usage

**Trigger phrases**: "Unity lifecycle", "MonoBehaviour methods", "Awake vs Start", "serialization", "prefabs"

**Example questions**:
- "When should I use Awake vs Start?"
- "How do I properly serialize private fields?"
- "What's the difference between Update and FixedUpdate?"

#### unity-performance
Optimization techniques and profiling:
- **Reference Caching**: GetComponent, Transform, Material caching patterns
- **Object Pooling**: Reusing instantiated objects
- **GC Optimization**: Reducing allocations, avoiding LINQ in Update
- **Profiling**: Using Unity Profiler, identifying bottlenecks

**Trigger phrases**: "Unity performance", "optimization", "GC allocation", "object pooling", "profiling"

**Example questions**:
- "How do I optimize GetComponent calls?"
- "What's causing garbage collection spikes?"
- "How should I implement object pooling for bullets?"

#### unity-architecture
Game architecture patterns and design:
- **Manager Patterns**: Singleton, Service Locator, initialization order
- **ScriptableObject Architecture**: Data-driven design, events, variables
- **Event Systems**: C# events, UnityEvents, global event bus
- **Design Patterns**: MVC, Observer, Strategy, State Machine

**Trigger phrases**: "game architecture", "design patterns", "manager pattern", "ScriptableObject", "event system"

**Example questions**:
- "How should I structure my game managers?"
- "What's the best way to implement an event system?"
- "When should I use ScriptableObjects vs regular classes?"

#### unity-workflows
Development workflows and tooling:
- **Editor Scripting**: Custom Inspectors, EditorWindows, PropertyDrawers, Menu items
- **Input System**: New Input System setup, InputActions, legacy input
- **UI Systems**: uGUI optimization, UI Toolkit, Canvas best practices
- **Asset Management**: Addressables, Resources, AssetDatabase

**Trigger phrases**: "editor scripting", "Custom Inspector", "Input System", "UI Toolkit", "Addressables"

**Example questions**:
- "How do I create a custom editor window?"
- "What's the difference between the new and old Input System?"
- "How should I optimize my UI Canvas?"

### Commands

#### /unity-dev:generate-script
Generate Unity script templates following best practices.

**Usage**:
```
/unity-dev:generate-script [script-type] [script-name]
```

**Script types**:
- `MonoBehaviour` - Standard Unity component
- `ScriptableObject` - Data asset with CreateAssetMenu
- `EditorWindow` - Custom editor window
- `CustomEditor` - Custom Inspector
- `PropertyDrawer` - Custom property display

**Examples**:
```
/unity-dev:generate-script MonoBehaviour PlayerController
/unity-dev:generate-script ScriptableObject WeaponData
/unity-dev:generate-script EditorWindow LevelEditor
```

**Interactive mode**: Call without arguments for guided prompts.

#### /unity-dev:create-editor-tool
Scaffold complete Unity editor tools with proper structure.

**Usage**:
```
/unity-dev:create-editor-tool [tool-type] [name]
```

**Tool types**:
- `EditorWindow` - Custom window with GUI
- `CustomEditor` - Enhanced Inspector
- `PropertyDrawer` - Property display
- `MenuItem` - Menu command utility
- `SceneGUI` - Scene view overlay

**Examples**:
```
/unity-dev:create-editor-tool EditorWindow ObjectPlacer
/unity-dev:create-editor-tool CustomEditor EnemyAI
/unity-dev:create-editor-tool MenuItem AlignObjects
```

### Agent

#### unity-code-reviewer
Autonomous code reviewer that triggers after you write Unity scripts.

**What it checks**:
- **Lifecycle patterns**: Proper Awake/Start usage, empty Update methods
- **Performance**: Uncached GetComponent, Find in Update, allocations
- **Serialization**: [SerializeField] usage, public fields, naming conventions
- **Architecture**: Component coupling, memory leaks, null checks

**Review format**:
```
## Unity Code Review: FileName.cs

### ✅ Good Practices
- [Positive patterns]

### ⚠️ Issues Found
**Performance - Critical**
- Line X: Issue description
  - Problem: What's wrong
  - Fix: How to fix
  - Example: Code snippet

### Priority
- 🔴 Critical: Must fix
- 🟡 Important: Should fix
- 🟢 Minor: Nice to have
```

**Triggering**: Automatically reviews when you create or modify Unity C# scripts.

## What's Included

- **Comprehensive knowledge base**: 1500-2000 word guides per topic
- **Reference materials**: Detailed technical documentation
- **Code examples**: Working Unity code snippets
- **Interactive tools**: Script generation and scaffolding
- **Autonomous quality checks**: Proactive code review

## Requirements

- Claude Code
- Unity projects (any version)

## Contributing

Contributions welcome! This plugin aims to represent Unity and game development best practices.

## License

MIT

---

*Part of the Claude Code plugin ecosystem*
