@adobe/data-ai 0.9.84 → 0.9.87

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.
Files changed (35) hide show
  1. package/.claude/rules/cohesion.md +2 -2
  2. package/.claude/rules/data-modelling.md +2 -0
  3. package/.claude/rules/ecs.md +275 -0
  4. package/.claude/rules/element.md +3 -1
  5. package/.claude/rules/features/data/state.md +2 -0
  6. package/.claude/rules/features/ecs/conformance.md +5 -3
  7. package/.claude/rules/features/ecs/systems.md +61 -5
  8. package/.claude/rules/features/ui/binding-element.md +226 -0
  9. package/.claude/rules/features/ui/lazy-wrapper.md +27 -0
  10. package/.claude/rules/features/ui/presentation-test.md +38 -0
  11. package/.claude/rules/{presentation.md → features/ui/presentation.md} +2 -32
  12. package/.claude/rules/function-references.md +2 -2
  13. package/.claude/rules/hooks.md +57 -0
  14. package/.claude/rules/layout.md +132 -0
  15. package/.claude/rules/lazy-element.md +1 -1
  16. package/.claude/rules/lit.md +115 -0
  17. package/.claude/rules/namespace.md +93 -135
  18. package/.claude/rules/observe.md +183 -0
  19. package/.claude/rules/react.md +102 -0
  20. package/.claude/rules/service.md +164 -0
  21. package/.claude/rules/type-casts.md +2 -2
  22. package/.claude-plugin/plugin.json +1 -1
  23. package/README.md +24 -4
  24. package/package.json +3 -3
  25. package/skills/build-actions/SKILL.md +3 -1
  26. package/skills/build-application/SKILL.md +5 -3
  27. package/skills/build-computed/SKILL.md +2 -0
  28. package/skills/build-data/SKILL.md +4 -0
  29. package/skills/build-feature/SKILL.md +12 -15
  30. package/skills/build-game/SKILL.md +4 -2
  31. package/skills/build-indexes/SKILL.md +2 -0
  32. package/skills/build-services/SKILL.md +2 -0
  33. package/skills/build-systems/SKILL.md +3 -3
  34. package/skills/graph-execute/SKILL.md +13 -0
  35. package/.claude/rules/archetypes.md +0 -60
@@ -5,6 +5,9 @@ input: feature
5
5
  output: feature
6
6
  ---
7
7
 
8
+ Skip if this feature doesn't contain or require systems.
9
+ Most games that use a canvas will use systems but most applications will not.
10
+
8
11
  Create `ecs/system-database/system-database.ts`: `Database.Plugin.create({ extends:
9
12
  Database.Plugin.combine(ComputedDatabase.plugin, scheduler), systems })` where the `systems`
10
13
  map is declared **inline** (see `features/ecs/systems.md` — inline is required for `db` to be
@@ -14,9 +17,6 @@ per-frame body helpers).
14
17
  - A system is a `SystemDeclaration`: `{ create, schedule?: { before?, after?, during? } }`.
15
18
  `create(db)` runs once (capture queries / index handles / closures); the returned function
16
19
  advances the world one tick. Return `void` for an init-only system (seeding entities).
17
- - The step math lives in `data/`; each system reads store rows, calls the pure `data/` step,
18
- writes back — via `db.store` (writable) for hot per-row work, or `db.transactions.*` for
19
- discrete events. Iterate archetypes per `archetypes.md` (tail→head when destroying rows).
20
20
  - Order under `schedule` (mirror the `data/` step's internal sequence); drive the loop by
21
21
  combining `scheduler` (rAF), gated by the `schedulerState` resource.
22
22
 
@@ -0,0 +1,13 @@
1
+ ---
2
+ name: graph-execute
3
+ description: executes a graph of steps
4
+ input: piped function calls
5
+ ---
6
+
7
+ The input is a set of piped function calls where each call is represented by a slash skill invocation.
8
+
9
+ Each step must be completed independently before moving on to the next.
10
+
11
+ The output of each phase is generally either a returned result or written to the file system. You can pass some context including any previous result to the next phase, but you must never read the subsequent phases in advance.
12
+
13
+ Call each of these phases in a subagent so that they are not even aware that future phases will take place.
@@ -1,60 +0,0 @@
1
- ---
2
- description: Authoring rules for ECS systems that iterate archetype rows.
3
- globs: "**/*.ts"
4
- ---
5
-
6
- # Archetypes — iteration rules
7
-
8
- ## Express selection in the query, not the loop
9
-
10
- `queryArchetypes(include, { exclude })` accepts both required and excluded
11
- component lists. Use them. Don't query a wider set and then skip rows or
12
- archetypes with an `if`.
13
-
14
- ```ts
15
- // ❌ post-filter
16
- for (const arch of db.store.queryArchetypes(["position", "rotation"])) {
17
- if (arch.components.has("_worldMatrix")) continue;
18
- ...
19
- }
20
-
21
- // ✅ declarative
22
- for (const arch of db.store.queryArchetypes(
23
- ["position", "rotation"],
24
- { exclude: ["_worldMatrix"] },
25
- )) {
26
- ...
27
- }
28
- ```
29
-
30
- ## When every row migrates out, iterate tail → head
31
-
32
- Archetypes are densely packed. Removing or migrating a row that isn't the
33
- last one triggers a hole-fill: the tail row is moved into the gap.
34
- Iterating `0 → rowCount-1` while migrating every row pays this cost on
35
- every iteration. Iterating `rowCount-1 → 0` means each removal is from
36
- the tail — no shift, indices ahead of the cursor stay valid.
37
-
38
- ```ts
39
- // ❌ shifts the tail into every hole, and the snapshot allocation is
40
- // only there to survive the shifts.
41
- const ids = [...];
42
- for (let i = 0; i < arch.rowCount; i++) ids[i] = arch.columns.id.get(i);
43
- for (const id of ids) db.store.update(id, { _worldMatrix: Mat4x4.identity });
44
-
45
- // ✅ no shifts, no allocation
46
- for (let i = arch.rowCount - 1; i >= 0; i--) {
47
- db.store.update(arch.columns.id.get(i), { _worldMatrix: Mat4x4.identity });
48
- }
49
- ```
50
-
51
- If only *some* rows migrate (filter inside the loop), snapshot the ids
52
- you'll touch — forward iteration is fine because rows you don't touch
53
- stay put.
54
-
55
- ## Don't snapshot what the query already filters
56
-
57
- A snapshot of "all entity ids in this archetype right now" is only
58
- needed when forward iteration would invalidate. Reverse iteration
59
- removes the need; an `exclude` clause removes the need to look at rows
60
- that don't qualify in the first place.