Agent skill

Unity Patterns

by Besty0728 in Besty0728/Unity-Skills

Advise on choosing Unity design patterns. An agent skill from Besty0728/Unity-Skills.

MITAuto-check passedGame Development

Install Unity Patterns

skills CLI
$ npx skills add Besty0728/Unity-Skills --skill unity-patterns -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Besty0728/Unity-Skills unity-patterns --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Besty0728/Unity-Skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/'SkillsForUnity/unity-skills~/skills/patterns' .claude/skills/unity-patterns && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
unity-patterns
GitHub stars
1.8k
Token cost
~1.3k tokens
SKILL.md length
703 words
Files
1
Skills in repo
82
Repo updated
First seen
Licence
MIT

At a glance

Advise on choosing Unity design patterns. An agent skill from Besty0728/Unity-Skills.

  • Tasks that involve Design patterns
  • SKILL.md covers Triggers, Guardrails, Pattern Guide and Decision Lab: Same Goal,…, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Unity Patterns is an agent skill from Besty0728/Unity-Skills. Advise on choosing Unity design patterns

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Game Development, covering Design patterns. The repository describes itself as: AI automation skills specifically designed for Unity. The licence is MIT.

When your agent uses it

  • Tasks that involve Design patterns

Example prompts

  • “/unity-patterns”

What it can do on your machine

Read from SKILL.md and the folder at commit 12a40e4. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Unity Patterns loads about 1.3k tokens when it runs. Until then it costs about 14 tokens; SKILL.md has 703 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~14
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Besty0728/Unity-Skills at commit 12a40e4, republished under its MIT licence (© Besty0728). 703 words, ~1,307 tokens.

