unity-coding

Enforce Unity C# coding conventions for nullable types, async patterns, LINQ, and UniT packages.

Updated Aug 20, 2025
One-click install
npx skills add https://github.com/frostbun/dotfiles --skill unity-coding-frostbun
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-coding
Source: https://github.com/frostbun/dotfiles/tree/main/configs/opencode/skills/unity/unity-coding
Command: npx skills add https://github.com/frostbun/dotfiles --skill unity-coding-frostbun

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers adhere to best practices and conventions for writing clean, maintainable, and efficient C# code within the Unity game engine.

Core Features & Use Cases

  • Coding Conventions: Enforces rules for nullability, access modifiers, using directives, and error handling.
  • Async Patterns: Guides the use of UniTask and CancellationToken for asynchronous operations.
  • LINQ & Reflection: Provides best practices for using LINQ and reflection in Unity.
  • Package Integration: Details conventions for various UniT packages like logging, DI, and resource management.
  • Use Case: Ensure all new Unity C# scripts follow the established coding standards for consistency and quality across the project.

Quick Start

Apply the unity-coding skill to review the current C# script for adherence to best practices.

Frequently Asked Questions about unity-coding

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

FAQPage Schema
What are the best practices for async patterns in Unity C#?

Unity C# async patterns should use UniTask and CancellationToken for efficient asynchronous operations. This approach ensures code quality and maintainability while preventing memory leaks and unnecessary allocations during gameplay.

How do I enforce coding conventions for nullable types and LINQ in Unity?

Coding conventions for nullable types and LINQ in Unity are enforced by applying specific rules for nullability, access modifiers, and LINQ best practices to script reviews, ensuring consistency and quality across C# projects.

Does this Unity C# coding standard cover UniT package integration?

Yes, the Unity C# coding standard details specific conventions for various UniT packages, including logging, dependency injection (DI), and resource management, ensuring standardized integration and maintainable code architecture.

What is the best way to handle reflection in Unity C# projects?

The best way to handle reflection in Unity C# projects is to follow established best practices that balance performance with maintainability, ensuring efficient asynchronous programming and high code quality without unnecessary overhead.

Why should I use UniTask instead of standard async await in Unity?

UniTask should be used instead of standard async await in Unity to achieve efficient asynchronous programming with zero allocations. It pairs with CancellationToken to ensure code quality and maintainable async patterns.

When do I need to apply Unity C# coding standards to my scripts?

You need to apply Unity C# coding standards to all new scripts to ensure adherence to best practices for consistency and quality. This covers error handling, using directives, and nullable types across the project.