@reicek/neataptic-ts 0.1.22 → 0.1.23

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 (240) hide show
  1. package/.github/agents/boundary-mapper.agent.md +4 -2
  2. package/.github/agents/plan-scout.agent.md +3 -1
  3. package/.github/agents/solid-split.agent.md +9 -4
  4. package/.github/copilot-instructions.md +16 -0
  5. package/.github/skills/solid-split-playbook/SKILL.md +220 -0
  6. package/.github/skills/solid-split-playbook/assets/docs-checklist.md +34 -0
  7. package/.github/skills/solid-split-playbook/assets/split-plan-template.md +48 -0
  8. package/.github/skills/solid-split-playbook/assets/split-workflow-checklist.md +51 -0
  9. package/.github/skills/trace-analyzer-extension/SKILL.md +63 -0
  10. package/.github/skills/trace-analyzer-extension/assets/extension-checklist.md +24 -0
  11. package/.github/skills/trace-analyzer-extension/references/analyzer-extension-workflow.md +101 -0
  12. package/.github/skills/trace-audit-reporting/SKILL.md +96 -0
  13. package/.github/skills/trace-audit-reporting/assets/performance-report-template.md +123 -0
  14. package/.github/skills/trace-audit-reporting/references/trace-analysis-workflow.md +132 -0
  15. package/package.json +2 -1
  16. package/plans/Flappy_Bird_Folder_Documentation_Pass.md +53 -0
  17. package/plans/Flappy_Evolution_Worker_Documentation_Pass.md +58 -0
  18. package/scripts/analyze-trace.ts +590 -0
  19. package/src/README.md +27 -0
  20. package/src/architecture/README.md +61 -0
  21. package/src/architecture/architect.ts +6 -0
  22. package/src/architecture/network/README.md +16 -0
  23. package/src/architecture/network/network.types.ts +39 -0
  24. package/src/architecture/network/serialize/network.serialize.json.utils.ts +1 -0
  25. package/src/architecture/network/serialize/network.serialize.utils.ts +6 -1
  26. package/src/architecture/network/serialize/network.serialize.utils.types.ts +1 -1
  27. package/src/architecture/network.ts +114 -10
  28. package/src/neat/README.md +61 -0
  29. package/src/neat/neat.evolve.population.utils.ts +29 -5
  30. package/src/neat/neat.helpers.ts +16 -0
  31. package/src/neat/neat.topology-intent.utils.ts +160 -0
  32. package/test/examples/flappy_bird/README.md +193 -88
  33. package/test/examples/flappy_bird/browser-entry/README.md +421 -109
  34. package/test/examples/flappy_bird/browser-entry/browser-entry.network-view.utils.ts +6 -0
  35. package/test/examples/flappy_bird/browser-entry/browser-entry.playback.utils.ts +8 -0
  36. package/test/examples/flappy_bird/browser-entry/browser-entry.render.types.ts +26 -3
  37. package/test/examples/flappy_bird/browser-entry/browser-entry.runtime.types.ts +16 -1
  38. package/test/examples/flappy_bird/browser-entry/browser-entry.simulation.types.ts +39 -5
  39. package/test/examples/flappy_bird/browser-entry/browser-entry.stats.types.ts +32 -4
  40. package/test/examples/flappy_bird/browser-entry/browser-entry.ts +11 -0
  41. package/test/examples/flappy_bird/browser-entry/browser-entry.types.ts +8 -0
  42. package/test/examples/flappy_bird/browser-entry/browser-entry.visualization.types.ts +50 -7
  43. package/test/examples/flappy_bird/browser-entry/browser-entry.visualization.utils.ts +6 -0
  44. package/test/examples/flappy_bird/browser-entry/browser-entry.worker.types.ts +91 -10
  45. package/test/examples/flappy_bird/browser-entry/host/README.md +72 -61
  46. package/test/examples/flappy_bird/browser-entry/host/host.canvas.service.ts +16 -0
  47. package/test/examples/flappy_bird/browser-entry/host/host.constants.ts +20 -0
  48. package/test/examples/flappy_bird/browser-entry/host/host.dom.service.ts +10 -0
  49. package/test/examples/flappy_bird/browser-entry/host/host.stats.service.ts +14 -0
  50. package/test/examples/flappy_bird/browser-entry/host/host.ts +30 -0
  51. package/test/examples/flappy_bird/browser-entry/host/host.types.ts +13 -0
  52. package/test/examples/flappy_bird/browser-entry/host/resize/README.md +79 -44
  53. package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.constants.ts +16 -0
  54. package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.services.ts +32 -0
  55. package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.ts +15 -0
  56. package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.types.ts +29 -0
  57. package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.utils.ts +22 -0
  58. package/test/examples/flappy_bird/browser-entry/network-view/README.md +52 -62
  59. package/test/examples/flappy_bird/browser-entry/network-view/network-view.draw.service.ts +13 -0
  60. package/test/examples/flappy_bird/browser-entry/network-view/network-view.labels.utils.ts +12 -0
  61. package/test/examples/flappy_bird/browser-entry/network-view/network-view.layout.utils.ts +14 -0
  62. package/test/examples/flappy_bird/browser-entry/network-view/network-view.topology.utils.ts +12 -0
  63. package/test/examples/flappy_bird/browser-entry/network-view/network-view.ts +21 -0
  64. package/test/examples/flappy_bird/browser-entry/network-view/network-view.types.ts +11 -0
  65. package/test/examples/flappy_bird/browser-entry/playback/README.md +359 -198
  66. package/test/examples/flappy_bird/browser-entry/playback/background/README.md +124 -46
  67. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/README.md +429 -131
  68. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.batch.services.ts +64 -0
  69. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.cache.services.ts +30 -1
  70. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.constants.ts +121 -31
  71. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.geometry.batch.utils.ts +114 -0
  72. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.geometry.layout.utils.test.ts +96 -0
  73. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.geometry.layout.utils.ts +204 -0
  74. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.geometry.services.ts +49 -0
  75. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.geometry.utils.ts +38 -243
  76. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.layer.services.ts +81 -0
  77. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.math.utils.test.ts +33 -0
  78. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.math.utils.ts +84 -0
  79. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.pulse.selection.utils.ts +171 -0
  80. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.pulse.timing.utils.ts +124 -0
  81. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.pulse.utils.test.ts +279 -0
  82. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.pulse.utils.ts +45 -146
  83. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.scene.services.ts +26 -0
  84. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.services.ts +17 -163
  85. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.types.ts +138 -8
  86. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.utils.ts +2 -73
  87. package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.constants.ts +77 -12
  88. package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.draw.services.ts +184 -0
  89. package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.scene.services.ts +64 -0
  90. package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.services.ts +6 -244
  91. package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.types.ts +39 -2
  92. package/test/examples/flappy_bird/browser-entry/playback/frame-render/README.md +316 -85
  93. package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.bird.utils.ts +180 -0
  94. package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.canvas.services.ts +77 -0
  95. package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.entity.services.ts +167 -0
  96. package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.scene.services.ts +57 -0
  97. package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.service.test.ts +176 -0
  98. package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.service.ts +24 -3
  99. package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.services.ts +27 -264
  100. package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.trail.utils.ts +248 -0
  101. package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.types.ts +64 -0
  102. package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.utils.ts +11 -493
  103. package/test/examples/flappy_bird/browser-entry/playback/playback.frame-render.service.ts +6 -0
  104. package/test/examples/flappy_bird/browser-entry/playback/playback.iteration.services.ts +192 -0
  105. package/test/examples/flappy_bird/browser-entry/playback/playback.loop.service.ts +12 -0
  106. package/test/examples/flappy_bird/browser-entry/playback/playback.orchestration.types.ts +78 -0
  107. package/test/examples/flappy_bird/browser-entry/playback/playback.render.pipe-outline.service.ts +128 -0
  108. package/test/examples/flappy_bird/browser-entry/playback/playback.render.service.ts +1 -116
  109. package/test/examples/flappy_bird/browser-entry/playback/playback.session.services.ts +184 -0
  110. package/test/examples/flappy_bird/browser-entry/playback/playback.snapshot.utils.test.ts +121 -0
  111. package/test/examples/flappy_bird/browser-entry/playback/playback.snapshot.utils.ts +5 -41
  112. package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.layer.services.ts +36 -0
  113. package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.service.ts +2 -36
  114. package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.services.ts +7 -11
  115. package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.types.ts +30 -1
  116. package/test/examples/flappy_bird/browser-entry/playback/playback.trail.utils.ts +9 -86
  117. package/test/examples/flappy_bird/browser-entry/playback/playback.ts +31 -364
  118. package/test/examples/flappy_bird/browser-entry/playback/playback.types.ts +11 -0
  119. package/test/examples/flappy_bird/browser-entry/playback/playback.worker-channel.utils.ts +11 -123
  120. package/test/examples/flappy_bird/browser-entry/playback/snapshot/README.md +55 -0
  121. package/test/examples/flappy_bird/browser-entry/playback/snapshot/playback.snapshot.services.ts +103 -0
  122. package/test/examples/flappy_bird/browser-entry/playback/snapshot/playback.snapshot.summary.utils.test.ts +45 -0
  123. package/test/examples/flappy_bird/browser-entry/playback/snapshot/playback.snapshot.summary.utils.ts +28 -0
  124. package/test/examples/flappy_bird/browser-entry/playback/trail/README.md +95 -0
  125. package/test/examples/flappy_bird/browser-entry/playback/trail/playback.trail.history.services.test.ts +35 -0
  126. package/test/examples/flappy_bird/browser-entry/playback/trail/playback.trail.history.services.ts +64 -0
  127. package/test/examples/flappy_bird/browser-entry/playback/trail/playback.trail.opacity.utils.test.ts +37 -0
  128. package/test/examples/flappy_bird/browser-entry/playback/trail/playback.trail.opacity.utils.ts +74 -0
  129. package/test/examples/flappy_bird/browser-entry/playback/worker-channel/README.md +71 -0
  130. package/test/examples/flappy_bird/browser-entry/playback/worker-channel/playback.worker-channel.request.services.ts +45 -0
  131. package/test/examples/flappy_bird/browser-entry/playback/worker-channel/playback.worker-channel.summary.services.ts +74 -0
  132. package/test/examples/flappy_bird/browser-entry/playback/worker-channel/playback.worker-channel.types.ts +53 -0
  133. package/test/examples/flappy_bird/browser-entry/runtime/README.md +100 -31
  134. package/test/examples/flappy_bird/browser-entry/runtime/runtime.browser-globals.service.ts +15 -0
  135. package/test/examples/flappy_bird/browser-entry/runtime/runtime.errors.ts +17 -0
  136. package/test/examples/flappy_bird/browser-entry/runtime/runtime.evolution-launch.service.ts +11 -0
  137. package/test/examples/flappy_bird/browser-entry/runtime/runtime.evolution-loop.service.ts +19 -0
  138. package/test/examples/flappy_bird/browser-entry/runtime/runtime.lifecycle.service.ts +15 -0
  139. package/test/examples/flappy_bird/browser-entry/runtime/runtime.startup.service.ts +18 -0
  140. package/test/examples/flappy_bird/browser-entry/runtime/runtime.telemetry.service.ts +24 -0
  141. package/test/examples/flappy_bird/browser-entry/runtime/runtime.types.ts +29 -0
  142. package/test/examples/flappy_bird/browser-entry/visualization/README.md +80 -69
  143. package/test/examples/flappy_bird/browser-entry/visualization/visualization.colors.utils.ts +26 -0
  144. package/test/examples/flappy_bird/browser-entry/visualization/visualization.draw.service.ts +22 -0
  145. package/test/examples/flappy_bird/browser-entry/visualization/visualization.legend.utils.ts +19 -0
  146. package/test/examples/flappy_bird/browser-entry/visualization/visualization.topology.utils.ts +10 -0
  147. package/test/examples/flappy_bird/browser-entry/visualization/visualization.ts +9 -0
  148. package/test/examples/flappy_bird/browser-entry/visualization/visualization.types.ts +14 -0
  149. package/test/examples/flappy_bird/browser-entry/worker-channel/README.md +98 -16
  150. package/test/examples/flappy_bird/browser-entry/worker-channel/worker-channel.errors.ts +11 -0
  151. package/test/examples/flappy_bird/browser-entry/worker-channel/worker-channel.generation.service.ts +12 -0
  152. package/test/examples/flappy_bird/browser-entry/worker-channel/worker-channel.playback.service.test.ts +143 -0
  153. package/test/examples/flappy_bird/browser-entry/worker-channel/worker-channel.playback.service.ts +140 -14
  154. package/test/examples/flappy_bird/browser-entry/worker-channel/worker-channel.request.service.ts +27 -0
  155. package/test/examples/flappy_bird/browser-entry/worker-channel/worker-channel.ts +8 -0
  156. package/test/examples/flappy_bird/browser-entry/worker-channel/worker-channel.types.ts +23 -0
  157. package/test/examples/flappy_bird/browser-entry/worker-channel/worker-channel.url.service.ts +5 -0
  158. package/test/examples/flappy_bird/constants/README.md +29 -45
  159. package/test/examples/flappy_bird/constants/constants.birds.ts +16 -38
  160. package/test/examples/flappy_bird/constants/constants.difficulty.ts +21 -0
  161. package/test/examples/flappy_bird/constants/constants.network.ts +1 -1
  162. package/test/examples/flappy_bird/constants/constants.observation.ts +7 -0
  163. package/test/examples/flappy_bird/constants/constants.palette.ts +4 -4
  164. package/test/examples/flappy_bird/constants/constants.physics.ts +9 -0
  165. package/test/examples/flappy_bird/constants/constants.pipe-render.ts +3 -0
  166. package/test/examples/flappy_bird/constants/constants.pipes.ts +22 -3
  167. package/test/examples/flappy_bird/constants/constants.runtime.ts +28 -4
  168. package/test/examples/flappy_bird/constants/constants.ts +6 -0
  169. package/test/examples/flappy_bird/environment/README.md +58 -19
  170. package/test/examples/flappy_bird/environment/environment.collision.utils.ts +7 -0
  171. package/test/examples/flappy_bird/environment/environment.constants.ts +16 -3
  172. package/test/examples/flappy_bird/environment/environment.observation.utils.ts +11 -0
  173. package/test/examples/flappy_bird/environment/environment.state.service.ts +10 -0
  174. package/test/examples/flappy_bird/environment/environment.step.service.ts +12 -0
  175. package/test/examples/flappy_bird/environment/environment.types.ts +14 -0
  176. package/test/examples/flappy_bird/evaluation/README.md +29 -4
  177. package/test/examples/flappy_bird/evaluation/evaluation.constants.ts +23 -4
  178. package/test/examples/flappy_bird/evaluation/evaluation.fitness.utils.ts +15 -0
  179. package/test/examples/flappy_bird/evaluation/evaluation.rollout.service.ts +3 -0
  180. package/test/examples/flappy_bird/evaluation/evaluation.seed.utils.ts +4 -0
  181. package/test/examples/flappy_bird/evaluation/evaluation.types.ts +18 -2
  182. package/test/examples/flappy_bird/evaluation/rollout/README.md +80 -16
  183. package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.constants.ts +9 -1
  184. package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.service.ts +13 -0
  185. package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.services.ts +28 -0
  186. package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.types.ts +13 -0
  187. package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.utils.ts +31 -0
  188. package/test/examples/flappy_bird/flappy-evolution-worker/README.md +266 -39
  189. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.constants.ts +49 -7
  190. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.errors.ts +34 -3
  191. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.evolution.service.ts +22 -0
  192. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.playback.service.ts +55 -19
  193. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.protocol.service.ts +27 -1
  194. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.runtime.service.ts +23 -0
  195. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.simulation.frame.service.ts +15 -1
  196. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.simulation.types.ts +9 -1
  197. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.simulation.utils.ts +16 -2
  198. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.snapshot.utils.test.ts +94 -0
  199. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.snapshot.utils.ts +78 -13
  200. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.ts +55 -3
  201. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.types.ts +170 -22
  202. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.warm-start.service.ts +27 -4
  203. package/test/examples/flappy_bird/flappy.simulation.shared.utils.ts +12 -0
  204. package/test/examples/flappy_bird/flappyEnvironment.ts +21 -0
  205. package/test/examples/flappy_bird/flappyEvaluation.ts +12 -0
  206. package/test/examples/flappy_bird/flappyEvolution.worker.ts +7 -0
  207. package/test/examples/flappy_bird/index.ts +8 -2
  208. package/test/examples/flappy_bird/rng.ts +10 -0
  209. package/test/examples/flappy_bird/simulation-shared/README.md +128 -27
  210. package/test/examples/flappy_bird/simulation-shared/observation/README.md +83 -11
  211. package/test/examples/flappy_bird/simulation-shared/observation/observation.features.utils.ts +38 -0
  212. package/test/examples/flappy_bird/simulation-shared/observation/observation.ts +10 -0
  213. package/test/examples/flappy_bird/simulation-shared/observation/observation.vector.utils.ts +22 -0
  214. package/test/examples/flappy_bird/simulation-shared/simulation-shared.constants.ts +3 -0
  215. package/test/examples/flappy_bird/simulation-shared/simulation-shared.control.utils.ts +6 -0
  216. package/test/examples/flappy_bird/simulation-shared/simulation-shared.difficulty.utils.ts +9 -0
  217. package/test/examples/flappy_bird/simulation-shared/simulation-shared.errors.ts +10 -1
  218. package/test/examples/flappy_bird/simulation-shared/simulation-shared.memory.utils.ts +18 -0
  219. package/test/examples/flappy_bird/simulation-shared/simulation-shared.observation.utils.ts +3 -0
  220. package/test/examples/flappy_bird/simulation-shared/simulation-shared.spawn.utils.ts +16 -0
  221. package/test/examples/flappy_bird/simulation-shared/simulation-shared.statistics.utils.ts +7 -1
  222. package/test/examples/flappy_bird/simulation-shared/simulation-shared.types.ts +38 -5
  223. package/test/examples/flappy_bird/trainFlappyBird.ts +13 -0
  224. package/test/examples/flappy_bird/trainer/README.md +140 -27
  225. package/test/examples/flappy_bird/trainer/evaluation/README.md +66 -12
  226. package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.constants.ts +6 -0
  227. package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.services.ts +13 -0
  228. package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.ts +22 -0
  229. package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.types.ts +7 -0
  230. package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.utils.ts +21 -0
  231. package/test/examples/flappy_bird/trainer/trainer.fitness.service.ts +23 -1
  232. package/test/examples/flappy_bird/trainer/trainer.loop.service.ts +17 -1
  233. package/test/examples/flappy_bird/trainer/trainer.report.service.ts +10 -0
  234. package/test/examples/flappy_bird/trainer/trainer.setup.service.ts +22 -0
  235. package/test/examples/flappy_bird/trainer/trainer.signals.service.ts +8 -0
  236. package/test/examples/flappy_bird/trainer/trainer.ts +27 -0
  237. package/test/examples/flappy_bird/trainer/trainer.types.ts +44 -7
  238. package/test/neat/neat.topology-intent.test.ts +129 -0
  239. package/test/network/network.topology-intent.test.ts +44 -0
  240. package/test/examples/flappy_bird/Trace-20260309T191949.json +0 -24124