Download SKILL.mdSave it as .claude/skills/unity-patterns/SKILL.md (or your agent's skills folder).
name
unity-patterns
description
Advise on choosing Unity design patterns

Before calling any skill in this module: if you are about to call a skill with parameters guessed from its name or description, STOP — read this file (or fetch its schema via GET /skills/recommend?includeSchema=true) first. If you already have the parameter definitions from recommend/schema, you may proceed straight to dryRun.

Triggers

  • Deciding which pattern fits a problem
  • Structuring decoupled systems
  • Choosing event/state-machine/pool approaches
  • 判断哪种模式适合某问题、构建解耦系统、在事件/状态机/对象池方案间抉择

Unity Pattern Selector

Use this skill to decide whether a pattern is justified. Do not recommend every pattern at once.

Guardrails

Mode: Documentation only — no REST skills to gate; load freely under any operating mode (Approval / Auto / Bypass).

  • Recommend at most 1-3 patterns, and explain why simpler options are not enough.

Pattern Guide

  • ScriptableObject

    • Use for authored config, shared static data, event channels, and reusable data assets.
    • Avoid as the default home for per-run mutable gameplay state.
  • C# events / delegates

    • Use for one-to-many notifications with clear ownership and unsubscribe points.
    • Avoid for imperative flows that need ordering, return values, or complex debugging.
  • Global event bus / observer hub

    • Use sparingly and only when many systems truly need broad decoupled notifications.
    • Avoid as the default answer to coupling. It often hides ownership and makes debugging harder.
  • Interfaces

    • Use when multiple implementations or clearer dependency boundaries are needed.
    • Avoid adding interfaces around every class without a real seam.
  • State machine

    • Use for actors with mutually exclusive states and explicit transitions.
    • Avoid when a few booleans or a small command flow is enough.
  • Object pool

    • Use for frequent spawn/despawn of bullets, VFX, enemies, UI items.
    • Avoid for rare objects or when lifetime is simple.
  • Service layer

    • Use for a small number of cross-scene systems with explicit bootstrap and interfaces.
    • Avoid turning everything into hidden singletons or service locators.
  • Generics / custom attributes

    • Use when they remove repeated boilerplate with clear type safety or editor metadata value.
    • Avoid when they make gameplay code harder to read than duplicated simple code.

Decision Lab: Same Goal, Multiple Implementations

The Pattern Guide above answers "which pattern?". For most non-trivial design decisions, the better exercise is: pick the 2-3 plausible implementations, put them side by side, and compare on switch cost, query cost, code complexity, and failure modes. Below is a worked example; use it as the shape for other decisions rather than as the answer.

Show full SKILL.md (323 more words)Show less
Worked example: "Pause AI on 100 enemies for a cutscene"
ImplementationSwitch cost (enter/exit cutscene)Per-frame cost while pausedCode complexityFailure modes
Field flag: each EnemyAI.Update starts with if (_paused) return;; manager sets the flagO(N) writes, no allocationsN branch tests + dispatch overhead per frameLowest — one bool, one guard clauseSilent bugs when a dev adds a new Update and forgets the guard
enabled = false: manager disables the MonoBehaviour on every enemyO(N) writes, no allocationsZero — Unity skips disabled Behaviours in its message listLow, but state spread across componentsOnDisable / OnEnable side effects (coroutines stop, listeners unsubscribe) may fire unexpectedly
Subset list: manager keeps _active / _frozen lists; no per-enemy Update — manager ticks only _activeO(N) list move on switchProportional to _active count only — perfect early-cullHighest — one source of truth for ownership, requires managed tickingAdding a new Update on enemies reintroduces per-frame cost; the list is easy to desync if other code respawns enemies directly
How to use
  • Pick the smallest scale where the trade-off matters. At N=5 all three are indistinguishable; at N=5000 only the subset list stays flat.
  • State what gets worse under each option, not only what improves. A table with only upsides is a sign you haven't thought about it yet.
  • The ECS lesson is that the same three shapes (value change, structural change, enableable) show up everywhere — the labels transfer even when the framework does not. Source: Dots101/Entities101/Assets/HelloCube/13. StateChange/SetStateSystem.cs:42-80 — one system dispatches to three implementations behind config.Mode, each with measurably different cost in the profiler.
When to skip this exercise

If one option is obviously bounded (N ≤ 10, state changes once per session, or the code runs once at startup), a single paragraph "we picked X because it's simplest" is enough. Decision Lab is for choices that will outlive the current task.

Output Format

  • Recommended pattern(s)
  • Why they fit this case
  • Why not the simpler alternative
  • Minimal implementation boundary
  • Known tradeoffs

© Besty0728, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in SkillsForUnity/unity-skills~/skills/patterns of Besty0728/Unity-Skills.

Open the folder on GitHubat commit 12a40e4

Compare with similar skills

Unity Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Unity Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Unity Patterns this skillBesty0728/Unity-Skills1.8k—~1.3kAutomated safety check: PassMIT
Unreal Actor-Component Architecturequodsoler/unreal-engine-skills359—~7.5kAutomated safety check: PassMIT
Godot Autoload Architecturethedivergentai/GD-Agentic-Skills803—~3.4kAutomated safety check: PassLGPL-3.0
Godot Compositionthedivergentai/GD-Agentic-Skills803—~3.7kAutomated safety check: PassLGPL-3.0
Godot Composition Appsthedivergentai/GD-Agentic-Skills803—~3.6kAutomated safety check: PassLGPL-3.0
Dependency Injectionjame581/GodotPrompter792—~2.8kAutomated safety check: PassMIT

Similar skills

  • Unreal Actor-Component Architecture

    quodsoler/unreal-engine-skills

    Unreal Engine C++ guidance for AActor and UActorComponent: lifecycle hooks, spawning, component creation and attachment, ticking, interfaces and composition.

    359 GitHub stars~7.5k tokensUpdated 9 days ago
    Game DevelopmentAuto-check passed
  • Godot Autoload Architecture

    thedivergentai/GD-Agentic-Skills

    Expert patterns for Godot AutoLoad (singleton) architecture including global state management, scene transitions, signal-based communication, dependency injection, autoload initialization order, and…

    803 GitHub stars~3.4k tokensUpdated 28 days ago
    Game DevelopmentAuto-check passed
  • Godot Composition

    thedivergentai/GD-Agentic-Skills

    Expert architectural standards for building scalable Godot GAMES (RPGs, Platformers, Shooters) using the Composition pattern (Entity-Component).

    803 GitHub stars~3.7k tokensUpdated 28 days ago
    Game DevelopmentAuto-check passed
  • Godot Composition Apps

    thedivergentai/GD-Agentic-Skills

    Expert architectural standards for scalable Godot Apps, Tools, EditorPlugins, and Control-heavy UIs using Composition (Has-A Orchestrator + components).

    803 GitHub stars~3.6k tokensUpdated 28 days ago
    Game DevelopmentAuto-check passed
  • Dependency Injection

    jame581/GodotPrompter

    A skill your agent uses when managing dependencies between systems — autoloads, service locators, @export injection, and scene injection patterns

    792 GitHub stars~2.8k tokensUpdated yesterday
    Game DevelopmentAuto-check passed
  • Component System

    jame581/GodotPrompter

    A skill your agent uses when building reusable node components — composition patterns, component communication, and interface design

    792 GitHub stars~3.3k tokensUpdated yesterday
    Game DevelopmentAuto-check passed

More from Besty0728/Unity-Skills

All 82 skills in this repo
  • Unity Skills

    Besty0728/Unity-Skills

    Automate the Unity Editor through a local REST API — scripts, scenes, prefabs, assets, materials, lighting, tests and hundreds of other Editor operations.

    1.8k GitHub stars~2k tokensUpdated yesterday
    Auto-check passed
  • Unity Animator

    Besty0728/Unity-Skills

    Edit Unity Animator Controllers and drive runtime parameters

    1.8k GitHub stars~2.4k tokensUpdated yesterday
    Auto-check passed
  • Unity Architecture

    Besty0728/Unity-Skills

    Advise on Unity gameplay and system architecture. An agent skill from Besty0728/Unity-Skills.

    1.8k GitHub stars~1.3k tokensUpdated yesterday
    Auto-check passed
  • Unity Batch

    Besty0728/Unity-Skills

    Unified batch and async-job orchestration. An agent skill from Besty0728/Unity-Skills.

    1.8k GitHub stars~2k tokensUpdated yesterday
    Auto-check passed
  • Unity Behavior

    Besty0728/Unity-Skills

    Drive Unity Behavior behavior graphs and blackboard variables

    1.8k GitHub stars~3k tokensUpdated yesterday
    Auto-check passed
  • Unity Console

    Besty0728/Unity-Skills

    Capture and query the Unity Editor console. An agent skill from Besty0728/Unity-Skills.

    1.8k GitHub stars~1.8k tokensUpdated yesterday
    Auto-check passed

Questions about Unity Patterns

What does Unity Patterns do?

Advise on choosing Unity design patterns. An agent skill from Besty0728/Unity-Skills. Unity Patterns is an agent skill from Besty0728/Unity-Skills.

When should I use Unity Patterns?

Unity Patterns fits situations like: tasks that involve Design patterns.

How do I install Unity Patterns in Claude Code?

Run `npx skills add Besty0728/Unity-Skills --skill unity-patterns -a claude-code`. Or copy the skill folder (SkillsForUnity/unity-skills~/skills/patterns in Besty0728/Unity-Skills) into .claude/skills/unity-patterns in your project. Claude Code loads it when a task matches its description.

How do I install Unity Patterns in Codex?

Run `npx skills add Besty0728/Unity-Skills --skill unity-patterns -a codex`. Or copy the skill folder (SkillsForUnity/unity-skills~/skills/patterns in Besty0728/Unity-Skills) into .agents/skills/unity-patterns in your project. Codex loads it when a task matches its description.

Can I use Unity Patterns in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Besty0728/Unity-Skills --skill unity-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/unity-patterns, .gemini/skills/unity-patterns, .github/skills/unity-patterns and .opencode/skills/unity-patterns in your project.

What does Unity Patterns need to run?

SKILL.md names no scripts, command-line tools or credentials: Unity Patterns is instructions for the agent only.

Does Unity Patterns access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Unity Patterns safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Unity Patterns use?

Unity Patterns is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Unity Patterns use?

About 1.3k tokens (SKILL.md is roughly 5.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Unity Patterns?

Skills that share tags, products or a category with Unity Patterns: Unreal Actor-Component Architecture (quodsoler/unreal-engine-skills, 359 stars), Godot Autoload Architecture (thedivergentai/GD-Agentic-Skills, 803 stars), Godot Composition (thedivergentai/GD-Agentic-Skills, 803 stars) and Godot Composition Apps (thedivergentai/GD-Agentic-Skills, 803 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Unity Patterns?

Besty0728 (a GitHub user) maintains it in Besty0728/Unity-Skills, which has 1,814 GitHub stars. The repository holds 82 skills in this directory. The repository was last updated on October 6, 2026.

Source: Besty0728/Unity-Skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.