@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.
- package/README.md +333 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/skills.loader.d.ts +31 -0
- package/dist/src/skills.loader.d.ts.map +1 -0
- package/dist/src/skills.loader.js +200 -0
- package/dist/src/skills.loader.js.map +1 -0
- package/dist/src/skills.types.d.ts +44 -0
- package/dist/src/skills.types.d.ts.map +1 -0
- package/dist/src/skills.types.js +9 -0
- package/dist/src/skills.types.js.map +1 -0
- package/package.json +35 -0
- package/skills/2048_core.aigameplay/SKILL.md +123 -0
- package/skills/2048_core.aigameplay/manifest.json +159 -0
- package/skills/2048_core.aigameplay/ref/pgs-schema.json +194 -0
- package/skills/2048_core.aigameplay/ref/reducer.template.ts +189 -0
- package/skills/SKILL.md +46 -0
- package/skills/ad_compliance_rules.aiconfig/SKILL.md +85 -0
- package/skills/ad_compliance_rules.aiconfig/manifest.json +60 -0
- package/skills/agent_remix_orchestrator.aicomponent/SKILL.md +257 -0
- package/skills/agent_remix_orchestrator.aicomponent/manifest.json +12 -0
- package/skills/app_metadata.aiconfig/SKILL.md +53 -0
- package/skills/app_metadata.aiconfig/manifest.json +32 -0
- package/skills/appear_sfx.aiaudio/SKILL.md +59 -0
- package/skills/appear_sfx.aiaudio/manifest.json +45 -0
- package/skills/appear_sfx.aiaudio/ref/appear.mp3 +0 -0
- package/skills/arrow_move_error_sfx.aiaudio/SKILL.md +59 -0
- package/skills/arrow_move_error_sfx.aiaudio/manifest.json +45 -0
- package/skills/arrow_move_error_sfx.aiaudio/ref/arrow_move_error.mp3 +0 -0
- package/skills/arrow_path_data_format.aicomponent/SKILL.md +152 -0
- package/skills/arrow_path_data_format.aicomponent/manifest.json +57 -0
- package/skills/arrow_path_data_format.aicomponent/ref/LevelParser.ts +188 -0
- package/skills/arrow_path_data_format.aicomponent/ref/LevelTypes.ts +131 -0
- package/skills/arrow_pick_match_rules.aigameplay/SKILL.md +117 -0
- package/skills/arrow_pick_match_rules.aigameplay/manifest.json +105 -0
- package/skills/arrow_pick_match_rules.aigameplay/ref/pgs-schema.json +180 -0
- package/skills/asset_pipeline_scripts.aicomponent/SKILL.md +117 -0
- package/skills/asset_pipeline_scripts.aicomponent/manifest.json +17 -0
- package/skills/asset_pipeline_scripts.aicomponent/ref/gen-sprite.sh +105 -0
- package/skills/ball_sort.aigameplay/SKILL.md +109 -0
- package/skills/ball_sort.aigameplay/manifest.json +155 -0
- package/skills/ball_sort.aigameplay/ref/pgs-schema.json +192 -0
- package/skills/ball_sort.aigameplay/ref/reducer.template.ts +156 -0
- package/skills/basketball_shot.aigameplay/SKILL.md +94 -0
- package/skills/basketball_shot.aigameplay/manifest.json +150 -0
- package/skills/basketball_shot.aigameplay/ref/pgs-schema.json +229 -0
- package/skills/basketball_shot.aigameplay/ref/reducer.template.ts +189 -0
- package/skills/bg_music.aiaudio/SKILL.md +61 -0
- package/skills/bg_music.aiaudio/manifest.json +48 -0
- package/skills/bg_music.aiaudio/ref/bg.mp3 +0 -0
- package/skills/big_watermelon.aigameplay/SKILL.md +94 -0
- package/skills/big_watermelon.aigameplay/manifest.json +155 -0
- package/skills/big_watermelon.aigameplay/ref/pgs-schema.json +191 -0
- package/skills/big_watermelon.aigameplay/ref/reducer.template.ts +202 -0
- package/skills/block_puzzle.aigameplay/SKILL.md +121 -0
- package/skills/block_puzzle.aigameplay/manifest.json +154 -0
- package/skills/block_puzzle.aigameplay/ref/pgs-schema.json +170 -0
- package/skills/block_puzzle.aigameplay/ref/reducer.template.ts +182 -0
- package/skills/board_entity_sprite.aiimage/SKILL.md +255 -0
- package/skills/board_entity_sprite.aiimage/manifest.json +153 -0
- package/skills/board_entity_sprite.aiimage/ref/ProceduralCar.ts +357 -0
- package/skills/board_entity_sprite.aiimage/ref/car.png +0 -0
- package/skills/board_entity_sprite.aiimage/ref/car.webp +0 -0
- package/skills/bottom_ui_bar.aicomponent/SKILL.md +50 -0
- package/skills/bottom_ui_bar.aicomponent/manifest.json +31 -0
- package/skills/bottom_ui_bar.aicomponent/ref/GameBottomUI.ts +27 -0
- package/skills/bubble_shooter.aigameplay/SKILL.md +129 -0
- package/skills/bubble_shooter.aigameplay/manifest.json +181 -0
- package/skills/bubble_shooter.aigameplay/ref/pgs-schema.json +226 -0
- package/skills/bubble_shooter.aigameplay/ref/reducer.template.ts +228 -0
- package/skills/button_click_sfx.aiaudio/SKILL.md +59 -0
- package/skills/button_click_sfx.aiaudio/manifest.json +45 -0
- package/skills/button_click_sfx.aiaudio/ref/button_click.mp3 +0 -0
- package/skills/calm_piano.aiaudio/SKILL.md +68 -0
- package/skills/calm_piano.aiaudio/manifest.json +50 -0
- package/skills/camera_controller_3d.aicomponent/SKILL.md +100 -0
- package/skills/camera_controller_3d.aicomponent/manifest.json +52 -0
- package/skills/camera_controller_3d.aicomponent/ref/CameraController.ts +199 -0
- package/skills/camera_controller_3d.aicomponent/ref/OrbitControlsAdapter.ts +152 -0
- package/skills/candy_tile.aiimage/SKILL.md +62 -0
- package/skills/candy_tile.aiimage/manifest.json +49 -0
- package/skills/car_parking.aigameplay/SKILL.md +105 -0
- package/skills/car_parking.aigameplay/manifest.json +164 -0
- package/skills/car_parking.aigameplay/ref/pgs-schema.json +163 -0
- package/skills/car_parking.aigameplay/ref/reducer.template.ts +166 -0
- package/skills/castle.aiimage/SKILL.md +64 -0
- package/skills/castle.aiimage/manifest.json +48 -0
- package/skills/cheerful_ukulele.aiaudio/SKILL.md +72 -0
- package/skills/cheerful_ukulele.aiaudio/manifest.json +50 -0
- package/skills/click_sfx.aiaudio/SKILL.md +59 -0
- package/skills/click_sfx.aiaudio/manifest.json +45 -0
- package/skills/click_sfx.aiaudio/ref/click.mp3 +0 -0
- package/skills/combo_display.aicomponent/SKILL.md +45 -0
- package/skills/combo_display.aicomponent/manifest.json +31 -0
- package/skills/combo_display.aicomponent/ref/ComboManager.ts +362 -0
- package/skills/combo_display.aicomponent/ref/ComboSmallUI.ts +232 -0
- package/skills/combo_praise_text.aicomponent/SKILL.md +56 -0
- package/skills/combo_praise_text.aicomponent/manifest.json +34 -0
- package/skills/combo_praise_text.aicomponent/ref/ComboManager.ts +362 -0
- package/skills/countdown_timer.aicomponent/SKILL.md +44 -0
- package/skills/countdown_timer.aicomponent/manifest.json +35 -0
- package/skills/countdown_timer.aicomponent/ref/CountdownDisplay.ts +213 -0
- package/skills/cta_platform_config.aiconfig/SKILL.md +72 -0
- package/skills/cta_platform_config.aiconfig/manifest.json +56 -0
- package/skills/debug_overlay.aicomponent/SKILL.md +75 -0
- package/skills/debug_overlay.aicomponent/manifest.json +17 -0
- package/skills/debug_overlay.aicomponent/ref/DebugOverlay.ts +144 -0
- package/skills/desert.aiimage/SKILL.md +63 -0
- package/skills/desert.aiimage/manifest.json +49 -0
- package/skills/difficulty_curve_designer.aiconfig/SKILL.md +68 -0
- package/skills/difficulty_curve_designer.aiconfig/manifest.json +36 -0
- package/skills/digit_renderer.aicomponent/SKILL.md +43 -0
- package/skills/digit_renderer.aicomponent/manifest.json +25 -0
- package/skills/digit_renderer.aicomponent/ref/DigitRenderer.ts +237 -0
- package/skills/download_button.aicomponent/SKILL.md +44 -0
- package/skills/download_button.aicomponent/manifest.json +25 -0
- package/skills/download_button.aicomponent/ref/DownloadButton.ts +137 -0
- package/skills/draw_line_puzzle.aigameplay/SKILL.md +84 -0
- package/skills/draw_line_puzzle.aigameplay/manifest.json +152 -0
- package/skills/draw_line_puzzle.aigameplay/ref/pgs-schema.json +189 -0
- package/skills/draw_line_puzzle.aigameplay/ref/reducer.template.ts +194 -0
- package/skills/easy_to_hard.aiconfig/SKILL.md +52 -0
- package/skills/easy_to_hard.aiconfig/manifest.json +33 -0
- package/skills/eight_ball_pool.aigameplay/SKILL.md +104 -0
- package/skills/eight_ball_pool.aigameplay/manifest.json +152 -0
- package/skills/eight_ball_pool.aigameplay/ref/pgs-schema.json +205 -0
- package/skills/eight_ball_pool.aigameplay/ref/reducer.template.ts +198 -0
- package/skills/energetic_electronic.aiaudio/SKILL.md +69 -0
- package/skills/energetic_electronic.aiaudio/manifest.json +51 -0
- package/skills/fail_sfx.aiaudio/SKILL.md +59 -0
- package/skills/fail_sfx.aiaudio/manifest.json +44 -0
- package/skills/fail_sfx.aiaudio/ref/fail.mp3 +0 -0
- package/skills/figer_icon.aiimage/SKILL.md +58 -0
- package/skills/figer_icon.aiimage/manifest.json +48 -0
- package/skills/figer_icon.aiimage/ref/figer.png +0 -0
- package/skills/figer_icon.aiimage/ref/figer.webp +0 -0
- package/skills/forest.aiimage/SKILL.md +74 -0
- package/skills/forest.aiimage/manifest.json +48 -0
- package/skills/fruit_tile.aiimage/SKILL.md +68 -0
- package/skills/fruit_tile.aiimage/manifest.json +48 -0
- package/skills/game_over_panel.aicomponent/SKILL.md +47 -0
- package/skills/game_over_panel.aicomponent/manifest.json +61 -0
- package/skills/game_over_panel.aicomponent/ref/GameOverPanel.ts +74 -0
- package/skills/game_scene.aicomponent/SKILL.md +57 -0
- package/skills/game_scene.aicomponent/manifest.json +36 -0
- package/skills/game_scene.aicomponent/ref/Game.ts +748 -0
- package/skills/gameplay_balance_check.aivalidator/SKILL.md +69 -0
- package/skills/gameplay_balance_check.aivalidator/manifest.json +21 -0
- package/skills/gameplay_unit_test.aivalidator/SKILL.md +89 -0
- package/skills/gameplay_unit_test.aivalidator/manifest.json +17 -0
- package/skills/gameplay_unit_test.aivalidator/ref/gameplay.test.ts +202 -0
- package/skills/gameplay_unit_test.aivalidator/ref/vitest.config.ts +13 -0
- package/skills/grid_board_layout.aicomponent/SKILL.md +85 -0
- package/skills/grid_board_layout.aicomponent/manifest.json +69 -0
- package/skills/grid_board_layout.aicomponent/ref/BoardLayout.ts +416 -0
- package/skills/grid_board_layout.aicomponent/ref/BoardLayout3D.ts +125 -0
- package/skills/grid_board_layout.aicomponent/ref/BoardLayoutMath.ts +85 -0
- package/skills/grid_board_layout.aicomponent/ref/BoardRenderer3D.ts +298 -0
- package/skills/heart_lives.aicomponent/SKILL.md +42 -0
- package/skills/heart_lives.aicomponent/manifest.json +25 -0
- package/skills/heart_lives.aicomponent/ref/HeartDisplay.ts +96 -0
- package/skills/idle-breathe.aicomponent/SKILL.md +27 -0
- package/skills/idle-breathe.aicomponent/manifest.json +20 -0
- package/skills/idle-breathe.aicomponent/ref/phaser.js +25 -0
- package/skills/idle-breathe.aicomponent/ref/playcanvas.js +29 -0
- package/skills/jewel_tile.aiimage/SKILL.md +63 -0
- package/skills/jewel_tile.aiimage/manifest.json +49 -0
- package/skills/knife_hit.aigameplay/SKILL.md +103 -0
- package/skills/knife_hit.aigameplay/manifest.json +151 -0
- package/skills/knife_hit.aigameplay/ref/pgs-schema.json +202 -0
- package/skills/knife_hit.aigameplay/ref/reducer.template.ts +196 -0
- package/skills/left_right_parkour.aigameplay/SKILL.md +120 -0
- package/skills/left_right_parkour.aigameplay/manifest.json +165 -0
- package/skills/left_right_parkour.aigameplay/ref/pgs-schema.json +200 -0
- package/skills/left_right_parkour.aigameplay/ref/reducer.template.ts +194 -0
- package/skills/level_data_pack.aiconfig/SKILL.md +64 -0
- package/skills/level_data_pack.aiconfig/manifest.json +37 -0
- package/skills/level_data_validator.aivalidator/SKILL.md +85 -0
- package/skills/level_data_validator.aivalidator/manifest.json +17 -0
- package/skills/level_data_validator.aivalidator/ref/LevelValidator.ts +113 -0
- package/skills/level_lifecycle.aicomponent/SKILL.md +81 -0
- package/skills/level_lifecycle.aicomponent/manifest.json +87 -0
- package/skills/level_lifecycle.aicomponent/ref/LevelLifecycle.ts +235 -0
- package/skills/level_solvability_validator.aivalidator/SKILL.md +74 -0
- package/skills/level_solvability_validator.aivalidator/manifest.json +23 -0
- package/skills/level_solvability_validator.aivalidator/ref/LevelValidator.ts +186 -0
- package/skills/level_state.aicomponent/SKILL.md +55 -0
- package/skills/level_state.aicomponent/manifest.json +34 -0
- package/skills/level_state.aicomponent/ref/LevelDataManager.ts +26 -0
- package/skills/level_state.aicomponent/ref/LevelManager.ts +26 -0
- package/skills/loading_screen.aicomponent/SKILL.md +57 -0
- package/skills/loading_screen.aicomponent/manifest.json +43 -0
- package/skills/loading_screen.aicomponent/ref/LoadingUI.ts +339 -0
- package/skills/lose_result_panel.aiimage/SKILL.md +58 -0
- package/skills/lose_result_panel.aiimage/manifest.json +47 -0
- package/skills/lose_result_panel.aiimage/ref/lose.png +0 -0
- package/skills/lose_result_panel.aiimage/ref/lose.webp +0 -0
- package/skills/lose_sfx.aiaudio/SKILL.md +59 -0
- package/skills/lose_sfx.aiaudio/manifest.json +45 -0
- package/skills/lose_sfx.aiaudio/ref/lose.mp3 +0 -0
- package/skills/match-pop.aicomponent/SKILL.md +29 -0
- package/skills/match-pop.aicomponent/manifest.json +19 -0
- package/skills/match-pop.aicomponent/ref/phaser.js +30 -0
- package/skills/match-pop.aicomponent/ref/playcanvas.js +22 -0
- package/skills/match3_core.aigameplay/SKILL.md +125 -0
- package/skills/match3_core.aigameplay/manifest.json +107 -0
- package/skills/match3_core.aigameplay/ref/pgs-schema.json +154 -0
- package/skills/match3_core.aigameplay/ref/reducer.template.ts +191 -0
- package/skills/match_engine.aicomponent/SKILL.md +84 -0
- package/skills/match_engine.aicomponent/manifest.json +23 -0
- package/skills/match_engine.aicomponent/ref/MatchEngine.ts +75 -0
- package/skills/memory_match.aigameplay/SKILL.md +111 -0
- package/skills/memory_match.aigameplay/manifest.json +164 -0
- package/skills/memory_match.aigameplay/ref/pgs-schema.json +190 -0
- package/skills/memory_match.aigameplay/ref/reducer.template.ts +162 -0
- package/skills/merge_core.aigameplay/SKILL.md +112 -0
- package/skills/merge_core.aigameplay/manifest.json +154 -0
- package/skills/merge_core.aigameplay/ref/pgs-schema.json +202 -0
- package/skills/merge_core.aigameplay/ref/reducer.template.ts +179 -0
- package/skills/mistake_sfx.aiaudio/SKILL.md +59 -0
- package/skills/mistake_sfx.aiaudio/manifest.json +45 -0
- package/skills/mistake_sfx.aiaudio/ref/mistake.mp3 +0 -0
- package/skills/nomove_hint_overlay.aiimage/SKILL.md +58 -0
- package/skills/nomove_hint_overlay.aiimage/manifest.json +48 -0
- package/skills/nomove_hint_overlay.aiimage/ref/nomove_hint.png +0 -0
- package/skills/nomove_hint_overlay.aiimage/ref/nomove_hint.webp +0 -0
- package/skills/normal_dot.aiimage/SKILL.md +58 -0
- package/skills/normal_dot.aiimage/manifest.json +46 -0
- package/skills/normal_dot.aiimage/ref/normal_dot.png +0 -0
- package/skills/normal_dot.aiimage/ref/normal_dot.webp +0 -0
- package/skills/ocean.aiimage/SKILL.md +71 -0
- package/skills/ocean.aiimage/manifest.json +49 -0
- package/skills/particle-confetti.aicomponent/SKILL.md +32 -0
- package/skills/particle-confetti.aicomponent/manifest.json +21 -0
- package/skills/particle-confetti.aicomponent/ref/html5-spritesheet.js +17 -0
- package/skills/particle-confetti.aicomponent/ref/phaser.js +38 -0
- package/skills/particle-explosion.aicomponent/SKILL.md +37 -0
- package/skills/particle-explosion.aicomponent/manifest.json +24 -0
- package/skills/particle-explosion.aicomponent/ref/html5-spritesheet.js +40 -0
- package/skills/particle-explosion.aicomponent/ref/phaser.js +46 -0
- package/skills/particle-explosion.aicomponent/ref/playcanvas.js +33 -0
- package/skills/particle-trail.aicomponent/SKILL.md +25 -0
- package/skills/particle-trail.aicomponent/manifest.json +22 -0
- package/skills/particle-trail.aicomponent/ref/phaser.js +31 -0
- package/skills/path_animation.aicomponent/SKILL.md +82 -0
- package/skills/path_animation.aicomponent/manifest.json +77 -0
- package/skills/path_animation.aicomponent/ref/AnimationManager.ts +694 -0
- package/skills/path_animation.aicomponent/ref/AnimationManager3D.ts +317 -0
- package/skills/path_elimination_rules.aigameplay/SKILL.md +88 -0
- package/skills/path_elimination_rules.aigameplay/manifest.json +119 -0
- package/skills/path_elimination_rules.aigameplay/ref/pgs-schema.json +227 -0
- package/skills/path_input_handler.aicomponent/SKILL.md +87 -0
- package/skills/path_input_handler.aicomponent/manifest.json +97 -0
- package/skills/path_input_handler.aicomponent/ref/InputHandler.ts +714 -0
- package/skills/path_input_handler.aicomponent/ref/InputHandler3D.ts +204 -0
- package/skills/path_renderer.aicomponent/SKILL.md +101 -0
- package/skills/path_renderer.aicomponent/manifest.json +69 -0
- package/skills/path_renderer.aicomponent/ref/PathRenderer.ts +509 -0
- package/skills/path_renderer.aicomponent/ref/PathRenderer3D.ts +176 -0
- package/skills/path_renderer.aicomponent/ref/PathRenderers.ts +640 -0
- package/skills/phaser.aicomponent/SKILL.md +315 -0
- package/skills/phaser.aicomponent/manifest.json +156 -0
- package/skills/phaser.aicomponent/ref/BootScene.ts +29 -0
- package/skills/phaser.aicomponent/ref/GameConfig.ts +29 -0
- package/skills/phaser.aicomponent/ref/GameScene.ts +88 -0
- package/skills/phaser.aicomponent/ref/PreloaderScene.ts +78 -0
- package/skills/phaser.aicomponent/ref/SceneKeys.ts +7 -0
- package/skills/phaser.aicomponent/ref/SoundUtils.ts +21 -0
- package/skills/phaser.aicomponent/ref/UiLayout.ts +74 -0
- package/skills/phaser.aicomponent/ref/globals.d.ts +52 -0
- package/skills/phaser.aicomponent/ref/index.css +40 -0
- package/skills/phaser.aicomponent/ref/index.html +14 -0
- package/skills/phaser.aicomponent/ref/index.ts +48 -0
- package/skills/phaser.aicomponent/ref/main.ts +16 -0
- package/skills/phaser.aicomponent/ref/package.json +22 -0
- package/skills/phaser.aicomponent/ref/tsconfig.json +25 -0
- package/skills/phaser.aicomponent/ref/webpack.config.js +57 -0
- package/skills/phaser_scene_lifecycle.aicomponent/SKILL.md +63 -0
- package/skills/phaser_scene_lifecycle.aicomponent/manifest.json +33 -0
- package/skills/pick_and_match_rules.aigameplay/SKILL.md +113 -0
- package/skills/pick_and_match_rules.aigameplay/manifest.json +121 -0
- package/skills/pick_and_match_rules.aigameplay/ref/pgs-schema.json +354 -0
- package/skills/pin_pull.aigameplay/SKILL.md +110 -0
- package/skills/pin_pull.aigameplay/manifest.json +164 -0
- package/skills/pin_pull.aigameplay/ref/pgs-schema.json +201 -0
- package/skills/pin_pull.aigameplay/ref/reducer.template.ts +216 -0
- package/skills/playable_app_logo.aiimage/SKILL.md +58 -0
- package/skills/playable_app_logo.aiimage/manifest.json +47 -0
- package/skills/playable_app_logo.aiimage/ref/logo.png +0 -0
- package/skills/playable_app_logo.aiimage/ref/logo.webp +0 -0
- package/skills/playable_end_screen_layout.aicomponent/SKILL.md +75 -0
- package/skills/playable_end_screen_layout.aicomponent/manifest.json +24 -0
- package/skills/playable_guidance_layer.aicomponent/SKILL.md +89 -0
- package/skills/playable_guidance_layer.aicomponent/manifest.json +24 -0
- package/skills/playable_hud_layout.aicomponent/SKILL.md +96 -0
- package/skills/playable_hud_layout.aicomponent/manifest.json +24 -0
- package/skills/playable_scripts_build.aicomponent/SKILL.md +69 -0
- package/skills/playable_scripts_build.aicomponent/manifest.json +53 -0
- package/skills/playable_scripts_build.aicomponent/ref/builds.config.js +257 -0
- package/skills/playcraft-3d-flip-sprite/SKILL.md +336 -0
- package/skills/playcraft-3d-flip-sprite/renderer/flatten_glb.mjs +62 -0
- package/skills/playcraft-3d-flip-sprite/renderer/render.mjs +325 -0
- package/skills/playcraft-3d-flip-sprite/renderer/render_single.mjs +138 -0
- package/skills/playcraft-asset-management/SKILL.md +73 -0
- package/skills/playcraft-audio-generation/SKILL.md +126 -0
- package/skills/playcraft-build/SKILL.md +44 -0
- package/skills/playcraft-code-editor/SKILL.md +71 -0
- package/skills/playcraft-create-remix/SKILL.md +62 -0
- package/skills/playcraft-deploy/SKILL.md +59 -0
- package/skills/playcraft-image-generation/SKILL.md +148 -0
- package/skills/playcraft-image-processing/SKILL.md +216 -0
- package/skills/playcraft-platform-intro/SKILL.md +41 -0
- package/skills/playcraft-prefab/SKILL.md +98 -0
- package/skills/playcraft-project-management/SKILL.md +57 -0
- package/skills/playcraft-remix-workflow/SKILL.md +119 -0
- package/skills/playcraft-remix-workflow/references/xplatform.schema.json5 +31 -0
- package/skills/playcraft-save/SKILL.md +46 -0
- package/skills/playcraft-skill-recommender/SKILL.md +152 -0
- package/skills/playcraft-sprite-generation/SKILL.md +534 -0
- package/skills/playcraft-sprite-remix/SKILL.md +155 -0
- package/skills/playcraft-sprite-sheet/SKILL.md +97 -0
- package/skills/playtest_report.aivalidator/SKILL.md +103 -0
- package/skills/playtest_report.aivalidator/manifest.json +21 -0
- package/skills/preloader_scene.aicomponent/SKILL.md +58 -0
- package/skills/preloader_scene.aicomponent/manifest.json +43 -0
- package/skills/preloader_scene.aicomponent/ref/Preloader.ts +339 -0
- package/skills/progress_bar.aicomponent/SKILL.md +38 -0
- package/skills/progress_bar.aicomponent/manifest.json +25 -0
- package/skills/progress_bar.aicomponent/ref/ProgressDisplay.ts +140 -0
- package/skills/references/xplatform.schema.json5 +31 -0
- package/skills/responsive_2d_layout.aicomponent/SKILL.md +161 -0
- package/skills/responsive_2d_layout.aicomponent/manifest.json +43 -0
- package/skills/responsive_2d_layout.aicomponent/ref/UiLayout.ts +56 -0
- package/skills/run_context_state.aicomponent/SKILL.md +54 -0
- package/skills/run_context_state.aicomponent/manifest.json +40 -0
- package/skills/run_context_state.aicomponent/ref/RunContextRuntime.ts +30 -0
- package/skills/score-fly.aicomponent/SKILL.md +31 -0
- package/skills/score-fly.aicomponent/manifest.json +21 -0
- package/skills/score-fly.aicomponent/ref/phaser.js +26 -0
- package/skills/score-fly.aicomponent/ref/playcanvas.js +28 -0
- package/skills/score_goal.aiconfig/SKILL.md +46 -0
- package/skills/score_goal.aiconfig/manifest.json +33 -0
- package/skills/screen-flash.aicomponent/SKILL.md +30 -0
- package/skills/screen-flash.aicomponent/manifest.json +20 -0
- package/skills/screen-flash.aicomponent/ref/phaser.js +48 -0
- package/skills/screen-shake.aicomponent/SKILL.md +30 -0
- package/skills/screen-shake.aicomponent/manifest.json +19 -0
- package/skills/screen-shake.aicomponent/ref/phaser.js +23 -0
- package/skills/screen-shake.aicomponent/ref/playcanvas.js +44 -0
- package/skills/screw_puzzle.aigameplay/SKILL.md +116 -0
- package/skills/screw_puzzle.aigameplay/manifest.json +164 -0
- package/skills/screw_puzzle.aigameplay/ref/pgs-schema.json +235 -0
- package/skills/screw_puzzle.aigameplay/ref/reducer.template.ts +213 -0
- package/skills/settings_state.aicomponent/SKILL.md +61 -0
- package/skills/settings_state.aicomponent/manifest.json +33 -0
- package/skills/settings_state.aicomponent/ref/SettingsManager.ts +130 -0
- package/skills/slide_out_to_tray_animation.aicomponent/SKILL.md +64 -0
- package/skills/slide_out_to_tray_animation.aicomponent/manifest.json +58 -0
- package/skills/slide_out_to_tray_animation.aicomponent/ref/AnimationManager.ts +164 -0
- package/skills/slide_out_to_tray_animation.aicomponent/ref/AnimationManager3D.ts +198 -0
- package/skills/slide_out_to_tray_animation.aicomponent/ref/BezierUtils.ts +59 -0
- package/skills/slot_machine.aigameplay/SKILL.md +119 -0
- package/skills/slot_machine.aigameplay/manifest.json +166 -0
- package/skills/slot_machine.aigameplay/ref/pgs-schema.json +212 -0
- package/skills/slot_machine.aigameplay/ref/reducer.template.ts +212 -0
- package/skills/sniper_shot.aigameplay/SKILL.md +84 -0
- package/skills/sniper_shot.aigameplay/manifest.json +153 -0
- package/skills/sniper_shot.aigameplay/ref/pgs-schema.json +211 -0
- package/skills/sniper_shot.aigameplay/ref/reducer.template.ts +211 -0
- package/skills/solitaire.aigameplay/SKILL.md +101 -0
- package/skills/solitaire.aigameplay/manifest.json +151 -0
- package/skills/solitaire.aigameplay/ref/pgs-schema.json +200 -0
- package/skills/solitaire.aigameplay/ref/reducer.template.ts +176 -0
- package/skills/sound-effects/SKILL.md +46 -0
- package/skills/sound_utils.aicomponent/SKILL.md +52 -0
- package/skills/sound_utils.aicomponent/manifest.json +30 -0
- package/skills/sound_utils.aicomponent/ref/SoundUtils.ts +29 -0
- package/skills/sprite-animation-2d.aicomponent/SKILL.md +45 -0
- package/skills/sprite-animation-2d.aicomponent/manifest.json +28 -0
- package/skills/sprite-animation-2d.aicomponent/ref/html5.js +83 -0
- package/skills/sprite-animation-2d.aicomponent/ref/phaser.js +38 -0
- package/skills/sprite-animation-2d.aicomponent/ref/playcanvas.js +67 -0
- package/skills/sprite_entity_renderer.aicomponent/SKILL.md +148 -0
- package/skills/sprite_entity_renderer.aicomponent/manifest.json +17 -0
- package/skills/sprite_entity_renderer.aicomponent/ref/SpriteEntityRenderer.ts +126 -0
- package/skills/success_sfx.aiaudio/SKILL.md +59 -0
- package/skills/success_sfx.aiaudio/manifest.json +45 -0
- package/skills/success_sfx.aiaudio/ref/success.mp3 +0 -0
- package/skills/tap_blast.aigameplay/SKILL.md +116 -0
- package/skills/tap_blast.aigameplay/manifest.json +153 -0
- package/skills/tap_blast.aigameplay/ref/pgs-schema.json +208 -0
- package/skills/tap_blast.aigameplay/ref/reducer.template.ts +202 -0
- package/skills/theme_state.aicomponent/SKILL.md +53 -0
- package/skills/theme_state.aicomponent/manifest.json +33 -0
- package/skills/theme_state.aicomponent/ref/ThemeManager.ts +174 -0
- package/skills/theme_switcher_build.aicomponent/SKILL.md +62 -0
- package/skills/theme_switcher_build.aicomponent/manifest.json +38 -0
- package/skills/theme_switcher_build.aicomponent/ref/theme-index.ts +8 -0
- package/skills/theme_variant.aiconfig/SKILL.md +78 -0
- package/skills/theme_variant.aiconfig/manifest.json +39 -0
- package/skills/theme_variant.aiconfig/ref/ExampleTheme/index.ts +16 -0
- package/skills/theme_variant.aiconfig/ref/ExampleTheme/levelEasy.json +141 -0
- package/skills/threejs.aicomponent/SKILL.md +422 -0
- package/skills/threejs.aicomponent/manifest.json +166 -0
- package/skills/threejs.aicomponent/ref/AssetLoader.ts +158 -0
- package/skills/threejs.aicomponent/ref/BaseScene.ts +88 -0
- package/skills/threejs.aicomponent/ref/GameConfig.ts +47 -0
- package/skills/threejs.aicomponent/ref/MainScene.ts +170 -0
- package/skills/threejs.aicomponent/ref/PreloaderScene.ts +93 -0
- package/skills/threejs.aicomponent/ref/SceneKeys.ts +6 -0
- package/skills/threejs.aicomponent/ref/SceneManager.ts +69 -0
- package/skills/threejs.aicomponent/ref/ViewportManager.ts +62 -0
- package/skills/threejs.aicomponent/ref/globals.d.ts +74 -0
- package/skills/threejs.aicomponent/ref/index.css +80 -0
- package/skills/threejs.aicomponent/ref/index.html +20 -0
- package/skills/threejs.aicomponent/ref/index.ts +117 -0
- package/skills/threejs.aicomponent/ref/main.ts +10 -0
- package/skills/threejs.aicomponent/ref/package.json +23 -0
- package/skills/threejs.aicomponent/ref/tsconfig.json +24 -0
- package/skills/threejs.aicomponent/ref/webpack.config.js +61 -0
- package/skills/time_clear_goal.aiconfig/SKILL.md +46 -0
- package/skills/time_clear_goal.aiconfig/manifest.json +32 -0
- package/skills/time_icon.aiimage/SKILL.md +58 -0
- package/skills/time_icon.aiimage/manifest.json +47 -0
- package/skills/time_icon.aiimage/ref/time.png +0 -0
- package/skills/time_icon.aiimage/ref/time.webp +0 -0
- package/skills/top_ui_bar.aicomponent/SKILL.md +45 -0
- package/skills/top_ui_bar.aicomponent/manifest.json +27 -0
- package/skills/top_ui_bar.aicomponent/ref/GameTopUI.ts +229 -0
- package/skills/tower_defence.aigameplay/SKILL.md +117 -0
- package/skills/tower_defence.aigameplay/manifest.json +175 -0
- package/skills/tower_defence.aigameplay/ref/pgs-schema.json +247 -0
- package/skills/tower_defence.aigameplay/ref/reducer.template.ts +239 -0
- package/skills/tray_container.aicomponent/SKILL.md +143 -0
- package/skills/tray_container.aicomponent/manifest.json +58 -0
- package/skills/tray_container.aicomponent/ref/TrayRenderer.ts +155 -0
- package/skills/tray_container.aicomponent/ref/TrayRenderer3D.ts +281 -0
- package/skills/tray_container.aicomponent/ref/TrayRendererHtmlOverlay.ts +228 -0
- package/skills/tutorial_overlay.aicomponent/SKILL.md +46 -0
- package/skills/tutorial_overlay.aicomponent/manifest.json +34 -0
- package/skills/tutorial_overlay.aicomponent/ref/TutorialManager.ts +367 -0
- package/skills/tween-animation-2d.aicomponent/SKILL.md +35 -0
- package/skills/tween-animation-2d.aicomponent/manifest.json +28 -0
- package/skills/tween-animation-2d.aicomponent/ref/phaser.js +49 -0
- package/skills/tween-animation-2d.aicomponent/ref/playcanvas.js +36 -0
- package/skills/typescript_module_patterns.aicomponent/SKILL.md +209 -0
- package/skills/typescript_module_patterns.aicomponent/manifest.json +28 -0
- package/skills/typescript_module_patterns.aicomponent/ref/globals.d.ts +31 -0
- package/skills/ui-transition.aicomponent/SKILL.md +33 -0
- package/skills/ui-transition.aicomponent/manifest.json +19 -0
- package/skills/ui-transition.aicomponent/ref/phaser.js +45 -0
- package/skills/ux_flow_spec.aiconfig/SKILL.md +82 -0
- package/skills/ux_flow_spec.aiconfig/manifest.json +39 -0
- package/skills/wave_difficulty.aiconfig/SKILL.md +46 -0
- package/skills/wave_difficulty.aiconfig/manifest.json +33 -0
- package/skills/webpack_build.aicomponent/SKILL.md +204 -0
- package/skills/webpack_build.aicomponent/manifest.json +29 -0
- package/skills/webpack_build.aicomponent/ref/package.json +16 -0
- package/skills/webpack_build.aicomponent/ref/webpack.config.js +53 -0
- package/skills/win_anim_sfx.aiaudio/SKILL.md +59 -0
- package/skills/win_anim_sfx.aiaudio/manifest.json +46 -0
- package/skills/win_anim_sfx.aiaudio/ref/win_anim.mp3 +0 -0
- package/skills/win_dot.aiimage/SKILL.md +58 -0
- package/skills/win_dot.aiimage/manifest.json +47 -0
- package/skills/win_dot.aiimage/ref/win_dot.png +0 -0
- package/skills/win_dot.aiimage/ref/win_dot.webp +0 -0
- package/skills/win_result_panel.aiimage/SKILL.md +58 -0
- package/skills/win_result_panel.aiimage/manifest.json +47 -0
- package/skills/win_result_panel.aiimage/ref/win.png +0 -0
- package/skills/win_result_panel.aiimage/ref/win.webp +0 -0
- package/skills/word_connect.aigameplay/SKILL.md +86 -0
- package/skills/word_connect.aigameplay/manifest.json +154 -0
- package/skills/word_connect.aigameplay/ref/pgs-schema.json +212 -0
- package/skills/word_connect.aigameplay/ref/reducer.template.ts +186 -0
- package/src/index.ts +10 -0
- package/src/skills.loader.ts +225 -0
- package/src/skills.types.ts +42 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills.types.js","sourceRoot":"","sources":["../../src/skills.types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@playcraft/skills",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "Atom-Skill assets and platform skill loaders for PlayCraft Agent.",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"main": "./dist/src/index.js",
|
|
11
|
+
"types": "./dist/src/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/src/index.d.ts",
|
|
15
|
+
"default": "./dist/src/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"skills",
|
|
20
|
+
"src",
|
|
21
|
+
"dist",
|
|
22
|
+
"README.md"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsc -p tsconfig.json",
|
|
26
|
+
"test": "vitest run",
|
|
27
|
+
"lint": "echo 'No TS sources to lint in @playcraft/skills'",
|
|
28
|
+
"release": "node scripts/release.js"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/node": "^22.0.0",
|
|
32
|
+
"typescript": "^5.9.3",
|
|
33
|
+
"vitest": "^3.2.4"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 2048_core.aigameplay
|
|
3
|
+
description: 2048 滑动合并玩法封包 - 标准 4×4 网格滑动合并数字方块直到合成 2048 的 PGS 实现
|
|
4
|
+
triggers: 2048,滑动,合并,数字,slide,merge,grid,number,方块,tile,puzzle
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 2048_core.aigameplay
|
|
8
|
+
|
|
9
|
+
2048 滑动合并核心玩法封包。实现标准 2048 规则的 PGS (PlayCraft Gameplay Schema, 玩法定义规范) JSON 和 reducer,玩家向四个方向滑动棋盘,相邻同值方块合并一次,每次有效滑动后随机生成新方块,目标是合成出值为 2048 的方块。
|
|
10
|
+
|
|
11
|
+
## Recipe
|
|
12
|
+
|
|
13
|
+
- **玩法类型**:2048(滑动合并)
|
|
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
|
+
- `gridSize`: 4(4×4 网格)
|
|
19
|
+
- `winValue`: 2048(达到此值即胜利)
|
|
20
|
+
- `spawnValues`: [2, 4](随机生成 2 或 4)
|
|
21
|
+
- `spawnWeights`: [0.9, 0.1](90% 概率生成 2,10% 概率生成 4)
|
|
22
|
+
- `mergeOncePerSlide`: true(每次滑动每组同值方块只合并一次)
|
|
23
|
+
- **PGS Agent 操作流程**:
|
|
24
|
+
1. 读取 `ref/pgs-schema.json` 作为规则骨架起点
|
|
25
|
+
2. 读取 `ref/reducer.template.ts` 了解接口约束
|
|
26
|
+
3. 实现 `reducer.ts`,导出 `init(config)`、`dispatch(state, action)`、`getState(state)` 以及**全部分步函数**
|
|
27
|
+
4. 运行 `ref/pgs-schema.json` 中的所有 `testCases`,全部通过后才算完成
|
|
28
|
+
5. 更新 manifest 的 `generation.pgsVersion` 和 `result.outputFile`
|
|
29
|
+
- **可 fork 变体**:
|
|
30
|
+
- 大棋盘:修改 `gridSize` 为 5 或 6
|
|
31
|
+
- 目标变体:修改 `winValue`(如 4096、8192)
|
|
32
|
+
- 障碍格:添加固定障碍方块,滑动时不可通过
|
|
33
|
+
|
|
34
|
+
## Result
|
|
35
|
+
|
|
36
|
+
- **产物文件**:`reducer.ts`
|
|
37
|
+
- **格式**:TypeScript,导出 `init(config)`、`dispatch(action)`、`getState()` + 分步函数接口
|
|
38
|
+
- **验证**:所有 testCases 必须通过
|
|
39
|
+
|
|
40
|
+
## 渲染集成(⚠️ 场景层必读)
|
|
41
|
+
|
|
42
|
+
### 设计原则:逻辑与动画分离
|
|
43
|
+
|
|
44
|
+
reducer 提供两套接口:
|
|
45
|
+
|
|
46
|
+
| 接口 | 适用场景 | 特点 |
|
|
47
|
+
|------|---------|------|
|
|
48
|
+
| `dispatch()` | 无头测试、AI 模拟、跳过动画 | 一步到位,只返回最终状态 |
|
|
49
|
+
| 分步函数 | **渲染层/GameScene** | 逐步执行,返回中间过程数据 |
|
|
50
|
+
|
|
51
|
+
### ⚠️ 禁止在渲染层使用 dispatch() 然后全量重建棋盘
|
|
52
|
+
|
|
53
|
+
正确做法是**分步驱动动画链**:
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
// ✅ 正确做法:逐步调用分步函数,每步之间插入动画
|
|
57
|
+
|
|
58
|
+
// Step 1: 执行滑动并获取移动/合并信息
|
|
59
|
+
const { moves, merges, boardAfterSlide } = slideBoard(board, direction);
|
|
60
|
+
if (moves.length === 0 && merges.length === 0) {
|
|
61
|
+
// 无效滑动,不生成新方块
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Step 2: 播放方块移动动画(并行 Tween)
|
|
66
|
+
await playTileMoveAnimation(moves);
|
|
67
|
+
|
|
68
|
+
// Step 3: 播放合并动画(缩放弹跳效果)
|
|
69
|
+
await playTileMergeAnimation(merges);
|
|
70
|
+
|
|
71
|
+
// Step 4: 生成新方块
|
|
72
|
+
const newTile = spawnTile(boardAfterSlide);
|
|
73
|
+
await playTileSpawnAnimation(newTile); // 新方块从小到大的出现动画
|
|
74
|
+
|
|
75
|
+
// Step 5: 检查胜败
|
|
76
|
+
if (!hasValidMoves(boardAfterSlide)) showGameOverPanel();
|
|
77
|
+
const score = calculateScore(merges);
|
|
78
|
+
updateScoreUI(score);
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### 分步函数返回值与动画映射
|
|
82
|
+
|
|
83
|
+
| 分步函数 | 返回值 | 场景层动画 |
|
|
84
|
+
|---------|--------|-----------|
|
|
85
|
+
| `slideBoard()` | `{ moves, merges, board }` | 方块平移 Tween |
|
|
86
|
+
| `mergeTiles()` | `MergeResult[]` | 合并方块缩放弹跳 + 数字变更 |
|
|
87
|
+
| `spawnTile()` | `SpawnedTile` | 新方块 scale 0→1 弹出动画 |
|
|
88
|
+
| `hasValidMoves()` | `boolean` | false 时显示游戏结束面板 |
|
|
89
|
+
| `calculateScore()` | `number` | 更新 score UI + 飘分动画 |
|
|
90
|
+
|
|
91
|
+
### 合并规则关键约束
|
|
92
|
+
|
|
93
|
+
- 同一次滑动中,合并生成的新方块**不能**再次参与合并
|
|
94
|
+
- 用 `merged` 标志位跟踪每个格子在本次滑动中是否已合并
|
|
95
|
+
- 滑动方向决定合并优先级:向左滑动时最左侧的合并优先
|
|
96
|
+
|
|
97
|
+
## Binding
|
|
98
|
+
|
|
99
|
+
- **Binding Role**:`gameplayRule`
|
|
100
|
+
- **挂载目标**:`game/gameplay/2048/reducer.ts`
|
|
101
|
+
- **引用类型**:`gameplay-module-reference`
|
|
102
|
+
- **接口契约**:`init(config)` / `dispatch(action)` / `getState()` / `slideBoard()` / `mergeTiles()` / `spawnTile()` / `hasValidMoves()` / `calculateScore()`
|
|
103
|
+
|
|
104
|
+
## Skill Definition
|
|
105
|
+
|
|
106
|
+
tools:
|
|
107
|
+
- bash
|
|
108
|
+
- write
|
|
109
|
+
- read
|
|
110
|
+
prompt_extension: |
|
|
111
|
+
You are implementing a 2048 slide-and-merge gameplay module following the PGS specification.
|
|
112
|
+
Write the PGS JSON with entities (board 4×4 grid, tiles with 2^n values, score, best_score), rules, algorithm, and testCases.
|
|
113
|
+
Implement the reducer.ts with:
|
|
114
|
+
- init/dispatch/getState (一体化接口,用于测试)
|
|
115
|
+
- slideBoard/mergeTiles/spawnTile/hasValidMoves/calculateScore (分步函数,用于渲染层动画驱动)
|
|
116
|
+
Key constraints:
|
|
117
|
+
- Each tile can only merge once per slide (track merged flag per tile)
|
|
118
|
+
- Spawn 2 (90%) or 4 (10%) in a random empty cell after each valid slide
|
|
119
|
+
- Win: any tile reaches winValue (default 2048)
|
|
120
|
+
- Lose: board is full AND no adjacent same-value tiles exist
|
|
121
|
+
The step-by-step functions are CRITICAL — the rendering layer (GameScene) must use them to drive animations.
|
|
122
|
+
Run the testCases to verify the logic before finalizing.
|
|
123
|
+
Apply the Binding to wire the reducer into the game's gameplay module path.
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"atomId": "2048_core.aigameplay",
|
|
4
|
+
"bundleType": "aigameplay",
|
|
5
|
+
"category": "gameplay",
|
|
6
|
+
"mode": "fixed",
|
|
7
|
+
"label": {
|
|
8
|
+
"zh": "2048 滑动合并",
|
|
9
|
+
"en": "2048 Slide & Merge gameplay"
|
|
10
|
+
},
|
|
11
|
+
"tags": [
|
|
12
|
+
"gameplay",
|
|
13
|
+
"2048",
|
|
14
|
+
"slide",
|
|
15
|
+
"merge",
|
|
16
|
+
"casual",
|
|
17
|
+
"grid",
|
|
18
|
+
"number"
|
|
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": "tutorial",
|
|
61
|
+
"description": "新手引导浮层",
|
|
62
|
+
"bindAs": "tutorial",
|
|
63
|
+
"required": false,
|
|
64
|
+
"edgeKind": "compatibleWith",
|
|
65
|
+
"matchBindingRoles": [
|
|
66
|
+
"tutorialOverlay"
|
|
67
|
+
],
|
|
68
|
+
"allowedBundleTypes": [
|
|
69
|
+
"aicomponent"
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"slot": "winPanel",
|
|
74
|
+
"description": "通关反馈面板视觉",
|
|
75
|
+
"bindAs": "winPanel",
|
|
76
|
+
"required": false,
|
|
77
|
+
"edgeKind": "compatibleWith",
|
|
78
|
+
"matchBindingRoles": [
|
|
79
|
+
"successFeedbackPanel"
|
|
80
|
+
],
|
|
81
|
+
"allowedBundleTypes": [
|
|
82
|
+
"aiimage"
|
|
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": "2048",
|
|
116
|
+
"rules": {
|
|
117
|
+
"gridSize": 4,
|
|
118
|
+
"winValue": 2048,
|
|
119
|
+
"spawnValues": [
|
|
120
|
+
2,
|
|
121
|
+
4
|
|
122
|
+
],
|
|
123
|
+
"spawnWeights": [
|
|
124
|
+
0.9,
|
|
125
|
+
0.1
|
|
126
|
+
],
|
|
127
|
+
"mergeOncePerSlide": true
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"result": {
|
|
131
|
+
"outputFile": "reducer.ts",
|
|
132
|
+
"format": "typescript",
|
|
133
|
+
"constraints": {
|
|
134
|
+
"testCasesMustPass": true
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"binding": {
|
|
138
|
+
"role": "gameplayRule",
|
|
139
|
+
"target": "game/gameplay/2048/reducer.ts",
|
|
140
|
+
"type": "gameplay-module-reference",
|
|
141
|
+
"constraints": {
|
|
142
|
+
"interface": [
|
|
143
|
+
"init(config)",
|
|
144
|
+
"dispatch(action)",
|
|
145
|
+
"getState()",
|
|
146
|
+
"slideBoard(board, direction)",
|
|
147
|
+
"mergeTiles(board, direction)",
|
|
148
|
+
"spawnTile(board)",
|
|
149
|
+
"hasValidMoves(board)",
|
|
150
|
+
"calculateScore(merges)"
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"files": {
|
|
155
|
+
"skill": "SKILL.md",
|
|
156
|
+
"pgsSchema": "ref/pgs-schema.json",
|
|
157
|
+
"reducerTemplate": "ref/reducer.template.ts"
|
|
158
|
+
}
|
|
159
|
+
}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "PGS (PlayCraft Gameplay Schema) 参考骨架 - 2048 滑动合并玩法。Agent 以此为起点编写或 fork 玩法规则。",
|
|
3
|
+
"version": "1.0",
|
|
4
|
+
"gameplayType": "2048",
|
|
5
|
+
"entities": {
|
|
6
|
+
"board": {
|
|
7
|
+
"type": "grid",
|
|
8
|
+
"cols": 4,
|
|
9
|
+
"rows": 4,
|
|
10
|
+
"description": "游戏棋盘,4×4 方格,board[row][col],null 表示空格"
|
|
11
|
+
},
|
|
12
|
+
"tile": {
|
|
13
|
+
"type": "cell-item",
|
|
14
|
+
"fields": {
|
|
15
|
+
"value": "number (2 的幂次,如 2/4/8/.../2048/4096)",
|
|
16
|
+
"merged": "boolean (本次滑动中是否已合并,防止二次合并)"
|
|
17
|
+
},
|
|
18
|
+
"description": "数字方块,值为 2 的幂次;同值相邻方块可合并为两倍值"
|
|
19
|
+
},
|
|
20
|
+
"score": {
|
|
21
|
+
"type": "counter",
|
|
22
|
+
"initial": 0,
|
|
23
|
+
"description": "当前得分,每次合并得分 = 合并后方块值"
|
|
24
|
+
},
|
|
25
|
+
"best_score": {
|
|
26
|
+
"type": "counter",
|
|
27
|
+
"initial": 0,
|
|
28
|
+
"description": "历史最高分,本地持久化"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"rules": {
|
|
32
|
+
"slide_direction": {
|
|
33
|
+
"description": "玩家向上/下/左/右滑动,所有方块沿该方向移动到最远空格",
|
|
34
|
+
"directions": ["up", "down", "left", "right"],
|
|
35
|
+
"effectiveIfAnyTileMoves": true,
|
|
36
|
+
"noMoveIfBoardUnchanged": true
|
|
37
|
+
},
|
|
38
|
+
"merge_same_value": {
|
|
39
|
+
"description": "滑动过程中,沿移动方向相邻且同值的方块合并为两倍值;每个方块本次滑动最多参与一次合并",
|
|
40
|
+
"mergeOncePerSlide": true,
|
|
41
|
+
"newValueAfterMerge": "tile.value * 2",
|
|
42
|
+
"scoreGain": "newValue"
|
|
43
|
+
},
|
|
44
|
+
"spawn_new_tile": {
|
|
45
|
+
"description": "每次有效滑动后(棋盘有任何变化),在随机空格生成新方块",
|
|
46
|
+
"values": [2, 4],
|
|
47
|
+
"weights": [0.9, 0.1],
|
|
48
|
+
"trigger": "after_effective_slide"
|
|
49
|
+
},
|
|
50
|
+
"game_over_check": {
|
|
51
|
+
"description": "棋盘满且无相邻同值方块(无有效移动)时游戏结束",
|
|
52
|
+
"trigger": "after_spawn",
|
|
53
|
+
"boardFull": "no empty cells",
|
|
54
|
+
"noValidMoves": "no adjacent same-value pairs in any direction"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"algorithm": {
|
|
58
|
+
"description": "主循环:swipe → slide_and_merge → spawn → win/lose 检测",
|
|
59
|
+
"steps": [
|
|
60
|
+
"1. 玩家输入滑动方向(up/down/left/right)",
|
|
61
|
+
"2. 按滑动方向对每行/列执行滑动和合并:",
|
|
62
|
+
" a. 提取行/列中非空方块(按移动方向排列)",
|
|
63
|
+
" b. 相邻同值且均未合并过的方块合并(merged = true),生成新值",
|
|
64
|
+
" c. 将结果写回行/列,其余位置填 null",
|
|
65
|
+
"3. 检查棋盘是否发生变化(与滑动前对比)",
|
|
66
|
+
"4. 若无变化 → 忽略此次操作,不生成新方块",
|
|
67
|
+
"5. 若有变化 → 在随机空格生成新方块(2: 90%,4: 10%)",
|
|
68
|
+
"6. 检查胜利:任意方块 value >= winValue(2048)",
|
|
69
|
+
"7. 检查失败:棋盘满 AND 无相邻同值方块(无合法滑动)"
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
"winCondition": {
|
|
73
|
+
"type": "tile_value_reached",
|
|
74
|
+
"value": 2048,
|
|
75
|
+
"description": "棋盘上出现值 >= 2048 的方块时胜利(可设置为继续游戏模式)"
|
|
76
|
+
},
|
|
77
|
+
"loseCondition": {
|
|
78
|
+
"type": "no_valid_moves",
|
|
79
|
+
"description": "棋盘已满(无空格)且四个方向均无相邻同值方块(无有效滑动)"
|
|
80
|
+
},
|
|
81
|
+
"testCases": [
|
|
82
|
+
{
|
|
83
|
+
"id": "tc_basic_slide_merge",
|
|
84
|
+
"description": "基础滑动合并:左滑,两个相邻同值方块合并",
|
|
85
|
+
"initialState": {
|
|
86
|
+
"board": [
|
|
87
|
+
[null, null, 2, 2 ],
|
|
88
|
+
[null, null, null, null],
|
|
89
|
+
[null, null, null, null],
|
|
90
|
+
[null, null, null, null]
|
|
91
|
+
],
|
|
92
|
+
"score": 0
|
|
93
|
+
},
|
|
94
|
+
"actions": [
|
|
95
|
+
{ "type": "slide", "direction": "left" }
|
|
96
|
+
],
|
|
97
|
+
"expectedState": {
|
|
98
|
+
"board": [
|
|
99
|
+
[4, null, null, null],
|
|
100
|
+
[null, null, null, null],
|
|
101
|
+
[null, null, null, null],
|
|
102
|
+
[null, null, null, null]
|
|
103
|
+
],
|
|
104
|
+
"scoreGained": 4,
|
|
105
|
+
"newTileSpawned": true
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"id": "tc_slide_no_merge",
|
|
110
|
+
"description": "滑动但无合并:左滑后方块移位但不合并(不同值),且生成新方块",
|
|
111
|
+
"initialState": {
|
|
112
|
+
"board": [
|
|
113
|
+
[null, 2, 4, null],
|
|
114
|
+
[null, null, null, null],
|
|
115
|
+
[null, null, null, null],
|
|
116
|
+
[null, null, null, null]
|
|
117
|
+
],
|
|
118
|
+
"score": 0
|
|
119
|
+
},
|
|
120
|
+
"actions": [
|
|
121
|
+
{ "type": "slide", "direction": "left" }
|
|
122
|
+
],
|
|
123
|
+
"expectedState": {
|
|
124
|
+
"board_row0": [2, 4, null, null],
|
|
125
|
+
"scoreGained": 0,
|
|
126
|
+
"newTileSpawned": true
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"id": "tc_merge_once_per_slide",
|
|
131
|
+
"description": "一次滑动中每组只合并一次:左滑 [2,2,2,2] → [4,4,null,null],不能合并成 [8]",
|
|
132
|
+
"initialState": {
|
|
133
|
+
"board": [
|
|
134
|
+
[2, 2, 2, 2],
|
|
135
|
+
[null, null, null, null],
|
|
136
|
+
[null, null, null, null],
|
|
137
|
+
[null, null, null, null]
|
|
138
|
+
],
|
|
139
|
+
"score": 0
|
|
140
|
+
},
|
|
141
|
+
"actions": [
|
|
142
|
+
{ "type": "slide", "direction": "left" }
|
|
143
|
+
],
|
|
144
|
+
"expectedState": {
|
|
145
|
+
"board_row0": [4, 4, null, null],
|
|
146
|
+
"scoreGained": 8,
|
|
147
|
+
"newTileSpawned": true
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"id": "tc_game_over_detection",
|
|
152
|
+
"description": "失败检测:棋盘已满且无相邻同值方块,任何方向滑动均无效",
|
|
153
|
+
"initialState": {
|
|
154
|
+
"board": [
|
|
155
|
+
[2, 4, 2, 4 ],
|
|
156
|
+
[4, 2, 4, 2 ],
|
|
157
|
+
[2, 4, 2, 4 ],
|
|
158
|
+
[4, 2, 4, 2 ]
|
|
159
|
+
],
|
|
160
|
+
"score": 0
|
|
161
|
+
},
|
|
162
|
+
"actions": [
|
|
163
|
+
{ "type": "slide", "direction": "left" }
|
|
164
|
+
],
|
|
165
|
+
"expectedState": {
|
|
166
|
+
"boardUnchanged": true,
|
|
167
|
+
"gameOver": true,
|
|
168
|
+
"win": false
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"id": "tc_win_condition",
|
|
173
|
+
"description": "胜利条件:合并后出现 2048",
|
|
174
|
+
"initialState": {
|
|
175
|
+
"board": [
|
|
176
|
+
[1024, 1024, null, null],
|
|
177
|
+
[null, null, null, null],
|
|
178
|
+
[null, null, null, null],
|
|
179
|
+
[null, null, null, null]
|
|
180
|
+
],
|
|
181
|
+
"score": 0
|
|
182
|
+
},
|
|
183
|
+
"actions": [
|
|
184
|
+
{ "type": "slide", "direction": "left" }
|
|
185
|
+
],
|
|
186
|
+
"expectedState": {
|
|
187
|
+
"board_row0_col0": 2048,
|
|
188
|
+
"win": true,
|
|
189
|
+
"gameOver": true,
|
|
190
|
+
"scoreGained": 2048
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
]
|
|
194
|
+
}
|