@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,534 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: playcraft-sprite-generation
|
|
3
|
+
description: 从概念图/示意图出发,通过 AI 文生图/图生图批量生成完整精灵图集(如 34 张麻将牌、54 张扑克牌、棋子集等),再智能切割为逐帧资产并组装精灵图。核心理念:信任现代生图模型(GPT-Image-2 等)的文字/符号精度,走「AI 直接生成 → 智能切割 → 组装」路径,不做分层合成。
|
|
4
|
+
compatibility: agent,opencode
|
|
5
|
+
triggers: 精灵图生成, sprite generation, 批量生成, 牌面生成, 完整套, tile set, card set, 从概念图, from concept, 全套素材, batch asset, mahjong set, poker set, chess set
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Skill Definition
|
|
9
|
+
tools:
|
|
10
|
+
- bash
|
|
11
|
+
- read
|
|
12
|
+
prompt_extension: |
|
|
13
|
+
你是批量精灵图生成工程师。从一张概念图/示意图出发,利用 AI 生图模型批量生成完整游戏资产集,再通过智能切割提取逐帧资产,最终组装为生产级精灵图。
|
|
14
|
+
不得向 /project/ 写入;所有中间产物与最终输出必须在会话 .../sessions/{id}/ta-workspace/ 下。
|
|
15
|
+
核心原则:信任现代生图模型的符号/文字精度,优先让 AI 直接生成带正确内容的资产,不搞"底板+符号"分层合成。
|
|
16
|
+
通过 bash 调用 playcraft CLI:tools generate-image、image sprite-split、image sprite-sheet、image remove-background、image resize 等。
|
|
17
|
+
|
|
18
|
+
## 我做什么
|
|
19
|
+
|
|
20
|
+
- 从一张概念图/示意图推导出完整资产集的生成计划(例:一张麻将牌 → 全部 34 种牌面)
|
|
21
|
+
- 利用 AI 生图模型(GPT-Image-2、Gemini 等)批量生成完整资产,保持风格一致性
|
|
22
|
+
- 智能切割 AI 生成的批量图(规则网格 / Vision 自动检测 / 未来 SAM 语义分割)
|
|
23
|
+
- 后处理(去背景、统一尺寸、质量检查)后组装为生产级精灵图 + JSON 帧坐标
|
|
24
|
+
|
|
25
|
+
## 何时用我
|
|
26
|
+
|
|
27
|
+
- 拿到一张概念图/示意图,需要生成**完整套**的同类元素(牌、棋子、图标集等)
|
|
28
|
+
- 元素上有**精确符号/文字/图案**(中文字符、数字、花色等),需要 AI 模型直接生成正确内容
|
|
29
|
+
- 需要保持全套元素**风格高度统一**
|
|
30
|
+
- 最终交付物是可用于游戏引擎的精灵图 + JSON 元数据
|
|
31
|
+
|
|
32
|
+
## 不用我的场景
|
|
33
|
+
|
|
34
|
+
- 已有完整精灵图只需换肤/风格变换 → 用 `playcraft-sprite-remix`
|
|
35
|
+
- 已有逐帧图片只需合并 → 用 `playcraft-sprite-sheet`
|
|
36
|
+
- 需要 3D 翻转动画 → 用 `playcraft-3d-flip-sprite`
|
|
37
|
+
- 单张图片生成(非批量套) → 用 `playcraft-image-generation`
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 核心流程
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
概念图/示意图
|
|
45
|
+
↓
|
|
46
|
+
Step 1: 分析 — 推导完整资产集清单
|
|
47
|
+
↓
|
|
48
|
+
Step 2: 选择生成策略 — 逐张 vs 批量拼板
|
|
49
|
+
↓
|
|
50
|
+
Step 3: AI 批量生成(图生图 + reference-image 保持风格)
|
|
51
|
+
↓
|
|
52
|
+
Step 4: 智能切割(grid / auto-detect / 未来 SAM)
|
|
53
|
+
↓
|
|
54
|
+
Step 5: 后处理(去背景、统一尺寸、质量校验)
|
|
55
|
+
↓
|
|
56
|
+
Step 6: 组装精灵图 + JSON 帧坐标
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Step 1: 分析概念图,推导完整资产清单
|
|
62
|
+
|
|
63
|
+
拿到概念图后,先明确**完整集合的定义**:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# 查看概念图
|
|
67
|
+
playcraft image info ta-workspace/concept.png
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
常见集合清单(TA 应根据项目 atom-plan / layout-spec 确定):
|
|
71
|
+
|
|
72
|
+
| 游戏类型 | 集合 | 元素数 | 每元素特征 |
|
|
73
|
+
|----------|------|--------|-----------|
|
|
74
|
+
| 麻将 | 万条筒风箭 | 34 | 每张牌有独特中文字符/图案 |
|
|
75
|
+
| 扑克 | A-K × 4花色 + 大小王 | 54 | 数字+花色,大小王特殊 |
|
|
76
|
+
| 象棋 | 红黑各 16 子 | 32 | 中文棋子名,红黑双色 |
|
|
77
|
+
| UNO | 数字牌+功能牌+万能牌 | 108 | 数字+颜色+功能符号 |
|
|
78
|
+
| Match-3 元素 | 按主题 | 6-8 | 各不相同的图案 |
|
|
79
|
+
| 图标集 | UI 元素 | N | 各不相同的图标 |
|
|
80
|
+
|
|
81
|
+
输出:**资产清单表**(记录在 ta-workspace/asset-manifest.json)
|
|
82
|
+
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"setName": "mahjong-tiles",
|
|
86
|
+
"conceptRef": "ta-workspace/concept.png",
|
|
87
|
+
"style": "ice crystal, frosted glass, blue-white cold theme",
|
|
88
|
+
"totalCount": 34,
|
|
89
|
+
"groups": [
|
|
90
|
+
{ "name": "wan", "items": ["一万","二万","三万","四万","五万","六万","七万","八万","九万"] },
|
|
91
|
+
{ "name": "tiao", "items": ["一条","二条","三条","四条","五条","六条","七条","八条","九条"] },
|
|
92
|
+
{ "name": "tong", "items": ["一筒","二筒","三筒","四筒","五筒","六筒","七筒","八筒","九筒"] },
|
|
93
|
+
{ "name": "feng", "items": ["东","南","西","北"] },
|
|
94
|
+
{ "name": "jian", "items": ["中","发","白"] }
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Step 2: 选择生成策略
|
|
102
|
+
|
|
103
|
+
### 策略 A:逐张生成(推荐,精度最高)
|
|
104
|
+
|
|
105
|
+
每个元素单独调用一次 `generate-image`,用概念图作为 `--reference-image` 锁定风格。
|
|
106
|
+
|
|
107
|
+
**优点**:每张有完整 prompt 描述符号,精度最高
|
|
108
|
+
**缺点**:API 调用次数多(N 次)
|
|
109
|
+
**适用**:元素数 < 50,每个元素有独特符号/文字
|
|
110
|
+
|
|
111
|
+
### 策略 B:批量拼板生成(省 API 调用)
|
|
112
|
+
|
|
113
|
+
让 AI 在一张大图中生成多个元素(如 "generate a 3×3 grid of mahjong tiles: 一万 through 九万"),然后切割。
|
|
114
|
+
|
|
115
|
+
**优点**:一次生成多个元素,风格自然一致
|
|
116
|
+
**缺点**:符号精度随密度下降;布局可能不够规则
|
|
117
|
+
**适用**:元素数多、符号相对简单(如 Match-3 的几何图案)
|
|
118
|
+
|
|
119
|
+
### 策略 C:分组生成(平衡方案)
|
|
120
|
+
|
|
121
|
+
按逻辑分组,每组生成一张拼板图。如麻将"万"字组 9 张一板、"条"组 9 张一板。
|
|
122
|
+
|
|
123
|
+
**优点**:组内风格 100% 一致,API 调用降到 4-5 次
|
|
124
|
+
**缺点**:需要切割步骤
|
|
125
|
+
**适用**:有自然分组的大集合(推荐麻将、扑克使用此策略)
|
|
126
|
+
|
|
127
|
+
### 策略选择决策
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
元素数量?
|
|
131
|
+
├── < 10 → 策略 A(逐张生成)
|
|
132
|
+
├── 10-50 且有自然分组 → 策略 C(分组生成)
|
|
133
|
+
├── 10-50 无分组 → 策略 A 或 B
|
|
134
|
+
└── > 50 → 策略 C(必须分组,否则太慢)
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Step 3: AI 批量生成
|
|
140
|
+
|
|
141
|
+
### 策略 A — 逐张生成
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
# 关键:使用同一模型 + 同一 reference-image,保证风格一致
|
|
145
|
+
|
|
146
|
+
# 先确认可用模型
|
|
147
|
+
playcraft tools list-image-models --json
|
|
148
|
+
|
|
149
|
+
# GPT-Image-2(符号精度最高,推荐用于带文字/符号的资产)
|
|
150
|
+
# 生成第一张(建立风格锚点)
|
|
151
|
+
playcraft tools generate-image \
|
|
152
|
+
--prompt "mahjong tile, ice crystal frosted glass style, tile shows Chinese character 一万 (yi wan), game asset, white background, front view, single tile centered" \
|
|
153
|
+
--reference-image ta-workspace/concept.png \
|
|
154
|
+
--aspect-ratio 1:1 \
|
|
155
|
+
--image-model iegg-litellm/gpt-image-2 \
|
|
156
|
+
--output ta-workspace/tiles/wan_1.png
|
|
157
|
+
|
|
158
|
+
# 后续用第一张作为额外 reference,双重锁定风格
|
|
159
|
+
playcraft tools generate-image \
|
|
160
|
+
--prompt "mahjong tile, ice crystal frosted glass style, tile shows Chinese character 二万 (er wan), game asset, white background, front view, single tile centered" \
|
|
161
|
+
--reference-image ta-workspace/concept.png \
|
|
162
|
+
--reference-image ta-workspace/tiles/wan_1.png \
|
|
163
|
+
--aspect-ratio 1:1 \
|
|
164
|
+
--image-model iegg-litellm/gpt-image-2 \
|
|
165
|
+
--output ta-workspace/tiles/wan_2.png
|
|
166
|
+
|
|
167
|
+
# 循环生成剩余元素...(同一模型、同样的 reference 组合)
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
**风格锁定技巧**:
|
|
171
|
+
|
|
172
|
+
1. **双 reference**:概念图 + 前一张成品,双重约束风格
|
|
173
|
+
2. **同一模型**:全套元素必须用同一个 `--image-model`
|
|
174
|
+
3. **prompt 模板化**:只替换符号描述部分,其余措辞完全一致
|
|
175
|
+
4. **先验证后批量**:先生成 2-3 张检查风格,确认后再跑全套
|
|
176
|
+
|
|
177
|
+
### 策略 C — 分组生成(以麻将为例)
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
# 万字组:9 张一板
|
|
181
|
+
playcraft tools generate-image \
|
|
182
|
+
--prompt "3x3 grid of mahjong tiles, ice crystal frosted glass style. Top row left to right: 一万, 二万, 三万. Middle row: 四万, 五万, 六万. Bottom row: 七万, 八万, 九万. Each tile clearly shows its Chinese character. Game assets, white background, uniform size, evenly spaced grid" \
|
|
183
|
+
--reference-image ta-workspace/concept.png \
|
|
184
|
+
--aspect-ratio 1:1 \
|
|
185
|
+
--image-model iegg-litellm/gpt-image-2 \
|
|
186
|
+
--output ta-workspace/sheets/wan_grid.png
|
|
187
|
+
|
|
188
|
+
# 条子组
|
|
189
|
+
playcraft tools generate-image \
|
|
190
|
+
--prompt "3x3 grid of mahjong tiles, ice crystal frosted glass style. Top row: 一条, 二条, 三条. Middle row: 四条, 五条, 六条. Bottom row: 七条, 八条, 九条. Each tile clearly shows its bamboo pattern. Game assets, white background, uniform size, evenly spaced grid" \
|
|
191
|
+
--reference-image ta-workspace/concept.png \
|
|
192
|
+
--reference-image ta-workspace/sheets/wan_grid.png \
|
|
193
|
+
--aspect-ratio 1:1 \
|
|
194
|
+
--image-model iegg-litellm/gpt-image-2 \
|
|
195
|
+
--output ta-workspace/sheets/tiao_grid.png
|
|
196
|
+
|
|
197
|
+
# 筒子组、风箭组(2x2 即可)...类似
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## Step 4: 智能切割
|
|
203
|
+
|
|
204
|
+
根据生成策略选择切割方式:
|
|
205
|
+
|
|
206
|
+
### 策略 A 的产物 — 逐张生成,无需切割
|
|
207
|
+
|
|
208
|
+
每张图已经是单独元素,跳到 Step 5。
|
|
209
|
+
|
|
210
|
+
### 策略 B/C 的产物 — 需要切割
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
# ── 方法 1:已知网格(最快、零 API 消耗)──
|
|
214
|
+
# 适用于 prompt 中明确指定了网格排列的生成结果
|
|
215
|
+
playcraft image sprite-split \
|
|
216
|
+
--input ta-workspace/sheets/wan_grid.png \
|
|
217
|
+
--output-dir ta-workspace/split/wan \
|
|
218
|
+
--rows 3 --columns 3 \
|
|
219
|
+
--frame-width 200 --frame-height 260 \
|
|
220
|
+
--padding 10
|
|
221
|
+
|
|
222
|
+
# ── 方法 2:Vision 自动检测(需 token)──
|
|
223
|
+
# 适用于 AI 生成的网格不够规则、间距不均匀时
|
|
224
|
+
playcraft image sprite-split \
|
|
225
|
+
--input ta-workspace/sheets/wan_grid.png \
|
|
226
|
+
--output-dir ta-workspace/split/wan \
|
|
227
|
+
--auto-detect \
|
|
228
|
+
--hint "3x3 grid of mahjong tiles, uniform cells"
|
|
229
|
+
|
|
230
|
+
# 检查切割结果
|
|
231
|
+
ls ta-workspace/split/wan/
|
|
232
|
+
cat ta-workspace/split/wan/split-meta.json
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
**切割质量检查**:
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
# 逐张检查尺寸是否一致
|
|
239
|
+
for f in ta-workspace/split/wan/frame_r*.png; do
|
|
240
|
+
playcraft image info "$f"
|
|
241
|
+
done
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
如果 auto-detect 结果不理想(帧偏移、尺寸不一),退回手动参数模式,
|
|
245
|
+
根据 `split-meta.json` 中报告的实际检测结果微调 `--rows --columns --frame-width --frame-height --padding`。
|
|
246
|
+
|
|
247
|
+
### 方法 3:SAM3 语义分割(不规则布局首选)
|
|
248
|
+
|
|
249
|
+
当 AI 生成的拼板图**不是规则网格**(元素散落、大小不一、间距不均),用 SAM3 语义分割精确提取每个对象。
|
|
250
|
+
SAM3 已集成到 CLI,通过 `playcraft image segment` 调用,冷启动约 15s,热启动约 5-10s。
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
# ── 从散乱拼板中提取所有麻将牌 ──
|
|
254
|
+
playcraft image segment \
|
|
255
|
+
--input ta-workspace/sheets/wan_grid.png \
|
|
256
|
+
--text "mahjong tile" \
|
|
257
|
+
--threshold 0.2 \
|
|
258
|
+
--output-dir ta-workspace/split/wan_sam
|
|
259
|
+
|
|
260
|
+
# 输出结构:
|
|
261
|
+
# ta-workspace/split/wan_sam/
|
|
262
|
+
# prompt_0_mahjong_tile/
|
|
263
|
+
# 00_rgba.png ← 已抠好透明背景,可直接用
|
|
264
|
+
# 00_mask.png
|
|
265
|
+
# 01_rgba.png
|
|
266
|
+
# ...
|
|
267
|
+
# segment-meta.json ← 含每个实例的 bbox 坐标(可用于自动排序)
|
|
268
|
+
|
|
269
|
+
# ── 多类型同时提取(如带底板文字 + 图案的牌)──
|
|
270
|
+
playcraft image segment \
|
|
271
|
+
--input ta-workspace/sheets/mixed_layout.png \
|
|
272
|
+
--prompts '[{"text":"mahjong tile"},{"text":"game icon"}]' \
|
|
273
|
+
--threshold 0.25 \
|
|
274
|
+
--output-dir ta-workspace/split/mixed_sam
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
**SAM3 分割后的后处理**:
|
|
278
|
+
|
|
279
|
+
```bash
|
|
280
|
+
# SAM3 输出的 rgba.png 已是透明背景,直接统一尺寸即可(无需再跑 remove-background)
|
|
281
|
+
for f in ta-workspace/split/wan_sam/prompt_0_mahjong_tile/*_rgba.png; do
|
|
282
|
+
base=$(basename "$f" _rgba.png)
|
|
283
|
+
playcraft image resize \
|
|
284
|
+
--input "$f" \
|
|
285
|
+
--output "ta-workspace/final/wan_${base}.png" \
|
|
286
|
+
--width 128 --height 168 \
|
|
287
|
+
--fit contain
|
|
288
|
+
done
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
**三种切割方法对比**:
|
|
292
|
+
|
|
293
|
+
| 方法 | 适用场景 | 精度 | API 消耗 |
|
|
294
|
+
|------|---------|------|---------|
|
|
295
|
+
| 规则网格(`--rows --columns`) | prompt 中明确指定了 NxM 网格 | 高(前提是 AI 生成规则) | 零 |
|
|
296
|
+
| Vision 自动检测(`--auto-detect`) | 轻微不规则、大致网格排列 | 中 | 低(Vision API) |
|
|
297
|
+
| **SAM3 语义分割**(`image segment`) | **散乱布局、不规则间距、大小不一** | **最高** | 中(SAM3 API) |
|
|
298
|
+
|
|
299
|
+
**决策规则**:
|
|
300
|
+
- AI 生成时用了明确的网格 prompt → 先试规则网格;失败再用 `--auto-detect`
|
|
301
|
+
- 生成结果明显不规则 → 直接用 SAM3,一步到位
|
|
302
|
+
- SAM3 是抠图而非坐标切割,输出直接是带透明通道的 RGBA,省去 remove-background 步骤
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## Step 5: 后处理
|
|
307
|
+
|
|
308
|
+
对每张切割/生成的资产做标准化处理:
|
|
309
|
+
|
|
310
|
+
```bash
|
|
311
|
+
# 1. 去背景(AI 生成图通常有白底/灰底)
|
|
312
|
+
playcraft image remove-background \
|
|
313
|
+
--input ta-workspace/split/wan/frame_r0_c0.png \
|
|
314
|
+
--output ta-workspace/clean/wan_1.png
|
|
315
|
+
|
|
316
|
+
# 复杂背景时用 AI 方法
|
|
317
|
+
playcraft image remove-background \
|
|
318
|
+
--input ta-workspace/split/wan/frame_r0_c0.png \
|
|
319
|
+
--output ta-workspace/clean/wan_1.png \
|
|
320
|
+
--method ai
|
|
321
|
+
|
|
322
|
+
# 2. 统一尺寸(所有元素必须完全相同的 width × height)
|
|
323
|
+
playcraft image resize \
|
|
324
|
+
--input ta-workspace/clean/wan_1.png \
|
|
325
|
+
--output ta-workspace/final/wan_1.png \
|
|
326
|
+
--width 128 --height 168 \
|
|
327
|
+
--fit contain
|
|
328
|
+
|
|
329
|
+
# 3. 质量校验
|
|
330
|
+
playcraft image info ta-workspace/final/wan_1.png
|
|
331
|
+
# → 确认:dimensions 正确、文件大小合理
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
**批量脚本模式**(TA 可用 `Bash(node:*)` 写批量处理脚本):
|
|
335
|
+
|
|
336
|
+
```bash
|
|
337
|
+
# 批量去背景 + 统一尺寸
|
|
338
|
+
for f in ta-workspace/split/wan/frame_r*.png; do
|
|
339
|
+
base=$(basename "$f" .png)
|
|
340
|
+
playcraft image remove-background --input "$f" --output "ta-workspace/clean/${base}.png"
|
|
341
|
+
playcraft image resize --input "ta-workspace/clean/${base}.png" --output "ta-workspace/final/${base}.png" --width 128 --height 168 --fit contain
|
|
342
|
+
done
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
---
|
|
346
|
+
|
|
347
|
+
## Step 6: 组装精灵图
|
|
348
|
+
|
|
349
|
+
```bash
|
|
350
|
+
# 将所有最终帧合并为精灵图 + JSON 帧坐标
|
|
351
|
+
playcraft image sprite-sheet \
|
|
352
|
+
--inputs ta-workspace/final/wan_1.png,ta-workspace/final/wan_2.png,ta-workspace/final/wan_3.png,ta-workspace/final/wan_4.png,ta-workspace/final/wan_5.png,ta-workspace/final/wan_6.png,ta-workspace/final/wan_7.png,ta-workspace/final/wan_8.png,ta-workspace/final/wan_9.png \
|
|
353
|
+
--output ta-workspace/output/wan_sheet \
|
|
354
|
+
--columns 3 \
|
|
355
|
+
--cell-width 128 --cell-height 168 \
|
|
356
|
+
--padding 2
|
|
357
|
+
|
|
358
|
+
# 结果:
|
|
359
|
+
# ta-workspace/output/wan_sheet.png — 精灵图
|
|
360
|
+
# ta-workspace/output/wan_sheet.json — 帧坐标元数据
|
|
361
|
+
|
|
362
|
+
# 也可以把全部 34 张合成一张总图
|
|
363
|
+
playcraft image sprite-sheet \
|
|
364
|
+
--inputs ta-workspace/final/wan_1.png,...,ta-workspace/final/jian_3.png \
|
|
365
|
+
--output ta-workspace/output/mahjong_full \
|
|
366
|
+
--columns 9 \
|
|
367
|
+
--cell-width 128 --cell-height 168 \
|
|
368
|
+
--padding 2
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
---
|
|
372
|
+
|
|
373
|
+
## Prompt 工程要点
|
|
374
|
+
|
|
375
|
+
### 符号精度技巧
|
|
376
|
+
|
|
377
|
+
现代生图模型(GPT-Image-2 等)中文字符精度已达 90%+,但仍需注意:
|
|
378
|
+
|
|
379
|
+
1. **明确标注拼音**:`Chinese character 一万 (yi wan)` 比纯写 `一万` 准确率更高
|
|
380
|
+
2. **单元素大图优先**:1:1 比例的单元素图比密集网格中的小元素精度高
|
|
381
|
+
3. **简单背景**:`white background` 或 `plain background` 减少干扰
|
|
382
|
+
4. **先验证再批量**:生成 2-3 张,人工确认符号正确后再跑全套
|
|
383
|
+
|
|
384
|
+
### 风格一致性技巧
|
|
385
|
+
|
|
386
|
+
1. **固定 prompt 模板**:只替换符号描述,其他措辞字字相同
|
|
387
|
+
2. **双 reference-image**:概念图 + 同批已确认的成品
|
|
388
|
+
3. **同一模型**:整套元素绝对不能中途换模型
|
|
389
|
+
4. **同一 aspect-ratio**:保持一致避免比例偏移
|
|
390
|
+
|
|
391
|
+
### Prompt 模板示例
|
|
392
|
+
|
|
393
|
+
```
|
|
394
|
+
单元素模板:
|
|
395
|
+
"[STYLE_DESC] mahjong tile, tile shows [SYMBOL_CN] ([SYMBOL_PINYIN]),
|
|
396
|
+
game asset, [BG_DESC], front view, single tile centered, [EXTRA]"
|
|
397
|
+
|
|
398
|
+
网格模板:
|
|
399
|
+
"[ROWS]x[COLS] grid of [STYLE_DESC] mahjong tiles.
|
|
400
|
+
Row 1 left to right: [SYM1], [SYM2], [SYM3].
|
|
401
|
+
Row 2: [SYM4], [SYM5], [SYM6].
|
|
402
|
+
...
|
|
403
|
+
Each tile clearly shows its symbol. Game assets, white background,
|
|
404
|
+
uniform size, evenly spaced grid, [EXTRA]"
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
---
|
|
408
|
+
|
|
409
|
+
## 完整示例:从概念图生成全套麻将牌
|
|
410
|
+
|
|
411
|
+
```bash
|
|
412
|
+
# === Step 1: 概念图已由 Designer 提供 ===
|
|
413
|
+
# ta-workspace/concept.png — 一张冰风格麻将牌示意图
|
|
414
|
+
|
|
415
|
+
# === Step 2: 选择策略 C(分组生成)===
|
|
416
|
+
# 34 牌 → 万(9) + 条(9) + 筒(9) + 风(4) + 箭(3) → 5 组
|
|
417
|
+
|
|
418
|
+
# === Step 3: 分组生成 ===
|
|
419
|
+
|
|
420
|
+
# 万字组(3×3 网格)
|
|
421
|
+
playcraft tools generate-image \
|
|
422
|
+
--prompt "3x3 grid of mahjong tiles, ice crystal frosted glass style, blue-white cold translucent material. Top row left to right: 一万 (yi wan), 二万 (er wan), 三万 (san wan). Middle row: 四万 (si wan), 五万 (wu wan), 六万 (liu wan). Bottom row: 七万 (qi wan), 八万 (ba wan), 九万 (jiu wan). Each tile clearly shows red Chinese characters. Game assets, white background, uniform size, evenly spaced" \
|
|
423
|
+
--reference-image ta-workspace/concept.png \
|
|
424
|
+
--aspect-ratio 1:1 \
|
|
425
|
+
--image-model iegg-litellm/gpt-image-2 \
|
|
426
|
+
--output ta-workspace/sheets/wan_grid.png
|
|
427
|
+
|
|
428
|
+
# 条子组(同样模式,reference 加上万字组成品锁定风格)
|
|
429
|
+
playcraft tools generate-image \
|
|
430
|
+
--prompt "3x3 grid of mahjong tiles, ice crystal frosted glass style, blue-white cold translucent material. Top row: 一条, 二条, 三条. Middle row: 四条, 五条, 六条. Bottom row: 七条, 八条, 九条. Each tile clearly shows bamboo stick patterns. Game assets, white background, uniform size, evenly spaced" \
|
|
431
|
+
--reference-image ta-workspace/concept.png \
|
|
432
|
+
--reference-image ta-workspace/sheets/wan_grid.png \
|
|
433
|
+
--aspect-ratio 1:1 \
|
|
434
|
+
--image-model iegg-litellm/gpt-image-2 \
|
|
435
|
+
--output ta-workspace/sheets/tiao_grid.png
|
|
436
|
+
|
|
437
|
+
# 筒子组
|
|
438
|
+
playcraft tools generate-image \
|
|
439
|
+
--prompt "3x3 grid of mahjong tiles, ice crystal frosted glass style, blue-white cold translucent material. Top row: 一筒, 二筒, 三筒. Middle row: 四筒, 五筒, 六筒. Bottom row: 七筒, 八筒, 九筒. Each tile clearly shows circular dot patterns. Game assets, white background, uniform size, evenly spaced" \
|
|
440
|
+
--reference-image ta-workspace/concept.png \
|
|
441
|
+
--reference-image ta-workspace/sheets/wan_grid.png \
|
|
442
|
+
--aspect-ratio 1:1 \
|
|
443
|
+
--image-model iegg-litellm/gpt-image-2 \
|
|
444
|
+
--output ta-workspace/sheets/tong_grid.png
|
|
445
|
+
|
|
446
|
+
# 风牌组(2×2)
|
|
447
|
+
playcraft tools generate-image \
|
|
448
|
+
--prompt "2x2 grid of mahjong tiles, ice crystal frosted glass style, blue-white cold translucent material. Top row: 东 (East wind), 南 (South wind). Bottom row: 西 (West wind), 北 (North wind). Each tile clearly shows its Chinese character. Game assets, white background, uniform size, evenly spaced" \
|
|
449
|
+
--reference-image ta-workspace/concept.png \
|
|
450
|
+
--reference-image ta-workspace/sheets/wan_grid.png \
|
|
451
|
+
--aspect-ratio 1:1 \
|
|
452
|
+
--image-model iegg-litellm/gpt-image-2 \
|
|
453
|
+
--output ta-workspace/sheets/feng_grid.png
|
|
454
|
+
|
|
455
|
+
# 箭牌(1×3 or 3×1)
|
|
456
|
+
playcraft tools generate-image \
|
|
457
|
+
--prompt "1 row of 3 mahjong tiles, ice crystal frosted glass style, blue-white cold translucent material. Left to right: 中 (red center, zhong), 发 (green prosperity, fa), 白 (white blank, bai). Each tile clearly shows its symbol. Game assets, white background, uniform size, evenly spaced" \
|
|
458
|
+
--reference-image ta-workspace/concept.png \
|
|
459
|
+
--reference-image ta-workspace/sheets/wan_grid.png \
|
|
460
|
+
--aspect-ratio 3:1 \
|
|
461
|
+
--image-model iegg-litellm/gpt-image-2 \
|
|
462
|
+
--output ta-workspace/sheets/jian_grid.png
|
|
463
|
+
|
|
464
|
+
# === Step 4: 切割 ===
|
|
465
|
+
|
|
466
|
+
playcraft image sprite-split --input ta-workspace/sheets/wan_grid.png --output-dir ta-workspace/split/wan --auto-detect --hint "3x3 grid of mahjong tiles"
|
|
467
|
+
playcraft image sprite-split --input ta-workspace/sheets/tiao_grid.png --output-dir ta-workspace/split/tiao --auto-detect --hint "3x3 grid of mahjong tiles"
|
|
468
|
+
playcraft image sprite-split --input ta-workspace/sheets/tong_grid.png --output-dir ta-workspace/split/tong --auto-detect --hint "3x3 grid of mahjong tiles"
|
|
469
|
+
playcraft image sprite-split --input ta-workspace/sheets/feng_grid.png --output-dir ta-workspace/split/feng --auto-detect --hint "2x2 grid of mahjong tiles"
|
|
470
|
+
playcraft image sprite-split --input ta-workspace/sheets/jian_grid.png --output-dir ta-workspace/split/jian --auto-detect --hint "1x3 row of mahjong tiles"
|
|
471
|
+
|
|
472
|
+
# === Step 5: 后处理 ===
|
|
473
|
+
|
|
474
|
+
for group in wan tiao tong feng jian; do
|
|
475
|
+
for f in ta-workspace/split/$group/frame_*.png; do
|
|
476
|
+
base=$(basename "$f" .png)
|
|
477
|
+
playcraft image remove-background --input "$f" --output "ta-workspace/clean/${group}_${base}.png"
|
|
478
|
+
playcraft image resize --input "ta-workspace/clean/${group}_${base}.png" --output "ta-workspace/final/${group}_${base}.png" --width 128 --height 168 --fit contain
|
|
479
|
+
done
|
|
480
|
+
done
|
|
481
|
+
|
|
482
|
+
# === Step 6: 质量检查 + 组装 ===
|
|
483
|
+
|
|
484
|
+
# 检查所有最终帧
|
|
485
|
+
for f in ta-workspace/final/*.png; do playcraft image info "$f"; done
|
|
486
|
+
|
|
487
|
+
# 组装全套精灵图(34 张, 9 列)
|
|
488
|
+
playcraft image sprite-sheet \
|
|
489
|
+
--inputs $(ls ta-workspace/final/*.png | tr '\n' ',') \
|
|
490
|
+
--output ta-workspace/output/mahjong_full \
|
|
491
|
+
--columns 9 \
|
|
492
|
+
--cell-width 128 --cell-height 168 \
|
|
493
|
+
--padding 2
|
|
494
|
+
|
|
495
|
+
# 最终产出:
|
|
496
|
+
# ta-workspace/output/mahjong_full.png — 全套精灵图
|
|
497
|
+
# ta-workspace/output/mahjong_full.json — 帧坐标
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
---
|
|
501
|
+
|
|
502
|
+
## 生图模型选择指南
|
|
503
|
+
|
|
504
|
+
| 模型 | 符号/文字精度 | 风格一致性 | reference-image | 推荐场景 |
|
|
505
|
+
|------|-------------|-----------|-----------------|---------|
|
|
506
|
+
| `iegg-litellm/gpt-image-2` | **极高** (中文 90%+) | 极高 | ✅ | 带文字/符号的资产(麻将、扑克、棋子) |
|
|
507
|
+
| `google/gemini-3.1-flash-image-preview` | 中 | 高 | ✅ 原生支持 | 图案类资产(Match-3 元素、图标) |
|
|
508
|
+
| `google/gemini-2.5-flash-preview-05-20` | 中 | 高 | ✅ | 同上 |
|
|
509
|
+
| `google/imagen-3.0-generate-002` | 低 | 高 | ❌ 纯文生图 | 无文字的背景/纹理 |
|
|
510
|
+
|
|
511
|
+
**关键原则**:带精确文字/符号的资产 → 优先 GPT-Image-2;纯图案 → Gemini 系列即可。
|
|
512
|
+
|
|
513
|
+
---
|
|
514
|
+
|
|
515
|
+
## 与现有 Skill 的关系
|
|
516
|
+
|
|
517
|
+
| Skill | 定位 | 本 Skill 的区别 |
|
|
518
|
+
|-------|------|----------------|
|
|
519
|
+
| `playcraft-image-generation` | 单张 AI 生图 | 本 Skill 覆盖「从概念到全套」的批量生成策略 |
|
|
520
|
+
| `playcraft-sprite-sheet` | 多张图合并为 sheet | 本 Skill 的 Step 6 调用它 |
|
|
521
|
+
| `playcraft-sprite-remix` | 已有 sheet 的换肤/重绘 | 本 Skill 是「从零生成」,不是改已有的 |
|
|
522
|
+
| `playcraft-image-processing` | 单张后处理 | 本 Skill 的 Step 5 调用它 |
|
|
523
|
+
| `playcraft-3d-flip-sprite` | 3D GLB 渲染精灵图 | 互补:3D 翻转动画走那边,平面批量走这边 |
|
|
524
|
+
|
|
525
|
+
---
|
|
526
|
+
|
|
527
|
+
## 注意事项
|
|
528
|
+
|
|
529
|
+
1. **先验证再批量**:前 2-3 张生成后人工确认符号正确、风格满意,再批量跑
|
|
530
|
+
2. **同一模型贯穿全套**:中途换模型会打破风格一致性
|
|
531
|
+
3. **保留 raw 产物**:`ta-workspace/sheets/` 和 `ta-workspace/split/` 保留原始中间产物,方便重切
|
|
532
|
+
4. **符号出错时的降级方案**:若 AI 对某个符号始终画错,该元素退回逐张生成(策略 A),其余继续批量
|
|
533
|
+
5. **API 限流**:批量生成时注意 provider 的 rate limit,按需在调用间加 sleep
|
|
534
|
+
6. **总资产预算**:可玩广告全部素材通常 ≤ 2-3 MB,精灵图分辨率不宜过高
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: playcraft-sprite-remix
|
|
3
|
+
description: 精灵图(sprite sheet)拆解、逐帧 AI 重绘、去背景与重组装的完整流水线。适用于换肤、风格变换、牌面/图集批量处理;通过 playcraft CLI 在沙箱内执行,分析步骤可走后端 Vision API。
|
|
4
|
+
compatibility: agent,opencode
|
|
5
|
+
triggers: 精灵图, sprite sheet, 图集, 换肤, 风格变换, 逐帧, 麻将牌, tile sheet, atlas remix
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Skill Definition
|
|
9
|
+
tools:
|
|
10
|
+
- bash
|
|
11
|
+
- read
|
|
12
|
+
prompt_extension: |
|
|
13
|
+
你是精灵图管线工程师。不得向 /project/ 写入;中间产物与最终输出必须在会话 .../sessions/{id}/ta-workspace/ 下。
|
|
14
|
+
当用户提到精灵图、sprite sheet、图集换肤、逐帧重绘、牌面风格变换等需求时,优先采用「分析/拆分 → 逐帧生成 → 去背景 → 重组 → 对比验收」流程,而不是把整张图直接丢给生图模型。
|
|
15
|
+
通过 bash 调用 playcraft CLI:sprite-split(可选 Vision)、tools generate-image、image remove-background、image sprite-sheet。
|
|
16
|
+
需要多模态理解布局时,使用 `playcraft image sprite-split --input ... --output-dir ... --auto-detect [--hint "..."]`(消耗后端 Vision 配额)。
|
|
17
|
+
若网格行列与帧尺寸已知,用手动参数省略 Vision:`--rows --columns --frame-width --frame-height [--padding]`。
|
|
18
|
+
交付到素材库时按 docs/agent/remixable-prefab-spec.md 整理 staging 后执行 `playcraft tools publish-prefab`。
|
|
19
|
+
|
|
20
|
+
## 我做什么
|
|
21
|
+
|
|
22
|
+
- 将整张精灵图拆成独立帧(规则网格或不规则元素)
|
|
23
|
+
- 按统一风格或用户要求对每帧做图生图(`playcraft tools generate-image` + `--reference-image`)
|
|
24
|
+
- 逐帧去背景(优先 `remove-background` 默认 floodfill;复杂底用 `--method ai`)
|
|
25
|
+
- 用 `playcraft image sprite-sheet` 按原拓扑拼回 PNG + JSON
|
|
26
|
+
- 产出 `split-meta.json` 记录裁切与网格,便于复现与人工微调
|
|
27
|
+
|
|
28
|
+
## 何时用我
|
|
29
|
+
|
|
30
|
+
- 用户明确在处理 **sprite sheet / 精灵图 / 纹理图集**,且需要 **保留网格或元素位置**
|
|
31
|
+
- 整张图直接文生图/图生图效果差、帧错位、风格不一致
|
|
32
|
+
- 需要批量对 **每一格 / 每一元素** 单独生成或变换
|
|
33
|
+
|
|
34
|
+
## 推荐工作流(6 步)
|
|
35
|
+
|
|
36
|
+
### 1–2. 分析与拆分(一步 CLI)
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Vision 自动推断网格(需 PLAYCRAFT_API_URL + PLAYCRAFT_SANDBOX_TOKEN或 .playcraft.json)
|
|
40
|
+
playcraft image sprite-split \
|
|
41
|
+
--input ta-workspace/source-sheet.png \
|
|
42
|
+
--output-dir ta-workspace/split_frames \
|
|
43
|
+
--auto-detect \
|
|
44
|
+
--hint "mahjong tiles, uniform grid, equal cell size"
|
|
45
|
+
|
|
46
|
+
# 或已知网格时(纯本地 sharp,不调后端)
|
|
47
|
+
playcraft image sprite-split \
|
|
48
|
+
--input ta-workspace/source-sheet.png \
|
|
49
|
+
--output-dir ta-workspace/split_frames \
|
|
50
|
+
--rows 4 --columns 10 --frame-width 100 --frame-height 130 --padding 2
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
输出:`split_frames/frame_r*_c*.png`(或不规则时的按元素命名)、`split_frames/split-meta.json`。
|
|
54
|
+
|
|
55
|
+
### 3. 逐帧重生成
|
|
56
|
+
|
|
57
|
+
对每一帧单独调用(可并行多个 bash 命令,注意 API 限流):
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
playcraft tools generate-image \
|
|
61
|
+
--prompt "same tile, frozen ice style, keep symbol readable, game asset" \
|
|
62
|
+
--reference-image ta-workspace/split_frames/frame_r0_c0.png \
|
|
63
|
+
--aspect-ratio 1:1 \
|
|
64
|
+
--output ta-workspace/remix_frames/frame_r0_c0.png
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
多帧时循环处理;单帧失败只需重试该帧。
|
|
68
|
+
|
|
69
|
+
### 4. 去背景
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
playcraft image remove-background \
|
|
73
|
+
--input ta-workspace/remix_frames/frame_r0_c0.png \
|
|
74
|
+
--output ta-workspace/remix_frames_nobg/frame_r0_c0.png
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
复杂背景再考虑 `--method ai`。
|
|
78
|
+
|
|
79
|
+
### 5. 重组精灵图
|
|
80
|
+
|
|
81
|
+
根据 `split-meta.json` 中的行列与 `frameWidth` / `frameHeight` / `padding` 与 `sprite-sheet` 对齐(与拆分时一致):
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
playcraft image sprite-sheet \
|
|
85
|
+
--inputs ta-workspace/remix_frames_nobg/frame_r0_c0.png,ta-workspace/remix_frames_nobg/frame_r0_c1.png \
|
|
86
|
+
--output ta-workspace/remixed-sheet \
|
|
87
|
+
--columns 10 \
|
|
88
|
+
--cell-width 100 --cell-height 130 \
|
|
89
|
+
--padding 2
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
(`--inputs` 顺序须与拼图行列一致;帧数多时用脚本生成逗号列表。)
|
|
93
|
+
|
|
94
|
+
### 6. Review(对比验收)
|
|
95
|
+
|
|
96
|
+
将 **原图** 与 **新精灵图** 作为参考图,请求模型做一致性/对齐简述(可选,用于汇报或自检):
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
playcraft tools generate-image \
|
|
100
|
+
--prompt "Compare layout: does the second image preserve the grid and approximate content of the first? Answer briefly in English." \
|
|
101
|
+
--reference-image ta-workspace/source-sheet.png \
|
|
102
|
+
--reference-image ta-workspace/remixed-sheet.png \
|
|
103
|
+
--aspect-ratio 1:1 \
|
|
104
|
+
--output ta-workspace/review_note.png
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
若仅需文字反馈,可改为由 Manager/Reviewer 角色阅读两张图;CLI 仍会生成一张图,可按项目约定使用或丢弃。
|
|
108
|
+
|
|
109
|
+
## 局部 remix:不拆整张,只替换单一元素
|
|
110
|
+
|
|
111
|
+
已知某个元素在原图上的 bounds(例如某个按钮位于 x=120 y=240 宽 160 高 64),想仅重绘该元素并贴回原图:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
# 1) 裁出目标区域(可向外扩 ~10% 给模型一点上下文)
|
|
115
|
+
playcraft image crop \
|
|
116
|
+
--input ta-workspace/source-sheet.png \
|
|
117
|
+
--output ta-workspace/region.png \
|
|
118
|
+
--x 104 --y 234 --width 192 --height 76
|
|
119
|
+
|
|
120
|
+
# 2) 以裁剪片作为 reference 做 image-to-image
|
|
121
|
+
playcraft tools generate-image \
|
|
122
|
+
--prompt "green rounded rectangle button with white text 'Start', flat UI" \
|
|
123
|
+
--reference-image ta-workspace/region.png \
|
|
124
|
+
--aspect-ratio 1:1 \
|
|
125
|
+
--output ta-workspace/region_remixed.png
|
|
126
|
+
|
|
127
|
+
# 3) 抠掉新片段的背景/边框
|
|
128
|
+
playcraft image remove-background \
|
|
129
|
+
--input ta-workspace/region_remixed.png \
|
|
130
|
+
--output ta-workspace/region_remixed_nobg.png
|
|
131
|
+
|
|
132
|
+
# 4) 贴回原图(注意 x/y 是粘贴起点,这里是 104/234,而不是 bounds 原点)
|
|
133
|
+
playcraft image overlay \
|
|
134
|
+
--base ta-workspace/source-sheet.png \
|
|
135
|
+
--overlay ta-workspace/region_remixed_nobg.png \
|
|
136
|
+
--output ta-workspace/source-sheet.v2.png \
|
|
137
|
+
--x 104 --y 234
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
4 步各是一个原子,可单独替换:
|
|
141
|
+
- 不需要外扩时 step 1 使用原始 bounds 即可。
|
|
142
|
+
- 场景融合足够好时 step 3 可跳过。
|
|
143
|
+
- 多元素批量换皮时把这套流程写在一个 for 循环里,或对每个元素走一遍 step 1–4 并合到同一底图上。
|
|
144
|
+
|
|
145
|
+
## 与现有 Skill 的关系
|
|
146
|
+
|
|
147
|
+
- **playcraft-sprite-sheet**:仅负责「多图合并为 sheet」;本 Skill 覆盖「从 sheet 出发的完整 remix」
|
|
148
|
+
- **playcraft-image-generation**:单图生成;本 Skill 强调 **逐帧** 与 **结构保持**
|
|
149
|
+
- **playcraft-image-processing**:缩放、裁剪、像素化等本地处理;在本流程中可与 remix 步骤穿插使用
|
|
150
|
+
|
|
151
|
+
## 注意事项
|
|
152
|
+
|
|
153
|
+
- **不要**对整张 sprite sheet 一次性下「全部改成某风格」的生图指令作为主路径
|
|
154
|
+
- `--auto-detect` 有成本;已知规格时务必用手动网格减少调用
|
|
155
|
+
- 不规则图集(`gridType: irregular`)重组时需按 `split-meta.json` 中元素坐标逐个 `overlay` 或扩展 `sprite-sheet` 工作流;优先在 ta-workspace 用脚本或分步 composite 还原布局
|