ecs-component-patterns

ecs-component-patterns is a skill for Claude Code from bullish0x/GameStudio. It costs 23 tokens per session (3,219 once invoked), scanned A, original, MIT.

A set of design patterns for organising data attached to entities in an Entity Component System (ECS), a game architecture where objects are built from small data pieces. It covers tags, shared data, and reusable component storage.

In plain words
What is it for?
Use it when designing components for game entities, improving how their data is stored, managing shared game data, or building reusable component libraries in TypeScript.
Why use it?
It helps keep game data small, consistent, and easy for systems to process. It also provides ways to represent flags and shared state without duplicating data.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: installed under .agents/ (shared by several agents).

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { Component } from '../core/Component';.

Good fit Use it when designing components for game entities, improving how their data is stored, managing shared game data, or building reusable component libraries in TypeScript.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/bullish0x/GameStudio
agentmods
npx agentmods add skills/bullish0x/gamestudio/ecs-component-patterns

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 ecs-component-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/bullish0x/gamestudio/ecs-component-patterns/github.svg)](https://agentmods.dev/skills/bullish0x/gamestudio/ecs-component-patterns)
Your own site
<a href="https://agentmods.dev/skills/bullish0x/gamestudio/ecs-component-patterns"><img src="https://agentmods.dev/badge/skills/bullish0x/gamestudio/ecs-component-patterns/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 ecs-component-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/bullish0x/gamestudio/ecs-component-patterns"><img src="https://agentmods.dev/badge/skills/bullish0x/gamestudio/ecs-component-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 23 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,219 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.00023 $0.03219
Opus 5 $0.00012 $0.01610
Sonnet 5 $0.00005 $0.00644
Haiku 4.5 $0.00002 $0.00322

Measured 7d ago against content hash 4648d847b8d6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

ecs-component-patterns 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 7d 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.

.agents/skills/ecs-component-patterns/SKILL.md · 576 lines

How it starts

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

ECS Component Patterns

When to Use

Use this skill when:

  • Designing components for game entities
  • Optimizing component memory layout
  • Implementing special component types
  • Managing shared game data
  • Creating reusable component libraries

Core Principles

  1. Data-Only Components: No logic, only data
  2. Small Components: Single responsibility principle
  3. Composition: Combine simple components for complex behavior
  4. Tag Components: Empty components as flags
  5. Shared Data: Singleton components for global state
  6. Type Safety: TypeScript for all component definitions

Implementation

1. Basic Component Types

// components/Transform.ts
import { Component } from '../core/Component';

export class Transform implements Component {
  constructor(
    public x: number = 0,
    public y: number = 0,
    public z: number = 0,
    public rotationX: number = 0,
    public rotationY: number = 0,
    public rotationZ: number = 0,
    public scaleX: number = 1,
    public scaleY: number = 1,
    public scaleZ: number = 1
  ) {}

  setPosition(x: number, y: number, z: number): this {
    this.x = x;
    this.y = y;
    this.z = z;
    return this;
  }

  setRotation(x: number, y: number, z: number): this {
    this.rotationX = x;
    this.rotationY = y;
    this.rotationZ = z;
    return this;
  }

  setScale(x: number, y: number, z: number): this {
    this.scaleX = x;
    this.scaleY = y;
    this.scaleZ = z;
    return this;
  }

  clone(): Transform {
    return new Transform(
      this.x, this.y, this.z,
      this.rotationX, this.rotationY, this.rotationZ,
      this.scaleX, this.scaleY, this.scaleZ
    );
  }
}
// components/Velocity.ts
export class Velocity implements Component {
  constructor(
    public vx: number = 0,
    public vy: number = 0,
    public vz: number = 0
  ) {}

  get magnitude(): number {
    return Math.sqrt(this.vx * this.vx + this.vy * this.vy + this.vz * this.vz);
  }

  set(x: number, y: number, z: number): this {
    this.vx = x;
    this.vy = y;
    this.vz = z;
    return this;
  }

  add(x: number, y: number, z: number): this {
    this.vx += x;
    this.vy += y;
    this.vz += z;
    return this;
  }

  scale(factor: number): this {
    this.vx *= factor;
    this.vy *= factor;
    this.vz *= factor;
    return this;
  }

  normalize(): this {
    const mag = this.magnitude;
    if (mag > 0) {
      this.scale(1 / mag);
    }
    return this;
  }
}

Read the full file on GitHub · 576 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. 7d ago First seen · 576 lines · 23 tokens per session scan A 4648d847b8d6

Subscribe to this mod's changes

ecs-component-patterns is a skill published in the GitHub repository bullish0x/GameStudio (12 stars, last pushed 3mo ago), licensed MIT. It adds 23 tokens to every session and 3,219 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-09-03.

Related

Other skills, from other repositories

pn-godot-dev

Guides Godot Engine 4.x development: GDScript, GDExtension (C++), multiplayer, VisualShader/shader code, export/platform config, autoloads, Resource serialization, InputMap, headless CI, AnimationPlayer/Tree, 2D/3D workflows, physics, PCG, and Blender pipeline. Use when developing Godot 4.x projects.

perniemann/pnCore · 86 tokens

pn-unreal-dev

Guides Unreal Engine development: C++, Blueprints, asset naming, build config, plugin development, programmatic asset creation, live uasset creation, Python automation, UAT/BuildGraph, Editor Utility Widgets, Data Validation, Materials, Niagara, PCG, and performance. Use when developing Unreal Engine projects.

perniemann/pnCore · 68 tokens

cocos-creator

A set of guidelines for writing Cocos Creator game components in TypeScript. Cocos Creator is a game engine where scenes contain nodes, components, prefabs, events, and managed resources.

Wade-DevCode/awesome-coding-skills-cn · 29 tokens

pn-unity-dev

Guides Unity development: C#, 2D Animation package, URP, asset pipelines, and scripting. Use when developing Unity projects, especially 2D games and animation workflows.

perniemann/pnCore · 42 tokens

threejs-development

Three.js TypeScript 3D game development patterns including scene architecture, geometry, manual physics, input handling, camera, lighting, and HUD. Use when implementing or modifying a Three.js 3D game.

robcost/gameforge · 46 tokens

coding-standards

Universal coding standards, best practices, and patterns for TypeScript, JavaScript, React, and Node.js development.

shahidshabbir-se/my-pi-setup · 28 tokens