@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,180 @@
1
+ {
2
+ "_comment": "PGS (PlayCraft Gameplay Schema) - 箭头推出三消玩法(arrow_pick_match)。棋盘上有带颜色和方向的路径,玩家点击路径触发方向推出,推出后飞入底部篮子。篮子中凑齐 3 条同色路径自动消除。所有路径推出且篮子清空为胜利。",
3
+ "version": "1.0",
4
+ "gameplayType": "arrow_pick_match",
5
+ "parentTypes": ["path_elimination", "pick_and_match"],
6
+ "entities": {
7
+ "board": {
8
+ "type": "grid",
9
+ "rows": "dynamic (4~7)",
10
+ "cols": "dynamic (4~7)",
11
+ "description": "棋盘网格,路径在其上占据格子。"
12
+ },
13
+ "path": {
14
+ "type": "multi-cell-entity",
15
+ "fields": {
16
+ "points": "GridPoint[] 路径覆盖的格子坐标列表",
17
+ "head": "GridPoint 车头位置(最后一个点)",
18
+ "direction": "string 推出方向 (up|down|left|right)",
19
+ "color": "string 颜色标识",
20
+ "indices": "number[] 覆盖的所有格子索引(row-major)",
21
+ "pathIndex": "number 在 level.paths 中的索引"
22
+ },
23
+ "state": "idle | sliding_out | in_tray | matched | removed",
24
+ "description": "棋盘上的路径实体,占据连续格子。方向由最后两点推导。推出时整体滑出。"
25
+ },
26
+ "tray": {
27
+ "type": "container",
28
+ "capacity": 7,
29
+ "fields": {
30
+ "items": "TrayItem[] 当前篮子中的物品(id + color)",
31
+ "maxSlots": "number 篮子最大容量(默认 7)"
32
+ },
33
+ "description": "底部篮子。路径推出后飞入此处。同色聚合排列,凑齐 3 个消除。"
34
+ },
35
+ "timer": {
36
+ "type": "countdown",
37
+ "initial": "levelTime 秒(来自关卡数据)",
38
+ "description": "倒计时计时器。归零时触发失败。"
39
+ }
40
+ },
41
+ "rules": {
42
+ "pathClickDetection": {
43
+ "description": "玩家点击棋盘上的任意路径格子即命中该路径。",
44
+ "trigger": "pointer_up",
45
+ "conditions": ["path.state === 'idle'", "not inputLocked"]
46
+ },
47
+ "blockingCheck": {
48
+ "description": "检测路径推出方向上是否有其他路径阻挡。从 head 沿 direction 逐格检测,直到出界或碰到其他路径占据的格子。",
49
+ "steps": [
50
+ "1. 计算 direction 对应的 delta (dx, dy)",
51
+ "2. 从 head 位置开始,逐步 += delta",
52
+ "3. 若到达棋盘边界 → 记录 stepsToExit,返回 unblocked",
53
+ "4. 若碰到其他未移除路径的格子 → 返回 blocked"
54
+ ]
55
+ },
56
+ "blockedFeedback": {
57
+ "description": "路径被阻挡时的反馈:棋盘抖动 + 路径短暂变红。不扣命不扣分。",
58
+ "trigger": "blocking_check_failed"
59
+ },
60
+ "slideOut": {
61
+ "description": "路径无阻挡时,整条路径沿方向滑出棋盘。所有格子上的精灵作为容器一起移动。",
62
+ "trigger": "blocking_check_passed",
63
+ "steps": [
64
+ "1. 锁定输入",
65
+ "2. 标记路径为 sliding_out",
66
+ "3. 创建临时容器包含路径所有精灵",
67
+ "4. Tween 容器沿方向移动 slideDistance",
68
+ "5. 完成后标记路径为 removed,触发 flyToTray"
69
+ ]
70
+ },
71
+ "flyToTray": {
72
+ "description": "路径滑出后,head 精灵贝塞尔曲线飞入篮子对应槽位。",
73
+ "trigger": "after_slide_out",
74
+ "steps": [
75
+ "1. 计算篮子中的插入位置(同色聚合)",
76
+ "2. head 精灵从滑出终点贝塞尔曲线飞入目标槽位",
77
+ "3. 到达后在篮子中创建物品精灵",
78
+ "4. 触发 matchDetection"
79
+ ]
80
+ },
81
+ "matchDetection": {
82
+ "description": "每次物品入篮后,检查是否有 3 个同色。有则消除。",
83
+ "trigger": "after_fly_to_tray",
84
+ "matchCondition": "3 items with identical color",
85
+ "steps": [
86
+ "1. 按 color 分组计数",
87
+ "2. 找到 count >= 3 的组",
88
+ "3. 消除该组前 3 个(放大+淡出动画)",
89
+ "4. 剩余物品左移填补",
90
+ "5. 若仍有 count >= 3,递归消除",
91
+ "6. 检查胜负条件"
92
+ ]
93
+ },
94
+ "winCondition": {
95
+ "description": "所有路径推出棋盘 + 篮子中物品全部消除 = 胜利",
96
+ "check": "removedPaths.size >= level.paths.length && tray.length === 0"
97
+ },
98
+ "loseCondition_trayFull": {
99
+ "description": "篮子物品数达到 maxSlots 且无消除触发 = 失败",
100
+ "check": "tray.length >= maxSlots && no match found"
101
+ },
102
+ "loseCondition_timeout": {
103
+ "description": "倒计时归零时棋盘仍有未推出路径 = 失败",
104
+ "check": "timer <= 0 && removedPaths.size < level.paths.length"
105
+ },
106
+ "inputLock": {
107
+ "description": "滑出动画、飞入动画、消除动画期间锁定输入"
108
+ }
109
+ },
110
+ "levelDataSchema": {
111
+ "format": {
112
+ "name": "number 关卡序号",
113
+ "row": "number 棋盘行数",
114
+ "col": "number 棋盘列数",
115
+ "arrows": "(number|string)[][][] 路径点数组,第一个点第三元素为颜色",
116
+ "levelTime": "number 关卡时限秒数",
117
+ "trayCapacity": "number? 篮子容量(默认7)"
118
+ },
119
+ "constraints": {
120
+ "tripleGuarantee": "每种颜色的路径数量必须恰好为 3",
121
+ "noOverlap": "任意两条路径不共享格子",
122
+ "allUnblocked": "建议所有路径可无阻挡推出(或存在合法推出序列)",
123
+ "minPaths": 6,
124
+ "minColors": 2
125
+ }
126
+ },
127
+ "testCases": [
128
+ {
129
+ "id": "tc_basic_slide_and_match",
130
+ "description": "基础通关:6 条路径(2色×3),全部无阻挡,连续推出同色即消除",
131
+ "initialState": {
132
+ "board": "4×4",
133
+ "paths": [
134
+ { "points": [[0,0],[1,0]], "color": "red", "direction": "right" },
135
+ { "points": [[3,1],[2,1]], "color": "red", "direction": "left" },
136
+ { "points": [[0,2],[0,3]], "color": "red", "direction": "down" },
137
+ { "points": [[3,3],[3,2]], "color": "blue", "direction": "up" },
138
+ { "points": [[1,3],[2,3]], "color": "blue", "direction": "right" },
139
+ { "points": [[2,2],[1,2]], "color": "blue", "direction": "left" }
140
+ ],
141
+ "tray": [],
142
+ "trayCapacity": 7
143
+ },
144
+ "actions": [
145
+ { "type": "clickPath", "pathIndex": 0 },
146
+ { "type": "clickPath", "pathIndex": 1 },
147
+ { "type": "clickPath", "pathIndex": 2 },
148
+ { "type": "clickPath", "pathIndex": 3 },
149
+ { "type": "clickPath", "pathIndex": 4 },
150
+ { "type": "clickPath", "pathIndex": 5 }
151
+ ],
152
+ "expectedState": {
153
+ "tray": [],
154
+ "removedCount": 6,
155
+ "win": true
156
+ }
157
+ },
158
+ {
159
+ "id": "tc_tray_overflow",
160
+ "description": "篮子溢出:乱序推出导致篮子满",
161
+ "initialState": {
162
+ "board": "5×5, 9 paths (3色×3)",
163
+ "trayCapacity": 5
164
+ },
165
+ "actions": "交替推出不同颜色,每色只推2个不足3消",
166
+ "expectedState": {
167
+ "win": false,
168
+ "loseReason": "tray_full"
169
+ }
170
+ },
171
+ {
172
+ "id": "tc_blocked_feedback",
173
+ "description": "阻挡反馈:路径被挡时不推出,只抖动",
174
+ "expectedState": {
175
+ "actionResult": "blocked",
176
+ "pathStillOnBoard": true
177
+ }
178
+ }
179
+ ]
180
+ }
@@ -0,0 +1,117 @@
1
+ ---
2
+ name: asset_pipeline_scripts.aicomponent
3
+ description: AI 生图资源管线自动化。一键完成 generate → remove-background → trim → convert webp → 输出集成提示。与 board_entity_sprite.aiimage 配套使用。
4
+ triggers: 资源管线,asset pipeline,生成图片,generate sprite,一键生图,自动化,gen-sprite
5
+ ---
6
+
7
+ # 资源管线自动化脚本(Asset Pipeline Scripts)
8
+
9
+ ## 说明
10
+
11
+ 将 AI 生图到项目集成的**全流程自动化**为一条命令:
12
+
13
+ ```bash
14
+ pnpm gen:sprite car
15
+ # 等价于:
16
+ pnpm gen:sprite "cute cartoon car"
17
+ ```
18
+
19
+ **自动完成:**
20
+ 1. 构造 prompt(填充 entity 变量)
21
+ 2. 调用 `playcraft tools generate-image`
22
+ 3. `playcraft image remove-background`
23
+ 4. `playcraft image trim`
24
+ 5. `playcraft image convert --format webp --quality 90`
25
+ 6. 清理中间文件
26
+ 7. 输出集成代码提示
27
+
28
+ ## Scaffold
29
+
30
+ | 目标路径 | 来源 | 说明 |
31
+ |---------|-----|------|
32
+ | `scripts/gen-sprite.sh` | `ref/gen-sprite.sh` | 一键生图脚本 |
33
+
34
+ `package.json` 新增:
35
+ ```json
36
+ {
37
+ "scripts": {
38
+ "gen:sprite": "bash scripts/gen-sprite.sh"
39
+ }
40
+ }
41
+ ```
42
+
43
+ ## 使用方式
44
+
45
+ ```bash
46
+ # 基础用法(默认 cartoon flat 风格)
47
+ pnpm gen:sprite car
48
+
49
+ # 指定完整描述
50
+ pnpm gen:sprite "red race car with flames"
51
+
52
+ # 指定输出名
53
+ pnpm gen:sprite car --name racing_car
54
+ ```
55
+
56
+ ## 输出
57
+
58
+ ```
59
+ 🎨 Generating: car
60
+ 📦 Model: google/gemini-3.1-flash-image-preview
61
+ ⏳ Generating image...
62
+ ✅ Generated raw image
63
+ 🔲 Removing background...
64
+ ✂️ Trimming...
65
+ 🔄 Converting to webp...
66
+ 🧹 Cleaning up...
67
+
68
+ ✅ Done: assets/images/car.webp (24KB)
69
+
70
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
71
+ Integration code:
72
+
73
+ // Add to Preloader.ts imports:
74
+ import carImage from "assets/images/car.webp";
75
+
76
+ // Add to preload():
77
+ this.load.image("car", carImage);
78
+
79
+ // Use in scene:
80
+ const sprite = scene.add.image(x, y, "car");
81
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
82
+ ```
83
+
84
+ ## Recipe
85
+
86
+ | 决策 | 原因 |
87
+ |------|------|
88
+ | **自动化为单一命令** | 手动执行 generate → remove-bg → trim → convert 五步极易遗漏步骤;脚本保证每次流程一致 |
89
+ | **Bash 脚本而非 Node.js** | Bash 调用 CLI 命令更直观,零额外依赖,PlayCraft CLI 工具已覆盖所有后处理需求 |
90
+ | **输出集成代码提示** | Agent 生成图片后立即得到 Preloader.ts 的 import 和 load 代码片段,减少上下文切换成本 |
91
+ | **与 aiimage skill 解耦** | Recipe(prompt 模板)在 `board_entity_sprite.aiimage` 中维护;本 skill 只负责执行流程,不重复定义 prompt |
92
+
93
+ ## Adapter
94
+
95
+ - **Role**: `assetPipeline` — AI 生图管线自动化工具(开发时脚本,非运行时组件)
96
+ - **Provides**: `scripts/gen-sprite.sh` 脚本、`pnpm gen:sprite` npm 命令
97
+ - **Requires**: `board_entity_sprite.aiimage`(prompt 模板知识)、PlayCraft CLI(`playcraft` 命令)
98
+ - **Consumed by**: Agent 在需要生成新精灵图资产时直接调用;无上游 skill 依赖
99
+ - **Integration point**: `package.json` `scripts.gen:sprite` —— Agent 执行 `pnpm gen:sprite <entity>` 触发完整管线
100
+
101
+ ## Imports
102
+
103
+ - `board_entity_sprite.aiimage`(知识层配套:prompt 模板 + 后处理规范)
104
+
105
+ ## Skill Definition
106
+
107
+ ```yaml
108
+ tools:
109
+ - bash
110
+ - write
111
+ - read
112
+ inputs:
113
+ - source: ref/gen-sprite.sh
114
+ outputs:
115
+ - script: scripts/gen-sprite.sh
116
+ - npmScript: gen:sprite
117
+ ```
@@ -0,0 +1,17 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "atomId": "asset_pipeline_scripts.aicomponent",
4
+ "bundleType": "aicomponent",
5
+ "category": "tool",
6
+ "mode": "fixed",
7
+ "label": {
8
+ "zh": "资源管线自动化脚本",
9
+ "en": "Asset pipeline automation scripts"
10
+ },
11
+ "tags": ["asset", "pipeline", "automation", "image", "generate", "script"],
12
+ "bindingRoles": ["assetPipeline"],
13
+ "files": {
14
+ "skill": "SKILL.md",
15
+ "ref": ["ref/gen-sprite.sh"]
16
+ }
17
+ }
@@ -0,0 +1,105 @@
1
+ #!/bin/bash
2
+ # gen-sprite.sh — AI 生图资源管线一键脚本
3
+ # 用法: bash scripts/gen-sprite.sh <entity> [--name output_name]
4
+ #
5
+ # 示例:
6
+ # bash scripts/gen-sprite.sh car
7
+ # bash scripts/gen-sprite.sh "red race car" --name racing_car
8
+
9
+ set -e
10
+
11
+ ENTITY="${1:-car}"
12
+ OUTPUT_NAME=""
13
+ MODEL="google/gemini-3.1-flash-image-preview"
14
+ ASSETS_DIR="assets/images"
15
+
16
+ # 解析参数
17
+ shift 2>/dev/null || true
18
+ while [[ $# -gt 0 ]]; do
19
+ case $1 in
20
+ --name) OUTPUT_NAME="$2"; shift 2 ;;
21
+ --model) MODEL="$2"; shift 2 ;;
22
+ *) shift ;;
23
+ esac
24
+ done
25
+
26
+ # 如果没有指定输出名,从 entity 提取(取第一个单词,小写)
27
+ if [ -z "$OUTPUT_NAME" ]; then
28
+ OUTPUT_NAME=$(echo "$ENTITY" | awk '{print $1}' | tr '[:upper:]' '[:lower:]')
29
+ fi
30
+
31
+ PROMPT="top-down bird's eye view of a cute cartoon ${ENTITY}, facing upward, simple flat design, bright vivid colors, game asset, white background, centered on canvas, no shadow, 256x256 icon style"
32
+
33
+ echo "🎨 Generating: ${ENTITY}"
34
+ echo "📦 Model: ${MODEL}"
35
+ echo "📂 Output: ${ASSETS_DIR}/${OUTPUT_NAME}.webp"
36
+ echo ""
37
+
38
+ # 确保目录存在
39
+ mkdir -p "${ASSETS_DIR}"
40
+
41
+ RAW_FILE="${ASSETS_DIR}/${OUTPUT_NAME}_raw.jpg"
42
+ NOBG_FILE="${ASSETS_DIR}/${OUTPUT_NAME}_nobg.png"
43
+ TRIM_FILE="${ASSETS_DIR}/${OUTPUT_NAME}_trimmed.png"
44
+ FINAL_FILE="${ASSETS_DIR}/${OUTPUT_NAME}.webp"
45
+
46
+ # Step 1: 生成
47
+ echo "⏳ Generating image..."
48
+ playcraft tools generate-image \
49
+ --prompt "${PROMPT}" \
50
+ --aspect-ratio 1:1 \
51
+ --image-model "${MODEL}" \
52
+ --output "${RAW_FILE}" 2>&1 | tail -1
53
+
54
+ # 处理 playcraft 可能将输出改为 .jpg
55
+ if [ ! -f "${RAW_FILE}" ]; then
56
+ # playcraft 可能输出了不同扩展名
57
+ POSSIBLE_JPG="${RAW_FILE%.png}.jpg"
58
+ if [ -f "${POSSIBLE_JPG}" ]; then
59
+ RAW_FILE="${POSSIBLE_JPG}"
60
+ fi
61
+ fi
62
+
63
+ echo "✅ Generated raw image"
64
+
65
+ # Step 2: 去背景
66
+ echo "🔲 Removing background..."
67
+ playcraft image remove-background \
68
+ --input "${RAW_FILE}" \
69
+ --output "${NOBG_FILE}" 2>&1 | tail -1
70
+
71
+ # Step 3: 裁切
72
+ echo "✂️ Trimming..."
73
+ playcraft image trim \
74
+ --input "${NOBG_FILE}" \
75
+ --output "${TRIM_FILE}" 2>&1 | tail -1
76
+
77
+ # Step 4: 转 webp
78
+ echo "🔄 Converting to webp..."
79
+ playcraft image convert \
80
+ --input "${TRIM_FILE}" \
81
+ --output "${FINAL_FILE}" \
82
+ --quality 90 2>&1 | tail -1
83
+
84
+ # Step 5: 清理
85
+ echo "🧹 Cleaning up..."
86
+ rm -f "${RAW_FILE}" "${NOBG_FILE}" "${TRIM_FILE}"
87
+
88
+ # 获取文件大小
89
+ FILE_SIZE=$(du -h "${FINAL_FILE}" | awk '{print $1}')
90
+
91
+ echo ""
92
+ echo "✅ Done: ${FINAL_FILE} (${FILE_SIZE})"
93
+ echo ""
94
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
95
+ echo "Integration code:"
96
+ echo ""
97
+ echo " // Add to Preloader.ts imports:"
98
+ echo " import ${OUTPUT_NAME}Image from \"assets/images/${OUTPUT_NAME}.webp\";"
99
+ echo ""
100
+ echo " // Add to preload():"
101
+ echo " this.load.image(\"${OUTPUT_NAME}\", ${OUTPUT_NAME}Image);"
102
+ echo ""
103
+ echo " // Use in scene:"
104
+ echo " const sprite = scene.add.image(x, y, \"${OUTPUT_NAME}\");"
105
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
@@ -0,0 +1,109 @@
1
+ ---
2
+ name: ball_sort.aigameplay
3
+ description: 球排序核心玩法封包 - 水管/试管球排序的 PGS 实现,玩家通过移动彩色球让每个容器中的球颜色一致
4
+ triggers: 球排序,ball sort,水排序,water sort,试管,tube,容器,排序,sorting,puzzle,玩法,gameplay
5
+ ---
6
+
7
+ # ball_sort.aigameplay
8
+
9
+ 球排序(水排序)核心玩法封包。实现标准球排序规则的 PGS JSON 和 reducer,玩家将球从一个容器移到另一个容器,目标是让每个容器中的球颜色完全相同。
10
+
11
+ ## Recipe
12
+
13
+ - **玩法类型**:ball_sort(球排序/水排序)
14
+ - **参考文件**:
15
+ - `ref/pgs-schema.json`:PGS (PlayCraft Gameplay Schema) 规则骨架(entities、rules、algorithm、testCases)
16
+ - `ref/reducer.template.ts`:reducer 接口约束模板(`init` / `dispatch` / `getState` + 分步函数)
17
+ - **核心规则**:
18
+ - `tubeCapacity`: 4(每个容器最多容纳 4 个球)
19
+ - `moveRule`: top_ball_only(只能移动最顶层的球)
20
+ - `validMoveCheck`: same_color_or_empty_target(目标容器顶部颜色相同或容器为空)+ capacity_check(目标未满)
21
+ - `emptyTubeCount`: 2(额外提供 2 个空容器作为缓冲)
22
+ - **PGS Agent 操作流程**:
23
+ 1. 读取 `ref/pgs-schema.json` 作为规则骨架起点
24
+ 2. 读取 `ref/reducer.template.ts` 了解接口约束
25
+ 3. 实现 `reducer.ts`,导出 `init(config)`、`dispatch(state, action)`、`getState(state)` 以及**全部分步函数**
26
+ 4. 运行 `ref/pgs-schema.json` 中的所有 `testCases`,全部通过后才算完成
27
+ 5. 更新 manifest 的 `generation.pgsVersion` 和 `result.outputFile`
28
+ - **可 fork 变体**:
29
+ - 更多颜色:修改 `colorCount` 提升难度
30
+ - 更大容量:修改 `tubeCapacity` 改变玩法深度
31
+ - 限步模式:添加 `maxMoves` 规则限制操作次数
32
+
33
+ ## Result
34
+
35
+ - **产物文件**:`reducer.ts`
36
+ - **格式**:TypeScript,导出 `init(config)`、`dispatch(state, action)`、`getState(state)` + 分步函数接口
37
+ - **验证**:所有 testCases 必须通过
38
+
39
+ ## 渲染集成(⚠️ 场景层必读)
40
+
41
+ ### 设计原则:逻辑与动画分离
42
+
43
+ reducer 提供两套接口:
44
+
45
+ | 接口 | 适用场景 | 特点 |
46
+ |------|---------|------|
47
+ | `dispatch()` | 无头测试、AI 模拟、跳过动画 | 一步到位,只返回最终状态 |
48
+ | 分步函数 | **渲染层/GameScene** | 逐步执行,返回中间过程数据 |
49
+
50
+ ### ⚠️ 禁止在渲染层使用 dispatch() 然后全量重建容器
51
+
52
+ 正确做法是**分步驱动动画链**:
53
+
54
+ ```ts
55
+ // ✅ 正确做法:逐步调用分步函数,每步之间插入动画
56
+ // Step 1: 验证移动是否合法
57
+ const valid = isValidMove(state, fromTube, toTube);
58
+ if (!valid) { playShakeAnimation(fromTube); return; }
59
+
60
+ // Step 2: 执行移动,获取被移动的球信息
61
+ const { ball, newState } = moveBall(state, fromTube, toTube);
62
+ await playBallMoveAnimation(ball, fromTube, toTube); // 只对该球做弧线移动动画
63
+
64
+ // Step 3: 检测胜利
65
+ const win = checkWin(newState);
66
+ if (win) { playWinAnimation(); return; }
67
+
68
+ // Step 4: 检测死锁
69
+ const validMoves = findValidMoves(newState);
70
+ if (validMoves.length === 0) { playDeadlockAnimation(); }
71
+ ```
72
+
73
+ ### 分步函数返回值与动画映射
74
+
75
+ | 分步函数 | 返回值 | 场景层动画 |
76
+ |---------|--------|-----------|
77
+ | `isValidMove()` | `boolean` | false → 播放容器抖动/禁止提示动画 |
78
+ | `moveBall()` | `{ ball, fromTube, toTube, newState }` | 对该球播放弧线移动 Tween 到目标容器顶部 |
79
+ | `checkWin()` | `boolean` | true → 播放通关庆祝动画 |
80
+ | `findValidMoves()` | `Move[]` | 空数组 → 触发死锁提示(Hint 按钮高亮) |
81
+
82
+ ## Binding
83
+
84
+ - **Binding Role**:`gameplayRule`
85
+ - **挂载目标**:`game/gameplay/ball_sort/reducer.ts`
86
+ - **引用类型**:`gameplay-module-reference`
87
+ - **接口契约**:`init(config)` / `dispatch(state, action)` / `getState(state)` / `isValidMove()` / `moveBall()` / `checkWin()` / `findValidMoves()`
88
+
89
+ ## Skill Definition
90
+
91
+ tools:
92
+ - bash
93
+ - write
94
+ - read
95
+ prompt_extension: |
96
+ You are implementing a ball sort (water sort) core gameplay module following the PGS specification.
97
+ Write the PGS JSON with entities, rules, algorithm, and testCases.
98
+ Implement the reducer.ts with:
99
+ - init/dispatch/getState (一体化接口,用于测试)
100
+ - isValidMove/moveBall/checkWin/findValidMoves (分步函数,用于渲染层动画驱动)
101
+ Key constraints:
102
+ - Only the top ball of each tube can be moved
103
+ - A ball can only move to a tube if the top color matches OR the tube is empty
104
+ - A tube can only receive a ball if it has capacity remaining
105
+ - Win condition: every tube contains balls of only one color (or is empty)
106
+ - Lose/deadlock: no valid moves exist
107
+ The step-by-step functions are CRITICAL for smooth ball move animations.
108
+ Run the testCases to verify the logic before finalizing.
109
+ Apply the Binding to wire the reducer into the game's gameplay module path.
@@ -0,0 +1,155 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "atomId": "ball_sort.aigameplay",
4
+ "bundleType": "aigameplay",
5
+ "category": "gameplay",
6
+ "mode": "fixed",
7
+ "label": {
8
+ "zh": "球排序核心玩法",
9
+ "en": "Ball sort core gameplay"
10
+ },
11
+ "tags": [
12
+ "gameplay",
13
+ "ball-sort",
14
+ "puzzle",
15
+ "sorting",
16
+ "tubes",
17
+ "casual",
18
+ "core"
19
+ ],
20
+ "bindingRoles": [
21
+ "gameplayRule"
22
+ ],
23
+ "imports": [
24
+ {
25
+ "slot": "engine",
26
+ "pinAtomId": "phaser.aicomponent",
27
+ "edgeKind": "requires",
28
+ "bindAs": "engine"
29
+ },
30
+ {
31
+ "slot": "bgMusic",
32
+ "description": "背景循环音乐",
33
+ "bindAs": "bgm",
34
+ "required": false,
35
+ "edgeKind": "compatibleWith",
36
+ "matchBindingRoles": [
37
+ "bgMusic"
38
+ ],
39
+ "allowedBundleTypes": [
40
+ "aiaudio"
41
+ ],
42
+ "constraints": {
43
+ "loop": true
44
+ }
45
+ },
46
+ {
47
+ "slot": "background",
48
+ "description": "游戏背景图",
49
+ "bindAs": "bg",
50
+ "required": false,
51
+ "edgeKind": "compatibleWith",
52
+ "matchBindingRoles": [
53
+ "backgroundTexture"
54
+ ],
55
+ "allowedBundleTypes": [
56
+ "aiimage"
57
+ ]
58
+ },
59
+ {
60
+ "slot": "winPanel",
61
+ "description": "通关反馈面板视觉",
62
+ "bindAs": "winPanel",
63
+ "required": false,
64
+ "edgeKind": "compatibleWith",
65
+ "matchBindingRoles": [
66
+ "successFeedbackPanel"
67
+ ],
68
+ "allowedBundleTypes": [
69
+ "aiimage"
70
+ ]
71
+ },
72
+ {
73
+ "slot": "tutorial",
74
+ "description": "新手引导浮层",
75
+ "bindAs": "tutorial",
76
+ "required": false,
77
+ "edgeKind": "compatibleWith",
78
+ "matchBindingRoles": [
79
+ "tutorialOverlay"
80
+ ],
81
+ "allowedBundleTypes": [
82
+ "aicomponent"
83
+ ]
84
+ },
85
+ {
86
+ "slot": "losePanel",
87
+ "description": "失败反馈面板视觉",
88
+ "bindAs": "losePanel",
89
+ "required": false,
90
+ "edgeKind": "compatibleWith",
91
+ "matchBindingRoles": [
92
+ "failFeedbackPanel"
93
+ ],
94
+ "allowedBundleTypes": [
95
+ "aiimage"
96
+ ]
97
+ },
98
+ {
99
+ "slot": "endScreen",
100
+ "description": "可玩广告结算屏(含 CTA 按钮)",
101
+ "bindAs": "endScreen",
102
+ "required": false,
103
+ "edgeKind": "compatibleWith",
104
+ "matchBindingRoles": [
105
+ "playableEndScreenLayout"
106
+ ],
107
+ "allowedBundleTypes": [
108
+ "aicomponent"
109
+ ]
110
+ }
111
+ ],
112
+ "generation": {
113
+ "kind": "pgs",
114
+ "pgsVersion": "1.0",
115
+ "gameplayType": "ball_sort",
116
+ "rules": {
117
+ "tubeCapacity": 4,
118
+ "emptyTubeCount": 2,
119
+ "colorCount": 6,
120
+ "moveRule": "top_ball_only",
121
+ "validMoveCheck": [
122
+ "same_color_or_empty_target",
123
+ "capacity_check"
124
+ ]
125
+ }
126
+ },
127
+ "result": {
128
+ "outputFile": "reducer.ts",
129
+ "format": "typescript",
130
+ "constraints": {
131
+ "testCasesMustPass": true
132
+ }
133
+ },
134
+ "binding": {
135
+ "role": "gameplayRule",
136
+ "target": "game/gameplay/ball_sort/reducer.ts",
137
+ "type": "gameplay-module-reference",
138
+ "constraints": {
139
+ "interface": [
140
+ "init(config)",
141
+ "dispatch(state, action)",
142
+ "getState(state)",
143
+ "isValidMove(state, from, to)",
144
+ "moveBall(state, from, to)",
145
+ "checkWin(state)",
146
+ "findValidMoves(state)"
147
+ ]
148
+ }
149
+ },
150
+ "files": {
151
+ "skill": "SKILL.md",
152
+ "pgsSchema": "ref/pgs-schema.json",
153
+ "reducerTemplate": "ref/reducer.template.ts"
154
+ }
155
+ }