@@ -13,12 +13,14 @@ Your job is to map folder responsibilities, identify orchestration files versus
13
13
  - DO NOT edit files.
14
14
  - DO NOT propose a large rewrite when a sequence of targeted edits is safer.
15
15
  - DO NOT ignore folder README guidance or plan alignment when the task is architectural.
16
+ - For demo/example tasks, DO NOT map only the demo boundary when the public library API or runtime contract is the real seam that should change.
16
17
 
17
18
  ## Approach
18
19
  1. Read the nearest folder `README.md` and parent README when needed.
19
20
  2. For architectural work, read `plans/README.md` and the single most relevant detailed plan.
20
- 3. Identify the public API surface, orchestration file, helper clusters, tests, and likely affected neighbors.
21
- 4. Return a stepwise decomposition that favors small, documented, low-risk passes.
21
+ 3. Identify whether the triggering issue is truly demo-local or whether the demo is surfacing a reusable library DX gap.
22
+ 4. Identify the public API surface, orchestration file, helper clusters, tests, and likely affected neighbors.
23
+ 5. Return a stepwise decomposition that favors small, documented, low-risk passes.
22
24
 
23
25
  ## Output Format
24
26
  Return:
@@ -13,12 +13,14 @@ Your job is to identify the smallest useful subset of `plans/` documents for a t
13
13
  - DO NOT edit files.
