← スキル一覧に戻る

ecs-systems
by narehart
⭐ 0🍴 0📅 2026年1月8日
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:
worldor imported query functions fromsrc/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
- No pure helper functions - Extract to
src/utils/instead - Props interface - All parameters via single props object
- Return object - Always return
{ success: boolean, ...data } - Query before mutate - Validate entities exist before changing them
- Single responsibility - One logical operation per system
Examples
Good system names:
moveItemSystem- moves an item between gridsdestroyItemSystem- removes an item from the worldequipItemSystem- places item in equipment slot
Bad (should be utils):
findFreePosition- pure calculation, no world accessisSpaceFree- pure validation, no world access
スコア
総合スコア
50/100
リポジトリの品質指標に基づく評価
✓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
レビュー
💬
レビュー機能は近日公開予定です