unity-inspector

Recommend Inspector field exposure and attributes for Unity C# scripts.

Updated Apr 11, 2026
One-click install
npx skills add https://github.com/lrbjk/FenShen_Remake_V0 --skill unity-inspector-lrbjk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-inspector
Source: https://github.com/lrbjk/FenShen_Remake_V0/tree/main/.codex/skills/unity-skills/skills/inspector
Command: npx skills add https://github.com/lrbjk/FenShen_Remake_V0 --skill unity-inspector-lrbjk

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Unity scripts can expose confusing or unsafe serialized state in the Inspector, making components hard to configure, error-prone, and difficult for teammates to understand; this Skill advises how to expose fields, apply attributes, and add lightweight validation so Inspectors are clear and safe.

Core Features & Use Cases

  • Field exposure strategy: Recommend when to use public vs [SerializeField] private and when to hide or expose fields for designers.
  • Recommended attributes: Suggest Header, Tooltip, Space, Range, Min, TextArea, RequireComponent, CreateAssetMenu, and SerializeReference usage scoped to clarity and necessity.
  • Validation & UX: Advise OnValidate patterns for safe normalization, grouping fields by responsibility, separating debug-only fields, and constraining tuning values to prevent runtime errors.
  • Use Case: Review a MonoBehaviour that has public fields and ambiguous defaults, then provide a concise plan to convert to safe serialized fields with tooltips, headers, and minimal validation.

Quick Start

Use the unity-inspector skill to recommend concrete SerializeField exposures, attributes, and lightweight OnValidate checks for a provided C# MonoBehaviour or ScriptableObject.

Frequently Asked Questions about unity-inspector

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

FAQPage Schema
How do I make Unity Inspector fields clear and safe for designers to configure?

To make Unity Inspector fields clear and safe, use private [SerializeField] instead of public variables, add Tooltip and Header attributes for grouping, and apply Range constraints to prevent invalid tuning values.

When should I use public fields versus [SerializeField] private in Unity?

Use [SerializeField] private fields in Unity when you need Inspector exposure without breaking encapsulation, reserving public only for fields requiring script-level access. This strategy prevents accidental modification while maintaining authoring clarity.

What Unity attributes improve Inspector readability for MonoBehaviours?

Unity attributes that improve Inspector readability include Header for grouping, Tooltip for guidance, Space for visual separation, Range and Min for value clamping, and TextArea for long text inputs, ensuring serialized fields are self-documenting.

How does OnValidate work for catching unsafe serialized values in Unity?

OnValidate in Unity fires when Inspector values change, allowing scripts to normalize unsafe inputs immediately. It catches out-of-bounds tuning values during authoring, preventing runtime errors before play mode without modifying project files.

Does this Unity Inspector review approach work for ScriptableObject classes?

Yes, this Inspector review approach works for ScriptableObject classes. It applies the same serialized field exposure strategies, validation rules, and authoring UX improvements used for MonoBehaviours to ensure safe asset configuration.

How to organize debug-only fields so they don't clutter the Unity Inspector?

Organize debug-only fields by separating them from tuning values using Header attributes or grouping them by responsibility. This keeps the Unity Inspector focused on configuration data, avoiding clutter while retaining necessary serialized debug state.