@combos-fun/engine 0.1.15 → 0.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/agent-skill.md CHANGED
@@ -1,35 +1,18 @@
1
1
  # `@combos-fun/engine` — Agent short card
2
2
 
3
- Combos Fun ECS microkernel. For new `@combos-fun/plugin-*` packages, read `plugin-authoring.md`.
4
-
5
- ## When to read
6
-
7
- Read when starting an engine task or resolving an engine API/lifecycle question. Public API and host protocol details are in [`references/public-api.md`](references/public-api.md).
8
-
9
- ## Microkernel model
10
-
11
- - Core: `Game`, `Scene`, `GameObject`, `Component`, `System`, `resource`, `decorators`. Hierarchy is `GameObject.parent` / `children` / `addChild`. 2D pose is `Transform2D` in `@combos-fun/plugin-renderer`; 3D pose is `Transform3D` in `@combos-fun/plugin-renderer-3d`.
12
- - Register an instance with `await game.addSystem(new XxxSystem(...))`; `Game({ systems })` awaits each system's `init`. Avoid `addSystem(XxxSystem, [params])`: runtime passes the tuple as one constructor argument.
13
- - Observe components with `@decorators.componentObserver({ Name: ['prop'] })`, then drain `componentObserver.clear()` in `update()`.
14
- - Frame order: all `Component.update` → all `Component.lateUpdate` → all `System.update` → all `System.lateUpdate`. `start()` runs on the first update tick.
15
-
16
- ## ECS hard rules
17
-
18
- 1. Keep per-entity state in Components so destroying a `GameObject` removes it.
19
- 2. Put single-entity behavior in Component hooks and cross-entity behavior in Systems; clean up listeners in `onDestroy`.
20
- 3. Bootstrap only creates and wires resources, Systems, GameObjects, and Components.
21
- 4. Use `static componentName` for custom Components and observers rather than ad-hoc scene scans.
22
- 5. Game code uses renderer plugins or registered `Renderer` / `Renderer3D` subclasses, not raw Pixi, Three, or DOM. Host-owning plugins are exceptions. Host `postMessage` types: `combos-game:*` only in this package; plugins use `combos-development-tool:*`.
23
- 6. Configure through constructor params; trigger runtime actions from lifecycle/event Components.
24
-
25
- ## Common pitfalls
26
-
27
- - Prefer `game.getSystem(SystemClass)`. String lookup matches `static systemName`, not the class name.
28
- - A blank canvas usually means the base renderer is missing or the game is not started; missing content usually means its renderer subsystem is absent.
29
- - Register resources with `resource.addResource`; `preload` only removes first-use delay.
30
- - `@Field` details belong to `@combos-fun/inspector-decorator`; engine `IDEProp` is legacy.
31
-
32
- ## See also
33
-
34
- - [`references/public-api.md`](references/public-api.md)
35
- - [`plugin-authoring.md`](plugin-authoring.md)
3
+ ECS microkernel. Host protocol: [`references/public-api.md`](references/public-api.md). New plugins: `plugin-authoring.md`.
4
+
5
+ - `Game`, `Scene`, `GameObject`, `Component`, `System`, `resource`, `decorators`. Hierarchy: `addChild` / `parent` / `children`. 2D pose: `Transform2D`. 3D pose: `Transform3D`.
6
+ - `await game.addSystem(new XxxSystem(...))`. `Game({ systems })` awaits each `init`. `addSystem(XxxSystem, [params])` passes the tuple as one argument.
7
+ - `@decorators.componentObserver({ Name: ['prop'] })`, then `componentObserver.clear()` in `update()`.
8
+ - Order: `Component.update` → `Component.lateUpdate` → `System.update` → `System.lateUpdate`. `start()` runs on the first tick.
9
+ - Per-entity state on Components, so destroying a GameObject removes it. Cross-entity work in Systems. Remove listeners in `onDestroy`.
10
+ - Bootstrap only wires resources, Systems, GameObjects, and Components. Configure in the constructor; act from lifecycle or events.
11
+ - Custom Components set `static componentName`. Do not scan the scene for them.
12
+ - Use renderer plugins or a registered `Renderer` / `Renderer3D`. Host-owned plugins may touch raw Pixi, Three, or DOM. Host messages: `combos-game:*` only here; plugins use `combos-development-tool:*`.
13
+ - `game.getSystem(SystemClass)`. String form is `static systemName`, not the class name.
14
+ - Scene: `game.scene`.
15
+ - Component `game` is a getter (`gameObject?.scene?.game`), after the GameObject is in the scene. System `game` is set in `addSystem`.
16
+ - `componentObserver.clear()` events may omit `gameObject`.
17
+ - `resource.addResource`. Each `src` slot is a url string or `{ type, url }`. `preload` only removes first-use delay.
18
+ - Inspector fields: `@Field` from `@combos-fun/inspector-decorator`. Engine `IDEProp` is legacy.
@@ -891,7 +891,7 @@ class Scene extends GameObject {
891
891
  }
892
892
 
893
893
  /** Generated at build from package.json */
894
- const version = "0.1.15";
894
+ const version = "0.1.16";
895
895
 
896
896
  /**
897
897
  * Sent to `window.parent` after each `System.init` completes during `Game.addSystem`