14
14
  - DO NOT read the whole `plans/` directory unless the task explicitly requires broad roadmap synthesis.
15
15
  - DO NOT recommend a plan file without explaining why it matches the task.
16
+ - For demo or example work, DO NOT default to demo-local compensation when the symptom points to a library/API/defaults gap; call out the higher-leverage library fix explicitly.
16
17
 
17
18
  ## Approach
18
19
  1. Read `plans/README.md` first.
19
20
  2. If the task concerns core NEAT architecture or evolutionary correctness, read `plans/neat.plans.md` next.
20
21
  3. Otherwise read only the single most relevant detailed plan, with at most one additional related plan when necessary.
21
- 4. Extract terminology, constraints, sequencing hints, and any likely code/plan mismatch risks.
22
+ 4. For demo-driven tasks, determine whether the demo is exposing a reusable library ergonomics gap and prefer plan alignment that fixes the library rather than the demo symptom.
23
+ 5. Extract terminology, constraints, sequencing hints, and any likely code/plan mismatch risks.
22
24
 
23
25
  ## Output Format
24
26
  Return:
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: "Use when executing a deliberate SOLID module split, folderizing a large file, following or creating a durable split plan, updating plan progress, and ending each completed step with a handoff prompt for the next session. Keywords: SOLID split, split plan, folderize, module boundary, orchestration-first, compatibility re-export, handoff prompt."
2
+ description: "Use when executing a deliberate SOLID module split, folderizing a large file, starting from a user-specified root such as #file:flappy_bird, following or creating a durable split plan, improving JSDoc so generated README files read naturally, updating plan progress, and ending each completed step with a handoff prompt for the next session. Keywords: SOLID split, split plan, folderize, module boundary, orchestration-first, compatibility re-export, generated README, JSDoc, handoff prompt."
3
3
  name: "solid-split"
