Back to list
narehart

ecs-systems

by narehart

0🍴 0📅 Jan 8, 2026

SKILL.md


name: ecs-systems description: Create ECS system functions that mutate the game world

ECS Systems

Write system functions in src/ecs/systems/ that implement game logic.

Requirements

  • File naming: *System.ts (e.g., moveItemSystem.ts)
  • Must reference: world or imported query functions from src/ecs/queries/
  • One system per file

Pattern

import { world } from '../world';
import type { Entity } from '../world';

interface SystemNameProps {
  entityId: string;
  // other parameters
}

interface SystemNameReturn {
  success: boolean;
  // optional data on success
}

export function systemName(props: SystemNameProps): SystemNameReturn {
  const { entityId } = props;

  // Query entities
  const entity = world.get(entityId);
  if (entity === undefined) {
    return { success: false };
  }

  // Perform mutations
  world.update(entity, {
    /* component changes */
  });

  return { success: true };
}

Rules

  1. No pure helper functions - Extract to src/utils/ instead
  2. Props interface - All parameters via single props object
  3. Return object - Always return { success: boolean, ...data }
  4. Query before mutate - Validate entities exist before changing them
  5. Single responsibility - One logical operation per system

Examples

Good system names:

  • moveItemSystem - moves an item between grids
  • destroyItemSystem - removes an item from the world
  • equipItemSystem - places item in equipment slot

Bad (should be utils):

  • findFreePosition - pure calculation, no world access
  • isSpaceFree - pure validation, no world access

Score

Total Score

50/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon