@playcraft/skills 0.0.2

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 (479) hide show
  1. package/README.md +333 -0
  2. package/dist/src/index.d.ts +3 -0
  3. package/dist/src/index.d.ts.map +1 -0
  4. package/dist/src/index.js +2 -0
  5. package/dist/src/index.js.map +1 -0
  6. package/dist/src/skills.loader.d.ts +31 -0
  7. package/dist/src/skills.loader.d.ts.map +1 -0
  8. package/dist/src/skills.loader.js +200 -0
  9. package/dist/src/skills.loader.js.map +1 -0
  10. package/dist/src/skills.types.d.ts +44 -0
  11. package/dist/src/skills.types.d.ts.map +1 -0
  12. package/dist/src/skills.types.js +9 -0
  13. package/dist/src/skills.types.js.map +1 -0
  14. package/package.json +35 -0
  15. package/skills/2048_core.aigameplay/SKILL.md +123 -0
  16. package/skills/2048_core.aigameplay/manifest.json +159 -0
  17. package/skills/2048_core.aigameplay/ref/pgs-schema.json +194 -0
  18. package/skills/2048_core.aigameplay/ref/reducer.template.ts +189 -0
  19. package/skills/SKILL.md +46 -0
  20. package/skills/ad_compliance_rules.aiconfig/SKILL.md +85 -0
  21. package/skills/ad_compliance_rules.aiconfig/manifest.json +60 -0
  22. package/skills/agent_remix_orchestrator.aicomponent/SKILL.md +257 -0
  23. package/skills/agent_remix_orchestrator.aicomponent/manifest.json +12 -0
  24. package/skills/app_metadata.aiconfig/SKILL.md +53 -0
  25. package/skills/app_metadata.aiconfig/manifest.json +32 -0
  26. package/skills/appear_sfx.aiaudio/SKILL.md +59 -0
  27. package/skills/appear_sfx.aiaudio/manifest.json +45 -0
  28. package/skills/appear_sfx.aiaudio/ref/appear.mp3 +0 -0
  29. package/skills/arrow_move_error_sfx.aiaudio/SKILL.md +59 -0
  30. package/skills/arrow_move_error_sfx.aiaudio/manifest.json +45 -0
  31. package/skills/arrow_move_error_sfx.aiaudio/ref/arrow_move_error.mp3 +0 -0
  32. package/skills/arrow_path_data_format.aicomponent/SKILL.md +152 -0
  33. package/skills/arrow_path_data_format.aicomponent/manifest.json +57 -0
  34. package/skills/arrow_path_data_format.aicomponent/ref/LevelParser.ts +188 -0
  35. package/skills/arrow_path_data_format.aicomponent/ref/LevelTypes.ts +131 -0
  36. package/skills/arrow_pick_match_rules.aigameplay/SKILL.md +117 -0
  37. package/skills/arrow_pick_match_rules.aigameplay/manifest.json +105 -0
  38. package/skills/arrow_pick_match_rules.aigameplay/ref/pgs-schema.json +180 -0
  39. package/skills/asset_pipeline_scripts.aicomponent/SKILL.md +117 -0
  40. package/skills/asset_pipeline_scripts.aicomponent/manifest.json +17 -0
  41. package/skills/asset_pipeline_scripts.aicomponent/ref/gen-sprite.sh +105 -0
  42. package/skills/ball_sort.aigameplay/SKILL.md +109 -0
  43. package/skills/ball_sort.aigameplay/manifest.json +155 -0
  44. package/skills/ball_sort.aigameplay/ref/pgs-schema.json +192 -0
  45. package/skills/ball_sort.aigameplay/ref/reducer.template.ts +156 -0
  46. package/skills/basketball_shot.aigameplay/SKILL.md +94 -0
  47. package/skills/basketball_shot.aigameplay/manifest.json +150 -0
  48. package/skills/basketball_shot.aigameplay/ref/pgs-schema.json +229 -0
  49. package/skills/basketball_shot.aigameplay/ref/reducer.template.ts +189 -0
  50. package/skills/bg_music.aiaudio/SKILL.md +61 -0
  51. package/skills/bg_music.aiaudio/manifest.json +48 -0
  52. package/skills/bg_music.aiaudio/ref/bg.mp3 +0 -0
  53. package/skills/big_watermelon.aigameplay/SKILL.md +94 -0
  54. package/skills/big_watermelon.aigameplay/manifest.json +155 -0
  55. package/skills/big_watermelon.aigameplay/ref/pgs-schema.json +191 -0
  56. package/skills/big_watermelon.aigameplay/ref/reducer.template.ts +202 -0
  57. package/skills/block_puzzle.aigameplay/SKILL.md +121 -0
  58. package/skills/block_puzzle.aigameplay/manifest.json +154 -0
  59. package/skills/block_puzzle.aigameplay/ref/pgs-schema.json +170 -0
  60. package/skills/block_puzzle.aigameplay/ref/reducer.template.ts +182 -0
  61. package/skills/board_entity_sprite.aiimage/SKILL.md +255 -0
  62. package/skills/board_entity_sprite.aiimage/manifest.json +153 -0
  63. package/skills/board_entity_sprite.aiimage/ref/ProceduralCar.ts +357 -0
  64. package/skills/board_entity_sprite.aiimage/ref/car.png +0 -0
  65. package/skills/board_entity_sprite.aiimage/ref/car.webp +0 -0
  66. package/skills/bottom_ui_bar.aicomponent/SKILL.md +50 -0
  67. package/skills/bottom_ui_bar.aicomponent/manifest.json +31 -0
  68. package/skills/bottom_ui_bar.aicomponent/ref/GameBottomUI.ts +27 -0
  69. package/skills/bubble_shooter.aigameplay/SKILL.md +129 -0
  70. package/skills/bubble_shooter.aigameplay/manifest.json +181 -0
  71. package/skills/bubble_shooter.aigameplay/ref/pgs-schema.json +226 -0
  72. package/skills/bubble_shooter.aigameplay/ref/reducer.template.ts +228 -0
  73. package/skills/button_click_sfx.aiaudio/SKILL.md +59 -0
  74. package/skills/button_click_sfx.aiaudio/manifest.json +45 -0
  75. package/skills/button_click_sfx.aiaudio/ref/button_click.mp3 +0 -0
  76. package/skills/calm_piano.aiaudio/SKILL.md +68 -0
  77. package/skills/calm_piano.aiaudio/manifest.json +50 -0
  78. package/skills/camera_controller_3d.aicomponent/SKILL.md +100 -0
  79. package/skills/camera_controller_3d.aicomponent/manifest.json +52 -0
  80. package/skills/camera_controller_3d.aicomponent/ref/CameraController.ts +199 -0
  81. package/skills/camera_controller_3d.aicomponent/ref/OrbitControlsAdapter.ts +152 -0
  82. package/skills/candy_tile.aiimage/SKILL.md +62 -0
  83. package/skills/candy_tile.aiimage/manifest.json +49 -0
  84. package/skills/car_parking.aigameplay/SKILL.md +105 -0
  85. package/skills/car_parking.aigameplay/manifest.json +164 -0
  86. package/skills/car_parking.aigameplay/ref/pgs-schema.json +163 -0
  87. package/skills/car_parking.aigameplay/ref/reducer.template.ts +166 -0
  88. package/skills/castle.aiimage/SKILL.md +64 -0
  89. package/skills/castle.aiimage/manifest.json +48 -0
  90. package/skills/cheerful_ukulele.aiaudio/SKILL.md +72 -0
  91. package/skills/cheerful_ukulele.aiaudio/manifest.json +50 -0
  92. package/skills/click_sfx.aiaudio/SKILL.md +59 -0
  93. package/skills/click_sfx.aiaudio/manifest.json +45 -0
  94. package/skills/click_sfx.aiaudio/ref/click.mp3 +0 -0
  95. package/skills/combo_display.aicomponent/SKILL.md +45 -0
  96. package/skills/combo_display.aicomponent/manifest.json +31 -0
  97. package/skills/combo_display.aicomponent/ref/ComboManager.ts +362 -0
  98. package/skills/combo_display.aicomponent/ref/ComboSmallUI.ts +232 -0
  99. package/skills/combo_praise_text.aicomponent/SKILL.md +56 -0
  100. package/skills/combo_praise_text.aicomponent/manifest.json +34 -0
  101. package/skills/combo_praise_text.aicomponent/ref/ComboManager.ts +362 -0
  102. package/skills/countdown_timer.aicomponent/SKILL.md +44 -0
  103. package/skills/countdown_timer.aicomponent/manifest.json +35 -0
  104. package/skills/countdown_timer.aicomponent/ref/CountdownDisplay.ts +213 -0
  105. package/skills/cta_platform_config.aiconfig/SKILL.md +72 -0
  106. package/skills/cta_platform_config.aiconfig/manifest.json +56 -0
  107. package/skills/debug_overlay.aicomponent/SKILL.md +75 -0
  108. package/skills/debug_overlay.aicomponent/manifest.json +17 -0
  109. package/skills/debug_overlay.aicomponent/ref/DebugOverlay.ts +144 -0
  110. package/skills/desert.aiimage/SKILL.md +63 -0
  111. package/skills/desert.aiimage/manifest.json +49 -0
  112. package/skills/difficulty_curve_designer.aiconfig/SKILL.md +68 -0
  113. package/skills/difficulty_curve_designer.aiconfig/manifest.json +36 -0
  114. package/skills/digit_renderer.aicomponent/SKILL.md +43 -0
  115. package/skills/digit_renderer.aicomponent/manifest.json +25 -0
  116. package/skills/digit_renderer.aicomponent/ref/DigitRenderer.ts +237 -0
  117. package/skills/download_button.aicomponent/SKILL.md +44 -0
  118. package/skills/download_button.aicomponent/manifest.json +25 -0
  119. package/skills/download_button.aicomponent/ref/DownloadButton.ts +137 -0
  120. package/skills/draw_line_puzzle.aigameplay/SKILL.md +84 -0
  121. package/skills/draw_line_puzzle.aigameplay/manifest.json +152 -0
  122. package/skills/draw_line_puzzle.aigameplay/ref/pgs-schema.json +189 -0
  123. package/skills/draw_line_puzzle.aigameplay/ref/reducer.template.ts +194 -0
  124. package/skills/easy_to_hard.aiconfig/SKILL.md +52 -0
  125. package/skills/easy_to_hard.aiconfig/manifest.json +33 -0
  126. package/skills/eight_ball_pool.aigameplay/SKILL.md +104 -0
  127. package/skills/eight_ball_pool.aigameplay/manifest.json +152 -0
  128. package/skills/eight_ball_pool.aigameplay/ref/pgs-schema.json +205 -0
  129. package/skills/eight_ball_pool.aigameplay/ref/reducer.template.ts +198 -0
  130. package/skills/energetic_electronic.aiaudio/SKILL.md +69 -0
  131. package/skills/energetic_electronic.aiaudio/manifest.json +51 -0
  132. package/skills/fail_sfx.aiaudio/SKILL.md +59 -0
  133. package/skills/fail_sfx.aiaudio/manifest.json +44 -0
  134. package/skills/fail_sfx.aiaudio/ref/fail.mp3 +0 -0
  135. package/skills/figer_icon.aiimage/SKILL.md +58 -0
  136. package/skills/figer_icon.aiimage/manifest.json +48 -0
  137. package/skills/figer_icon.aiimage/ref/figer.png +0 -0
  138. package/skills/figer_icon.aiimage/ref/figer.webp +0 -0
  139. package/skills/forest.aiimage/SKILL.md +74 -0
  140. package/skills/forest.aiimage/manifest.json +48 -0
  141. package/skills/fruit_tile.aiimage/SKILL.md +68 -0
  142. package/skills/fruit_tile.aiimage/manifest.json +48 -0
  143. package/skills/game_over_panel.aicomponent/SKILL.md +47 -0
  144. package/skills/game_over_panel.aicomponent/manifest.json +61 -0
  145. package/skills/game_over_panel.aicomponent/ref/GameOverPanel.ts +74 -0
  146. package/skills/game_scene.aicomponent/SKILL.md +57 -0
  147. package/skills/game_scene.aicomponent/manifest.json +36 -0
  148. package/skills/game_scene.aicomponent/ref/Game.ts +748 -0
  149. package/skills/gameplay_balance_check.aivalidator/SKILL.md +69 -0
  150. package/skills/gameplay_balance_check.aivalidator/manifest.json +21 -0
  151. package/skills/gameplay_unit_test.aivalidator/SKILL.md +89 -0
  152. package/skills/gameplay_unit_test.aivalidator/manifest.json +17 -0
  153. package/skills/gameplay_unit_test.aivalidator/ref/gameplay.test.ts +202 -0
  154. package/skills/gameplay_unit_test.aivalidator/ref/vitest.config.ts +13 -0
  155. package/skills/grid_board_layout.aicomponent/SKILL.md +85 -0
  156. package/skills/grid_board_layout.aicomponent/manifest.json +69 -0
  157. package/skills/grid_board_layout.aicomponent/ref/BoardLayout.ts +416 -0
  158. package/skills/grid_board_layout.aicomponent/ref/BoardLayout3D.ts +125 -0
  159. package/skills/grid_board_layout.aicomponent/ref/BoardLayoutMath.ts +85 -0
  160. package/skills/grid_board_layout.aicomponent/ref/BoardRenderer3D.ts +298 -0
  161. package/skills/heart_lives.aicomponent/SKILL.md +42 -0
  162. package/skills/heart_lives.aicomponent/manifest.json +25 -0
  163. package/skills/heart_lives.aicomponent/ref/HeartDisplay.ts +96 -0
  164. package/skills/idle-breathe.aicomponent/SKILL.md +27 -0
  165. package/skills/idle-breathe.aicomponent/manifest.json +20 -0
  166. package/skills/idle-breathe.aicomponent/ref/phaser.js +25 -0
  167. package/skills/idle-breathe.aicomponent/ref/playcanvas.js +29 -0
  168. package/skills/jewel_tile.aiimage/SKILL.md +63 -0
  169. package/skills/jewel_tile.aiimage/manifest.json +49 -0
  170. package/skills/knife_hit.aigameplay/SKILL.md +103 -0
  171. package/skills/knife_hit.aigameplay/manifest.json +151 -0
  172. package/skills/knife_hit.aigameplay/ref/pgs-schema.json +202 -0
  173. package/skills/knife_hit.aigameplay/ref/reducer.template.ts +196 -0
  174. package/skills/left_right_parkour.aigameplay/SKILL.md +120 -0
  175. package/skills/left_right_parkour.aigameplay/manifest.json +165 -0
  176. package/skills/left_right_parkour.aigameplay/ref/pgs-schema.json +200 -0
  177. package/skills/left_right_parkour.aigameplay/ref/reducer.template.ts +194 -0
  178. package/skills/level_data_pack.aiconfig/SKILL.md +64 -0
  179. package/skills/level_data_pack.aiconfig/manifest.json +37 -0
  180. package/skills/level_data_validator.aivalidator/SKILL.md +85 -0
  181. package/skills/level_data_validator.aivalidator/manifest.json +17 -0
  182. package/skills/level_data_validator.aivalidator/ref/LevelValidator.ts +113 -0
  183. package/skills/level_lifecycle.aicomponent/SKILL.md +81 -0
  184. package/skills/level_lifecycle.aicomponent/manifest.json +87 -0
  185. package/skills/level_lifecycle.aicomponent/ref/LevelLifecycle.ts +235 -0
  186. package/skills/level_solvability_validator.aivalidator/SKILL.md +74 -0
  187. package/skills/level_solvability_validator.aivalidator/manifest.json +23 -0
  188. package/skills/level_solvability_validator.aivalidator/ref/LevelValidator.ts +186 -0
  189. package/skills/level_state.aicomponent/SKILL.md +55 -0
  190. package/skills/level_state.aicomponent/manifest.json +34 -0
  191. package/skills/level_state.aicomponent/ref/LevelDataManager.ts +26 -0
  192. package/skills/level_state.aicomponent/ref/LevelManager.ts +26 -0
  193. package/skills/loading_screen.aicomponent/SKILL.md +57 -0
  194. package/skills/loading_screen.aicomponent/manifest.json +43 -0
  195. package/skills/loading_screen.aicomponent/ref/LoadingUI.ts +339 -0
  196. package/skills/lose_result_panel.aiimage/SKILL.md +58 -0
  197. package/skills/lose_result_panel.aiimage/manifest.json +47 -0
  198. package/skills/lose_result_panel.aiimage/ref/lose.png +0 -0
  199. package/skills/lose_result_panel.aiimage/ref/lose.webp +0 -0
  200. package/skills/lose_sfx.aiaudio/SKILL.md +59 -0
  201. package/skills/lose_sfx.aiaudio/manifest.json +45 -0
  202. package/skills/lose_sfx.aiaudio/ref/lose.mp3 +0 -0
  203. package/skills/match-pop.aicomponent/SKILL.md +29 -0
  204. package/skills/match-pop.aicomponent/manifest.json +19 -0
  205. package/skills/match-pop.aicomponent/ref/phaser.js +30 -0
  206. package/skills/match-pop.aicomponent/ref/playcanvas.js +22 -0
  207. package/skills/match3_core.aigameplay/SKILL.md +125 -0
  208. package/skills/match3_core.aigameplay/manifest.json +107 -0
  209. package/skills/match3_core.aigameplay/ref/pgs-schema.json +154 -0
  210. package/skills/match3_core.aigameplay/ref/reducer.template.ts +191 -0
  211. package/skills/match_engine.aicomponent/SKILL.md +84 -0
  212. package/skills/match_engine.aicomponent/manifest.json +23 -0
  213. package/skills/match_engine.aicomponent/ref/MatchEngine.ts +75 -0
  214. package/skills/memory_match.aigameplay/SKILL.md +111 -0
  215. package/skills/memory_match.aigameplay/manifest.json +164 -0
  216. package/skills/memory_match.aigameplay/ref/pgs-schema.json +190 -0
  217. package/skills/memory_match.aigameplay/ref/reducer.template.ts +162 -0
  218. package/skills/merge_core.aigameplay/SKILL.md +112 -0
  219. package/skills/merge_core.aigameplay/manifest.json +154 -0
  220. package/skills/merge_core.aigameplay/ref/pgs-schema.json +202 -0
  221. package/skills/merge_core.aigameplay/ref/reducer.template.ts +179 -0
  222. package/skills/mistake_sfx.aiaudio/SKILL.md +59 -0
  223. package/skills/mistake_sfx.aiaudio/manifest.json +45 -0
  224. package/skills/mistake_sfx.aiaudio/ref/mistake.mp3 +0 -0
  225. package/skills/nomove_hint_overlay.aiimage/SKILL.md +58 -0
  226. package/skills/nomove_hint_overlay.aiimage/manifest.json +48 -0
  227. package/skills/nomove_hint_overlay.aiimage/ref/nomove_hint.png +0 -0
  228. package/skills/nomove_hint_overlay.aiimage/ref/nomove_hint.webp +0 -0
  229. package/skills/normal_dot.aiimage/SKILL.md +58 -0
  230. package/skills/normal_dot.aiimage/manifest.json +46 -0
  231. package/skills/normal_dot.aiimage/ref/normal_dot.png +0 -0
  232. package/skills/normal_dot.aiimage/ref/normal_dot.webp +0 -0
  233. package/skills/ocean.aiimage/SKILL.md +71 -0
  234. package/skills/ocean.aiimage/manifest.json +49 -0
  235. package/skills/particle-confetti.aicomponent/SKILL.md +32 -0
  236. package/skills/particle-confetti.aicomponent/manifest.json +21 -0
  237. package/skills/particle-confetti.aicomponent/ref/html5-spritesheet.js +17 -0
  238. package/skills/particle-confetti.aicomponent/ref/phaser.js +38 -0
  239. package/skills/particle-explosion.aicomponent/SKILL.md +37 -0
  240. package/skills/particle-explosion.aicomponent/manifest.json +24 -0
  241. package/skills/particle-explosion.aicomponent/ref/html5-spritesheet.js +40 -0
  242. package/skills/particle-explosion.aicomponent/ref/phaser.js +46 -0
  243. package/skills/particle-explosion.aicomponent/ref/playcanvas.js +33 -0
  244. package/skills/particle-trail.aicomponent/SKILL.md +25 -0
  245. package/skills/particle-trail.aicomponent/manifest.json +22 -0
  246. package/skills/particle-trail.aicomponent/ref/phaser.js +31 -0
  247. package/skills/path_animation.aicomponent/SKILL.md +82 -0
  248. package/skills/path_animation.aicomponent/manifest.json +77 -0
  249. package/skills/path_animation.aicomponent/ref/AnimationManager.ts +694 -0
  250. package/skills/path_animation.aicomponent/ref/AnimationManager3D.ts +317 -0
  251. package/skills/path_elimination_rules.aigameplay/SKILL.md +88 -0
  252. package/skills/path_elimination_rules.aigameplay/manifest.json +119 -0
  253. package/skills/path_elimination_rules.aigameplay/ref/pgs-schema.json +227 -0
  254. package/skills/path_input_handler.aicomponent/SKILL.md +87 -0
  255. package/skills/path_input_handler.aicomponent/manifest.json +97 -0
  256. package/skills/path_input_handler.aicomponent/ref/InputHandler.ts +714 -0
  257. package/skills/path_input_handler.aicomponent/ref/InputHandler3D.ts +204 -0
  258. package/skills/path_renderer.aicomponent/SKILL.md +101 -0
  259. package/skills/path_renderer.aicomponent/manifest.json +69 -0
  260. package/skills/path_renderer.aicomponent/ref/PathRenderer.ts +509 -0
  261. package/skills/path_renderer.aicomponent/ref/PathRenderer3D.ts +176 -0
  262. package/skills/path_renderer.aicomponent/ref/PathRenderers.ts +640 -0
  263. package/skills/phaser.aicomponent/SKILL.md +315 -0
  264. package/skills/phaser.aicomponent/manifest.json +156 -0
  265. package/skills/phaser.aicomponent/ref/BootScene.ts +29 -0
  266. package/skills/phaser.aicomponent/ref/GameConfig.ts +29 -0
  267. package/skills/phaser.aicomponent/ref/GameScene.ts +88 -0
  268. package/skills/phaser.aicomponent/ref/PreloaderScene.ts +78 -0
  269. package/skills/phaser.aicomponent/ref/SceneKeys.ts +7 -0
  270. package/skills/phaser.aicomponent/ref/SoundUtils.ts +21 -0
  271. package/skills/phaser.aicomponent/ref/UiLayout.ts +74 -0
  272. package/skills/phaser.aicomponent/ref/globals.d.ts +52 -0
  273. package/skills/phaser.aicomponent/ref/index.css +40 -0
  274. package/skills/phaser.aicomponent/ref/index.html +14 -0
  275. package/skills/phaser.aicomponent/ref/index.ts +48 -0
  276. package/skills/phaser.aicomponent/ref/main.ts +16 -0
  277. package/skills/phaser.aicomponent/ref/package.json +22 -0
  278. package/skills/phaser.aicomponent/ref/tsconfig.json +25 -0
  279. package/skills/phaser.aicomponent/ref/webpack.config.js +57 -0
  280. package/skills/phaser_scene_lifecycle.aicomponent/SKILL.md +63 -0
  281. package/skills/phaser_scene_lifecycle.aicomponent/manifest.json +33 -0
  282. package/skills/pick_and_match_rules.aigameplay/SKILL.md +113 -0
  283. package/skills/pick_and_match_rules.aigameplay/manifest.json +121 -0
  284. package/skills/pick_and_match_rules.aigameplay/ref/pgs-schema.json +354 -0
  285. package/skills/pin_pull.aigameplay/SKILL.md +110 -0
  286. package/skills/pin_pull.aigameplay/manifest.json +164 -0
  287. package/skills/pin_pull.aigameplay/ref/pgs-schema.json +201 -0
  288. package/skills/pin_pull.aigameplay/ref/reducer.template.ts +216 -0
  289. package/skills/playable_app_logo.aiimage/SKILL.md +58 -0
  290. package/skills/playable_app_logo.aiimage/manifest.json +47 -0
  291. package/skills/playable_app_logo.aiimage/ref/logo.png +0 -0
  292. package/skills/playable_app_logo.aiimage/ref/logo.webp +0 -0
  293. package/skills/playable_end_screen_layout.aicomponent/SKILL.md +75 -0
  294. package/skills/playable_end_screen_layout.aicomponent/manifest.json +24 -0
  295. package/skills/playable_guidance_layer.aicomponent/SKILL.md +89 -0
  296. package/skills/playable_guidance_layer.aicomponent/manifest.json +24 -0
  297. package/skills/playable_hud_layout.aicomponent/SKILL.md +96 -0
  298. package/skills/playable_hud_layout.aicomponent/manifest.json +24 -0
  299. package/skills/playable_scripts_build.aicomponent/SKILL.md +69 -0
  300. package/skills/playable_scripts_build.aicomponent/manifest.json +53 -0
  301. package/skills/playable_scripts_build.aicomponent/ref/builds.config.js +257 -0
  302. package/skills/playcraft-3d-flip-sprite/SKILL.md +336 -0
  303. package/skills/playcraft-3d-flip-sprite/renderer/flatten_glb.mjs +62 -0
  304. package/skills/playcraft-3d-flip-sprite/renderer/render.mjs +325 -0
  305. package/skills/playcraft-3d-flip-sprite/renderer/render_single.mjs +138 -0
  306. package/skills/playcraft-asset-management/SKILL.md +73 -0
  307. package/skills/playcraft-audio-generation/SKILL.md +126 -0
  308. package/skills/playcraft-build/SKILL.md +44 -0
  309. package/skills/playcraft-code-editor/SKILL.md +71 -0
  310. package/skills/playcraft-create-remix/SKILL.md +62 -0
  311. package/skills/playcraft-deploy/SKILL.md +59 -0
  312. package/skills/playcraft-image-generation/SKILL.md +148 -0
  313. package/skills/playcraft-image-processing/SKILL.md +216 -0
  314. package/skills/playcraft-platform-intro/SKILL.md +41 -0
  315. package/skills/playcraft-prefab/SKILL.md +98 -0
  316. package/skills/playcraft-project-management/SKILL.md +57 -0
  317. package/skills/playcraft-remix-workflow/SKILL.md +119 -0
  318. package/skills/playcraft-remix-workflow/references/xplatform.schema.json5 +31 -0
  319. package/skills/playcraft-save/SKILL.md +46 -0
  320. package/skills/playcraft-skill-recommender/SKILL.md +152 -0
  321. package/skills/playcraft-sprite-generation/SKILL.md +534 -0
  322. package/skills/playcraft-sprite-remix/SKILL.md +155 -0
  323. package/skills/playcraft-sprite-sheet/SKILL.md +97 -0
  324. package/skills/playtest_report.aivalidator/SKILL.md +103 -0
  325. package/skills/playtest_report.aivalidator/manifest.json +21 -0
  326. package/skills/preloader_scene.aicomponent/SKILL.md +58 -0
  327. package/skills/preloader_scene.aicomponent/manifest.json +43 -0
  328. package/skills/preloader_scene.aicomponent/ref/Preloader.ts +339 -0
  329. package/skills/progress_bar.aicomponent/SKILL.md +38 -0
  330. package/skills/progress_bar.aicomponent/manifest.json +25 -0
  331. package/skills/progress_bar.aicomponent/ref/ProgressDisplay.ts +140 -0
  332. package/skills/references/xplatform.schema.json5 +31 -0
  333. package/skills/responsive_2d_layout.aicomponent/SKILL.md +161 -0
  334. package/skills/responsive_2d_layout.aicomponent/manifest.json +43 -0
  335. package/skills/responsive_2d_layout.aicomponent/ref/UiLayout.ts +56 -0
  336. package/skills/run_context_state.aicomponent/SKILL.md +54 -0
  337. package/skills/run_context_state.aicomponent/manifest.json +40 -0
  338. package/skills/run_context_state.aicomponent/ref/RunContextRuntime.ts +30 -0
  339. package/skills/score-fly.aicomponent/SKILL.md +31 -0
  340. package/skills/score-fly.aicomponent/manifest.json +21 -0
  341. package/skills/score-fly.aicomponent/ref/phaser.js +26 -0
  342. package/skills/score-fly.aicomponent/ref/playcanvas.js +28 -0
  343. package/skills/score_goal.aiconfig/SKILL.md +46 -0
  344. package/skills/score_goal.aiconfig/manifest.json +33 -0
  345. package/skills/screen-flash.aicomponent/SKILL.md +30 -0
  346. package/skills/screen-flash.aicomponent/manifest.json +20 -0
  347. package/skills/screen-flash.aicomponent/ref/phaser.js +48 -0
  348. package/skills/screen-shake.aicomponent/SKILL.md +30 -0
  349. package/skills/screen-shake.aicomponent/manifest.json +19 -0
  350. package/skills/screen-shake.aicomponent/ref/phaser.js +23 -0
  351. package/skills/screen-shake.aicomponent/ref/playcanvas.js +44 -0
  352. package/skills/screw_puzzle.aigameplay/SKILL.md +116 -0
  353. package/skills/screw_puzzle.aigameplay/manifest.json +164 -0
  354. package/skills/screw_puzzle.aigameplay/ref/pgs-schema.json +235 -0
  355. package/skills/screw_puzzle.aigameplay/ref/reducer.template.ts +213 -0
  356. package/skills/settings_state.aicomponent/SKILL.md +61 -0
  357. package/skills/settings_state.aicomponent/manifest.json +33 -0
  358. package/skills/settings_state.aicomponent/ref/SettingsManager.ts +130 -0
  359. package/skills/slide_out_to_tray_animation.aicomponent/SKILL.md +64 -0
  360. package/skills/slide_out_to_tray_animation.aicomponent/manifest.json +58 -0
  361. package/skills/slide_out_to_tray_animation.aicomponent/ref/AnimationManager.ts +164 -0
  362. package/skills/slide_out_to_tray_animation.aicomponent/ref/AnimationManager3D.ts +198 -0
  363. package/skills/slide_out_to_tray_animation.aicomponent/ref/BezierUtils.ts +59 -0
  364. package/skills/slot_machine.aigameplay/SKILL.md +119 -0
  365. package/skills/slot_machine.aigameplay/manifest.json +166 -0
  366. package/skills/slot_machine.aigameplay/ref/pgs-schema.json +212 -0
  367. package/skills/slot_machine.aigameplay/ref/reducer.template.ts +212 -0
  368. package/skills/sniper_shot.aigameplay/SKILL.md +84 -0
  369. package/skills/sniper_shot.aigameplay/manifest.json +153 -0
  370. package/skills/sniper_shot.aigameplay/ref/pgs-schema.json +211 -0
  371. package/skills/sniper_shot.aigameplay/ref/reducer.template.ts +211 -0
  372. package/skills/solitaire.aigameplay/SKILL.md +101 -0
  373. package/skills/solitaire.aigameplay/manifest.json +151 -0
  374. package/skills/solitaire.aigameplay/ref/pgs-schema.json +200 -0
  375. package/skills/solitaire.aigameplay/ref/reducer.template.ts +176 -0
  376. package/skills/sound-effects/SKILL.md +46 -0
  377. package/skills/sound_utils.aicomponent/SKILL.md +52 -0
  378. package/skills/sound_utils.aicomponent/manifest.json +30 -0
  379. package/skills/sound_utils.aicomponent/ref/SoundUtils.ts +29 -0
  380. package/skills/sprite-animation-2d.aicomponent/SKILL.md +45 -0
  381. package/skills/sprite-animation-2d.aicomponent/manifest.json +28 -0
  382. package/skills/sprite-animation-2d.aicomponent/ref/html5.js +83 -0
  383. package/skills/sprite-animation-2d.aicomponent/ref/phaser.js +38 -0
  384. package/skills/sprite-animation-2d.aicomponent/ref/playcanvas.js +67 -0
  385. package/skills/sprite_entity_renderer.aicomponent/SKILL.md +148 -0
  386. package/skills/sprite_entity_renderer.aicomponent/manifest.json +17 -0
  387. package/skills/sprite_entity_renderer.aicomponent/ref/SpriteEntityRenderer.ts +126 -0
  388. package/skills/success_sfx.aiaudio/SKILL.md +59 -0
  389. package/skills/success_sfx.aiaudio/manifest.json +45 -0
  390. package/skills/success_sfx.aiaudio/ref/success.mp3 +0 -0
  391. package/skills/tap_blast.aigameplay/SKILL.md +116 -0
  392. package/skills/tap_blast.aigameplay/manifest.json +153 -0
  393. package/skills/tap_blast.aigameplay/ref/pgs-schema.json +208 -0
  394. package/skills/tap_blast.aigameplay/ref/reducer.template.ts +202 -0
  395. package/skills/theme_state.aicomponent/SKILL.md +53 -0
  396. package/skills/theme_state.aicomponent/manifest.json +33 -0
  397. package/skills/theme_state.aicomponent/ref/ThemeManager.ts +174 -0
  398. package/skills/theme_switcher_build.aicomponent/SKILL.md +62 -0
  399. package/skills/theme_switcher_build.aicomponent/manifest.json +38 -0
  400. package/skills/theme_switcher_build.aicomponent/ref/theme-index.ts +8 -0
  401. package/skills/theme_variant.aiconfig/SKILL.md +78 -0
  402. package/skills/theme_variant.aiconfig/manifest.json +39 -0
  403. package/skills/theme_variant.aiconfig/ref/ExampleTheme/index.ts +16 -0
  404. package/skills/theme_variant.aiconfig/ref/ExampleTheme/levelEasy.json +141 -0
  405. package/skills/threejs.aicomponent/SKILL.md +422 -0
  406. package/skills/threejs.aicomponent/manifest.json +166 -0
  407. package/skills/threejs.aicomponent/ref/AssetLoader.ts +158 -0
  408. package/skills/threejs.aicomponent/ref/BaseScene.ts +88 -0
  409. package/skills/threejs.aicomponent/ref/GameConfig.ts +47 -0
  410. package/skills/threejs.aicomponent/ref/MainScene.ts +170 -0
  411. package/skills/threejs.aicomponent/ref/PreloaderScene.ts +93 -0
  412. package/skills/threejs.aicomponent/ref/SceneKeys.ts +6 -0
  413. package/skills/threejs.aicomponent/ref/SceneManager.ts +69 -0
  414. package/skills/threejs.aicomponent/ref/ViewportManager.ts +62 -0
  415. package/skills/threejs.aicomponent/ref/globals.d.ts +74 -0
  416. package/skills/threejs.aicomponent/ref/index.css +80 -0
  417. package/skills/threejs.aicomponent/ref/index.html +20 -0
  418. package/skills/threejs.aicomponent/ref/index.ts +117 -0
  419. package/skills/threejs.aicomponent/ref/main.ts +10 -0
  420. package/skills/threejs.aicomponent/ref/package.json +23 -0
  421. package/skills/threejs.aicomponent/ref/tsconfig.json +24 -0
  422. package/skills/threejs.aicomponent/ref/webpack.config.js +61 -0
  423. package/skills/time_clear_goal.aiconfig/SKILL.md +46 -0
  424. package/skills/time_clear_goal.aiconfig/manifest.json +32 -0
  425. package/skills/time_icon.aiimage/SKILL.md +58 -0
  426. package/skills/time_icon.aiimage/manifest.json +47 -0
  427. package/skills/time_icon.aiimage/ref/time.png +0 -0
  428. package/skills/time_icon.aiimage/ref/time.webp +0 -0
  429. package/skills/top_ui_bar.aicomponent/SKILL.md +45 -0
  430. package/skills/top_ui_bar.aicomponent/manifest.json +27 -0
  431. package/skills/top_ui_bar.aicomponent/ref/GameTopUI.ts +229 -0
  432. package/skills/tower_defence.aigameplay/SKILL.md +117 -0
  433. package/skills/tower_defence.aigameplay/manifest.json +175 -0
  434. package/skills/tower_defence.aigameplay/ref/pgs-schema.json +247 -0
  435. package/skills/tower_defence.aigameplay/ref/reducer.template.ts +239 -0
  436. package/skills/tray_container.aicomponent/SKILL.md +143 -0
  437. package/skills/tray_container.aicomponent/manifest.json +58 -0
  438. package/skills/tray_container.aicomponent/ref/TrayRenderer.ts +155 -0
  439. package/skills/tray_container.aicomponent/ref/TrayRenderer3D.ts +281 -0
  440. package/skills/tray_container.aicomponent/ref/TrayRendererHtmlOverlay.ts +228 -0
  441. package/skills/tutorial_overlay.aicomponent/SKILL.md +46 -0
  442. package/skills/tutorial_overlay.aicomponent/manifest.json +34 -0
  443. package/skills/tutorial_overlay.aicomponent/ref/TutorialManager.ts +367 -0
  444. package/skills/tween-animation-2d.aicomponent/SKILL.md +35 -0
  445. package/skills/tween-animation-2d.aicomponent/manifest.json +28 -0
  446. package/skills/tween-animation-2d.aicomponent/ref/phaser.js +49 -0
  447. package/skills/tween-animation-2d.aicomponent/ref/playcanvas.js +36 -0
  448. package/skills/typescript_module_patterns.aicomponent/SKILL.md +209 -0
  449. package/skills/typescript_module_patterns.aicomponent/manifest.json +28 -0
  450. package/skills/typescript_module_patterns.aicomponent/ref/globals.d.ts +31 -0
  451. package/skills/ui-transition.aicomponent/SKILL.md +33 -0
  452. package/skills/ui-transition.aicomponent/manifest.json +19 -0
  453. package/skills/ui-transition.aicomponent/ref/phaser.js +45 -0
  454. package/skills/ux_flow_spec.aiconfig/SKILL.md +82 -0
  455. package/skills/ux_flow_spec.aiconfig/manifest.json +39 -0
  456. package/skills/wave_difficulty.aiconfig/SKILL.md +46 -0
  457. package/skills/wave_difficulty.aiconfig/manifest.json +33 -0
  458. package/skills/webpack_build.aicomponent/SKILL.md +204 -0
  459. package/skills/webpack_build.aicomponent/manifest.json +29 -0
  460. package/skills/webpack_build.aicomponent/ref/package.json +16 -0
  461. package/skills/webpack_build.aicomponent/ref/webpack.config.js +53 -0
  462. package/skills/win_anim_sfx.aiaudio/SKILL.md +59 -0
  463. package/skills/win_anim_sfx.aiaudio/manifest.json +46 -0
  464. package/skills/win_anim_sfx.aiaudio/ref/win_anim.mp3 +0 -0
  465. package/skills/win_dot.aiimage/SKILL.md +58 -0
  466. package/skills/win_dot.aiimage/manifest.json +47 -0
  467. package/skills/win_dot.aiimage/ref/win_dot.png +0 -0
  468. package/skills/win_dot.aiimage/ref/win_dot.webp +0 -0
  469. package/skills/win_result_panel.aiimage/SKILL.md +58 -0
  470. package/skills/win_result_panel.aiimage/manifest.json +47 -0
  471. package/skills/win_result_panel.aiimage/ref/win.png +0 -0
  472. package/skills/win_result_panel.aiimage/ref/win.webp +0 -0
  473. package/skills/word_connect.aigameplay/SKILL.md +86 -0
  474. package/skills/word_connect.aigameplay/manifest.json +154 -0
  475. package/skills/word_connect.aigameplay/ref/pgs-schema.json +212 -0
  476. package/skills/word_connect.aigameplay/ref/reducer.template.ts +186 -0
  477. package/src/index.ts +10 -0
  478. package/src/skills.loader.ts +225 -0
  479. package/src/skills.types.ts +42 -0
