code-style

Enforce C# and Unity coding conventions during writing and review.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/punkfuncgames/tetris-clone --skill code-style-punkfuncgames
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: code-style
Source: https://github.com/punkfuncgames/tetris-clone/tree/main/.claude/skills/code-style
Command: npx skills add https://github.com/punkfuncgames/tetris-clone --skill code-style-punkfuncgames

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a single-source reference for C# naming, layout, and Unity-specific conventions to prevent inconsistent code, fragile Unity lifecycle checks, and mismatched dependency/injection patterns across the project.

Core Features & Use Cases

  • Naming & Visibility: Defines private field, property/method, and constant naming conventions and requires explicit visibility.
  • Unity-safe Patterns: Prescribes UnityEngine.Object null-check idioms, object disambiguation, and MonoBehaviour injection patterns to avoid lifecycle bugs.
  • Structure & Maintainability: Enforces explicit types, field grouping, mandatory braces, class layout order, and async/reactive rules to improve readability and reduce runtime errors.
  • Use Case: Use during code review or when authoring new C# modules to ensure contributions compile and behave consistently with project patterns.

Quick Start

Apply the code-style guidelines when writing or reviewing any C# file in this Unity project to enforce naming, explicit typing, Unity null-checks, field grouping, class layout, injection, and async/reactive rules.

Frequently Asked Questions about code-style

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

FAQPage Schema
How do I enforce consistent C# naming conventions and class layout in a Unity project?▼

To enforce C# naming conventions and class layout in Unity, apply guidelines covering explicit typing, field grouping, mandatory braces, and strict class layout order across MonoBehaviours and pure C# classes to reduce bugs and improve readability.

What is the best way to handle Unity object null-checks to avoid MonoBehaviour lifecycle bugs?▼

The best way to handle Unity object null-checks is using prescribed UnityEngine.Object null-check idioms and object disambiguation patterns, which prevent fragile lifecycle checks and runtime errors specific to MonoBehaviour injection.

Can I use these code standards during a C# code review or refactor workflow?▼

Yes, you can use these code standards during C# code review and refactor workflows to ensure new modules compile and behave consistently with project patterns regarding explicit visibility, async cancellation, and reactive disposal practices.

Do I need explicit typing and mandatory braces for Unity editor scripts and test code?▼

Yes, explicit typing and mandatory braces are required for Unity editor scripts and test code, as the conventions apply to all C# files to improve maintainability and reduce runtime errors across the repository.

Why does my Unity project have mismatched dependency injection patterns across different modules?▼

Mismatched dependency injection patterns occur without a single-source reference for C# conventions. Standardizing MonoBehaviour injection patterns and explicit visibility rules ensures consistent dependency management across the project.

What async and reactive rules should I follow when writing C# modules for Unity?▼

When writing C# modules for Unity, follow async cancellation and reactive disposal rules to improve readability and reduce runtime errors, ensuring consistent behavior across MonoBehaviours and pure C# classes.