component-design

A decision guide for structuring Unity MonoBehaviour scripts, which are C# components attached to game objects. It covers responsibility boundaries, communication between components, and execution order.

In plain words
What is it for?
Use it to decide whether to split a script, name components, choose communication methods, and manage the order in which Unity code runs.
Why use it?
It helps prevent scripts from becoming tangled or difficult to reuse. It also supports clearer decisions about when components should be split and how they should interact.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/thearcforge/uniclaude/component-design
Any agent
npx skills add TheArcForge/UniClaude --skill component-design
Clone the repo
git clone --depth 1 https://github.com/TheArcForge/UniClaude

Made for: Claude Code, Codex.

Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 838 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00026 $0.00838
Opus 5 $0.00013 $0.00419
Sonnet 5 $0.00005 $0.00168
Haiku 4.5 $0.00003 $0.00084

Measured 2d ago against content hash 5ad84fc70d3a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

component-design scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Sidecar~/skills/component-design/SKILL.md · 93 lines

How it starts

The opening of the file, as written. The whole thing — 93 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Component Design — Full Decision Framework

Use this when unity-architect's condensed component section needs more depth.

DECISION: Splitting Responsibilities

When this applies: A script is growing or handles multiple concerns.

Split signals (do split):

  • Script exceeds 150 lines with distinct sections.
  • You want to reuse part of the behavior on another object.
  • Two unrelated concerns share a file (movement code + health code).
  • Adding a feature requires touching unrelated methods.

Keep-together signals (do not split):

  • Logic is inherently sequential (< 100 lines).
  • Splitting would require constant cross-calls for trivial data.
  • The "separate concerns" are actually one concern (e.g., aiming and shooting are one "combat" concern).

Naming convention:

  • [ObjectType][Concern]: PlayerMovement, PlayerHealth, PlayerInput, EnemyAI, EnemyVisuals.
  • Never generic names: Manager, Controller, Handler (unless it actually manages a collection).

DECISION: Inter-Component Communication

When this applies: Components on the same or different GameObjects need to interact.

Options (ordered by coupling, lowest first):

  1. ScriptableObject event channel — fully decoupled, asset-based.

    • Use when: systems shouldn't know about each other (UI ← GameState → Audio).
    • Pattern: SO asset with Raise()/Register(). Both reference the same SO.
    • Tradeoff: indirection makes debugging harder; need SO assets per event type.
  2. C# events (Action/delegate) — component exposes an event.

    • Use when: one-to-many within the same object or direct reference.
    • Pattern: public event Action OnHealthChanged; invoked from the owner.
    • Rule: subscribe in OnEnable, unsubscribe in OnDisable. No exceptions.
    • Tradeoff: need reference to the publisher.
  3. Interface + GetComponent — polymorphic access.

    • Use when: caller needs to interact with unknown implementations (IDamageable, IInteractable).
    • Pattern: if (collision.TryGetComponent(out var target)) target.TakeDamage(10);
    • Tradeoff: GetComponent call cost (cache if used frequently).

Read the full file on GitHub · 93 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 93 lines · 26 tokens per session scan A 5ad84fc70d3a

Subscribe to this mod's changes

component-design is a skill published in the GitHub repository TheArcForge/UniClaude (51 stars, last pushed 3mo ago), licensed MIT. It adds 26 tokens to every session and 838 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.