@@ -0,0 +1,152 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "atomId": "eight_ball_pool.aigameplay",
4
+ "bundleType": "aigameplay",
5
+ "category": "gameplay",
6
+ "mode": "fixed",
7
+ "label": {
8
+ "zh": "8球台球玩法",
9
+ "en": "8-Ball Pool gameplay"
10
+ },
11
+ "tags": [
12
+ "gameplay",
13
+ "billiards",
14
+ "pool",
15
+ "physics",
16
+ "aim",
17
+ "sports"
18
+ ],
19
+ "bindingRoles": [
20
+ "gameplayRule"
21
+ ],
22
+ "imports": [
23
+ {
24
+ "slot": "engine",
25
+ "pinAtomId": "phaser.aicomponent",
26
+ "edgeKind": "requires",
27
+ "bindAs": "engine"
28
+ },
29
+ {
30
+ "slot": "bgMusic",
31
+ "description": "背景循环音乐",
32
+ "bindAs": "bgm",
33
+ "required": false,
34
+ "edgeKind": "compatibleWith",
35
+ "matchBindingRoles": [
36
+ "bgMusic"
37
+ ],
38
+ "allowedBundleTypes": [
39
+ "aiaudio"
40
+ ],
41
+ "constraints": {
42
+ "loop": true
43
+ }
44
+ },
45
+ {
46
+ "slot": "background",
47
+ "description": "台球桌背景图",
48
+ "bindAs": "bg",
49
+ "required": false,
50
+ "edgeKind": "compatibleWith",
51
+ "matchBindingRoles": [
52
+ "backgroundTexture"
53
+ ],
54
+ "allowedBundleTypes": [
55
+ "aiimage"
56
+ ]
57
+ },
58
+ {
59
+ "slot": "tutorial",
60
+ "description": "新手引导浮层",
61
+ "bindAs": "tutorial",
62
+ "required": false,
63
+ "edgeKind": "compatibleWith",
64
+ "matchBindingRoles": [
65
+ "tutorialOverlay"
66
+ ],
67
+ "allowedBundleTypes": [
68
+ "aicomponent"
69
+ ]
70
+ },
71
+ {
72
+ "slot": "winPanel",
73
+ "description": "通关反馈面板视觉",
74
+ "bindAs": "winPanel",
75
+ "required": false,
76
+ "edgeKind": "compatibleWith",
77
+ "matchBindingRoles": [
78
+ "successFeedbackPanel"
79
+ ],
80
+ "allowedBundleTypes": [
81
+ "aiimage"
82
+ ]
83
+ },
84
+ {
85
+ "slot": "losePanel",
86
+ "description": "失败反馈面板视觉",
87
+ "bindAs": "losePanel",
88
+ "required": false,
89
+ "edgeKind": "compatibleWith",
90
+ "matchBindingRoles": [
91
+ "failFeedbackPanel"
92
+ ],
93
+ "allowedBundleTypes": [
94
+ "aiimage"
95
+ ]
96
+ },
97
+ {
98
+ "slot": "endScreen",
99
+ "description": "可玩广告结算屏(含 CTA 按钮)",
100
+ "bindAs": "endScreen",
101
+ "required": false,
102
+ "edgeKind": "compatibleWith",
103
+ "matchBindingRoles": [
104
+ "playableEndScreenLayout"
105
+ ],
106
+ "allowedBundleTypes": [
107
+ "aicomponent"
108
+ ]
109
+ }
110
+ ],
111
+ "generation": {
112
+ "kind": "pgs",
113
+ "pgsVersion": "1.0",
114
+ "gameplayType": "eight_ball_pool",
115
+ "rules": {
116
+ "ballCount": 16,
117
+ "pocketCount": 6,
118
+ "physicsStepsPerFrame": 10,
119
+ "minSeparationAngle": 5,
120
+ "singlePlayer": true
121
+ }
122
+ },
123
+ "result": {
124
+ "outputFile": "reducer.ts",
125
+ "format": "typescript",
126
+ "constraints": {
127
+ "testCasesMustPass": true
128
+ }
129
+ },
130
+ "binding": {
131
+ "role": "gameplayRule",
132
+ "target": "game/gameplay/eight_ball_pool/reducer.ts",
133
+ "type": "gameplay-module-reference",
134
+ "constraints": {
135
+ "interface": [
136
+ "init(config)",
137
+ "dispatch(action)",
138
+ "getState()",
139
+ "aimCueBall(state, angle, power)",
140
+ "shootCueBall(state)",
141
+ "applyPhysicsStep(state, dt)",
142
+ "checkPockets(state)",
143
+ "determineTurn(state)"
144
+ ]
145
+ }
146
+ },
147
+ "files": {
148
+ "skill": "SKILL.md",
149
+ "pgsSchema": "ref/pgs-schema.json",
150
+ "reducerTemplate": "ref/reducer.template.ts"
151
+ }
152
+ }
@@ -0,0 +1,205 @@
1
+ {
2
+ "_comment": "PGS (PlayCraft Gameplay Schema) 参考骨架 - 8球台球简化版。Agent 以此为起点编写或 fork 玩法规则。",
3
+ "version": "1.0",
4
+ "gameplayType": "eight_ball_pool",
5
+ "entities": {
6
+ "table": {
7
+ "type": "play-field",
8
+ "width": 1000,
9
+ "height": 500,
10
+ "description": "台球桌,包含6个球袋",
11
+ "pockets": [
12
+ { "id": "top_left", "x": 0, "y": 0 },
13
+ { "id": "top_mid", "x": 500, "y": 0 },
14
+ { "id": "top_right", "x": 1000, "y": 0 },
15
+ { "id": "bot_left", "x": 0, "y": 500 },
16
+ { "id": "bot_mid", "x": 500, "y": 500 },
17
+ { "id": "bot_right", "x": 1000, "y": 500 }
18
+ ],
19
+ "pocketRadius": 28
20
+ },
21
+ "ball": {
22
+ "type": "physics-object",
23
+ "radius": 14,
24
+ "description": "台球实体,包含白球(cue)、实心球(solid,1-7)、条纹球(stripe,9-15)、黑8(eight)",
25
+ "fields": {
26
+ "id": { "type": "integer", "range": [0, 15], "description": "0=白球,1-7=实心,8=黑球,9-15=条纹" },
27
+ "type": { "type": "enum", "values": ["cue", "solid", "stripe", "eight"] },
28
+ "position": { "type": "vector2", "description": "球心坐标 {x, y}" },
29
+ "velocity": { "type": "vector2", "description": "当前速度 {vx, vy},单位 px/s" },
30
+ "state": { "type": "enum", "values": ["on_table", "pocketed"], "default": "on_table" }
31
+ }
32
+ },
33
+ "aim": {
34
+ "type": "input-state",
35
+ "description": "当前瞄准状态",
36
+ "fields": {
37
+ "angle": { "type": "number", "range": [0, 360], "description": "击球方向角度(度),0=向右" },
38
+ "power": { "type": "number", "range": [0, 100], "description": "力度百分比" }
39
+ }
40
+ },
41
+ "turn_state": {
42
+ "type": "game-state",
43
+ "description": "回合状态",
44
+ "fields": {
45
+ "playerGroup": { "type": "enum", "values": ["solid", "stripe", "unassigned"], "default": "unassigned" },
46
+ "pocketedOwn": { "type": "integer", "default": 0, "description": "已入袋的己方球数量" },
47
+ "phase": { "type": "enum", "values": ["assign", "clear_own", "sink_eight"], "default": "assign" },
48
+ "ballsMoving": { "type": "boolean", "default": false },
49
+ "shotInProgress": { "type": "boolean", "default": false }
50
+ }
51
+ },
52
+ "score": {
53
+ "type": "counter",
54
+ "initial": 0,
55
+ "description": "当前得分(每入袋己方球+100,消灭对方球-50,仅用于展示)"
56
+ }
57
+ },
58
+ "rules": {
59
+ "aim_cue_ball": {
60
+ "description": "玩家设置白球击打角度和力度,不消耗回合",
61
+ "trigger": "player_input",
62
+ "effect": "update aim.angle and aim.power"
63
+ },
64
+ "shoot": {
65
+ "description": "玩家确认击打:给白球施加速度 velocity = power × maxSpeed × direction(angle)",
66
+ "trigger": "player_confirm",
67
+ "effect": "cue_ball.velocity = powerToVelocity(aim.power, aim.angle); turn_state.shotInProgress = true"
68
+ },
69
+ "physics_step": {
70
+ "description": "每帧更新:所有球按速度移动,速度每帧乘以 frictionFactor(约0.985),低于阈值停止",
71
+ "frictionFactor": 0.985,
72
+ "stopThreshold": 1,
73
+ "wallBounce": true,
74
+ "ballCollision": "elastic"
75
+ },
76
+ "pocket_check": {
77
+ "description": "球心进入任意球袋半径内则进袋;白球进袋=犯规(scratch)",
78
+ "pocketRadius": 28,
79
+ "effects": {
80
+ "own_group_ball": "ball.state=pocketed, pocketedOwn++, score+100",
81
+ "other_group_ball":"ball.state=pocketed(对方获利)",
82
+ "eight_ball_early":"game_over(lose) unless all own balls pocketed",
83
+ "eight_ball_win": "game_over(win) if all own balls pocketed AND phase==sink_eight",
84
+ "cue_ball": "scratch: cue ball respawn at kitchen area"
85
+ }
86
+ },
87
+ "turn_switch": {
88
+ "description": "所有球停止后检查回合结果:若入袋>=1个己方球则继续,否则结束本次回合",
89
+ "trigger": "all_balls_stopped"
90
+ },
91
+ "group_assign": {
92
+ "description": "首次入袋时根据球类型分配玩家球组",
93
+ "trigger": "first_pocket_event",
94
+ "effect": "playerGroup = ball.type (solid or stripe)"
95
+ }
96
+ },
97
+ "algorithm": {
98
+ "description": "主循环:aim → shoot → physics → pocket_check → turn_switch",
99
+ "steps": [
100
+ "1. 玩家调整瞄准参数(angle, power),可多次设置",
101
+ "2. 玩家确认击打,给白球赋予初始速度",
102
+ "3. 物理帧循环:移动所有球、处理碰撞、处理边界反弹",
103
+ "4. 每帧检测所有球是否进入球袋",
104
+ "5. 所有球停止后进行入袋判定:己方球入袋加分,犯规处理",
105
+ "6. 若 phase==assign 且首次有球入袋,分配玩家球组",
106
+ "7. 检测胜利(phase==sink_eight 且8号球入袋)或失败(8号球提前入袋/scratch on 8ball shot)",
107
+ "8. 回合切换,等待下一次击球"
108
+ ]
109
+ },
110
+ "winCondition": {
111
+ "type": "pocket_eight_ball",
112
+ "description": "先将己方7个球(实心或条纹)全部打入球袋,再将8号黑球打入球袋"
113
+ },
114
+ "loseCondition": {
115
+ "type": "foul_on_eight",
116
+ "description": "在己方球未全部入袋时打入8号球,或在击打8号球时白球入袋(scratch)"
117
+ },
118
+ "testCases": [
119
+ {
120
+ "id": "tc_pocket_own_ball",
121
+ "description": "成功入袋己方球(实心球):白球击中1号实心球,1号球进袋",
122
+ "initialState": {
123
+ "balls": [
124
+ { "id": 0, "type": "cue", "position": { "x": 300, "y": 250 }, "velocity": { "vx": 0, "vy": 0 }, "state": "on_table" },
125
+ { "id": 1, "type": "solid", "position": { "x": 30, "y": 30 }, "velocity": { "vx": 0, "vy": 0 }, "state": "on_table" }
126
+ ],
127
+ "turn_state": { "playerGroup": "solid", "pocketedOwn": 0, "phase": "clear_own" },
128
+ "aim": { "angle": 315, "power": 80 }
129
+ },
130
+ "actions": [
131
+ { "type": "shoot" },
132
+ { "type": "simulate_until_stop" }
133
+ ],
134
+ "expectedState": {
135
+ "ball_1_state": "pocketed",
136
+ "turn_state.pocketedOwn": 1,
137
+ "score_gained": 100
138
+ }
139
+ },
140
+ {
141
+ "id": "tc_win_sink_eight",
142
+ "description": "胜利条件:己方7球已全入袋,成功打入8号球",
143
+ "initialState": {
144
+ "balls": [
145
+ { "id": 0, "type": "cue", "position": { "x": 500, "y": 250 }, "velocity": { "vx": 0, "vy": 0 }, "state": "on_table" },
146
+ { "id": 8, "type": "eight", "position": { "x": 480, "y": 25 }, "velocity": { "vx": 0, "vy": 0 }, "state": "on_table" }
147
+ ],
148
+ "turn_state": { "playerGroup": "solid", "pocketedOwn": 7, "phase": "sink_eight" },
149
+ "aim": { "angle": 90, "power": 70 }
150
+ },
151
+ "actions": [
152
+ { "type": "shoot" },
153
+ { "type": "simulate_until_stop" }
154
+ ],
155
+ "expectedState": {
156
+ "gameOver": true,
157
+ "win": true,
158
+ "ball_8_state": "pocketed"
159
+ }
160
+ },
161
+ {
162
+ "id": "tc_scratch_lose",
163
+ "description": "失败:击打8号球时白球入袋(scratch on 8ball shot)",
164
+ "initialState": {
165
+ "balls": [
166
+ { "id": 0, "type": "cue", "position": { "x": 500, "y": 470 }, "velocity": { "vx": 0, "vy": 0 }, "state": "on_table" },
167
+ { "id": 8, "type": "eight", "position": { "x": 500, "y": 400 }, "velocity": { "vx": 0, "vy": 0 }, "state": "on_table" }
168
+ ],
169
+ "turn_state": { "playerGroup": "solid", "pocketedOwn": 7, "phase": "sink_eight" },
170
+ "aim": { "angle": 90, "power": 100 }
171
+ },
172
+ "actions": [
173
+ { "type": "shoot" },
174
+ { "type": "simulate_until_stop" }
175
+ ],
176
+ "expectedState": {
177
+ "gameOver": true,
178
+ "win": false,
179
+ "loseReason": "scratch_on_eight_ball"
180
+ }
181
+ },
182
+ {
183
+ "id": "tc_early_eight_lose",
184
+ "description": "失败:己方球未清空时打入8号球",
185
+ "initialState": {
186
+ "balls": [
187
+ { "id": 0, "type": "cue", "position": { "x": 500, "y": 250 }, "velocity": { "vx": 0, "vy": 0 }, "state": "on_table" },
188
+ { "id": 8, "type": "eight", "position": { "x": 480, "y": 25 }, "velocity": { "vx": 0, "vy": 0 }, "state": "on_table" },
189
+ { "id": 1, "type": "solid", "position": { "x": 600, "y": 250 }, "velocity": { "vx": 0, "vy": 0 }, "state": "on_table" }
190
+ ],
191
+ "turn_state": { "playerGroup": "solid", "pocketedOwn": 6, "phase": "clear_own" },
192
+ "aim": { "angle": 90, "power": 70 }
193
+ },
194
+ "actions": [
195
+ { "type": "shoot" },
196
+ { "type": "simulate_until_stop" }
197
+ ],
198
+ "expectedState": {
199
+ "gameOver": true,
200
+ "win": false,
201
+ "loseReason": "eight_ball_pocketed_early"
202
+ }
203
+ }
204
+ ]
205
+ }
@@ -0,0 +1,198 @@
1
+ /**
2
+ * eight_ball_pool.aigameplay — reducer 接口模板
3
+ *
4
+ * Agent 生成实际 reducer 时,必须导出以下函数。
5
+ * 此文件是接口约束模板,不是可执行代码。
6
+ *
7
+ * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
8
+ * ⚠️ 重要:渲染层(GameScene)不应直接调用 dispatch()
9
+ *
10
+ * dispatch() 是一体化接口,内部跑完整个物理模拟后只返回最终状态,
11
+ * 中间每帧球的位置、碰撞事件、进袋事件全部丢失。
12
+ *
13
+ * 渲染层需要逐帧更新球的精灵位置,因此必须使用下方的「分步函数」,
14
+ * 每帧调用 applyPhysicsStep + checkPockets,渲染层根据状态更新精灵。
15
+ *
16
+ * dispatch() 的用途:无头测试、AI 模拟、快速跳过动画等场景。
17
+ * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
18
+ */
19
+
20
+ // ─── 配置类型 ─────────────────────────────────────────────────────────────────
21
+
22
+ export type EightBallConfig = {
23
+ /** 台球桌宽度(像素),默认 1000 */
24
+ tableWidth: number;
25
+ /** 台球桌高度(像素),默认 500 */
26
+ tableHeight: number;
27
+ /** 球的半径(像素),默认 14 */
28
+ ballRadius: number;
29
+ /** 球袋半径(像素),默认 28 */
30
+ pocketRadius: number;
31
+ /** 最大击球速度(像素/秒) */
32
+ maxShotSpeed: number;
33
+ /** 摩擦系数(每帧速度乘以此值,约 0.985) */
34
+ frictionFactor: number;
35
+ /** 球停止阈值(速度小于此值视为停止,像素/秒) */
36
+ stopThreshold: number;
37
+ /** 物理模拟每帧步数 */
38
+ physicsStepsPerFrame: number;
39
+ };
40
+
41
+ // ─── 核心类型 ─────────────────────────────────────────────────────────────────
42
+
43
+ export type BallType = 'cue' | 'solid' | 'stripe' | 'eight';
44
+ export type BallState = 'on_table' | 'pocketed';
45
+ export type PlayerGroup = 'solid' | 'stripe' | 'unassigned';
46
+ export type GamePhase = 'assign' | 'clear_own' | 'sink_eight';
47
+ export type LoseReason = 'eight_ball_pocketed_early' | 'scratch_on_eight_ball' | null;
48
+
49
+ export type Vector2 = { x: number; y: number };
50
+
51
+ export type Ball = {
52
+ id: number; // 0=白球,1-7=实心,8=黑球,9-15=条纹
53
+ type: BallType;
54
+ position: Vector2;
55
+ velocity: Vector2;
56
+ state: BallState;
57
+ };
58
+
59
+ export type Pocket = {
60
+ id: string;
61
+ position: Vector2;
62
+ };
63
+
64
+ // ─── 动作类型 ─────────────────────────────────────────────────────────────────
65
+
66
+ export type EightBallAction =
67
+ | { type: 'aim'; angle: number; power: number } // 设置瞄准参数
68
+ | { type: 'shoot' } // 确认击球
69
+ | { type: 'simulate_until_stop' } // (测试用)模拟直到所有球停止
70
+ | { type: 'simulate_step'; dt: number } // 模拟单帧
71
+ | { type: 'reset' };
72
+
73
+ // ─── 状态类型 ─────────────────────────────────────────────────────────────────
74
+
75
+ export type EightBallState = {
76
+ balls: Ball[];
77
+ pockets: Pocket[];
78
+ aim: { angle: number; power: number };
79
+ playerGroup: PlayerGroup;
80
+ pocketedOwn: number; // 已入袋的己方球数量
81
+ phase: GamePhase;
82
+ ballsMoving: boolean;
83
+ shotInProgress: boolean;
84
+ gameOver: boolean;
85
+ win: boolean;
86
+ loseReason: LoseReason;
87
+ score: number;
88
+ /** 上一次物理步骤产生的进袋事件 */
89
+ lastPocketEvents: PocketEvent[];
90
+ /** 上一次物理步骤产生的碰撞事件 */
91
+ lastCollisionEvents: CollisionEvent[];
92
+ };
93
+
94
+ // ─── 分步操作返回类型 ─────────────────────────────────────────────────────────
95
+
96
+ /** 进袋事件 */
97
+ export type PocketEvent = {
98
+ ballId: number;
99
+ pocketId: string;
100
+ ballType: BallType;
101
+ isOwnGroup: boolean;
102
+ isFoul: boolean; // scratch(白球入袋)或提前入8号球
103
+ };
104
+
105
+ /** 球碰撞事件(渲染层可据此播放碰撞音效) */
106
+ export type CollisionEvent = {
107
+ ball1Id: number;
108
+ ball2Id: number;
109
+ impactSpeed: number; // 碰撞速度大小,用于决定音效强度
110
+ };
111
+
112
+ // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
113
+ // 必须导出的函数
114
+ // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
115
+
116
+ // ─── 初始化 ──────────────────────────────────────────────────────────────────
117
+
118
+ /**
119
+ * init:根据配置初始化游戏状态,摆放标准开球阵型(三角形排列)
120
+ */
121
+ export declare function init(config: EightBallConfig): EightBallState;
122
+
123
+ // ─── 一体化接口(测试/AI 模拟用) ───────────────────────────────────────────
124
+
125
+ /**
126
+ * dispatch:接收动作,返回新状态(纯函数,不得修改原 state)
127
+ * - aim:设置瞄准参数
128
+ * - shoot:执行击球,模拟到所有球停止,返回最终状态
129
+ * - simulate_step:单帧物理模拟
130
+ * - simulate_until_stop:模拟直到所有球停止
131
+ * - reset:重置
132
+ *
133
+ * ⚠️ 仅用于无头测试和 AI 模拟。渲染层请使用下方分步函数。
134
+ */
135
+ export declare function dispatch(state: EightBallState, action: EightBallAction): EightBallState;
136
+
137
+ /**
138
+ * getState:返回当前状态快照
139
+ */
140
+ export declare function getState(state: EightBallState): EightBallState;
141
+
142
+ // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
143
+ // 分步函数(渲染层/场景层必须使用这些函数逐帧驱动)
144
+ // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
145
+
146
+ /**
147
+ * aimCueBall:设置瞄准参数(角度和力度),不触发击球
148
+ * 渲染层在玩家拖动瞄准线时调用,用于预览击球方向
149
+ */
150
+ export declare function aimCueBall(
151
+ state: EightBallState,
152
+ angle: number, // 0~360 度
153
+ power: number, // 0~100
154
+ ): EightBallState;
155
+
156
+ /**
157
+ * shootCueBall:根据当前 aim 参数给白球施加初始速度
158
+ * 渲染层在玩家确认击球时调用,之后进入物理帧循环
159
+ */
160
+ export declare function shootCueBall(state: EightBallState): EightBallState;
161
+
162
+ /**
163
+ * applyPhysicsStep:执行单帧物理模拟
164
+ * - 更新所有球的位置(position += velocity × dt)
165
+ * - 应用摩擦力(velocity *= frictionFactor)
166
+ * - 处理边界反弹(velocity 分量取反)
167
+ * - 处理球与球碰撞(弹性碰撞,交换速度分量)
168
+ * - 返回包含碰撞事件的新状态
169
+ *
170
+ * 渲染层每帧调用此函数,根据 state.balls 更新精灵位置
171
+ */
172
+ export declare function applyPhysicsStep(
173
+ state: EightBallState,
174
+ dt: number, // 帧时间(秒),典型值 1/60
175
+ ): EightBallState;
176
+
177
+ /**
178
+ * checkPockets:检测所有球是否进入球袋
179
+ * - 球心距任意球袋中心 <= pocketRadius → 进袋
180
+ * - 更新 ball.state = 'pocketed'
181
+ * - 白球进袋:scratch 处理
182
+ * - 8号球进袋:根据 phase 判断胜负
183
+ * - 返回含进袋事件的新状态
184
+ *
185
+ * 渲染层在每次 applyPhysicsStep 后调用,检测进袋并播放进袋动画
186
+ */
187
+ export declare function checkPockets(state: EightBallState): EightBallState;
188
+
189
+ /**
190
+ * determineTurn:所有球停止后,判断回合结果并更新 turn_state
191
+ * - 处理球组分配(首次进袋时)
192
+ * - 检测胜利/失败条件
193
+ * - 更新 phase(assign → clear_own → sink_eight)
194
+ * - 返回更新后的状态(含 gameOver/win 标记)
195
+ *
196
+ * 渲染层在检测到 ballsMoving 由 true 变为 false 时调用
197
+ */
198
+ export declare function determineTurn(state: EightBallState): EightBallState;
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: energetic_electronic.aiaudio
3
+ description: 紧张电子 BGM 封包 - 高能量电子音乐循环,适合逃脱益智、箭头逃脱等需要营造紧迫感的游戏
4
+ triggers: 背景音乐,bgm,紧张,tension,电子,electronic,激昂,energetic,逃脱,escape,紧迫,intense,合成器,synth
5
+ ---
6
+
7
+ # energetic_electronic.aiaudio
8
+
9
+ 紧张电子 BGM 封包。高能量电子音乐,营造紧迫逃脱的游戏氛围,适合箭头逃脱、停车逃脱等玩法。
10
+
11
+ ## Recipe
12
+
13
+ - **基础 prompt**:`intense energetic electronic loop, tension-building background music for escape puzzle game, driving beat, synth, 140 BPM`
14
+ - **时长**:30 秒(循环)
15
+ - **BPM**:约 140
16
+ - **风格**:电子、合成器、紧张感
17
+ - **可 fork 变体**:
18
+ - 极限紧张:BPM 提升至 160,加入倒计时节拍感
19
+ - 赛博朋克:添加 cyberpunk 风格合成器元素
20
+ - 动作冒险:加入打击乐器和管弦乐
21
+
22
+ **生成步骤:**
23
+ 1. 调用音频生成 API,传入 prompt 和 30s 时长
24
+ 2. 验证时长并检查循环无缝衔接
25
+ 3. 写入 `audio.mp3`,更新 manifest
26
+
27
+ ## Result
28
+
29
+ - **产物文件**:`audio.mp3`
30
+ - **格式**:MP3,15-60 秒循环
31
+
32
+ ## Binding
33
+
34
+ - **Binding Role**:`backgroundMusic`
35
+ - **挂载目标**:`scene://entities/AudioManager/bgm/asset`
36
+ - **引用类型**:`audio-asset-reference`
37
+ - **播放模式**:loop
38
+
39
+ ## 生成方式
40
+
41
+ Platform Skill: `playcraft-audio-generation`
42
+
43
+ ```bash
44
+ # 1. 生成 BGM(Google Lyria 3,固定 30s)
45
+ playcraft tools generate-bgm \
46
+ --prompt "intense energetic electronic loop, tension-building background music for escape puzzle game, driving beat, synth, 140 BPM" \
47
+ --style electronic \
48
+ --bpm 140 \
49
+ --output ta-workspace/raw_bgm.mp3
50
+
51
+ # 2. 处理无缝循环 + 归一化
52
+ playcraft audio loop --input ta-workspace/raw_bgm.mp3 --output ta-workspace/bgm_loop.mp3 --crossfade 0.5
53
+ playcraft audio normalize --input ta-workspace/bgm_loop.mp3 --output ta-workspace/bgm_loop.mp3 --target-loudness -16
54
+
55
+ # 3. 压缩至体积预算(Facebook 可玩广告 BGM 目标 ≤60KB)
56
+ playcraft audio compress --input ta-workspace/bgm_loop.mp3 --output ta-workspace/asset --target-size 60KB
57
+
58
+ # 4. 将产物写入 sandbox 对应路径(见 binding.target)
59
+ ```
60
+ ## Skill Definition
61
+
62
+ tools:
63
+ - bash
64
+ - write
65
+ - read
66
+ prompt_extension: |
67
+ You are generating an energetic electronic BGM for an escape puzzle game.
68
+ Follow the Recipe to generate a high-energy, tension-building electronic track.
69
+ Ensure the loop is seamless. Apply the Binding to the AudioManager.
@@ -0,0 +1,51 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "atomId": "energetic_electronic.aiaudio",
4
+ "bundleType": "aiaudio",
5
+ "category": "audio",
6
+ "mode": "generative",
7
+ "label": {
8
+ "zh": "紧张电子 BGM",
9
+ "en": "Energetic electronic BGM"
10
+ },
11
+ "tags": [
12
+ "audio",
13
+ "bgm",
14
+ "music",
15
+ "energetic",
16
+ "electronic",
17
+ "tension",
18
+ "escape",
19
+ "loop",
20
+ "intense"
21
+ ],
22
+ "bindingRoles": ["bgMusic"],
23
+ "generation": {
24
+ "kind": "bgm",
25
+ "prompt": "intense energetic electronic loop, tension-building background music for escape puzzle game, driving beat, synth, 140 BPM",
26
+ "duration": 30,
27
+ "loop": true,
28
+ "platformSkill": "playcraft-audio-generation",
29
+ "bgmStyle": "electronic",
30
+ "bpm": 140
31
+ },
32
+ "result": {
33
+ "outputFile": "audio.mp3",
34
+ "format": "mp3",
35
+ "constraints": {
36
+ "minDuration": 15,
37
+ "maxDuration": 60
38
+ }
39
+ },
40
+ "binding": {
41
+ "role": "backgroundMusic",
42
+ "target": "scene://entities/AudioManager/bgm/asset",
43
+ "type": "audio-asset-reference",
44
+ "constraints": {
45
+ "playMode": "loop"
46
+ }
47
+ },
48
+ "files": {
49
+ "skill": "SKILL.md"
50
+ }
51
+ }