4
4
  tools: [read, edit, search, execute, todo, agent]
5
5
  argument-hint: "Describe the module to split, the plan file to follow or create, and the single current step to complete."
@@ -10,6 +10,8 @@ You are a plan-first SOLID refactor execution agent for NeatapticTS.
10
10
 
11
11
  Your job is to complete one durable split step at a time, keep the codebase aligned with a resumable plan document, and end every completed step with a handoff prompt that is ready to start the next step in a new session.
12
12
 
13
+ You should follow the companion skill `solid-split-playbook` when it is available. Treat that skill as the canonical repository workflow for README-first reconnaissance, plan discipline, documentation upgrades, validation expectations, and final handoff quality.
14
+
13
15
  ## Constraints
14
16
  - ALWAYS locate and follow the most relevant existing plan in `plans/` before editing.
15
17
  - If no suitable durable plan exists, create one in `plans/` before making implementation edits.
@@ -19,6 +21,7 @@ Your job is to complete one durable split step at a time, keep the codebase alig
19
21
  - DO NOT move on to the next plan step in the same session after finishing the current one.
20
22
  - DO NOT leave the plan file stale after completing or materially reshaping a step.
21
23
  - DO NOT hand-edit generated README files; improve source JSDoc and run docs generation when needed.
24
+ - DO improve touched public JSDoc so generated README output becomes richer, more educational, and easier to navigate after the split.
22
25
  - DO NOT break stable import paths when a compatibility facade or re-export shim is required.
23
26
  - Prefer folder-first module boundaries and orchestration-first main files.
24
27
 
@@ -29,15 +32,17 @@ Your job is to complete one durable split step at a time, keep the codebase alig
29
32
  4. Find the current plan step to execute. If no durable plan exists, create one modeled after `plans/asciiMaze_SOLID_split.md`: short purpose, durable progress rules, concise target shape, explicit execution steps, and done criteria.
30
33
  5. Convert the current step into a tight todo list with one active item.
31
34
  6. Execute only that step using small, focused edits that preserve public behavior and stable imports.
32
- 7. Update the plan immediately after the step is complete or if the durable step ordering changes.
33
- 8. Run the minimum validation needed for touched files and stated done criteria, such as TypeScript checks, docs generation, or build validation.
34
- 9. Stop after reporting the completed step. Do not continue into the next step automatically.
35
+ 7. Treat generated README files as doc-gap detectors. If the README would read too thinly after the split, improve the touched source JSDoc before validating.
36
+ 8. Update the plan immediately after the step is complete or if the durable step ordering changes.
37
+ 9. Run the minimum validation needed for touched files and stated done criteria, such as TypeScript checks, docs generation, or build validation.
38
+ 10. Stop after reporting the completed step. Do not continue into the next step automatically.
35
39
 
36
40
  ## Split Execution Rules
37
41
  - Keep the main `module/module.ts` file orchestration-first.
38
42
  - Move one helper category at a time behind focused files or subfolders.
39
43
  - Reduce the old top-level file to a compatibility re-export when stable imports must keep working.
40
44
  - Improve JSDoc on exported or public surfaces touched by the split.
45
+ - When a concept is important to understanding the boundary, prefer richer educational JSDoc that explains the why and, when useful, points readers toward a high-value background reference such as a relevant Wikipedia topic.
41
46
  - Prefer declarative top-level flow and keep implementation detail below the fold in helpers or services.
