bibhash/unity icon
public
Published on 4/22/2025
bibhash/unity

Rules

Build & Development Commands

{ "name": "Create Unity Script Template", "description": "Generate a Unity C# script using standard MonoBehaviour setup", "prompt": "Create a new Unity MonoBehaviour C# script that includes common lifecycle methods: Awake, Start, Update. Add XML summary comments. Class name should match the filename and be in PascalCase:\n\n{{input}}" }, { "name": "Build Custom Unity Editor Tool", "description": "Generate an EditorWindow or custom inspector for Unity", "prompt": "Create a custom Unity EditorWindow or editor inspector script in C# based on this functionality:\n\n{{input}}" }, { "name": "Convert Script to ScriptableObject Pattern", "description": "Refactor a MonoBehaviour class to use ScriptableObject architecture", "prompt": "Refactor the following Unity MonoBehaviour logic to use ScriptableObject-based architecture. Include a separate class definition for the SO, and usage example:\n\n{{selection}}" }

Testing Guidelines

{ "name": "Generate Unity Unit Tests", "description": "Generate a test class for a Unity C# script", "prompt": "Write NUnit unit tests for this Unity C# class. Test public methods, edge cases, and MonoBehaviour behavior where applicable. Use mock data where needed:\n\n{{selection}}" }, { "name": "Test ScriptableObject Logic", "description": "Create test cases for ScriptableObject-based logic", "prompt": "Generate NUnit-compatible tests for this ScriptableObject. Focus on logic and serialized field behavior across PlayMode and EditMode:\n\n{{selection}}" }, { "name": "Validate Scene Logic with Integration Test", "description": "Create integration test for scene object interaction", "prompt": "Write a Unity integration test that validates the interaction between these scene objects and their logic. Ensure the test is PlayMode compatible:\n\n{{input}}" }

Code Style & Guidelines

-{ "name": "Apply Unity C# Style", "description": "Refactor code to follow Unity C# conventions", "prompt": "Refactor the following C# code to follow Unity's coding conventions:\n- PascalCase for methods and class names\n- camelCase for variables\n- XML summary for public members\n- Use SerializeField with [Tooltip] when necessary\n- Keep one class per file\n\nCode:\n\n{{selection}}" }, { "name": "Simplify MonoBehaviour Logic", "description": "Clean up Unity MonoBehaviour logic", "prompt": "Simplify this Unity MonoBehaviour script by extracting methods, removing unused variables, and improving naming:\n\n{{selection}}" }, { "name": "Ensure Performance Best Practices", "description": "Optimize Unity update logic", "prompt": "Review this Unity MonoBehaviour and suggest improvements for performance, e.g., minimizing usage of Update(), caching components, using object pooling, etc. Then refactor accordingly:\n\n{{selection}}" }

Documentation Guidelines

-{ "name": "Add XML Documentation", "description": "Generate XML-style summaries for Unity C# methods", "prompt": "Add XML documentation summaries to all public methods and properties in this Unity C# class. If any methods use Unity lifecycle functions (e.g., Awake, Update), explain their Unity behavior too:\n\n{{selection}}" }, { "name": "Document Unity Editor Tool", "description": "Create usage instructions for a Unity Editor script", "prompt": "Write a usage guide for this custom Unity Editor tool, including how to open it, what it does, and example use cases:\n\n{{selection}}" }, { "name": "Explain Component Usage", "description": "Write documentation for a MonoBehaviour component", "prompt": "Write user-facing documentation for this Unity MonoBehaviour. Include its purpose, how to configure it in the Inspector, and example usage in scenes:\n\n{{selection}}" }