structural-change-cost-model

structural-change-cost-model is a skill for Claude Code from dyCuong03/unity-agent-team. It costs 35 tokens per session (835 once invoked), scanned A, original, MIT.

A decision guide for changing the state of Unity ECS entities. It compares changing a component value, toggling an enableable component, and adding or removing a component.

In plain words
What is it for?
Use it when choosing how to represent changing health, position, speed, active status, or other entity state based on how often it changes and whether separate entity types are useful.
Why use it?
It helps avoid unnecessary entity movement between ECS storage groups, which can cost more than changing a value or an enabled flag, especially when state changes often.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it when choosing how to represent changing health, position, speed, active status, or other entity state based on how often it changes and whether separate entity types are useful.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/dycuong03/unity-agent-team/structural-change-cost-model
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.

Any agent
npx skills add dyCuong03/unity-agent-team --skill structural-change-cost-model
Clone the repo
git clone --depth 1 https://github.com/dyCuong03/unity-agent-team

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for structural-change-cost-model

README.md
[![agentmods](https://agentmods.dev/badge/skills/dycuong03/unity-agent-team/structural-change-cost-model/github.svg)](https://agentmods.dev/skills/dycuong03/unity-agent-team/structural-change-cost-model)
Your own site
<a href="https://agentmods.dev/skills/dycuong03/unity-agent-team/structural-change-cost-model"><img src="https://agentmods.dev/badge/skills/dycuong03/unity-agent-team/structural-change-cost-model/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for structural-change-cost-model

Your own site · 80×15
<a href="https://agentmods.dev/skills/dycuong03/unity-agent-team/structural-change-cost-model"><img src="https://agentmods.dev/badge/skills/dycuong03/unity-agent-team/structural-change-cost-model.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 835 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00035 $0.00835
Opus 5.5 $0.00014 $0.00334
Sonnet 5.5 $0.00007 $0.00167
Haiku 4.5 $0.00003 $0.00084

Measured 11d ago against content hash d8d6837dd446, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

structural-change-cost-model 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 11d 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.

.claude/skills/unity-dots/structural-change-cost-model/SKILL.md · 76 lines

How it starts

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

Structural Change Cost Model

Intent

Choose between value mutation, enableable component toggle, and structural add/remove based on change frequency, providing the canonical decision model for ECS state transitions.

Use When

Designing any system that needs to change entity state. This is the architectural decision that most directly affects ECS runtime performance.

Avoid When

There is no "avoid when" — this model applies to every state change decision in ECS.

Senior Pattern (Decision Tree)

  1. Value mutation (field on existing component): zero structural change, O(1) write, cheapest. Use when the state is a continuous quantity (health, position, speed) or a discrete enum field.
  2. Enableable component (IEnableableComponent toggle): O(1) bit flip per entity, no chunk migration. Use when binary active/inactive state toggles more than once per second per entity.
  3. Structural change (AddComponent / RemoveComponent): O(entity) chunk migrations. Use when the state change is infrequent (less than once per second per entity) AND semantic clarity from different archetypes is valuable.

Frequency Rule

  • Frequency > 1/sec per entity → value or enableable.
  • Frequency 1/sec – 1/minute per entity → enableable preferred, structural acceptable.
  • Frequency < 1/minute per entity → structural is fine and semantically clearest.
  • When in doubt: measure. The three-mode benchmark below is the definitive reference.

Code Template

// VALUE — continuous state, always cheapest
public struct EnemyState : IComponentData
{
    public float Health;         // mutate directly
    public float Speed;          // mutate directly
    public EnemyBehavior Mode;   // enum field — value mutation
}

// ENABLEABLE — binary toggle, high-frequency
public struct Stunned : IComponentData, IEnableableComponent
{
    public float RemainingDuration;
}
// Toggle: enabledRef.ValueRW = false  (O(1), no chunk move)

// STRUCTURAL — infrequent semantic archetype boundary
public struct Dead : IComponentData { }
// Add: ecb.AddComponent<Dead>(entity)  (once, when entity dies)
// Natural exclusion: all AI/movement queries use .WithNone<Dead>()

Read the full file on GitHub · 76 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. 11d ago First seen · 76 lines · 35 tokens per session scan A d8d6837dd446

Subscribe to this mod's changes

structural-change-cost-model is a skill published in the GitHub repository dyCuong03/unity-agent-team (7 stars, last pushed 2mo ago), licensed MIT. It adds 35 tokens to every session and 835 once invoked, about $0.0001 per session on Opus 5.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-10-02.

Related

Other skills, from other repositories

profiling

Diagnose frame-rate bottlenecks (CPU vs GPU bound FIRST), control Unreal Insights traces, sample live frame times, and annotate performance captures. Use when FPS is low/bad, the game is slow, or you need to find what is limiting the frame rate.

kevinpbuckley/VibeUE · 57 tokens

unity-performance-and-gc

Use when touching Unity per-frame code, spawning, physics queries, UI updates or rendering setup - profiling with numbers, zero-GC hot paths (caching, NonAlloc queries, no LINQ/closures/boxing, TMP SetText), ObjectPool, allocation tests, Burst/Jobs for bulk math, and rendering/physics settings that cost frames.

makifbaysal/tasktrooper · 76 tokens

web-game-performance-and-testing

Use when working on any browser game (Phaser, PixiJS, three.js, Babylon.js, PlayCanvas, Excalibur, KAPLAY) - requestAnimationFrame with clamped delta and visibility pause, zero-allocation frame loops, measuring in DevTools, bundle and asset size budgets, Vitest with seeded RNG and injected time, and a seeded…

makifbaysal/tasktrooper · 87 tokens

game-performance-budget

Use when touching anything that runs per frame, adding entities/effects at scale, or answering a stutter/frame-drop report - frame budgets per target FPS, per-system split, the profiler per engine, before/after numbers, and threshold tests.

makifbaysal/tasktrooper · 53 tokens

tune-performance

Use when the user reports the game is slow, drops framerate, stutters, takes forever to start, or runs poorly on specific hardware. Profiles the running game via summergetdiagnostics, identifies hotspots (rendering / physics / scripting), and proposes specific fixes with before/after metric expectations. Trigger on…

SummerEngine/summer-engine-agent · 94 tokens

technical-artist

!cat skills/shared/protocols/3d-spatial-foundations.md 2>/dev/null || echo "=== 3D Foundations not loaded ===".

buiphucminhtam/forgewright · 54 tokens