42
47
  - Preserve existing style, naming conventions, and ES2023-first patterns.
43
48
 
@@ -76,6 +76,22 @@ When applying a plan:
76
76
  - prefer incremental steps that move the code toward the documented direction,
77
77
  - avoid introducing APIs or architecture that conflict with a stated plan without explicitly flagging the conflict.
78
78
 
79
+ Demo-first library gap policy (critical)
80
+ ---------------------------------------
81
+ Examples and demos in `test/examples/` are not places to normalize library ergonomics gaps. They are probes that should reveal where the public API, defaults, or runtime contracts fall short of world-class expectations.
82
+
83
+ When demo work exposes a mismatch between obvious user intent and the library behavior:
84
+
85
+ - treat the demo as evidence of a library DX gap first,
86
+ - prefer fixing the library, public API, defaults, or shared runtime semantics,
87
+ - use demo-local compensation only when the issue is genuinely demo-specific or a library fix would be unsafe for the current task,
88
+ - if a temporary demo-local workaround is unavoidable, call it out explicitly as technical debt and note the preferred library-level fix.
89
+
90
+ Critical expectation for feed-forward examples:
91
+
92
+ - if a user selects a feed-forward builder or feed-forward mutation policy, agents should assume the expected DX is that feed-forward intent flows through to the runtime without extra demo-specific flags unless the codebase explicitly documents a different contract,
93
+ - when that expectation is not met, agents should frame the issue as a library-level design gap and update plans accordingly.
94
+
79
95
  For substantial work, agent prompts and final summaries should briefly note which README and which plan document informed the change.
80
96
  After substantial edits, keep summaries short and high level by default, and only expand into detailed walkthroughs when the user asks.
81
97
 
@@ -0,0 +1,220 @@
1
+ ---
2
+ name: solid-split-playbook
3
+ description: 'Plan and execute repo-consistent SOLID splits in NeatapticTS across src/ or test/, starting from a user-specified root such as #file:flappy_bird. Use when folderizing a module, thinning a compatibility facade, improving JSDoc so generated README files read naturally, or continuing an incremental split pass with stable imports.'
4
+ argument-hint: 'Describe the split root, target module or folder, any relevant plan file, and optional detail about the next boundary to extract.'
5
+ user-invocable: true
6
+ disable-model-invocation: false
7
+ ---
8
+
9
+ # Solid Split Playbook
10
+
11
+ Use this skill to run the NeatapticTS house style for deliberate, resumable,
12
+ documentation-aware SOLID splits in either library code under `src/` or demos
13
+ and examples under `test/`.
14
+
15
+ This skill is designed to complement the existing `solid-split` custom agent.
16
+ The skill defines the repository-specific split protocol, documentation bar,
17
+ plan expectations, and validation checklist that should remain consistent across
18
+ split sessions.
19
+
20
+ ## When to Use
21
+
22
+ - The user wants a SOLID split, folderization pass, or orchestration-first
23
+ cleanup from a specific root such as `#file:flappy_bird`.
24
+ - A top-level file is acting as a coordination sink and should become a thin
25
+ compatibility facade or stable public entrypoint.
26
+ - A module boundary needs to be mapped before extracting `*.services.ts`,
27
+ `*.utils.ts`, `*.types.ts`, `*.errors.ts`, or `*.constants.ts` helpers.
28
+ - Generated folder README output looks stale, thin, or not educational enough
29
+ after a refactor.
30
+ - A multi-session split needs a durable plan, strict step sequencing, and a
31
+ high-quality handoff prompt for the next session.
32
+
33
+ ## Invocation Pattern
34
+
35
+ Typical use:
36
+
37
+ ```text
38
+ /solid-split
39
+ SOLID split #file:flappy_bird
40
+ ```
41
+
42
+ Useful optional detail to include:
43
+
44
+ - the root from which to start splitting,
45
+ - the current file or boundary believed to be overloaded,
46
+ - the plan file to follow if one already exists,
47
+ - whether this session should map boundaries, create the plan, or complete one
48
+ specific split step.
49
+
50
+ ## Primary Resources
51
+
52
+ - [Split workflow checklist](./assets/split-workflow-checklist.md)
53
+ - [Split plan template](./assets/split-plan-template.md)
54
+ - [Documentation improvement checklist](./assets/docs-checklist.md)
55
+ - Existing split execution agent: `solid-split`
56
+
57
+ ## Repo Discovery Order
58
+
59
+ For any non-trivial split, follow this order before editing:
60
+
61
+ 1. Build a full README inventory for the requested root, including nested
62
+ subfolder `README.md` files that shape the documentation surface.
63
+ 2. Convert that README inventory into an explicit todo list so the session can
64
+ proceed folder by folder with visible scope.
65
+ 3. Read the nearest folder `README.md` for the target root.
66
+ 4. Read the nearest useful parent `README.md` if the split spans sibling
67
+ surfaces.
68
+ 5. Read `plans/README.md`.
69
+ 6. Read only the single most relevant detailed plan, plus at most one adjacent
70
+ plan if the split clearly spans two initiatives.
71
+ 7. Then inspect the smallest set of source files needed to confirm the actual
72
+ seams.
73
+
74
+ Generated folder README files are reconnaissance artifacts. Do not hand-edit
75
+ them. Use them to infer responsibility boundaries, missing docs, stale public
76
+ surface descriptions, likely neighboring consumers, and where source JSDoc must
77
+ improve.
78
+
79
+ For documentation-heavy passes over a root such as `#file:flappy_bird`, the
80
+ README inventory is mandatory. Do not start editing source until the full set of
81
+ README-owning folders is visible in the todo list.
82
+
83
+ ## Split Philosophy
84
+
85
+ The project prefers small, durable, orchestration-first refactors over large
86
+ one-pass rewrites.
87
+
88
+ - Keep stable public import paths working unless the user explicitly approves a
89
+ breaking change.
90
+ - Reduce the old top-level file to a compatibility facade or public orchestration
91
+ surface when stable imports matter.
92
+ - Move one responsibility cluster at a time into focused helpers or subfolders.
93
+ - Prefer folder-based boundaries when a file has become a real subsystem.
94
+ - Keep top-level flows declarative: collect, transform, fold, return.
95
+ - Use descriptive names and ES2023-first style where the touched code benefits.
96
+
97
+ For demos under `test/examples/`, treat DX gaps as library/runtime evidence
98
+ first. Do not normalize demo-specific workarounds if the real issue is a shared
99
+ API, default, or runtime contract.
100
+
101
+ ## Required Split Workflow
102
+
103
+ 1. Confirm the split root and whether the user wants planning, execution, or
104
+ continuation of an existing pass.
105
+ 2. Build a full inventory of every `README.md` under that root.
106
+ 3. Convert the inventory into a todo list that names each README-owning folder.
107
+ 4. Read the README files in that inventory before deep code search, starting at
108
+ the root and then proceeding folder by folder.
109
+ 5. Read `plans/README.md`, then the single most relevant plan file when the work
110
+ is architectural or part of an ongoing roadmap stream.
111
+ 6. If the split spans an unfamiliar area, use the existing `Boundary Mapper`,
112
+ `Plan Scout`, or `Docs Scout` agents as needed.
113
+ 7. If no durable plan exists, create one using the bundled template.
114
+ 8. Keep the README todo explicit and folder-focused, with exactly one active
115
+ README or folder documentation item at a time.
116
+ 9. Execute only one durable step unless the user explicitly asks for more.
117
+ 10. Improve JSDoc on touched exported and public surfaces so generated README
118
+ output remains educational, example-driven, and conceptually clear.
119
+ 11. Run the minimum validation needed for touched files and the step's done
120
+ criteria.
121
+ 12. Update the plan immediately after the step completes.
122
+ 13. End with a next-session handoff prompt that can continue from the next step
123
+ without depending on prior chat history.
124
+
125
+ ## Documentation Standards
126
+
127
+ This repository is a public-facing educational library. Splits must improve the
128
+ generated documentation story, not only the file structure.
129
+
130
+ When touching exported or public surfaces:
131
+
132
+ - Add or improve JSDoc so the generated README reads naturally.
133
+ - Include concise “what/why” explanations, not only type signatures.
134
+ - Add short `@example` blocks when behavior or intended usage is not obvious.
135
+ - Mention invariants, defaults, performance costs, or error semantics when they
136
+ materially affect downstream users.
137
+ - When the topic is conceptually important, suggest useful background reading in
138
+ plain prose inside the JSDoc description, for example a Wikipedia article on
139
+ a concept such as parallax, graph theory, dynamic programming, or NEAT.
140
+ - Keep examples short, dependency-light, and aligned with the actual public API.
141
+
142
+ Use the generated README as a doc gap detector:
143
+
144
+ - If the README sounds too terse, improve source JSDoc.
145
+ - If neighboring modules are undocumented in the README, consider whether the
146
+ touched source needs clearer exported comments.
147
+ - If a new subfolder is introduced, run `npm run docs` after doc-affecting edits
148
+ so the generated README surface stays synchronized.
149
+ - During large documentation passes, work through the README inventory one todo
150
+ item at a time instead of jumping between folders opportunistically.
151
+
152
+ ## Naming and File-Shape Rules
153
+
154
+ Use the repo's standard architecture pattern where it fits the boundary:
155
+
156
+ - `module/module.ts`
157
+ - `module/module.utils.ts`
158
+ - `module/module.types.ts`
159
+ - `module/module.errors.ts`
160
+ - `module/module.services.ts`
161
+ - `module/module.constants.ts`
162
+
163
+ For nested boundaries:
164
+
165
+ - `module/sub-module/module.sub-module.ts`
166
+ - `module/sub-module/module.sub-module.utils.ts`
167
+ - `module/sub-module/module.sub-module.types.ts`
168
+ - `module/sub-module/module.sub-module.errors.ts`
169
+ - `module/sub-module/module.sub-module.services.ts`
170
+ - `module/sub-module/module.sub-module.constants.ts`
171
+
172
+ Interpretation rules:
173
+
174
+ - `*.ts`: public surface or orchestration-first entrypoint.
175
+ - `*.utils.ts`: pure or narrow helper logic.
176
+ - `*.services.ts`: stateful, coordinating, or side-effecting helpers.
177
+ - `*.types.ts`: typed contracts and context/result objects.
178
+ - `*.errors.ts`: local error classes and error helpers.
179
+ - `*.constants.ts`: named constants and local lookup tables.
180
+
181
+ ## Validation Rules
182
+
183
+ After a split step, run only the minimum validation needed for the touched
184
+ surface and the plan step done criteria.
185
+
186
+ Typical options:
187
+
188
+ - file-level diagnostics for touched files,
189
+ - focused Jest tests for the changed surface,
190
+ - `npx tsc --noEmit -p tsconfig.json` or `tsconfig.test.json` when the step is
191
+ type-heavy,
192
+ - `npm run docs` after doc-affecting changes,
193
+ - targeted build validation when the split changes bundling or runtime entry
194
+ behavior.
195
+
196
+ Do not run broad test suites unless they are truly needed for the current step.
197
+
198
+ ## Guardrails
199
+
200
+ - Do not hand-edit generated README files.
201
+ - Do not revert unrelated user or generated changes.
202
+ - Do not complete multiple durable plan steps in one invocation unless the user
203
+ explicitly asks.
204
+ - Do not break stable import paths when a facade or compatibility shim is
205
+ appropriate.
206
+ - Do not leave a plan stale after reshaping a step.
207
+ - Do not treat examples as the final place to hide library ergonomics gaps.
208
+ - Do not lower the documentation bar during refactors; public-facing docs should
209
+ get better as boundaries improve.
210
+
211
+ ## Expected Final Output
212
+
213
+ The final response for a split step should include:
214
+
215
+ - the plan file used or created,
216
+ - the completed step label,
217
+ - a short summary of the new boundary shape,
218
+ - validation results,
219
+ - the durable plan update,
220
+ - a fenced `text` handoff prompt for the next step.
@@ -0,0 +1,34 @@
1
+ # Documentation Checklist For Splits
2
+
3
+ Use this checklist whenever a split touches exported or public code.
4
+
5
+ ## Required
6
+
7
+ - Every touched exported function, class, type, and shared constant has JSDoc.
8
+ - JSDoc explains what the API does and why the boundary exists.
9
+ - Parameters and returns are documented.
10
+ - Non-obvious semantics include a short example.
11
+ - Important invariants, defaults, error cases, or performance notes are called
12
+ out.
13
+
14
+ ## README-Aware Review
15
+
16
+ Ask these questions while looking at the generated folder README:
17
+
18
+ 1. Would a first-time reader understand the purpose of the new subfolder?
19
+ 2. Does the public facade description explain why it still exists?
20
+ 3. Are helper files described in a way that sounds educational rather than
21
+ merely mechanical?
22
+ 4. Are any exported constants under-documented in the README because their
23
+ source JSDoc is too terse?
24
+ 5. Does the README make the module feel easier to explore after the split?
25
+
26
+ ## Educational Quality Bar
27
+
28
+ - Prefer short conceptual descriptions over bare type restatement.
29
+ - Use brief examples that match the current public API.
30
+ - When the concept is central to understanding the design, mention useful
31
+ external reading in prose, such as a relevant Wikipedia article.
32
+ - Keep examples and explanations dependency-light so they survive doc
33
+ generation cleanly.
34
+ - Avoid filler comments that say only what the code already states.
@@ -0,0 +1,48 @@
1
+ # <Workstream Name> SOLID Split
2
+
3
+ ## Purpose
4
+
5
+ Describe the coordination sink being reduced, the stable surface that must keep
6
+ working, and the target architectural shape after the split.
7
+
8
+ ## Root
9
+
10
+ - Split root: `<path>`
11
+ - Nearest README reviewed: `<path>`
12
+ - Parent README reviewed: `<path or n/a>`
13
+ - Relevant plan: `<path or n/a>`
14
+
15
+ ## Durable Rules
16
+
17
+ - Keep exactly one active step at a time.
18
+ - Update this plan immediately after each completed step.
19
+ - Preserve stable imports unless a breaking change is explicitly approved.
20
+ - Do not hand-edit generated README files; improve source JSDoc and run docs.
21
+ - Keep the true public facade orchestration-first.
22
+
23
+ ## Target Shape
24
+
25
+ - `<facade path>` remains the public facade or compatibility shim.
26
+ - `<subfolder path>` owns extracted helper categories.
27
+ - Public responsibilities remain visible in the facade.
28
+ - Implementation detail moves behind focused `*.services.ts`, `*.utils.ts`,
29
+ `*.types.ts`, `*.errors.ts`, or `*.constants.ts` files.
30
+
31
+ ## Steps
32
+
33
+ - [] Step 1: Map the current boundary, stable imports, and likely helper seams.
34
+ - [] Step 2: Extract the first focused responsibility cluster behind the stable
35
+ facade.
36
+ - [] Step 3: Extract the next responsibility cluster and reduce the facade to
37
+ orchestration-only behavior.
38
+ - [] Step 4: Improve JSDoc so the generated README reads naturally for the new
39
+ boundary.
40
+ - [] Step 5: Validate the touched surface and record the durable boundary note.
41
+
42
+ ## Done Criteria
43
+
44
+ - The target file is no longer the obvious coordination sink.
45
+ - The public facade remains stable and orchestration-first.
46
+ - Extracted helper files own the detailed responsibilities.
47
+ - Generated README output reflects the new shape after docs regeneration.
48
+ - The boundary can be resumed safely in a later session from this plan alone.
@@ -0,0 +1,51 @@
1
+ # Split Workflow Checklist
2
+
3
+ Use this checklist during each SOLID split session.
4
+
5
+ ## Before Editing
6
+
7
+ 1. Confirm the split root and the single durable step for this session.
8
+ 2. Build a full inventory of every `README.md` under the requested root.
9
+ 3. Convert that inventory into an explicit todo list so every README-owning
10
+ folder is visible before edits begin.
11
+ 4. Read the nearest folder `README.md` first.
12
+ 5. Read the nearest useful parent `README.md` if the boundary spans sibling
13
+ areas.
14
+ 6. Read `plans/README.md`.
15
+ 7. Read only the most relevant plan file, with at most one additional related
16
+ plan if needed.
17
+ 8. Inspect the current public surface, its closest helpers, and its main
18
+ consumers.
19
+ 9. Decide whether the current file should remain a public facade, a
20
+ compatibility shim, or the true orchestration entrypoint.
21
+
22
+ ## During the Split
23
+
24
+ 1. Keep exactly one active todo item.
25
+ 2. For documentation-heavy passes, keep that active item bound to one README or
26
+ one README-owning folder at a time.
27
+ 3. Move one responsibility cluster at a time.
28
+ 4. Prefer a dedicated subfolder when the file is a real subsystem.
29
+ 5. Keep the main entrypoint orchestration-first.
30
+ 6. Preserve stable imports where possible.
31
+ 7. Improve JSDoc on touched public surfaces while splitting.
32
+ 8. Add narrow tests only when they increase confidence in the extracted
33
+ boundary.
34
+
35
+ ## Documentation Pass
36
+
37
+ 1. Re-read the generated README mentally through the source JSDoc you touched.
38
+ 2. Add conceptual “what/why” text where the README would otherwise be too dry.
39
+ 3. Add short examples for exported APIs with non-obvious behavior.
40
+ 4. Mention defaults, invariants, error cases, and performance notes when they
41
+ matter.
42
+ 5. Suggest high-value background reading in JSDoc prose for important concepts
43
+ when that would help users learn from the API.
44
+
45
+ ## Validation
46
+
47
+ 1. Run file diagnostics for touched files.
48
+ 2. Run focused tests if the extracted logic has meaningful behavior to lock in.
49
+ 3. Run `npm run docs` when JSDoc or folder shape changed.
50
+ 4. Update the plan immediately after the step is complete.
51
+ 5. Stop and produce the next-session handoff prompt.
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: trace-analyzer-extension
3
+ description: 'Extend scripts/analyze-trace.ts with new rollups, comparisons, script attribution, percentiles, or deterministic report sections. Use when the existing trace analyzer cannot answer an engineering question about Chrome trace or Perfetto data.'
4
+ argument-hint: 'Describe the trace question, missing metric, and validation trace file.'
5
+ user-invocable: true
6
+ disable-model-invocation: false
7
+ ---
8
+
9
+ # Trace Analyzer Extension
10
+
11
+ Use this skill when an agent needs to modify `scripts/analyze-trace.ts` instead
12
+ of only consuming its current output.
13
+
14
+ ## When to Use
15
+
16
+ - The existing analyzer output is not enough to explain a performance problem.
17
+ - A trace audit needs a new deterministic rollup or comparison section.
18
+ - A hotspot needs better attribution by bundle, worker URL, thread, or event.
19
+ - The report needs percentiles, top-N comparisons, or a tighter summary format.
20
+ - A one-off shell command would be too fragile or too noisy to repeat.
21
+
22
+ ## Primary Resources
23
+
24
+ - [Analyzer extension workflow](./references/analyzer-extension-workflow.md)
25
+ - [Extension checklist](./assets/extension-checklist.md)
26
+
27
+ ## Standard Workflow
28
+
29
+ 1. State the engineering question the current analyzer cannot answer.
30
+ 2. Read `scripts/analyze-trace.ts` before proposing a new section.
31
+ 3. Prefer extending existing helpers over adding parallel ad hoc logic.
32
+ 4. Keep output deterministic, text-first, and easy to compare across captures.
33
+ 5. Validate the new output against a real trace file from the repo.
34
+ 6. If the new section changes how agents should interpret results, update the
35
+ reporting skill or its reference docs too.
36
+
37
+ ## Output Design Rules
38
+
39
+ - New sections must answer a concrete engineering question.
40
+ - Prefer compact tables or one-line summaries over verbose prose.
41
+ - Keep ordering deterministic by value, then stable by name when needed.
42
+ - Preserve thread awareness so renderer, worker, browser, and GPU work remain
43
+ separable.
44
+ - Avoid sections that require manual post-processing to become useful.
45
+
46
+ ## Guardrails
47
+
48
+ - Do not add output that duplicates an existing section with minor formatting
49
+ changes.
50
+ - Do not overfit the analyzer to one trace unless the repo clearly needs that
51
+ exact workflow.
52
+ - Do not add non-deterministic timestamps, colors, or formatting noise.
53
+ - Do not pull in a new dependency unless the existing TypeScript runtime cannot
54
+ reasonably support the change.
55
+ - Keep JSDoc current when adding helpers or changing CLI behavior.
56
+
57
+ ## Repo-Specific Notes
58
+
59
+ - The analyzer is intentionally lightweight and runs through `ts-node`.
60
+ - The script already supports thread summaries, longest events, event rollups,
61
+ function-call attribution, and percentile summaries for selected events.
62
+ - Extend the current architecture instead of replacing it with a large parser
63
+ abstraction unless the script has clearly outgrown the current shape.
@@ -0,0 +1,24 @@
1
+ # Trace Analyzer Extension Checklist
2
+
3
+ Use this checklist before finalizing changes to `scripts/analyze-trace.ts`.
4
+
5
+ ## Before Editing
6
+
7
+ - Identify the exact engineering question.
8
+ - Confirm the current analyzer cannot already answer it.
9
+ - Pick the smallest extension type: rollup, attribution, or comparison.
10
+
11
+ ## During Editing
12
+
13
+ - Keep the new logic deterministic.
14
+ - Reuse existing helper patterns for duration conversion and thread labeling.
15
+ - Add or update JSDoc for any new helper or CLI option.
16
+ - Keep the report readable in a plain terminal.
17
+
18
+ ## Before Finalizing
19
+
20
+ - Run the analyzer on a real repo trace.
21
+ - Confirm the new section is actionable.
22
+ - Confirm the new section does not duplicate older output.
23
+ - Update the reporting skill if the default workflow changed.
24
+ - Summarize the engineering value of the new section, not just the code change.
@@ -0,0 +1,101 @@
1
+ # Analyzer Extension Workflow
2
+
3
+ This reference explains how to safely extend `scripts/analyze-trace.ts` without
4
+ turning it into a one-off debugging script.
5
+
6
+ ## Start With the Question
7
+
8
+ Write the missing question in one sentence.
9
+
10
+ Good examples:
11
+
12
+ - Which thread owns most `HandlePostMessage` time?
13
+ - Which script URLs dominate `FunctionCall` on dropped-frame traces?
14
+ - Are frame spikes coming from a few outliers or a broad high-percentile shift?
15
+ - How do two traces compare on dropped frames, worker totals, and hottest
16
+ events?
17
+
18
+ If the question is vague, the output section will usually be vague too.
19
+
20
+ ## Preferred Extension Types
21
+
22
+ Choose the smallest useful extension.
23
+
24
+ ### 1. New rollup section
25
+
26
+ Use when the event exists already and only aggregation is missing.
27
+
28
+ Examples:
29
+
30
+ - event totals by thread,
31
+ - `HandlePostMessage` by worker URL,
32
+ - `RunTask` by thread category.
33
+
34
+ ### 2. Better attribution
35
+
36
+ Use when a current section is correct but not actionable enough.
37
+
38
+ Examples:
39
+
40
+ - resolve script URL from event args,
41
+ - surface worker URL alongside generic worker thread labels,
42
+ - split browser-main and renderer-main owners more clearly.
43
+
44
+ ### 3. Comparison mode
45
+
46
+ Use when engineers need baseline-versus-candidate reporting.
47
+
48
+ Examples:
49
+
50
+ - compare dropped frames between two traces,
51
+ - compare top events and top threads side by side,
52
+ - compare p50, p90, p99 frame metrics.
53
+
54
+ Only add comparison mode if the repo is likely to reuse it.
55
+
56
+ ## Implementation Guidance
57
+
58
+ Follow this order:
59
+
60
+ 1. Add or adjust the smallest data helper needed.
61
+ 2. Reuse existing normalization helpers for thread labels and durations.
62
+ 3. Keep the section printer near the existing report flow in `main()`.
63
+ 4. Preserve the current compact textual style.
64
+ 5. Add or update JSDoc for new helpers and CLI flags.
65
+
66
+ ## Validation Workflow
67
+
68
+ Validate against a real trace from the repository.
69
+
70
+ Recommended command pattern:
71
+
72
+ ```bash
73
+ npm run trace:analyze -- <trace-path> --top=15
74
+ ```
75
+
76
+ Validation questions:
77
+
78
+ - Does the new section answer the intended question directly?
79
+ - Is the output deterministic between runs?
80
+ - Does the new section avoid duplicating older sections?
81
+ - Does the script still work for a normal single-trace audit?
82
+
83
+ ## When to Update the Reporting Skill
84
+
85
+ Update `.github/skills/trace-audit-reporting/` when the analyzer extension
86
+ changes the default audit workflow.
87
+
88
+ Examples:
89
+
90
+ - a new high-value summary section should be mentioned in the workflow,
91
+ - a new comparison mode becomes standard for regression triage,
92
+ - a new CLI flag changes the recommended command.
93
+
94
+ ## Anti-Patterns
95
+
96
+ - Adding raw JSON dumps.
97
+ - Adding wide output that is hard to scan in chat or terminals.
98
+ - Mixing data collection, formatting, and CLI parsing into one large helper.
99
+ - Replacing deterministic summaries with subjective prose inside the script.
100
+ - Adding a feature that only makes sense for one trace file with no reusable
101
+ value.