@playcraft/cli 0.0.44 → 0.0.46
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/dist/atom-tree/build-skeleton.js +180 -0
- package/dist/atom-tree/fusion-hints.js +86 -0
- package/dist/atom-tree/selection.js +402 -0
- package/dist/commands/build-all.js +33 -5
- package/dist/commands/build.js +7 -1
- package/dist/commands/create.js +774 -50
- package/dist/commands/image.js +11 -0
- package/dist/commands/prad.js +61 -0
- package/dist/commands/remix.js +20 -0
- package/dist/commands/skills.js +961 -185
- package/dist/commands/tools-detect.js +56 -0
- package/dist/commands/tools-generation.js +21 -0
- package/dist/commands/tools-video-review.js +100 -0
- package/dist/commands/tools.js +4 -0
- package/dist/index.js +2 -0
- package/dist/prad/atom-ref.js +23 -0
- package/dist/prad/check.js +377 -0
- package/dist/prad/check.test.js +49 -0
- package/dist/prad/explain.js +109 -0
- package/dist/prad/load-spec.js +23 -0
- package/dist/prad/paths.js +83 -0
- package/dist/prad/skills-index.js +60 -0
- package/dist/remix/init-template.js +80 -0
- package/dist/scaffold/compose.js +211 -0
- package/engine-packs/phaser/game/adapters/phaser.ts +52 -0
- package/engine-packs/phaser/game/config/game-config.ts +46 -0
- package/engine-packs/phaser/game/contract/publish.ts +141 -0
- package/engine-packs/phaser/game/contract/types.ts +34 -0
- package/engine-packs/phaser/game/index.ts +81 -0
- package/engine-packs/phaser/game/runtime-contract.ts +28 -0
- package/engine-packs/phaser/manifest.json +1 -0
- package/engine-packs/phaser/package.deps.json +1 -0
- package/engine-packs/threejs/game/config/.gitkeep +0 -0
- package/engine-packs/threejs/game/config/game-config.ts +46 -0
- package/engine-packs/threejs/game/contract/publish.ts +141 -0
- package/engine-packs/threejs/game/contract/types.ts +34 -0
- package/engine-packs/threejs/game/gameplay/.gitkeep +0 -0
- package/engine-packs/threejs/game/index.ts +76 -0
- package/engine-packs/threejs/game/runtime-contract.ts +15 -0
- package/engine-packs/threejs/game/scenes/.gitkeep +0 -0
- package/engine-packs/threejs/manifest.json +1 -0
- package/engine-packs/threejs/package.deps.json +8 -0
- package/package.json +17 -3
- package/project-template/.claude/agents/artist.md +101 -0
- package/project-template/.claude/agents/developer.md +90 -93
- package/project-template/.claude/agents/game-designer.md +192 -0
- package/project-template/.claude/agents/refs/README.md +57 -51
- package/project-template/.claude/agents/refs/{designer-color-audio-recipes.md → artist-color-audio-recipes.md} +2 -2
- package/project-template/.claude/agents/refs/{designer-deliverable-spec.md → artist-deliverable-spec.md} +57 -57
- package/project-template/.claude/agents/refs/{designer-dimension-axis.md → artist-dimension-axis.md} +5 -5
- package/project-template/.claude/agents/refs/{designer-handoff-v2-checklist.md → artist-handoff-v2-checklist.md} +15 -15
- package/project-template/.claude/agents/refs/artist-legacy-fallback.md +14 -0
- package/project-template/.claude/agents/refs/{designer-master-composite-recipes.md → artist-master-composite-recipes.md} +3 -3
- package/project-template/.claude/agents/refs/artist-style-exploration-flow.md +55 -0
- package/project-template/.claude/agents/refs/developer-dev-handoff.md +83 -40
- package/project-template/.claude/agents/refs/developer-impl-cookbook.md +365 -67
- package/project-template/.claude/agents/refs/developer-legacy-fallback.md +15 -0
- package/project-template/.claude/agents/refs/developer-phase1-flow.md +131 -85
- package/project-template/.claude/agents/refs/framework-5-component-filter.md +252 -0
- package/project-template/.claude/agents/refs/framework-game-feel-juice.md +266 -0
- package/project-template/.claude/agents/refs/framework-mda.md +147 -0
- package/project-template/.claude/agents/refs/game-designer-gameplay-sufficiency.md +123 -0
- package/project-template/.claude/agents/refs/game-designer-legacy-fallback.md +15 -0
- package/project-template/.claude/agents/refs/game-designer-workflow-detail.md +69 -0
- package/project-template/.claude/agents/refs/implementation-plan-guide.md +316 -0
- package/project-template/.claude/agents/refs/reviewer-convergence-eval.md +247 -33
- package/project-template/.claude/agents/refs/reviewer-legacy-fallback.md +14 -0
- package/project-template/.claude/agents/refs/skill-selector-guide.md +465 -0
- package/project-template/.claude/agents/refs/skill-value-layers.md +145 -0
- package/project-template/.claude/agents/refs/storyboard-generation-guide.md +110 -0
- package/project-template/.claude/agents/refs/ta-atlas-deliverable-standard.md +4 -4
- package/project-template/.claude/agents/refs/ta-pipeline-cookbook.md +101 -104
- package/project-template/.claude/agents/refs/technical-artist-legacy-fallback.md +14 -0
- package/project-template/.claude/agents/reviewer.md +81 -95
- package/project-template/.claude/agents/technical-artist.md +71 -95
- package/project-template/.claude/hooks/README.md +83 -35
- package/project-template/.claude/hooks/asr-coverage-validate.mjs +19 -19
- package/project-template/.claude/hooks/block-developer-preflight.mjs +185 -0
- package/project-template/.claude/hooks/block-ring1-tasklist.mjs +95 -0
- package/project-template/.claude/hooks/gate-dispatcher.mjs +78 -0
- package/project-template/.claude/hooks/gate-runner.mjs +557 -0
- package/project-template/.claude/hooks/gate.mjs +170 -0
- package/project-template/.claude/hooks/snapshot-milestone.mjs +246 -0
- package/project-template/.claude/hooks/user-prompt.mjs +193 -0
- package/project-template/.claude/hooks/validate-atom-tree-selection.mjs +281 -0
- package/project-template/.claude/hooks/validate-workflow-stop.mjs +1535 -95
- package/project-template/.claude/settings.json +54 -9
- package/project-template/.claude/skills/brainstorming/SKILL.md +161 -0
- package/project-template/.claude/skills/brainstorming/scripts/frame-template.html +270 -0
- package/project-template/.claude/skills/brainstorming/scripts/helper.js +177 -0
- package/project-template/.claude/skills/brainstorming/scripts/server.cjs +354 -0
- package/project-template/.claude/skills/brainstorming/scripts/start-server.sh +148 -0
- package/project-template/.claude/skills/brainstorming/scripts/stop-server.sh +56 -0
- package/project-template/.claude/skills/brainstorming/scripts/wait-for-selection.sh +62 -0
- package/project-template/.claude/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/project-template/.claude/skills/brainstorming/visual-companion.md +309 -0
- package/project-template/.claude/skills/playcraft-ad-psychology/SKILL.md +3 -3
- package/project-template/.claude/skills/playcraft-art-style-guide/SKILL.md +3 -3
- package/project-template/.claude/skills/playcraft-asset-state-sheet/SKILL.md +35 -25
- package/project-template/.claude/skills/playcraft-audio-generation/SKILL.md +15 -15
- package/project-template/.claude/skills/playcraft-build-optimizer/SKILL.md +5 -5
- package/project-template/.claude/skills/playcraft-image-generation/SKILL.md +5 -5
- package/project-template/.claude/skills/playcraft-image-generation/reference/compare-style.template.mjs +5 -5
- package/project-template/.claude/skills/playcraft-image-generation/reference/gen-batch-sprite.template.mjs +116 -27
- package/project-template/.claude/skills/playcraft-image-generation/reference/prompt-cookbook.md +1 -1
- package/project-template/.claude/skills/playcraft-image-processing/SKILL.md +219 -0
- package/project-template/.claude/skills/playcraft-playable-optimization/SKILL.md +161 -0
- package/project-template/.claude/skills/playcraft-research/SKILL.md +24 -21
- package/project-template/.claude/skills/playcraft-skill-recommender/SKILL.md +331 -0
- package/project-template/.claude/skills/playcraft-sprite-generation/SKILL.md +48 -48
- package/project-template/.claude/skills/playcraft-sprite-remix/SKILL.md +158 -0
- package/project-template/.claude/skills/playcraft-sprite-sheet/SKILL.md +100 -0
- package/project-template/.claude/skills/playcraft-storyboard/SKILL.md +4 -4
- package/project-template/.claude/skills/playcraft-style-qa/SKILL.md +45 -45
- package/project-template/.claude/skills/playcraft-text-rendering/SKILL.md +27 -27
- package/project-template/.claude/skills/session-analyzer/SKILL.md +386 -0
- package/project-template/.claude/skills/session-analyzer/scripts/execution-breakdown.mjs +182 -0
- package/project-template/.claude/skills/session-analyzer/scripts/find-turns.mjs +72 -0
- package/project-template/.claude/skills/session-analyzer/scripts/heavy-output.mjs +121 -0
- package/project-template/.claude/skills/session-analyzer/scripts/resolve-session.mjs +103 -0
- package/project-template/.claude/skills/session-analyzer/scripts/subagent-stats.mjs +127 -0
- package/project-template/.claude/skills/session-analyzer/scripts/subagent-tool-timeline.mjs +106 -0
- package/project-template/.claude/skills/session-analyzer/scripts/time-gaps.mjs +128 -0
- package/project-template/.claude/skills/session-analyzer/scripts/turn-timeline.mjs +67 -0
- package/project-template/.claude/snapshot.mjs +350 -0
- package/project-template/.codebuddy/settings.json +53 -0
- package/project-template/.cursor/hooks.json +1 -1
- package/project-template/.cursor/rules/playcraft-orchestrator.mdc +91 -86
- package/project-template/.cursor/rules/playcraft-subagent-boundary.mdc +16 -5
- package/project-template/CHANGELOG.md +105 -0
- package/project-template/CLAUDE.md +58 -254
- package/project-template/docs/DESIGN.md +65 -0
- package/project-template/docs/intent-clarifications.md +58 -0
- package/project-template/docs/pipeline-overview.md +69 -0
- package/project-template/docs/project-state.md +211 -0
- package/project-template/docs/team/agent-conduct.md +51 -105
- package/project-template/docs/team/agent-runtime-matrix.md +60 -74
- package/project-template/docs/team/atom-tree-format.md +169 -0
- package/project-template/docs/team/collaboration.md +319 -225
- package/project-template/docs/team/core-model.md +80 -46
- package/project-template/docs/team/game-designer-migration-todo.md +8 -0
- package/project-template/docs/team/harness-legacy-deprecation.md +23 -0
- package/project-template/docs/team/platform-capabilities.md +16 -13
- package/project-template/docs/team/workflow-changelog.md +95 -23
- package/project-template/docs/team/workflow-consistency-checklist.md +93 -45
- package/project-template/focus-lab/.gitkeep +0 -0
- package/project-template/game/.playcraft-scaffold-pending +0 -0
- package/project-template/game/index.ts +18 -0
- package/project-template/globals.d.ts +51 -0
- package/project-template/index.css +34 -0
- package/project-template/index.html +18 -0
- package/project-template/main.ts +9 -0
- package/project-template/package.json +79 -0
- package/project-template/skills/README.md +52 -0
- package/project-template/skills/_shared/agent-prep.md +136 -0
- package/project-template/skills/_shared/requirements.txt +1 -0
- package/project-template/skills/_shared/scripts/build-evidence-gate.mjs +87 -0
- package/project-template/skills/_shared/scripts/context-budget.mjs +215 -0
- package/project-template/skills/_shared/scripts/create-playable.mjs +140 -0
- package/project-template/skills/_shared/scripts/dev-start.mjs +151 -0
- package/project-template/skills/_shared/scripts/disclosure-config.mjs +480 -0
- package/project-template/skills/_shared/scripts/ensure-project.mjs +532 -0
- package/project-template/skills/_shared/scripts/gen-placeholder-audio.py +345 -0
- package/project-template/skills/_shared/scripts/gen-placeholder.py +244 -0
- package/project-template/skills/_shared/scripts/harness-smoke.mjs +257 -0
- package/project-template/skills/_shared/scripts/lib/validator-artifacts.mjs +129 -0
- package/project-template/skills/_shared/scripts/placeholder-pack-sheet.mjs +67 -0
- package/project-template/skills/_shared/scripts/placeholder_audio_lib.py +142 -0
- package/project-template/skills/_shared/scripts/placeholder_lib.py +993 -0
- package/project-template/skills/_shared/scripts/render-project-state.mjs +278 -0
- package/project-template/skills/_shared/scripts/ring-config.mjs +252 -0
- package/project-template/skills/_shared/scripts/skills-check.mjs +176 -0
- package/project-template/skills/_shared/scripts/slice-set.mjs +77 -0
- package/project-template/skills/_shared/scripts/state-advance-ring.mjs +63 -0
- package/project-template/skills/_shared/scripts/state-get.mjs +215 -0
- package/project-template/skills/_shared/scripts/state-handoff.mjs +120 -0
- package/project-template/skills/_shared/scripts/state-set.mjs +113 -0
- package/project-template/skills/_shared/scripts/state-store.mjs +893 -0
- package/project-template/skills/_shared/scripts/sync-template-skills.mjs +112 -0
- package/project-template/skills/_shared/scripts/verify-asset-code-sync.mjs +265 -0
- package/project-template/skills/_shared/scripts/verify-atom-conformance.mjs +181 -0
- package/project-template/skills/_shared/scripts/verify-env.mjs +285 -0
- package/project-template/skills/_shared/scripts/verify-placeholders.mjs +161 -0
- package/project-template/skills/_shared/scripts/workflow-doctor.mjs +348 -0
- package/project-template/skills/playable-animate/SKILL.md +52 -0
- package/project-template/skills/playable-animate/agents/openai.yaml +4 -0
- package/project-template/skills/playable-animate/references/board-refresh.md +30 -0
- package/project-template/skills/playable-animate/references/diagnosis-checklist.md +25 -0
- package/project-template/skills/playable-animate/references/entrance-sequencing.md +33 -0
- package/project-template/skills/playable-animate/references/interaction-timing.md +23 -0
- package/project-template/skills/playable-art/SKILL.md +203 -0
- package/project-template/skills/playable-art/agents/openai.yaml +4 -0
- package/project-template/skills/playable-art/references/alpha-postprocess.md +46 -0
- package/project-template/skills/playable-art/references/cta-art-spec.md +59 -0
- package/project-template/skills/playable-art/references/layout-proportions.md +30 -0
- package/project-template/skills/playable-art/references/prompt-patterns.md +83 -0
- package/project-template/skills/playable-art/references/reference-comparison.md +30 -0
- package/project-template/skills/playable-art/references/sheet-import-v2.md +91 -0
- package/project-template/skills/playable-art/scripts/build-atlas.py +332 -0
- package/project-template/skills/playable-art/scripts/chroma-key.py +50 -0
- package/project-template/skills/playable-art/scripts/extract-alpha-split.py +65 -0
- package/project-template/skills/playable-art/scripts/extract-dual-bg-alpha.py +118 -0
- package/project-template/skills/playable-art/scripts/import-gpt-art-sheets-v2.py +403 -0
- package/project-template/skills/playable-art/scripts/import-gpt-art-sheets.py +280 -0
- package/project-template/skills/playable-art/scripts/import-gpt-tile-sheet.py +114 -0
- package/project-template/skills/playable-art/scripts/import_gpt_art_pipeline.py +321 -0
- package/project-template/skills/playable-art/scripts/import_gpt_art_sheets_v2_test.py +126 -0
- package/project-template/skills/playable-art/scripts/placeholder_common.py +98 -0
- package/project-template/skills/playable-art/scripts/remove-bg.py +91 -0
- package/project-template/skills/playable-art/scripts/review-processed-assets.py +468 -0
- package/project-template/skills/playable-art/scripts/review_processed_assets_test.py +116 -0
- package/project-template/skills/playable-art/scripts/verify-alpha-clean.py +105 -0
- package/project-template/skills/playable-debug/SKILL.md +116 -0
- package/project-template/skills/playable-debug/agents/openai.yaml +4 -0
- package/project-template/skills/playable-debug/references/debug-config.md +40 -0
- package/project-template/skills/playable-focus/SKILL.md +148 -0
- package/project-template/skills/playable-focus/scripts/bootstrap-playground.mjs +84 -0
- package/project-template/skills/playable-focus/scripts/extract-focus-frames.mjs +87 -0
- package/project-template/skills/playable-focus/scripts/generate-focus-reports.mjs +121 -0
- package/project-template/skills/playable-focus/scripts/playground.mjs +390 -0
- package/project-template/skills/playable-focus/templates/focus-lab/frame.html +39 -0
- package/project-template/skills/playable-focus/templates/focus-lab/harness/clean-stage.js +114 -0
- package/project-template/skills/playable-focus/templates/focus-lab/harness/frame-lab-scene.js +94 -0
- package/project-template/skills/playable-focus/templates/focus-lab/harness/particle-lab-scene.js +224 -0
- package/project-template/skills/playable-focus/templates/focus-lab/model.html +16 -0
- package/project-template/skills/playable-focus/templates/focus-lab/particle.html +38 -0
- package/project-template/skills/playable-focus/templates/focus-lab/shatter.html +47 -0
- package/project-template/skills/playable-focus/templates/playground/registry.template.json +55 -0
- package/project-template/skills/playable-focus/templates/playground/vfx-catalog.template.json +280 -0
- package/project-template/skills/playable-fx-decompose/SKILL.md +212 -0
- package/project-template/skills/playable-fx-decompose/examples.md +89 -0
- package/project-template/skills/playable-fx-decompose/reference.md +201 -0
- package/project-template/skills/playable-fx-decompose/requirements.txt +2 -0
- package/project-template/skills/playable-fx-decompose/scripts/build-blank-tile-crack.py +192 -0
- package/project-template/skills/playable-fx-decompose/scripts/fix-shard-debris-frames.py +60 -0
- package/project-template/skills/playable-fx-decompose/scripts/generate-shard-debris.py +276 -0
- package/project-template/skills/playable-fx-peak/SKILL.md +237 -0
- package/project-template/skills/playable-fx-peak/requirements.txt +2 -0
- package/project-template/skills/playable-fx-peak/scripts/fix-frame-edges.py +70 -0
- package/project-template/skills/playable-fx-peak/scripts/repack-frame-sequence.py +526 -0
- package/project-template/skills/playable-fx-peak/scripts/validate-frame-anchors.py +130 -0
- package/project-template/skills/playable-placeholder/SKILL.md +239 -0
- package/project-template/skills/playable-record/SKILL.md +166 -0
- package/project-template/skills/playable-record/scripts/lib/build-artifact.mjs +92 -0
- package/project-template/skills/playable-record/scripts/lib/dev-server.mjs +104 -0
- package/project-template/skills/playable-record/scripts/lib/record-audio-bridge.js +141 -0
- package/project-template/skills/playable-record/scripts/lib/slice-structure-verify.mjs +199 -0
- package/project-template/skills/playable-record/scripts/record-playable.mjs +583 -0
- package/project-template/skills/playable-record/scripts/verify-build.mjs +185 -0
- package/project-template/skills/playable-record/scripts/verify-contract.mjs +261 -0
- package/project-template/skills/playable-record/scripts/verify-firstwin.mjs +398 -0
- package/project-template/skills/playable-record/scripts/verify-fusion.mjs +320 -0
- package/project-template/skills/playable-record/scripts/verify-lifecycle.mjs +78 -0
- package/project-template/skills/playable-record/scripts/verify-slice-artist.mjs +53 -0
- package/project-template/skills/playable-record/scripts/verify-slice-ta.mjs +53 -0
- package/project-template/skills/playable-record/scripts/verify-slice.mjs +142 -0
- package/project-template/skills/playable-record/scripts/verify-visual-ring.mjs +250 -0
- package/project-template/skills/playable-record/scripts/verify-visual-ring1.mjs +190 -0
- package/project-template/skills/playable-record/scripts/verify-vlm-video.mjs +227 -0
- package/project-template/skills/playable-validate/SKILL.md +260 -0
- package/project-template/skills/playable-validate/references/checklist-detail.md +36 -0
- package/project-template/skills/playable-validate/references/single-html-bundle.md +76 -0
- package/project-template/skills/playable-validate/validation-rules.md +200 -0
- package/project-template/skills/playable-verify-ui/SKILL.md +295 -0
- package/project-template/skills/playable-verify-ui/examples/asset-manifest.example.json +36 -0
- package/project-template/skills/playable-verify-ui/examples/mahjong-match.profile.yaml +334 -0
- package/project-template/skills/playable-verify-ui/profiles/template.profile.yaml +84 -0
- package/project-template/skills/playable-verify-ui/reference.md +165 -0
- package/project-template/skills/playable-verify-ui/references/phaser-patterns.md +67 -0
- package/project-template/skills/playable-verify-ui/references/scaling-decision-tree.md +51 -0
- package/project-template/skills/playable-verify-ui/requirements.txt +7 -0
- package/project-template/skills/playable-verify-ui/schema/asset-manifest.schema.json +68 -0
- package/project-template/skills/playable-verify-ui/schema/playable-ui-profile.schema.json +171 -0
- package/project-template/skills/playable-verify-ui/scripts/asset_manifest.py +231 -0
- package/project-template/skills/playable-verify-ui/scripts/lib/__init__.py +1 -0
- package/project-template/skills/playable-verify-ui/scripts/lib/config_expr.js +218 -0
- package/project-template/skills/playable-verify-ui/scripts/lib/node_utils.js +51 -0
- package/project-template/skills/playable-verify-ui/scripts/lib/profile_loader.py +59 -0
- package/project-template/skills/playable-verify-ui/scripts/lib/report.py +106 -0
- package/project-template/skills/playable-verify-ui/scripts/lib/runtime_contract.js +116 -0
- package/project-template/skills/playable-verify-ui/scripts/measure_frame_content.py +77 -0
- package/project-template/skills/playable-verify-ui/scripts/run_all.py +265 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_asset_sizes.py +77 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_assets_present.py +62 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_atlas_budget.py +84 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_atlas_frames.py +79 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_bg_clean.py +365 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_doc_asset_sync.py +90 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_fetch_antipatterns.py +59 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_game_config_load.js +54 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_hardcoded_layout.js +64 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_layout_regions.js +110 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_profile_schema.py +37 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_ring1_visual.py +211 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_runtime_contract.js +58 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_script_load_order.js +73 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_slice_plan.py +238 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_slice_plan_test.py +125 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_text_overlap.py +333 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_tile_consistency.py +323 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_vision_evidence.py +894 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_vision_evidence_test.py +122 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_visual.py +422 -0
- package/project-template/templates/{designer-log.template.md → artist-log.template.md} +26 -31
- package/project-template/templates/atom-tree.template.json +133 -0
- package/project-template/templates/design-brief.template.md +59 -162
- package/project-template/templates/design-lens-checklist.reference.md +14 -14
- package/project-template/templates/design-methodology.md +25 -25
- package/project-template/templates/design.template.md +50 -0
- package/project-template/templates/developer-log.template.md +187 -63
- package/project-template/templates/five-axis-framework.md +89 -44
- package/project-template/templates/gen-placeholder-audio.template.mjs +63 -0
- package/project-template/templates/gen-placeholders.template.mjs +81 -0
- package/project-template/templates/intent-clarifications.template.md +7 -7
- package/project-template/templates/layout-spec.template.md +32 -20
- package/project-template/templates/plan.template.md +80 -0
- package/project-template/templates/project-state.template.md +90 -191
- package/project-template/templates/review-report.template.md +208 -24
- package/project-template/templates/style-exploration.template.md +8 -8
- package/project-template/templates/ta-log.template.md +58 -35
- package/project-template/tsconfig.json +20 -0
- package/project-template/vite.config.ts +27 -0
- package/project-templates/phaser/.claude/agents/artist.md +101 -0
- package/project-templates/phaser/.claude/agents/developer.md +123 -0
- package/project-templates/phaser/.claude/agents/game-designer.md +192 -0
- package/project-templates/phaser/.claude/agents/refs/README.md +77 -0
- package/project-templates/phaser/.claude/agents/refs/artist-art-style-catalog.md +533 -0
- package/project-templates/phaser/.claude/agents/refs/artist-color-audio-recipes.md +153 -0
- package/project-templates/phaser/.claude/agents/refs/artist-deliverable-spec.md +230 -0
- package/project-templates/phaser/.claude/agents/refs/artist-dimension-axis.md +27 -0
- package/project-templates/phaser/.claude/agents/refs/artist-handoff-v2-checklist.md +76 -0
- package/project-templates/phaser/.claude/agents/refs/artist-legacy-fallback.md +14 -0
- package/project-templates/phaser/.claude/agents/refs/artist-master-composite-recipes.md +208 -0
- package/project-templates/phaser/.claude/agents/refs/artist-style-exploration-flow.md +55 -0
- package/project-templates/phaser/.claude/agents/refs/developer-dev-handoff.md +152 -0
- package/project-templates/phaser/.claude/agents/refs/developer-impl-cookbook.md +432 -0
- package/project-templates/phaser/.claude/agents/refs/developer-legacy-fallback.md +15 -0
- package/project-templates/phaser/.claude/agents/refs/developer-phase1-flow.md +404 -0
- package/project-templates/phaser/.claude/agents/refs/framework-5-component-filter.md +252 -0
- package/project-templates/phaser/.claude/agents/refs/framework-game-feel-juice.md +266 -0
- package/project-templates/phaser/.claude/agents/refs/framework-mda.md +147 -0
- package/project-templates/phaser/.claude/agents/refs/game-designer-gameplay-sufficiency.md +123 -0
- package/project-templates/phaser/.claude/agents/refs/game-designer-legacy-fallback.md +15 -0
- package/project-templates/phaser/.claude/agents/refs/game-designer-workflow-detail.md +69 -0
- package/project-templates/phaser/.claude/agents/refs/implementation-plan-guide.md +309 -0
- package/project-templates/phaser/.claude/agents/refs/reviewer-convergence-eval.md +350 -0
- package/project-templates/phaser/.claude/agents/refs/reviewer-legacy-fallback.md +14 -0
- package/project-templates/phaser/.claude/agents/refs/reviewer-six-dimension-eval.md +6 -0
- package/project-templates/phaser/.claude/agents/refs/skill-selector-guide.md +465 -0
- package/project-templates/phaser/.claude/agents/refs/skill-value-layers.md +145 -0
- package/project-templates/phaser/.claude/agents/refs/storyboard-generation-guide.md +110 -0
- package/project-templates/phaser/.claude/agents/refs/ta-3d-flip-recipe.md +88 -0
- package/project-templates/phaser/.claude/agents/refs/ta-atlas-deliverable-standard.md +67 -0
- package/project-templates/phaser/.claude/agents/refs/ta-batch-pipeline-recipes.md +120 -0
- package/project-templates/phaser/.claude/agents/refs/ta-image-generation-detail.md +300 -0
- package/project-templates/phaser/.claude/agents/refs/ta-image-ops-reference.md +495 -0
- package/project-templates/phaser/.claude/agents/refs/ta-pipeline-cookbook.md +1141 -0
- package/project-templates/phaser/.claude/agents/refs/ta-tools-reference.md +111 -0
- package/project-templates/phaser/.claude/agents/refs/ta-vfx-preset-catalog.md +365 -0
- package/project-templates/phaser/.claude/agents/refs/technical-artist-legacy-fallback.md +14 -0
- package/project-templates/phaser/.claude/agents/reviewer.md +116 -0
- package/project-templates/phaser/.claude/agents/technical-artist.md +100 -0
- package/project-templates/phaser/.claude/hooks/README.md +120 -0
- package/project-templates/phaser/.claude/hooks/asr-coverage-validate.mjs +381 -0
- package/project-templates/phaser/.claude/hooks/block-developer-preflight.mjs +185 -0
- package/project-templates/phaser/.claude/hooks/block-ring1-tasklist.mjs +95 -0
- package/project-templates/phaser/.claude/hooks/gate-dispatcher.mjs +78 -0
- package/project-templates/phaser/.claude/hooks/gate-runner.mjs +557 -0
- package/project-templates/phaser/.claude/hooks/gate.mjs +171 -0
- package/project-templates/phaser/.claude/hooks/snapshot-milestone.mjs +247 -0
- package/project-templates/phaser/.claude/hooks/user-prompt.mjs +194 -0
- package/project-templates/phaser/.claude/hooks/validate-atom-tree-selection.mjs +281 -0
- package/project-templates/phaser/.claude/hooks/validate-workflow-stop.mjs +1889 -0
- package/project-templates/phaser/.claude/settings.json +81 -0
- package/project-templates/phaser/.claude/skills/brainstorming/SKILL.md +161 -0
- package/project-templates/phaser/.claude/skills/brainstorming/scripts/frame-template.html +270 -0
- package/project-templates/phaser/.claude/skills/brainstorming/scripts/helper.js +177 -0
- package/project-templates/phaser/.claude/skills/brainstorming/scripts/server.cjs +354 -0
- package/project-templates/phaser/.claude/skills/brainstorming/scripts/start-server.sh +148 -0
- package/project-templates/phaser/.claude/skills/brainstorming/scripts/stop-server.sh +56 -0
- package/project-templates/phaser/.claude/skills/brainstorming/scripts/wait-for-selection.sh +62 -0
- package/project-templates/phaser/.claude/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/project-templates/phaser/.claude/skills/brainstorming/visual-companion.md +309 -0
- package/project-templates/phaser/.claude/skills/playcraft-ad-psychology/SKILL.md +182 -0
- package/project-templates/phaser/.claude/skills/playcraft-art-style-guide/SKILL.md +123 -0
- package/project-templates/phaser/.claude/skills/playcraft-asset-state-sheet/SKILL.md +205 -0
- package/project-templates/phaser/.claude/skills/playcraft-audio-generation/SKILL.md +280 -0
- package/project-templates/phaser/.claude/skills/playcraft-batch-pipeline/SKILL.md +184 -0
- package/project-templates/phaser/.claude/skills/playcraft-build-optimizer/SKILL.md +306 -0
- package/project-templates/phaser/.claude/skills/playcraft-image-generation/SKILL.md +298 -0
- package/project-templates/phaser/.claude/skills/playcraft-image-generation/reference/build-sprite-sheet.template.mjs +123 -0
- package/project-templates/phaser/.claude/skills/playcraft-image-generation/reference/compare-style.template.mjs +254 -0
- package/project-templates/phaser/.claude/skills/playcraft-image-generation/reference/gen-batch-sprite.template.mjs +324 -0
- package/project-templates/phaser/.claude/skills/playcraft-image-generation/reference/gen-batch.template.mjs +97 -0
- package/project-templates/phaser/.claude/skills/playcraft-image-generation/reference/gen-edit-variants.template.mjs +118 -0
- package/project-templates/phaser/.claude/skills/playcraft-image-generation/reference/process-batch.template.mjs +137 -0
- package/project-templates/phaser/.claude/skills/playcraft-image-generation/reference/prompt-cookbook.md +397 -0
- package/project-templates/phaser/.claude/skills/playcraft-image-generation/reference/validate-sprite-sheet.template.mjs +296 -0
- package/project-templates/phaser/.claude/skills/playcraft-image-ops/SKILL.md +122 -0
- package/project-templates/phaser/.claude/skills/playcraft-image-processing/SKILL.md +219 -0
- package/project-templates/phaser/.claude/skills/playcraft-masking/SKILL.md +373 -0
- package/project-templates/phaser/.claude/skills/playcraft-playable-optimization/SKILL.md +161 -0
- package/project-templates/phaser/.claude/skills/playcraft-research/SKILL.md +215 -0
- package/project-templates/phaser/.claude/skills/playcraft-skill-recommender/SKILL.md +331 -0
- package/project-templates/phaser/.claude/skills/playcraft-sprite-generation/SKILL.md +423 -0
- package/project-templates/phaser/.claude/skills/playcraft-sprite-remix/SKILL.md +158 -0
- package/project-templates/phaser/.claude/skills/playcraft-sprite-sheet/SKILL.md +100 -0
- package/project-templates/phaser/.claude/skills/playcraft-storyboard/SKILL.md +167 -0
- package/project-templates/phaser/.claude/skills/playcraft-style-qa/SKILL.md +270 -0
- package/project-templates/phaser/.claude/skills/playcraft-text-rendering/SKILL.md +236 -0
- package/project-templates/phaser/.claude/skills/playcraft-vfx-animation/SKILL.md +130 -0
- package/project-templates/phaser/.claude/skills/playwright-cli/SKILL.md +390 -0
- package/project-templates/phaser/.claude/skills/playwright-cli/references/element-attributes.md +23 -0
- package/project-templates/phaser/.claude/skills/playwright-cli/references/playwright-tests.md +39 -0
- package/project-templates/phaser/.claude/skills/playwright-cli/references/request-mocking.md +87 -0
- package/project-templates/phaser/.claude/skills/playwright-cli/references/running-code.md +240 -0
- package/project-templates/phaser/.claude/skills/playwright-cli/references/session-management.md +226 -0
- package/project-templates/phaser/.claude/skills/playwright-cli/references/spec-driven-testing.md +308 -0
- package/project-templates/phaser/.claude/skills/playwright-cli/references/storage-state.md +275 -0
- package/project-templates/phaser/.claude/skills/playwright-cli/references/test-generation.md +134 -0
- package/project-templates/phaser/.claude/skills/playwright-cli/references/tracing.md +142 -0
- package/project-templates/phaser/.claude/skills/playwright-cli/references/video-recording.md +153 -0
- package/project-templates/phaser/.claude/skills/session-analyzer/SKILL.md +386 -0
- package/project-templates/phaser/.claude/skills/session-analyzer/scripts/execution-breakdown.mjs +182 -0
- package/project-templates/phaser/.claude/skills/session-analyzer/scripts/find-turns.mjs +72 -0
- package/project-templates/phaser/.claude/skills/session-analyzer/scripts/heavy-output.mjs +121 -0
- package/project-templates/phaser/.claude/skills/session-analyzer/scripts/resolve-session.mjs +103 -0
- package/project-templates/phaser/.claude/skills/session-analyzer/scripts/subagent-stats.mjs +127 -0
- package/project-templates/phaser/.claude/skills/session-analyzer/scripts/subagent-tool-timeline.mjs +106 -0
- package/project-templates/phaser/.claude/skills/session-analyzer/scripts/time-gaps.mjs +128 -0
- package/project-templates/phaser/.claude/skills/session-analyzer/scripts/turn-timeline.mjs +67 -0
- package/project-templates/phaser/.claude/snapshot.mjs +257 -0
- package/project-templates/phaser/.cursor/hooks.json +17 -0
- package/project-templates/phaser/.cursor/rules/playcraft-orchestrator.mdc +142 -0
- package/project-templates/phaser/.cursor/rules/playcraft-subagent-boundary.mdc +29 -0
- package/project-templates/phaser/.playcraft-engine +1 -0
- package/project-templates/phaser/CHANGELOG.md +105 -0
- package/project-templates/phaser/CLAUDE.md +84 -0
- package/project-templates/phaser/assets/audio/bgm/.gitkeep +0 -0
- package/project-templates/phaser/assets/audio/sfx/.gitkeep +0 -0
- package/project-templates/phaser/assets/bundles/.gitkeep +0 -0
- package/project-templates/phaser/assets/images/bg/.gitkeep +0 -0
- package/project-templates/phaser/assets/images/reference/.gitkeep +0 -0
- package/project-templates/phaser/assets/images/storyboard/.gitkeep +0 -0
- package/project-templates/phaser/assets/images/tiles/.gitkeep +0 -0
- package/project-templates/phaser/assets/images/ui/.gitkeep +0 -0
- package/project-templates/phaser/assets/images/vfx/.gitkeep +0 -0
- package/project-templates/phaser/assets/models/.gitkeep +0 -0
- package/project-templates/phaser/docs/DESIGN.md +65 -0
- package/project-templates/phaser/docs/intent-clarifications.md +58 -0
- package/project-templates/phaser/docs/pipeline-overview.md +69 -0
- package/project-templates/phaser/docs/project-state.md +211 -0
- package/project-templates/phaser/docs/scaffold-manifest.md +10 -0
- package/project-templates/phaser/docs/team/agent-conduct.md +67 -0
- package/project-templates/phaser/docs/team/agent-runtime-matrix.md +80 -0
- package/project-templates/phaser/docs/team/atom-tree-format.md +114 -0
- package/project-templates/phaser/docs/team/collaboration.md +391 -0
- package/project-templates/phaser/docs/team/core-model.md +85 -0
- package/project-templates/phaser/docs/team/game-designer-migration-todo.md +8 -0
- package/project-templates/phaser/docs/team/harness-legacy-deprecation.md +23 -0
- package/project-templates/phaser/docs/team/platform-capabilities.md +18 -0
- package/project-templates/phaser/docs/team/workflow-changelog.md +137 -0
- package/project-templates/phaser/docs/team/workflow-consistency-checklist.md +240 -0
- package/project-templates/phaser/focus-lab/.gitkeep +0 -0
- package/project-templates/phaser/game/adapters/phaser.ts +52 -0
- package/project-templates/phaser/game/config/.gitkeep +0 -0
- package/project-templates/phaser/game/config/game-config.ts +46 -0
- package/project-templates/phaser/game/contract/publish.ts +141 -0
- package/project-templates/phaser/game/contract/types.ts +34 -0
- package/project-templates/phaser/game/gameplay/.gitkeep +0 -0
- package/project-templates/phaser/game/index.ts +81 -0
- package/project-templates/phaser/game/runtime-contract.ts +28 -0
- package/project-templates/phaser/game/scenes/.gitkeep +0 -0
- package/project-templates/phaser/globals.d.ts +51 -0
- package/project-templates/phaser/index.css +34 -0
- package/project-templates/phaser/index.html +18 -0
- package/project-templates/phaser/main.ts +9 -0
- package/project-templates/phaser/package.json +79 -0
- package/project-templates/phaser/skills/README.md +52 -0
- package/project-templates/phaser/skills/_shared/agent-prep.md +136 -0
- package/project-templates/phaser/skills/_shared/requirements.txt +1 -0
- package/project-templates/phaser/skills/_shared/scripts/build-evidence-gate.mjs +87 -0
- package/project-templates/phaser/skills/_shared/scripts/context-budget.mjs +215 -0
- package/project-templates/phaser/skills/_shared/scripts/create-playable.mjs +140 -0
- package/project-templates/phaser/skills/_shared/scripts/dev-start.mjs +151 -0
- package/project-templates/phaser/skills/_shared/scripts/disclosure-config.mjs +480 -0
- package/project-templates/phaser/skills/_shared/scripts/ensure-project.mjs +532 -0
- package/project-templates/phaser/skills/_shared/scripts/gen-placeholder-audio.py +345 -0
- package/project-templates/phaser/skills/_shared/scripts/gen-placeholder.py +244 -0
- package/project-templates/phaser/skills/_shared/scripts/harness-smoke.mjs +257 -0
- package/project-templates/phaser/skills/_shared/scripts/lib/validator-artifacts.mjs +129 -0
- package/project-templates/phaser/skills/_shared/scripts/placeholder-pack-sheet.mjs +67 -0
- package/project-templates/phaser/skills/_shared/scripts/placeholder_audio_lib.py +142 -0
- package/project-templates/phaser/skills/_shared/scripts/placeholder_lib.py +993 -0
- package/project-templates/phaser/skills/_shared/scripts/render-project-state.mjs +278 -0
- package/project-templates/phaser/skills/_shared/scripts/ring-config.mjs +252 -0
- package/project-templates/phaser/skills/_shared/scripts/skills-check.mjs +176 -0
- package/project-templates/phaser/skills/_shared/scripts/slice-set.mjs +77 -0
- package/project-templates/phaser/skills/_shared/scripts/state-advance-ring.mjs +63 -0
- package/project-templates/phaser/skills/_shared/scripts/state-get.mjs +215 -0
- package/project-templates/phaser/skills/_shared/scripts/state-handoff.mjs +120 -0
- package/project-templates/phaser/skills/_shared/scripts/state-set.mjs +113 -0
- package/project-templates/phaser/skills/_shared/scripts/state-store.mjs +893 -0
- package/project-templates/phaser/skills/_shared/scripts/sync-template-skills.mjs +112 -0
- package/project-templates/phaser/skills/_shared/scripts/verify-asset-code-sync.mjs +265 -0
- package/project-templates/phaser/skills/_shared/scripts/verify-atom-conformance.mjs +181 -0
- package/project-templates/phaser/skills/_shared/scripts/verify-env.mjs +285 -0
- package/project-templates/phaser/skills/_shared/scripts/verify-placeholders.mjs +161 -0
- package/project-templates/phaser/skills/_shared/scripts/workflow-doctor.mjs +348 -0
- package/project-templates/phaser/skills/playable-animate/SKILL.md +52 -0
- package/project-templates/phaser/skills/playable-animate/agents/openai.yaml +4 -0
- package/project-templates/phaser/skills/playable-animate/references/board-refresh.md +30 -0
- package/project-templates/phaser/skills/playable-animate/references/diagnosis-checklist.md +25 -0
- package/project-templates/phaser/skills/playable-animate/references/entrance-sequencing.md +33 -0
- package/project-templates/phaser/skills/playable-animate/references/interaction-timing.md +23 -0
- package/project-templates/phaser/skills/playable-art/SKILL.md +203 -0
- package/project-templates/phaser/skills/playable-art/agents/openai.yaml +4 -0
- package/project-templates/phaser/skills/playable-art/references/alpha-postprocess.md +46 -0
- package/project-templates/phaser/skills/playable-art/references/cta-art-spec.md +59 -0
- package/project-templates/phaser/skills/playable-art/references/layout-proportions.md +30 -0
- package/project-templates/phaser/skills/playable-art/references/prompt-patterns.md +83 -0
- package/project-templates/phaser/skills/playable-art/references/reference-comparison.md +30 -0
- package/project-templates/phaser/skills/playable-art/references/sheet-import-v2.md +91 -0
- package/project-templates/phaser/skills/playable-art/scripts/build-atlas.py +332 -0
- package/project-templates/phaser/skills/playable-art/scripts/chroma-key.py +50 -0
- package/project-templates/phaser/skills/playable-art/scripts/extract-alpha-split.py +65 -0
- package/project-templates/phaser/skills/playable-art/scripts/extract-dual-bg-alpha.py +118 -0
- package/project-templates/phaser/skills/playable-art/scripts/import-gpt-art-sheets-v2.py +403 -0
- package/project-templates/phaser/skills/playable-art/scripts/import-gpt-art-sheets.py +280 -0
- package/project-templates/phaser/skills/playable-art/scripts/import-gpt-tile-sheet.py +114 -0
- package/project-templates/phaser/skills/playable-art/scripts/import_gpt_art_pipeline.py +321 -0
- package/project-templates/phaser/skills/playable-art/scripts/import_gpt_art_sheets_v2_test.py +126 -0
- package/project-templates/phaser/skills/playable-art/scripts/placeholder_common.py +98 -0
- package/project-templates/phaser/skills/playable-art/scripts/remove-bg.py +91 -0
- package/project-templates/phaser/skills/playable-art/scripts/review-processed-assets.py +468 -0
- package/project-templates/phaser/skills/playable-art/scripts/review_processed_assets_test.py +116 -0
- package/project-templates/phaser/skills/playable-art/scripts/verify-alpha-clean.py +105 -0
- package/project-templates/phaser/skills/playable-debug/SKILL.md +116 -0
- package/project-templates/phaser/skills/playable-debug/agents/openai.yaml +4 -0
- package/project-templates/phaser/skills/playable-debug/references/debug-config.md +40 -0
- package/project-templates/phaser/skills/playable-focus/SKILL.md +148 -0
- package/project-templates/phaser/skills/playable-focus/scripts/bootstrap-playground.mjs +84 -0
- package/project-templates/phaser/skills/playable-focus/scripts/extract-focus-frames.mjs +87 -0
- package/project-templates/phaser/skills/playable-focus/scripts/generate-focus-reports.mjs +121 -0
- package/project-templates/phaser/skills/playable-focus/scripts/playground.mjs +390 -0
- package/project-templates/phaser/skills/playable-focus/templates/focus-lab/frame.html +39 -0
- package/project-templates/phaser/skills/playable-focus/templates/focus-lab/harness/clean-stage.js +114 -0
- package/project-templates/phaser/skills/playable-focus/templates/focus-lab/harness/frame-lab-scene.js +94 -0
- package/project-templates/phaser/skills/playable-focus/templates/focus-lab/harness/particle-lab-scene.js +224 -0
- package/project-templates/phaser/skills/playable-focus/templates/focus-lab/model.html +16 -0
- package/project-templates/phaser/skills/playable-focus/templates/focus-lab/particle.html +38 -0
- package/project-templates/phaser/skills/playable-focus/templates/focus-lab/shatter.html +47 -0
- package/project-templates/phaser/skills/playable-fx-decompose/SKILL.md +212 -0
- package/project-templates/phaser/skills/playable-fx-decompose/examples.md +89 -0
- package/project-templates/phaser/skills/playable-fx-decompose/reference.md +201 -0
- package/project-templates/phaser/skills/playable-fx-decompose/requirements.txt +2 -0
- package/project-templates/phaser/skills/playable-fx-decompose/scripts/build-blank-tile-crack.py +192 -0
- package/project-templates/phaser/skills/playable-fx-decompose/scripts/fix-shard-debris-frames.py +60 -0
- package/project-templates/phaser/skills/playable-fx-decompose/scripts/generate-shard-debris.py +276 -0
- package/project-templates/phaser/skills/playable-fx-peak/SKILL.md +237 -0
- package/project-templates/phaser/skills/playable-fx-peak/requirements.txt +2 -0
- package/project-templates/phaser/skills/playable-fx-peak/scripts/fix-frame-edges.py +70 -0
- package/project-templates/phaser/skills/playable-fx-peak/scripts/repack-frame-sequence.py +526 -0
- package/project-templates/phaser/skills/playable-fx-peak/scripts/validate-frame-anchors.py +130 -0
- package/project-templates/phaser/skills/playable-placeholder/SKILL.md +239 -0
- package/project-templates/phaser/skills/playable-record/SKILL.md +166 -0
- package/project-templates/phaser/skills/playable-record/scripts/lib/build-artifact.mjs +92 -0
- package/project-templates/phaser/skills/playable-record/scripts/lib/dev-server.mjs +104 -0
- package/project-templates/phaser/skills/playable-record/scripts/lib/record-audio-bridge.js +141 -0
- package/project-templates/phaser/skills/playable-record/scripts/lib/slice-structure-verify.mjs +199 -0
- package/project-templates/phaser/skills/playable-record/scripts/record-playable.mjs +583 -0
- package/project-templates/phaser/skills/playable-record/scripts/verify-build.mjs +185 -0
- package/project-templates/phaser/skills/playable-record/scripts/verify-contract.mjs +261 -0
- package/project-templates/phaser/skills/playable-record/scripts/verify-firstwin.mjs +398 -0
- package/project-templates/phaser/skills/playable-record/scripts/verify-fusion.mjs +320 -0
- package/project-templates/phaser/skills/playable-record/scripts/verify-lifecycle.mjs +78 -0
- package/project-templates/phaser/skills/playable-record/scripts/verify-slice-artist.mjs +53 -0
- package/project-templates/phaser/skills/playable-record/scripts/verify-slice-ta.mjs +53 -0
- package/project-templates/phaser/skills/playable-record/scripts/verify-slice.mjs +142 -0
- package/project-templates/phaser/skills/playable-record/scripts/verify-visual-ring.mjs +250 -0
- package/project-templates/phaser/skills/playable-record/scripts/verify-visual-ring1.mjs +190 -0
- package/project-templates/phaser/skills/playable-record/scripts/verify-vlm-video.mjs +227 -0
- package/project-templates/phaser/skills/playable-validate/SKILL.md +260 -0
- package/project-templates/phaser/skills/playable-validate/references/checklist-detail.md +36 -0
- package/project-templates/phaser/skills/playable-validate/references/single-html-bundle.md +76 -0
- package/project-templates/phaser/skills/playable-validate/validation-rules.md +200 -0
- package/project-templates/phaser/skills/playable-verify-ui/SKILL.md +295 -0
- package/project-templates/phaser/skills/playable-verify-ui/examples/asset-manifest.example.json +36 -0
- package/project-templates/phaser/skills/playable-verify-ui/examples/mahjong-match.profile.yaml +334 -0
- package/project-templates/phaser/skills/playable-verify-ui/profiles/template.profile.yaml +84 -0
- package/project-templates/phaser/skills/playable-verify-ui/reference.md +165 -0
- package/project-templates/phaser/skills/playable-verify-ui/references/phaser-patterns.md +67 -0
- package/project-templates/phaser/skills/playable-verify-ui/references/scaling-decision-tree.md +51 -0
- package/project-templates/phaser/skills/playable-verify-ui/requirements.txt +7 -0
- package/project-templates/phaser/skills/playable-verify-ui/schema/asset-manifest.schema.json +68 -0
- package/project-templates/phaser/skills/playable-verify-ui/schema/playable-ui-profile.schema.json +171 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/asset_manifest.py +231 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/lib/__init__.py +1 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/lib/config_expr.js +218 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/lib/node_utils.js +51 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/lib/profile_loader.py +59 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/lib/report.py +106 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/lib/runtime_contract.js +116 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/measure_frame_content.py +77 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/run_all.py +265 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_asset_sizes.py +77 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_assets_present.py +62 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_atlas_budget.py +84 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_atlas_frames.py +79 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_bg_clean.py +365 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_doc_asset_sync.py +90 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_fetch_antipatterns.py +59 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_game_config_load.js +54 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_hardcoded_layout.js +64 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_layout_regions.js +110 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_profile_schema.py +37 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_ring1_visual.py +211 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_runtime_contract.js +58 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_script_load_order.js +73 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_slice_plan.py +238 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_slice_plan_test.py +125 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_text_overlap.py +333 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_tile_consistency.py +323 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_vision_evidence.py +894 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_vision_evidence_test.py +122 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_visual.py +422 -0
- package/project-templates/phaser/ta-workspace/scripts/.gitkeep +0 -0
- package/project-templates/phaser/templates/artist-log.template.md +182 -0
- package/project-templates/phaser/templates/atom-tree.template.json +133 -0
- package/project-templates/phaser/templates/design-brief.template.md +92 -0
- package/project-templates/phaser/templates/design-lens-checklist.reference.md +117 -0
- package/project-templates/phaser/templates/design-methodology.md +99 -0
- package/project-templates/phaser/templates/design.template.md +50 -0
- package/project-templates/phaser/templates/developer-log.template.md +258 -0
- package/project-templates/phaser/templates/five-axis-framework.md +194 -0
- package/project-templates/phaser/templates/gen-placeholder-audio.template.mjs +63 -0
- package/project-templates/phaser/templates/gen-placeholders.template.mjs +81 -0
- package/project-templates/phaser/templates/intent-clarifications.template.md +58 -0
- package/project-templates/phaser/templates/layout-spec.template.md +198 -0
- package/project-templates/phaser/templates/plan.template.md +80 -0
- package/project-templates/phaser/templates/project-state.template.md +136 -0
- package/project-templates/phaser/templates/review-report.template.md +275 -0
- package/project-templates/phaser/templates/style-exploration.template.md +93 -0
- package/project-templates/phaser/templates/ta-log.template.md +394 -0
- package/project-templates/phaser/tsconfig.json +20 -0
- package/project-templates/phaser/vite.config.ts +27 -0
- package/project-templates/threejs/.claude/agents/artist.md +101 -0
- package/project-templates/threejs/.claude/agents/developer.md +123 -0
- package/project-templates/threejs/.claude/agents/game-designer.md +192 -0
- package/project-templates/threejs/.claude/agents/refs/README.md +77 -0
- package/project-templates/threejs/.claude/agents/refs/artist-art-style-catalog.md +533 -0
- package/project-templates/threejs/.claude/agents/refs/artist-color-audio-recipes.md +153 -0
- package/project-templates/threejs/.claude/agents/refs/artist-deliverable-spec.md +230 -0
- package/project-templates/threejs/.claude/agents/refs/artist-dimension-axis.md +27 -0
- package/project-templates/threejs/.claude/agents/refs/artist-handoff-v2-checklist.md +76 -0
- package/project-templates/threejs/.claude/agents/refs/artist-legacy-fallback.md +14 -0
- package/project-templates/threejs/.claude/agents/refs/artist-master-composite-recipes.md +208 -0
- package/project-templates/threejs/.claude/agents/refs/artist-style-exploration-flow.md +55 -0
- package/project-templates/threejs/.claude/agents/refs/developer-dev-handoff.md +152 -0
- package/project-templates/threejs/.claude/agents/refs/developer-impl-cookbook.md +432 -0
- package/project-templates/threejs/.claude/agents/refs/developer-legacy-fallback.md +15 -0
- package/project-templates/threejs/.claude/agents/refs/developer-phase1-flow.md +404 -0
- package/project-templates/threejs/.claude/agents/refs/framework-5-component-filter.md +252 -0
- package/project-templates/threejs/.claude/agents/refs/framework-game-feel-juice.md +266 -0
- package/project-templates/threejs/.claude/agents/refs/framework-mda.md +147 -0
- package/project-templates/threejs/.claude/agents/refs/game-designer-gameplay-sufficiency.md +123 -0
- package/project-templates/threejs/.claude/agents/refs/game-designer-legacy-fallback.md +15 -0
- package/project-templates/threejs/.claude/agents/refs/game-designer-workflow-detail.md +69 -0
- package/project-templates/threejs/.claude/agents/refs/implementation-plan-guide.md +309 -0
- package/project-templates/threejs/.claude/agents/refs/reviewer-convergence-eval.md +350 -0
- package/project-templates/threejs/.claude/agents/refs/reviewer-legacy-fallback.md +14 -0
- package/project-templates/threejs/.claude/agents/refs/reviewer-six-dimension-eval.md +6 -0
- package/project-templates/threejs/.claude/agents/refs/skill-selector-guide.md +465 -0
- package/project-templates/threejs/.claude/agents/refs/skill-value-layers.md +145 -0
- package/project-templates/threejs/.claude/agents/refs/storyboard-generation-guide.md +110 -0
- package/project-templates/threejs/.claude/agents/refs/ta-3d-flip-recipe.md +88 -0
- package/project-templates/threejs/.claude/agents/refs/ta-atlas-deliverable-standard.md +67 -0
- package/project-templates/threejs/.claude/agents/refs/ta-batch-pipeline-recipes.md +120 -0
- package/project-templates/threejs/.claude/agents/refs/ta-image-generation-detail.md +300 -0
- package/project-templates/threejs/.claude/agents/refs/ta-image-ops-reference.md +495 -0
- package/project-templates/threejs/.claude/agents/refs/ta-pipeline-cookbook.md +1141 -0
- package/project-templates/threejs/.claude/agents/refs/ta-tools-reference.md +111 -0
- package/project-templates/threejs/.claude/agents/refs/ta-vfx-preset-catalog.md +365 -0
- package/project-templates/threejs/.claude/agents/refs/technical-artist-legacy-fallback.md +14 -0
- package/project-templates/threejs/.claude/agents/reviewer.md +116 -0
- package/project-templates/threejs/.claude/agents/technical-artist.md +100 -0
- package/project-templates/threejs/.claude/hooks/README.md +120 -0
- package/project-templates/threejs/.claude/hooks/asr-coverage-validate.mjs +381 -0
- package/project-templates/threejs/.claude/hooks/block-developer-preflight.mjs +185 -0
- package/project-templates/threejs/.claude/hooks/block-ring1-tasklist.mjs +95 -0
- package/project-templates/threejs/.claude/hooks/gate-dispatcher.mjs +78 -0
- package/project-templates/threejs/.claude/hooks/gate-runner.mjs +557 -0
- package/project-templates/threejs/.claude/hooks/gate.mjs +171 -0
- package/project-templates/threejs/.claude/hooks/snapshot-milestone.mjs +247 -0
- package/project-templates/threejs/.claude/hooks/user-prompt.mjs +194 -0
- package/project-templates/threejs/.claude/hooks/validate-atom-tree-selection.mjs +281 -0
- package/project-templates/threejs/.claude/hooks/validate-workflow-stop.mjs +1889 -0
- package/project-templates/threejs/.claude/settings.json +81 -0
- package/project-templates/threejs/.claude/skills/brainstorming/SKILL.md +161 -0
- package/project-templates/threejs/.claude/skills/brainstorming/scripts/frame-template.html +270 -0
- package/project-templates/threejs/.claude/skills/brainstorming/scripts/helper.js +177 -0
- package/project-templates/threejs/.claude/skills/brainstorming/scripts/server.cjs +354 -0
- package/project-templates/threejs/.claude/skills/brainstorming/scripts/start-server.sh +148 -0
- package/project-templates/threejs/.claude/skills/brainstorming/scripts/stop-server.sh +56 -0
- package/project-templates/threejs/.claude/skills/brainstorming/scripts/wait-for-selection.sh +62 -0
- package/project-templates/threejs/.claude/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/project-templates/threejs/.claude/skills/brainstorming/visual-companion.md +309 -0
- package/project-templates/threejs/.claude/skills/playcraft-ad-psychology/SKILL.md +182 -0
- package/project-templates/threejs/.claude/skills/playcraft-art-style-guide/SKILL.md +123 -0
- package/project-templates/threejs/.claude/skills/playcraft-asset-state-sheet/SKILL.md +205 -0
- package/project-templates/threejs/.claude/skills/playcraft-audio-generation/SKILL.md +280 -0
- package/project-templates/threejs/.claude/skills/playcraft-batch-pipeline/SKILL.md +184 -0
- package/project-templates/threejs/.claude/skills/playcraft-build-optimizer/SKILL.md +306 -0
- package/project-templates/threejs/.claude/skills/playcraft-image-generation/SKILL.md +298 -0
- package/project-templates/threejs/.claude/skills/playcraft-image-generation/reference/build-sprite-sheet.template.mjs +123 -0
- package/project-templates/threejs/.claude/skills/playcraft-image-generation/reference/compare-style.template.mjs +254 -0
- package/project-templates/threejs/.claude/skills/playcraft-image-generation/reference/gen-batch-sprite.template.mjs +324 -0
- package/project-templates/threejs/.claude/skills/playcraft-image-generation/reference/gen-batch.template.mjs +97 -0
- package/project-templates/threejs/.claude/skills/playcraft-image-generation/reference/gen-edit-variants.template.mjs +118 -0
- package/project-templates/threejs/.claude/skills/playcraft-image-generation/reference/process-batch.template.mjs +137 -0
- package/project-templates/threejs/.claude/skills/playcraft-image-generation/reference/prompt-cookbook.md +397 -0
- package/project-templates/threejs/.claude/skills/playcraft-image-generation/reference/validate-sprite-sheet.template.mjs +296 -0
- package/project-templates/threejs/.claude/skills/playcraft-image-ops/SKILL.md +122 -0
- package/project-templates/threejs/.claude/skills/playcraft-image-processing/SKILL.md +219 -0
- package/project-templates/threejs/.claude/skills/playcraft-masking/SKILL.md +373 -0
- package/project-templates/threejs/.claude/skills/playcraft-playable-optimization/SKILL.md +161 -0
- package/project-templates/threejs/.claude/skills/playcraft-research/SKILL.md +215 -0
- package/project-templates/threejs/.claude/skills/playcraft-skill-recommender/SKILL.md +331 -0
- package/project-templates/threejs/.claude/skills/playcraft-sprite-generation/SKILL.md +423 -0
- package/project-templates/threejs/.claude/skills/playcraft-sprite-remix/SKILL.md +158 -0
- package/project-templates/threejs/.claude/skills/playcraft-sprite-sheet/SKILL.md +100 -0
- package/project-templates/threejs/.claude/skills/playcraft-storyboard/SKILL.md +167 -0
- package/project-templates/threejs/.claude/skills/playcraft-style-qa/SKILL.md +270 -0
- package/project-templates/threejs/.claude/skills/playcraft-text-rendering/SKILL.md +236 -0
- package/project-templates/threejs/.claude/skills/playcraft-vfx-animation/SKILL.md +130 -0
- package/project-templates/threejs/.claude/skills/playwright-cli/SKILL.md +390 -0
- package/project-templates/threejs/.claude/skills/playwright-cli/references/element-attributes.md +23 -0
- package/project-templates/threejs/.claude/skills/playwright-cli/references/playwright-tests.md +39 -0
- package/project-templates/threejs/.claude/skills/playwright-cli/references/request-mocking.md +87 -0
- package/project-templates/threejs/.claude/skills/playwright-cli/references/running-code.md +240 -0
- package/project-templates/threejs/.claude/skills/playwright-cli/references/session-management.md +226 -0
- package/project-templates/threejs/.claude/skills/playwright-cli/references/spec-driven-testing.md +308 -0
- package/project-templates/threejs/.claude/skills/playwright-cli/references/storage-state.md +275 -0
- package/project-templates/threejs/.claude/skills/playwright-cli/references/test-generation.md +134 -0
- package/project-templates/threejs/.claude/skills/playwright-cli/references/tracing.md +142 -0
- package/project-templates/threejs/.claude/skills/playwright-cli/references/video-recording.md +153 -0
- package/project-templates/threejs/.claude/skills/session-analyzer/SKILL.md +386 -0
- package/project-templates/threejs/.claude/skills/session-analyzer/scripts/execution-breakdown.mjs +182 -0
- package/project-templates/threejs/.claude/skills/session-analyzer/scripts/find-turns.mjs +72 -0
- package/project-templates/threejs/.claude/skills/session-analyzer/scripts/heavy-output.mjs +121 -0
- package/project-templates/threejs/.claude/skills/session-analyzer/scripts/resolve-session.mjs +103 -0
- package/project-templates/threejs/.claude/skills/session-analyzer/scripts/subagent-stats.mjs +127 -0
- package/project-templates/threejs/.claude/skills/session-analyzer/scripts/subagent-tool-timeline.mjs +106 -0
- package/project-templates/threejs/.claude/skills/session-analyzer/scripts/time-gaps.mjs +128 -0
- package/project-templates/threejs/.claude/skills/session-analyzer/scripts/turn-timeline.mjs +67 -0
- package/project-templates/threejs/.claude/snapshot.mjs +257 -0
- package/project-templates/threejs/.cursor/hooks.json +17 -0
- package/project-templates/threejs/.cursor/rules/playcraft-orchestrator.mdc +142 -0
- package/project-templates/threejs/.cursor/rules/playcraft-subagent-boundary.mdc +29 -0
- package/project-templates/threejs/.playcraft-engine +1 -0
- package/project-templates/threejs/CHANGELOG.md +105 -0
- package/project-templates/threejs/CLAUDE.md +84 -0
- package/project-templates/threejs/assets/audio/bgm/.gitkeep +0 -0
- package/project-templates/threejs/assets/audio/sfx/.gitkeep +0 -0
- package/project-templates/threejs/assets/bundles/.gitkeep +0 -0
- package/project-templates/threejs/assets/images/bg/.gitkeep +0 -0
- package/project-templates/threejs/assets/images/reference/.gitkeep +0 -0
- package/project-templates/threejs/assets/images/storyboard/.gitkeep +0 -0
- package/project-templates/threejs/assets/images/tiles/.gitkeep +0 -0
- package/project-templates/threejs/assets/images/ui/.gitkeep +0 -0
- package/project-templates/threejs/assets/images/vfx/.gitkeep +0 -0
- package/project-templates/threejs/assets/models/.gitkeep +0 -0
- package/project-templates/threejs/docs/DESIGN.md +65 -0
- package/project-templates/threejs/docs/intent-clarifications.md +58 -0
- package/project-templates/threejs/docs/pipeline-overview.md +69 -0
- package/project-templates/threejs/docs/project-state.md +211 -0
- package/project-templates/threejs/docs/scaffold-manifest.md +10 -0
- package/project-templates/threejs/docs/team/agent-conduct.md +67 -0
- package/project-templates/threejs/docs/team/agent-runtime-matrix.md +80 -0
- package/project-templates/threejs/docs/team/atom-tree-format.md +114 -0
- package/project-templates/threejs/docs/team/collaboration.md +391 -0
- package/project-templates/threejs/docs/team/core-model.md +85 -0
- package/project-templates/threejs/docs/team/game-designer-migration-todo.md +8 -0
- package/project-templates/threejs/docs/team/harness-legacy-deprecation.md +23 -0
- package/project-templates/threejs/docs/team/platform-capabilities.md +18 -0
- package/project-templates/threejs/docs/team/workflow-changelog.md +137 -0
- package/project-templates/threejs/docs/team/workflow-consistency-checklist.md +240 -0
- package/project-templates/threejs/focus-lab/.gitkeep +0 -0
- package/project-templates/threejs/game/config/.gitkeep +0 -0
- package/project-templates/threejs/game/config/game-config.ts +46 -0
- package/project-templates/threejs/game/contract/publish.ts +141 -0
- package/project-templates/threejs/game/contract/types.ts +34 -0
- package/project-templates/threejs/game/gameplay/.gitkeep +0 -0
- package/project-templates/threejs/game/index.ts +76 -0
- package/project-templates/threejs/game/runtime-contract.ts +15 -0
- package/project-templates/threejs/game/scenes/.gitkeep +0 -0
- package/project-templates/threejs/globals.d.ts +51 -0
- package/project-templates/threejs/index.css +34 -0
- package/project-templates/threejs/index.html +18 -0
- package/project-templates/threejs/main.ts +9 -0
- package/project-templates/threejs/package.json +79 -0
- package/project-templates/threejs/skills/README.md +52 -0
- package/project-templates/threejs/skills/_shared/agent-prep.md +136 -0
- package/project-templates/threejs/skills/_shared/requirements.txt +1 -0
- package/project-templates/threejs/skills/_shared/scripts/build-evidence-gate.mjs +87 -0
- package/project-templates/threejs/skills/_shared/scripts/context-budget.mjs +215 -0
- package/project-templates/threejs/skills/_shared/scripts/create-playable.mjs +140 -0
- package/project-templates/threejs/skills/_shared/scripts/dev-start.mjs +151 -0
- package/project-templates/threejs/skills/_shared/scripts/disclosure-config.mjs +480 -0
- package/project-templates/threejs/skills/_shared/scripts/ensure-project.mjs +532 -0
- package/project-templates/threejs/skills/_shared/scripts/gen-placeholder-audio.py +345 -0
- package/project-templates/threejs/skills/_shared/scripts/gen-placeholder.py +244 -0
- package/project-templates/threejs/skills/_shared/scripts/harness-smoke.mjs +257 -0
- package/project-templates/threejs/skills/_shared/scripts/lib/validator-artifacts.mjs +129 -0
- package/project-templates/threejs/skills/_shared/scripts/placeholder-pack-sheet.mjs +67 -0
- package/project-templates/threejs/skills/_shared/scripts/placeholder_audio_lib.py +142 -0
- package/project-templates/threejs/skills/_shared/scripts/placeholder_lib.py +993 -0
- package/project-templates/threejs/skills/_shared/scripts/render-project-state.mjs +278 -0
- package/project-templates/threejs/skills/_shared/scripts/ring-config.mjs +252 -0
- package/project-templates/threejs/skills/_shared/scripts/skills-check.mjs +176 -0
- package/project-templates/threejs/skills/_shared/scripts/slice-set.mjs +77 -0
- package/project-templates/threejs/skills/_shared/scripts/state-advance-ring.mjs +63 -0
- package/project-templates/threejs/skills/_shared/scripts/state-get.mjs +215 -0
- package/project-templates/threejs/skills/_shared/scripts/state-handoff.mjs +120 -0
- package/project-templates/threejs/skills/_shared/scripts/state-set.mjs +113 -0
- package/project-templates/threejs/skills/_shared/scripts/state-store.mjs +893 -0
- package/project-templates/threejs/skills/_shared/scripts/sync-template-skills.mjs +112 -0
- package/project-templates/threejs/skills/_shared/scripts/verify-asset-code-sync.mjs +265 -0
- package/project-templates/threejs/skills/_shared/scripts/verify-atom-conformance.mjs +181 -0
- package/project-templates/threejs/skills/_shared/scripts/verify-env.mjs +285 -0
- package/project-templates/threejs/skills/_shared/scripts/verify-placeholders.mjs +161 -0
- package/project-templates/threejs/skills/_shared/scripts/workflow-doctor.mjs +348 -0
- package/project-templates/threejs/skills/playable-animate/SKILL.md +52 -0
- package/project-templates/threejs/skills/playable-animate/agents/openai.yaml +4 -0
- package/project-templates/threejs/skills/playable-animate/references/board-refresh.md +30 -0
- package/project-templates/threejs/skills/playable-animate/references/diagnosis-checklist.md +25 -0
- package/project-templates/threejs/skills/playable-animate/references/entrance-sequencing.md +33 -0
- package/project-templates/threejs/skills/playable-animate/references/interaction-timing.md +23 -0
- package/project-templates/threejs/skills/playable-art/SKILL.md +203 -0
- package/project-templates/threejs/skills/playable-art/agents/openai.yaml +4 -0
- package/project-templates/threejs/skills/playable-art/references/alpha-postprocess.md +46 -0
- package/project-templates/threejs/skills/playable-art/references/cta-art-spec.md +59 -0
- package/project-templates/threejs/skills/playable-art/references/layout-proportions.md +30 -0
- package/project-templates/threejs/skills/playable-art/references/prompt-patterns.md +83 -0
- package/project-templates/threejs/skills/playable-art/references/reference-comparison.md +30 -0
- package/project-templates/threejs/skills/playable-art/references/sheet-import-v2.md +91 -0
- package/project-templates/threejs/skills/playable-art/scripts/build-atlas.py +332 -0
- package/project-templates/threejs/skills/playable-art/scripts/chroma-key.py +50 -0
- package/project-templates/threejs/skills/playable-art/scripts/extract-alpha-split.py +65 -0
- package/project-templates/threejs/skills/playable-art/scripts/extract-dual-bg-alpha.py +118 -0
- package/project-templates/threejs/skills/playable-art/scripts/import-gpt-art-sheets-v2.py +403 -0
- package/project-templates/threejs/skills/playable-art/scripts/import-gpt-art-sheets.py +280 -0
- package/project-templates/threejs/skills/playable-art/scripts/import-gpt-tile-sheet.py +114 -0
- package/project-templates/threejs/skills/playable-art/scripts/import_gpt_art_pipeline.py +321 -0
- package/project-templates/threejs/skills/playable-art/scripts/import_gpt_art_sheets_v2_test.py +126 -0
- package/project-templates/threejs/skills/playable-art/scripts/placeholder_common.py +98 -0
- package/project-templates/threejs/skills/playable-art/scripts/remove-bg.py +91 -0
- package/project-templates/threejs/skills/playable-art/scripts/review-processed-assets.py +468 -0
- package/project-templates/threejs/skills/playable-art/scripts/review_processed_assets_test.py +116 -0
- package/project-templates/threejs/skills/playable-art/scripts/verify-alpha-clean.py +105 -0
- package/project-templates/threejs/skills/playable-debug/SKILL.md +116 -0
- package/project-templates/threejs/skills/playable-debug/agents/openai.yaml +4 -0
- package/project-templates/threejs/skills/playable-debug/references/debug-config.md +40 -0
- package/project-templates/threejs/skills/playable-focus/SKILL.md +148 -0
- package/project-templates/threejs/skills/playable-focus/scripts/bootstrap-playground.mjs +84 -0
- package/project-templates/threejs/skills/playable-focus/scripts/extract-focus-frames.mjs +87 -0
- package/project-templates/threejs/skills/playable-focus/scripts/generate-focus-reports.mjs +121 -0
- package/project-templates/threejs/skills/playable-focus/scripts/playground.mjs +390 -0
- package/project-templates/threejs/skills/playable-focus/templates/focus-lab/frame.html +39 -0
- package/project-templates/threejs/skills/playable-focus/templates/focus-lab/harness/clean-stage.js +114 -0
- package/project-templates/threejs/skills/playable-focus/templates/focus-lab/harness/frame-lab-scene.js +94 -0
- package/project-templates/threejs/skills/playable-focus/templates/focus-lab/harness/particle-lab-scene.js +224 -0
- package/project-templates/threejs/skills/playable-focus/templates/focus-lab/model.html +16 -0
- package/project-templates/threejs/skills/playable-focus/templates/focus-lab/particle.html +38 -0
- package/project-templates/threejs/skills/playable-focus/templates/focus-lab/shatter.html +47 -0
- package/project-templates/threejs/skills/playable-fx-decompose/SKILL.md +212 -0
- package/project-templates/threejs/skills/playable-fx-decompose/examples.md +89 -0
- package/project-templates/threejs/skills/playable-fx-decompose/reference.md +201 -0
- package/project-templates/threejs/skills/playable-fx-decompose/requirements.txt +2 -0
- package/project-templates/threejs/skills/playable-fx-decompose/scripts/build-blank-tile-crack.py +192 -0
- package/project-templates/threejs/skills/playable-fx-decompose/scripts/fix-shard-debris-frames.py +60 -0
- package/project-templates/threejs/skills/playable-fx-decompose/scripts/generate-shard-debris.py +276 -0
- package/project-templates/threejs/skills/playable-fx-peak/SKILL.md +237 -0
- package/project-templates/threejs/skills/playable-fx-peak/requirements.txt +2 -0
- package/project-templates/threejs/skills/playable-fx-peak/scripts/fix-frame-edges.py +70 -0
- package/project-templates/threejs/skills/playable-fx-peak/scripts/repack-frame-sequence.py +526 -0
- package/project-templates/threejs/skills/playable-fx-peak/scripts/validate-frame-anchors.py +130 -0
- package/project-templates/threejs/skills/playable-placeholder/SKILL.md +239 -0
- package/project-templates/threejs/skills/playable-record/SKILL.md +166 -0
- package/project-templates/threejs/skills/playable-record/scripts/lib/build-artifact.mjs +92 -0
- package/project-templates/threejs/skills/playable-record/scripts/lib/dev-server.mjs +104 -0
- package/project-templates/threejs/skills/playable-record/scripts/lib/record-audio-bridge.js +141 -0
- package/project-templates/threejs/skills/playable-record/scripts/lib/slice-structure-verify.mjs +199 -0
- package/project-templates/threejs/skills/playable-record/scripts/record-playable.mjs +583 -0
- package/project-templates/threejs/skills/playable-record/scripts/verify-build.mjs +185 -0
- package/project-templates/threejs/skills/playable-record/scripts/verify-contract.mjs +261 -0
- package/project-templates/threejs/skills/playable-record/scripts/verify-firstwin.mjs +398 -0
- package/project-templates/threejs/skills/playable-record/scripts/verify-fusion.mjs +320 -0
- package/project-templates/threejs/skills/playable-record/scripts/verify-lifecycle.mjs +78 -0
- package/project-templates/threejs/skills/playable-record/scripts/verify-slice-artist.mjs +53 -0
- package/project-templates/threejs/skills/playable-record/scripts/verify-slice-ta.mjs +53 -0
- package/project-templates/threejs/skills/playable-record/scripts/verify-slice.mjs +142 -0
- package/project-templates/threejs/skills/playable-record/scripts/verify-visual-ring.mjs +250 -0
- package/project-templates/threejs/skills/playable-record/scripts/verify-visual-ring1.mjs +190 -0
- package/project-templates/threejs/skills/playable-record/scripts/verify-vlm-video.mjs +227 -0
- package/project-templates/threejs/skills/playable-validate/SKILL.md +260 -0
- package/project-templates/threejs/skills/playable-validate/references/checklist-detail.md +36 -0
- package/project-templates/threejs/skills/playable-validate/references/single-html-bundle.md +76 -0
- package/project-templates/threejs/skills/playable-validate/validation-rules.md +200 -0
- package/project-templates/threejs/skills/playable-verify-ui/SKILL.md +295 -0
- package/project-templates/threejs/skills/playable-verify-ui/examples/asset-manifest.example.json +36 -0
- package/project-templates/threejs/skills/playable-verify-ui/examples/mahjong-match.profile.yaml +334 -0
- package/project-templates/threejs/skills/playable-verify-ui/profiles/template.profile.yaml +84 -0
- package/project-templates/threejs/skills/playable-verify-ui/reference.md +165 -0
- package/project-templates/threejs/skills/playable-verify-ui/references/phaser-patterns.md +67 -0
- package/project-templates/threejs/skills/playable-verify-ui/references/scaling-decision-tree.md +51 -0
- package/project-templates/threejs/skills/playable-verify-ui/requirements.txt +7 -0
- package/project-templates/threejs/skills/playable-verify-ui/schema/asset-manifest.schema.json +68 -0
- package/project-templates/threejs/skills/playable-verify-ui/schema/playable-ui-profile.schema.json +171 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/asset_manifest.py +231 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/lib/__init__.py +1 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/lib/config_expr.js +218 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/lib/node_utils.js +51 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/lib/profile_loader.py +59 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/lib/report.py +106 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/lib/runtime_contract.js +116 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/measure_frame_content.py +77 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/run_all.py +265 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_asset_sizes.py +77 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_assets_present.py +62 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_atlas_budget.py +84 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_atlas_frames.py +79 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_bg_clean.py +365 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_doc_asset_sync.py +90 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_fetch_antipatterns.py +59 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_game_config_load.js +54 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_hardcoded_layout.js +64 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_layout_regions.js +110 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_profile_schema.py +37 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_ring1_visual.py +211 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_runtime_contract.js +58 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_script_load_order.js +73 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_slice_plan.py +238 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_slice_plan_test.py +125 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_text_overlap.py +333 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_tile_consistency.py +323 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_vision_evidence.py +894 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_vision_evidence_test.py +122 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_visual.py +422 -0
- package/project-templates/threejs/ta-workspace/scripts/.gitkeep +0 -0
- package/project-templates/threejs/templates/artist-log.template.md +182 -0
- package/project-templates/threejs/templates/atom-tree.template.json +133 -0
- package/project-templates/threejs/templates/design-brief.template.md +92 -0
- package/project-templates/threejs/templates/design-lens-checklist.reference.md +117 -0
- package/project-templates/threejs/templates/design-methodology.md +99 -0
- package/project-templates/threejs/templates/design.template.md +50 -0
- package/project-templates/threejs/templates/developer-log.template.md +258 -0
- package/project-templates/threejs/templates/five-axis-framework.md +194 -0
- package/project-templates/threejs/templates/gen-placeholder-audio.template.mjs +63 -0
- package/project-templates/threejs/templates/gen-placeholders.template.mjs +81 -0
- package/project-templates/threejs/templates/intent-clarifications.template.md +58 -0
- package/project-templates/threejs/templates/layout-spec.template.md +198 -0
- package/project-templates/threejs/templates/plan.template.md +80 -0
- package/project-templates/threejs/templates/project-state.template.md +136 -0
- package/project-templates/threejs/templates/review-report.template.md +275 -0
- package/project-templates/threejs/templates/style-exploration.template.md +93 -0
- package/project-templates/threejs/templates/ta-log.template.md +394 -0
- package/project-templates/threejs/tsconfig.json +20 -0
- package/project-templates/threejs/vite.config.ts +27 -0
- package/dist/atom-plan/validate-atom-plan.js +0 -298
- package/project-template/.claude/agents/designer.md +0 -124
- package/project-template/.claude/agents/pm.md +0 -166
- package/project-template/.claude/agents/refs/designer-style-exploration-flow.md +0 -67
- package/project-template/.claude/agents/refs/pm-workflow-detail.md +0 -567
- package/project-template/.claude/hooks/validate-atom-plan.mjs +0 -224
- package/project-template/.claude/skills/playcraft-workflow/SKILL.md +0 -485
- package/project-template/docs/team/atom-plan-format.md +0 -173
- package/project-template/templates/atom-plan.template.json +0 -44
- package/project-template/templates/atom-plan.template.md +0 -108
- /package/dist/{atom-plan → asr}/validate-asr-coverage.js +0 -0
- /package/{project-template → engine-packs/phaser}/game/config/.gitkeep +0 -0
- /package/{project-template → engine-packs/phaser}/game/gameplay/.gitkeep +0 -0
- /package/{project-template → engine-packs/phaser}/game/scenes/.gitkeep +0 -0
- /package/project-template/.claude/agents/refs/{designer-art-style-catalog.md → artist-art-style-catalog.md} +0 -0
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// gen-batch-sprite.template.mjs — gpt-image-2 精灵图直出脚本模板
|
|
3
|
+
//
|
|
4
|
+
// 核心原则:让 gpt-image-2 一次 API 调用直接生成包含多个元素的
|
|
5
|
+
// 网格精灵图,然后用 sprite-split 切分。比逐个生成效率高 N 倍。
|
|
6
|
+
//
|
|
7
|
+
// 适用场景:
|
|
8
|
+
// - 卡牌(扑克/麻将/游戏卡):一批 13 张以内
|
|
9
|
+
// - 图标集:一批 9-16 张以内
|
|
10
|
+
// - 数字/字母贴图:一批 ≤16 个
|
|
11
|
+
//
|
|
12
|
+
// 使用方式:
|
|
13
|
+
// 1. cp .claude/skills/playcraft-image-generation/reference/gen-batch-sprite.template.mjs ta-workspace/scripts/gen-<name>-sprite.mjs
|
|
14
|
+
// 2. 修改下方 CONFIG 和 BATCHES 区域
|
|
15
|
+
// 3. node ta-workspace/scripts/gen-<name>-sprite.mjs
|
|
16
|
+
// ============================================================
|
|
17
|
+
|
|
18
|
+
import { execFileSync } from 'child_process';
|
|
19
|
+
import { existsSync, mkdirSync, appendFileSync, copyFileSync } from 'fs';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Run the `playcraft` CLI with an argv ARRAY (never a shell string), so prompts
|
|
23
|
+
* and paths containing $(), backticks, quotes, spaces, backslashes, etc. are
|
|
24
|
+
* passed verbatim and cannot be reinterpreted by a shell.
|
|
25
|
+
* - capture:true → returns stdout (utf8); otherwise inherits stdio.
|
|
26
|
+
*/
|
|
27
|
+
function playcraft(args, { capture = false, timeout } = {}) {
|
|
28
|
+
return execFileSync('playcraft', args, {
|
|
29
|
+
...(capture ? { encoding: 'utf8' } : { stdio: 'inherit' }),
|
|
30
|
+
...(timeout ? { timeout } : {}),
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// ============ CONFIG — 修改这里 ============
|
|
35
|
+
const CONFIG = {
|
|
36
|
+
/**
|
|
37
|
+
* 精灵图直出模型:永远用 gpt-image-2(图像理解 + 布局能力最强)
|
|
38
|
+
* mulerouter 质量更高(建议作为主模型),iegg 更快(备用)
|
|
39
|
+
* 注意:精灵图生成比单图慢,通常需要 90-150s,timeout 设 240 以上
|
|
40
|
+
*/
|
|
41
|
+
model: 'mulerouter/gpt-image-2',
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* 每批精灵图的列数
|
|
45
|
+
* 行数由 items.length / columns 自动计算。
|
|
46
|
+
* 推荐:每批 ≤16 个元素(如 columns=4 则每批最多 4 行),超过会出现混乱。
|
|
47
|
+
*/
|
|
48
|
+
columns: 4,
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* 宽高比:根据 columns/rows 比例选择
|
|
52
|
+
* - 1:1 → 4×4 方形网格
|
|
53
|
+
* - 3:2 → 4×3 横向网格(4列3行)
|
|
54
|
+
* - 2:3 → 3×4 纵向网格(3列4行)
|
|
55
|
+
* - 16:9 → 适合宽横向布局
|
|
56
|
+
*/
|
|
57
|
+
aspectRatio: '1:1',
|
|
58
|
+
|
|
59
|
+
/** 生成的精灵图输出目录 */
|
|
60
|
+
sheetDir: 'assets/gen/sheets',
|
|
61
|
+
/** sprite-split 切分后的单图输出目录 */
|
|
62
|
+
outputDir: 'assets/images/batch',
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* 通用风格描述(追加到每个批次 prompt 末尾)
|
|
66
|
+
*
|
|
67
|
+
* 元素需要透明背景(独立元素:角色/车/道具/图标)→ 绿幕策略:
|
|
68
|
+
* style: 'flat 2D illustration, isolated on solid bright green #00FF00 background, centered, no shadow'
|
|
69
|
+
* removeBg: true (切分后逐帧去背景)
|
|
70
|
+
*
|
|
71
|
+
* 元素本身就是矩形(卡牌/棋子/UI 面板)→ 白底策略:
|
|
72
|
+
* style: 'flat 2D, white background, no shadow, no drop shadow, clean edges'
|
|
73
|
+
* removeBg: false
|
|
74
|
+
*/
|
|
75
|
+
style: 'flat 2D illustration, isolated on solid bright green #00FF00 background, centered, no shadow',
|
|
76
|
+
/**
|
|
77
|
+
* 切分后是否对每帧执行 remove-background(绿幕去背景)
|
|
78
|
+
* true → 独立元素(需透明通道):remove-background --tolerance 25
|
|
79
|
+
* false → 卡牌/UI 面板等矩形元素:直接 resize,不去背景
|
|
80
|
+
*/
|
|
81
|
+
removeBg: true,
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* 切分单元尺寸(像素)。留空(null)= 自动按精灵图实际像素尺寸 ÷ 网格推导(推荐)。
|
|
85
|
+
* 仅当模型输出的格子并非均匀均分、需要手动指定时才填写。
|
|
86
|
+
* ⚠️ 不要写死 256:4K 精灵图按 256 切分会严重错位。
|
|
87
|
+
*/
|
|
88
|
+
cellWidth: null,
|
|
89
|
+
cellHeight: null,
|
|
90
|
+
/** 帧间距(像素),默认 0 */
|
|
91
|
+
padding: 0,
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
// ============ DATA — 分批定义元素 ============
|
|
95
|
+
// 规则:每批 ≤ CONFIG.columns × CONFIG.rows 个元素
|
|
96
|
+
// 每个元素必须有 name(输出文件名)和 desc(精灵图中该格的内容描述)
|
|
97
|
+
const BATCHES = [
|
|
98
|
+
{
|
|
99
|
+
sheetName: 'sheet_batch_1',
|
|
100
|
+
items: [
|
|
101
|
+
{ name: 'item_01', desc: '<格 1 内容描述>' },
|
|
102
|
+
{ name: 'item_02', desc: '<格 2 内容描述>' },
|
|
103
|
+
{ name: 'item_03', desc: '<格 3 内容描述>' },
|
|
104
|
+
{ name: 'item_04', desc: '<格 4 内容描述>' },
|
|
105
|
+
// 最多 CONFIG.columns × CONFIG.rows 个
|
|
106
|
+
],
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
sheetName: 'sheet_batch_2',
|
|
110
|
+
items: [
|
|
111
|
+
{ name: 'item_05', desc: '<格 5 内容描述>' },
|
|
112
|
+
{ name: 'item_06', desc: '<格 6 内容描述>' },
|
|
113
|
+
// ...
|
|
114
|
+
],
|
|
115
|
+
},
|
|
116
|
+
// 继续添加批次...
|
|
117
|
+
];
|
|
118
|
+
|
|
119
|
+
// ============ 精灵图 Prompt 构建器 ============
|
|
120
|
+
/**
|
|
121
|
+
* 根据 items 列表构建精灵图网格 prompt
|
|
122
|
+
* 关键词组合让 gpt-image-2 理解"网格布局"意图
|
|
123
|
+
*/
|
|
124
|
+
/**
|
|
125
|
+
* 读取精灵图实际像素尺寸(用于自动推导切分单元尺寸)。
|
|
126
|
+
* 失败返回 null,由调用方决定是否中止该批次。
|
|
127
|
+
*/
|
|
128
|
+
function readSheetDims(sheetPath) {
|
|
129
|
+
try {
|
|
130
|
+
const out = playcraft(['image', 'info', '--input', sheetPath, '--json'], { capture: true });
|
|
131
|
+
const meta = JSON.parse(out.slice(out.indexOf('{')));
|
|
132
|
+
if (typeof meta.width === 'number' && typeof meta.height === 'number') {
|
|
133
|
+
return { width: meta.width, height: meta.height };
|
|
134
|
+
}
|
|
135
|
+
} catch {
|
|
136
|
+
// fall through → null
|
|
137
|
+
}
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function buildSpriteSheetPrompt(items, columns, style, removeBg) {
|
|
142
|
+
const actualRows = Math.ceil(items.length / columns);
|
|
143
|
+
const cellDescs = items.map((item, i) => {
|
|
144
|
+
const col = (i % columns) + 1;
|
|
145
|
+
const row = Math.floor(i / columns) + 1;
|
|
146
|
+
return `[Row${row},Col${col}]: ${item.desc}`;
|
|
147
|
+
}).join('; ');
|
|
148
|
+
|
|
149
|
+
// 绿幕模式强制在 prompt 里明确背景色,避免模型用白底
|
|
150
|
+
const bgInstruction = removeBg
|
|
151
|
+
? 'Each element isolated on solid bright green #00FF00 background, no shadow, no gradient background.'
|
|
152
|
+
: 'Each element on clean white background.';
|
|
153
|
+
|
|
154
|
+
return [
|
|
155
|
+
`Sprite sheet grid layout, ${columns} columns × ${actualRows} rows.`,
|
|
156
|
+
`Each cell contains one element. Cell contents: ${cellDescs}.`,
|
|
157
|
+
bgInstruction,
|
|
158
|
+
`Grid layout, uniform cell size, equal spacing, elements perfectly centered in each cell.`,
|
|
159
|
+
`No borders between cells, no labels, no numbers on cells.`,
|
|
160
|
+
style,
|
|
161
|
+
].join(' ');
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// ============ LOGIC — 通常不需要修改 ============
|
|
165
|
+
|
|
166
|
+
const LOG_FILE = 'ta-workspace/logs/gen-batch-sprite.log';
|
|
167
|
+
mkdirSync(CONFIG.sheetDir, { recursive: true });
|
|
168
|
+
mkdirSync(CONFIG.outputDir, { recursive: true });
|
|
169
|
+
mkdirSync('ta-workspace/logs', { recursive: true });
|
|
170
|
+
|
|
171
|
+
function log(msg) {
|
|
172
|
+
const line = `[${new Date().toISOString()}] ${msg}`;
|
|
173
|
+
console.log(line);
|
|
174
|
+
appendFileSync(LOG_FILE, line + '\n');
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const totalElements = BATCHES.reduce((s, b) => s + b.items.length, 0);
|
|
178
|
+
log(`=== Batch Sprite Generation Start ===`);
|
|
179
|
+
log(`Total: ${BATCHES.length} batches, ${totalElements} elements`);
|
|
180
|
+
log(`Model: ${CONFIG.model}`);
|
|
181
|
+
|
|
182
|
+
let doneBatches = 0, failedBatches = 0;
|
|
183
|
+
|
|
184
|
+
for (let bi = 0; bi < BATCHES.length; bi++) {
|
|
185
|
+
const batch = BATCHES[bi];
|
|
186
|
+
const sheetPath = `${CONFIG.sheetDir}/${batch.sheetName}.png`;
|
|
187
|
+
|
|
188
|
+
// ── Step 1: 生成精灵图(幂等跳过)────────────────────────────────
|
|
189
|
+
if (existsSync(sheetPath)) {
|
|
190
|
+
log(`[SKIP-SHEET] (${bi + 1}/${BATCHES.length}) ${batch.sheetName} already exists`);
|
|
191
|
+
} else {
|
|
192
|
+
log(`[GEN-SHEET ] (${bi + 1}/${BATCHES.length}) Generating ${batch.sheetName} (${batch.items.length} elements)`);
|
|
193
|
+
const prompt = buildSpriteSheetPrompt(batch.items, CONFIG.columns, CONFIG.style, CONFIG.removeBg);
|
|
194
|
+
|
|
195
|
+
try {
|
|
196
|
+
playcraft(
|
|
197
|
+
[
|
|
198
|
+
'tools', 'generate-image',
|
|
199
|
+
'--prompt', prompt,
|
|
200
|
+
'--output', sheetPath,
|
|
201
|
+
'--aspect-ratio', CONFIG.aspectRatio,
|
|
202
|
+
'--image-model', CONFIG.model,
|
|
203
|
+
'--timeout', '240',
|
|
204
|
+
],
|
|
205
|
+
{ timeout: 300_000 },
|
|
206
|
+
);
|
|
207
|
+
log(`[OK-SHEET ] ${batch.sheetName}`);
|
|
208
|
+
} catch (e) {
|
|
209
|
+
log(`[FAIL-SHEET] ${batch.sheetName}: ${e.message?.slice(0, 200)}`);
|
|
210
|
+
failedBatches++;
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// ── Step 2: sprite-split 切分精灵图 ──────────────────────────────
|
|
216
|
+
const actualRows = Math.ceil(batch.items.length / CONFIG.columns);
|
|
217
|
+
// 检查第一个切分结果是否已存在(幂等)
|
|
218
|
+
const firstItemPath = `${CONFIG.outputDir}/${batch.items[0]?.name}.png`;
|
|
219
|
+
if (batch.items[0] && existsSync(firstItemPath)) {
|
|
220
|
+
log(`[SKIP-SPLIT] ${batch.sheetName} already split`);
|
|
221
|
+
doneBatches++;
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// 切分单元尺寸:优先用 CONFIG 显式值;否则按精灵图实际像素尺寸 ÷ 网格自动推导。
|
|
226
|
+
// ⚠️ 绝不写死 256——4K 精灵图按 256 切分会严重错位(test11 类事故)。
|
|
227
|
+
const padding = CONFIG.padding ?? 0;
|
|
228
|
+
let cellWidth = CONFIG.cellWidth;
|
|
229
|
+
let cellHeight = CONFIG.cellHeight;
|
|
230
|
+
if (cellWidth == null || cellHeight == null) {
|
|
231
|
+
const dims = readSheetDims(sheetPath);
|
|
232
|
+
if (!dims) {
|
|
233
|
+
log(
|
|
234
|
+
`[FAIL-SPLIT] ${batch.sheetName}: 无法读取精灵图尺寸,请在 CONFIG 显式设置 cellWidth/cellHeight`,
|
|
235
|
+
);
|
|
236
|
+
failedBatches++;
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
239
|
+
// 去掉帧间距后按网格均分
|
|
240
|
+
cellWidth ??= Math.floor((dims.width - padding * (CONFIG.columns - 1)) / CONFIG.columns);
|
|
241
|
+
cellHeight ??= Math.floor((dims.height - padding * (actualRows - 1)) / actualRows);
|
|
242
|
+
log(
|
|
243
|
+
`[CELL-SIZE ] ${batch.sheetName}: sheet ${dims.width}×${dims.height} → cell ${cellWidth}×${cellHeight} (grid ${CONFIG.columns}×${actualRows}, padding ${padding})`,
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
if (!(cellWidth > 0 && cellHeight > 0)) {
|
|
247
|
+
log(`[FAIL-SPLIT] ${batch.sheetName}: 推导出的 cell 尺寸非法 (${cellWidth}×${cellHeight})`);
|
|
248
|
+
failedBatches++;
|
|
249
|
+
continue;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
log(`[SPLIT ] Splitting ${batch.sheetName} (${CONFIG.columns}×${actualRows}, cell ${cellWidth}×${cellHeight})`);
|
|
253
|
+
const splitDir = `ta-workspace/tmp/${batch.sheetName}`;
|
|
254
|
+
|
|
255
|
+
try {
|
|
256
|
+
playcraft([
|
|
257
|
+
'image', 'sprite-split',
|
|
258
|
+
'--input', sheetPath,
|
|
259
|
+
'--output-dir', splitDir,
|
|
260
|
+
'--rows', String(actualRows),
|
|
261
|
+
'--columns', String(CONFIG.columns),
|
|
262
|
+
'--frame-width', String(cellWidth),
|
|
263
|
+
'--frame-height', String(cellHeight),
|
|
264
|
+
'--padding', String(padding),
|
|
265
|
+
]);
|
|
266
|
+
} catch (e) {
|
|
267
|
+
log(`[FAIL-SPLIT] ${batch.sheetName}: ${e.message?.slice(0, 200)}`);
|
|
268
|
+
failedBatches++;
|
|
269
|
+
continue;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// ── Step 3: 重命名(+可选绿幕去背景)切分结果到最终位置 ─────────
|
|
273
|
+
// 任何缺帧 / 处理失败都视为该批次失败(FAIL,不是 WARN):一个不完整的
|
|
274
|
+
// 批次绝不能被报成 OK-BATCH,否则下游会拿到缺图的资产集。
|
|
275
|
+
log(`[RENAME ] Renaming ${batch.items.length} cells${CONFIG.removeBg ? ' + remove-background' : ''}`);
|
|
276
|
+
let processedOk = 0;
|
|
277
|
+
let batchFailed = false;
|
|
278
|
+
for (let j = 0; j < batch.items.length; j++) {
|
|
279
|
+
const item = batch.items[j];
|
|
280
|
+
const row = Math.floor(j / CONFIG.columns);
|
|
281
|
+
const col = j % CONFIG.columns;
|
|
282
|
+
// sprite-split 默认命名:frame_r{row}_c{col}.png(0-indexed)
|
|
283
|
+
const srcPath = `${splitDir}/frame_r${row}_c${col}.png`;
|
|
284
|
+
const dstPath = `${CONFIG.outputDir}/${item.name}.png`;
|
|
285
|
+
|
|
286
|
+
if (!existsSync(srcPath)) {
|
|
287
|
+
log(`[FAIL-CELL ] Expected cell not found: ${srcPath} (item ${item.name}, index ${j}/${batch.items.length})`);
|
|
288
|
+
batchFailed = true;
|
|
289
|
+
continue;
|
|
290
|
+
}
|
|
291
|
+
try {
|
|
292
|
+
if (CONFIG.removeBg) {
|
|
293
|
+
// 绿幕去背景(tolerance 25 适合纯绿色 #00FF00 背景)
|
|
294
|
+
playcraft([
|
|
295
|
+
'image', 'remove-background',
|
|
296
|
+
'--input', srcPath,
|
|
297
|
+
'--output', dstPath,
|
|
298
|
+
'--tolerance', '25',
|
|
299
|
+
]);
|
|
300
|
+
} else {
|
|
301
|
+
copyFileSync(srcPath, dstPath);
|
|
302
|
+
}
|
|
303
|
+
processedOk++;
|
|
304
|
+
} catch (e) {
|
|
305
|
+
log(`[FAIL-CELL ] Failed to process ${srcPath} → ${dstPath}: ${e.message?.slice(0, 120)}`);
|
|
306
|
+
batchFailed = true;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
if (batchFailed) {
|
|
311
|
+
log(`[FAIL-BATCH] (${bi + 1}/${BATCHES.length}) ${batch.sheetName} → only ${processedOk}/${batch.items.length} cells OK (see FAIL-CELL above)`);
|
|
312
|
+
failedBatches++;
|
|
313
|
+
} else {
|
|
314
|
+
log(`[OK-BATCH ] (${bi + 1}/${BATCHES.length}) ${batch.sheetName} → ${batch.items.length} files`);
|
|
315
|
+
doneBatches++;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
log(`\n=== Complete: Done=${doneBatches} Failed=${failedBatches}/${BATCHES.length} batches ===`);
|
|
320
|
+
log(`Output: ${CONFIG.outputDir}`);
|
|
321
|
+
if (failedBatches > 0) {
|
|
322
|
+
log('Re-run to retry failed batches (successful batches will be skipped)');
|
|
323
|
+
process.exit(1);
|
|
324
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// gen-batch.template.mjs — 批量 AI 生图脚本模板
|
|
3
|
+
// 用途:从零批量生成一组风格一致的素材(reference-image 模式)
|
|
4
|
+
//
|
|
5
|
+
// 使用方式:
|
|
6
|
+
// 1. cp .claude/skills/playcraft-image-generation/reference/gen-batch.template.mjs ta-workspace/scripts/gen-<name>.mjs
|
|
7
|
+
// 2. 修改下方 CONFIG 和 ITEMS 区域
|
|
8
|
+
// 3. node ta-workspace/scripts/gen-<name>.mjs
|
|
9
|
+
// ============================================================
|
|
10
|
+
|
|
11
|
+
import { execSync } from 'child_process';
|
|
12
|
+
import { existsSync, mkdirSync, appendFileSync } from 'fs';
|
|
13
|
+
|
|
14
|
+
// ============ CONFIG — 修改这里 ============
|
|
15
|
+
const CONFIG = {
|
|
16
|
+
/**
|
|
17
|
+
* 生图模型。
|
|
18
|
+
* - Phase 1 概念图(追求质量):用 gpt-image-2
|
|
19
|
+
* model: 'iegg-litellm/gpt-image-2'
|
|
20
|
+
* - Phase 2 批量(reference-image 一致性):用 google/,更稳定
|
|
21
|
+
* model: 'google/gemini-3.1-flash-image-preview'
|
|
22
|
+
*
|
|
23
|
+
* 后端按优先级自动 fallback 多个 provider,无需手动指定 provider。
|
|
24
|
+
* text+image CAPABILITY 的模型才支持 --reference-image
|
|
25
|
+
*/
|
|
26
|
+
model: 'google/gemini-3.1-flash-image-preview',
|
|
27
|
+
/** 概念图路径(确认过风格的样本,所有后续图的参考来源) */
|
|
28
|
+
referenceImage: 'assets/images/concept/approved_sample.png',
|
|
29
|
+
/** 输出目录 */
|
|
30
|
+
outputDir: 'assets/images/batch',
|
|
31
|
+
/** 图片比例 */
|
|
32
|
+
aspectRatio: '1:1',
|
|
33
|
+
/**
|
|
34
|
+
* 统一风格描述(从 design-brief.md 复制,粘贴到每个 prompt 末尾)
|
|
35
|
+
* 示例:"flat 2D icon, vibrant colors, clean edges, white background, no shadow"
|
|
36
|
+
*/
|
|
37
|
+
style: '<从 design-brief 复制的统一风格描述>',
|
|
38
|
+
};
|
|
39
|
+
// ============ DATA — 定义要生成的素材列表 ============
|
|
40
|
+
const ITEMS = [
|
|
41
|
+
{ name: 'item_01', desc: '<素材描述 1>' },
|
|
42
|
+
{ name: 'item_02', desc: '<素材描述 2>' },
|
|
43
|
+
// 继续添加...
|
|
44
|
+
];
|
|
45
|
+
// ============ LOGIC — 通常不需要修改 ============
|
|
46
|
+
|
|
47
|
+
const LOG_FILE = 'ta-workspace/logs/gen-batch.log';
|
|
48
|
+
mkdirSync(CONFIG.outputDir, { recursive: true });
|
|
49
|
+
mkdirSync('ta-workspace/logs', { recursive: true });
|
|
50
|
+
|
|
51
|
+
function log(msg) {
|
|
52
|
+
const line = `[${new Date().toISOString()}] ${msg}`;
|
|
53
|
+
console.log(line);
|
|
54
|
+
appendFileSync(LOG_FILE, line + '\n');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
log(`=== Batch Generation Start ===`);
|
|
58
|
+
log(`Total: ${ITEMS.length} | Model: ${CONFIG.model}`);
|
|
59
|
+
|
|
60
|
+
let done = 0, skipped = 0, failed = 0;
|
|
61
|
+
const failures = [];
|
|
62
|
+
|
|
63
|
+
for (let i = 0; i < ITEMS.length; i++) {
|
|
64
|
+
const item = ITEMS[i];
|
|
65
|
+
const outPath = `${CONFIG.outputDir}/${item.name}.png`;
|
|
66
|
+
|
|
67
|
+
if (existsSync(outPath)) {
|
|
68
|
+
log(`[SKIP] (${i + 1}/${ITEMS.length}) ${item.name}`);
|
|
69
|
+
skipped++;
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
log(`[GEN ] (${i + 1}/${ITEMS.length}) ${item.name}`);
|
|
74
|
+
|
|
75
|
+
const promptEscaped = `${item.desc}. ${CONFIG.style}`.replace(/"/g, '\\"');
|
|
76
|
+
const cmd =
|
|
77
|
+
`playcraft tools generate-image` +
|
|
78
|
+
` --prompt "${promptEscaped}"` +
|
|
79
|
+
` --output "${outPath}"` +
|
|
80
|
+
` --aspect-ratio ${CONFIG.aspectRatio}` +
|
|
81
|
+
` --reference-image "${CONFIG.referenceImage}"` +
|
|
82
|
+
` --image-model "${CONFIG.model}"`;
|
|
83
|
+
|
|
84
|
+
try {
|
|
85
|
+
execSync(cmd, { stdio: 'inherit', timeout: 120_000 });
|
|
86
|
+
done++;
|
|
87
|
+
log(`[OK ] ${item.name}`);
|
|
88
|
+
} catch (e) {
|
|
89
|
+
log(`[FAIL] ${item.name}: ${e.message?.slice(0, 100)}`);
|
|
90
|
+
failures.push(item.name);
|
|
91
|
+
failed++;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
log(`\n=== Complete: Done=${done} Skipped=${skipped} Failed=${failed}/${ITEMS.length} ===`);
|
|
96
|
+
if (failures.length > 0) log(`Failed: ${failures.join(', ')}`);
|
|
97
|
+
if (failed > 0) process.exit(1);
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// gen-edit-variants.template.mjs — 基图 + Edit 模型生成变体脚本模板
|
|
3
|
+
// 用途:先用高质量模型生成 1 张完美基图,再用 edit 模型批量修改出一组变体
|
|
4
|
+
//
|
|
5
|
+
// 适用场景:结构相同、只改局部的变体集合
|
|
6
|
+
// - 扑克牌(换花色/换数字)
|
|
7
|
+
// - 棋子系列(换颜色/换图案)
|
|
8
|
+
// - 图标集(换内容符号)
|
|
9
|
+
//
|
|
10
|
+
// 使用方式:
|
|
11
|
+
// 1. cp .claude/skills/playcraft-image-generation/reference/gen-edit-variants.template.mjs ta-workspace/scripts/gen-<name>-variants.mjs
|
|
12
|
+
// 2. Phase 1:先手动生成基图(见下方说明),存为 CONFIG.baseImage 路径
|
|
13
|
+
// 3. 填写 CONFIG 和 VARIANTS,然后 node ta-workspace/scripts/gen-<name>-variants.mjs
|
|
14
|
+
//
|
|
15
|
+
// Edit 模型决策(按优先级):
|
|
16
|
+
// 1. mulerouter/qwen-image-edit-max — 纯 edit,局部修改能力最强
|
|
17
|
+
// 2. mulerouter/gpt-image-2 — 有图走 /edit 端点,质量高
|
|
18
|
+
// 3. mulerouter/wan2.6-image — 图生图,回退选项
|
|
19
|
+
// ============================================================
|
|
20
|
+
|
|
21
|
+
import { execSync } from 'child_process';
|
|
22
|
+
import { existsSync, mkdirSync, appendFileSync } from 'fs';
|
|
23
|
+
|
|
24
|
+
// ============ CONFIG — 修改这里 ============
|
|
25
|
+
const CONFIG = {
|
|
26
|
+
/**
|
|
27
|
+
* Phase 1 基图路径(必须已存在)
|
|
28
|
+
* 生成基图的命令示例(gpt-image-2 质量最高,双 provider 回退):
|
|
29
|
+
* playcraft tools generate-image \
|
|
30
|
+
* --prompt "A playing card: Ace of Spades. [完整风格描述]" \
|
|
31
|
+
* --output assets/images/cards/base_ace_spades.png \
|
|
32
|
+
* --aspect-ratio 3:4 \
|
|
33
|
+
* --image-model iegg-litellm/gpt-image-2
|
|
34
|
+
*/
|
|
35
|
+
baseImage: 'assets/images/cards/base_ace_spades.png',
|
|
36
|
+
/** Edit 模型(qwen-image-edit-max 局部修改能力最强) */
|
|
37
|
+
editModel: 'mulerouter/qwen-image-edit-max',
|
|
38
|
+
/** 输出目录 */
|
|
39
|
+
outputDir: 'assets/images/cards',
|
|
40
|
+
/** 图片比例(建议与基图相同) */
|
|
41
|
+
aspectRatio: '3:4',
|
|
42
|
+
};
|
|
43
|
+
// ============ DATA — 定义要生成的变体列表 ============
|
|
44
|
+
// editPrompt 应该描述"修改指令"而不是"完整重新描述"
|
|
45
|
+
// 好的写法:'Change the rank symbol from A to 2, show two spade symbols in center'
|
|
46
|
+
// 差的写法:'A playing card with two spade symbols...'(这是重新生成,不是编辑)
|
|
47
|
+
const VARIANTS = [
|
|
48
|
+
{
|
|
49
|
+
name: 'spades_2',
|
|
50
|
+
editPrompt: 'Change the rank symbol from A to 2. Show two spade suit symbols in center.',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'spades_3',
|
|
54
|
+
editPrompt: 'Change the rank symbol from A to 3. Show three spade suit symbols in center.',
|
|
55
|
+
},
|
|
56
|
+
// 继续添加变体...
|
|
57
|
+
];
|
|
58
|
+
// ============ LOGIC — 通常不需要修改 ============
|
|
59
|
+
|
|
60
|
+
const LOG_FILE = 'ta-workspace/logs/gen-edit-variants.log';
|
|
61
|
+
mkdirSync(CONFIG.outputDir, { recursive: true });
|
|
62
|
+
mkdirSync('ta-workspace/logs', { recursive: true });
|
|
63
|
+
|
|
64
|
+
function log(msg) {
|
|
65
|
+
const line = `[${new Date().toISOString()}] ${msg}`;
|
|
66
|
+
console.log(line);
|
|
67
|
+
appendFileSync(LOG_FILE, line + '\n');
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// 检查基图
|
|
71
|
+
if (!existsSync(CONFIG.baseImage)) {
|
|
72
|
+
log(`ERROR: Base image not found: ${CONFIG.baseImage}`);
|
|
73
|
+
log(`Please generate the base image first (Phase 1), then run this script.`);
|
|
74
|
+
process.exit(1);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
log(`=== Edit Variants Start ===`);
|
|
78
|
+
log(`Base: ${CONFIG.baseImage} | Model: ${CONFIG.editModel}`);
|
|
79
|
+
log(`Total variants: ${VARIANTS.length}`);
|
|
80
|
+
|
|
81
|
+
let done = 0, skipped = 0, failed = 0;
|
|
82
|
+
const failures = [];
|
|
83
|
+
|
|
84
|
+
for (let i = 0; i < VARIANTS.length; i++) {
|
|
85
|
+
const variant = VARIANTS[i];
|
|
86
|
+
const outPath = `${CONFIG.outputDir}/${variant.name}.png`;
|
|
87
|
+
|
|
88
|
+
if (existsSync(outPath)) {
|
|
89
|
+
log(`[SKIP] (${i + 1}/${VARIANTS.length}) ${variant.name}`);
|
|
90
|
+
skipped++;
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
log(`[EDIT] (${i + 1}/${VARIANTS.length}) ${variant.name}: ${variant.editPrompt.slice(0, 60)}...`);
|
|
95
|
+
|
|
96
|
+
const promptEscaped = variant.editPrompt.replace(/"/g, '\\"');
|
|
97
|
+
const cmd =
|
|
98
|
+
`playcraft tools generate-image` +
|
|
99
|
+
` --prompt "${promptEscaped}"` +
|
|
100
|
+
` --output "${outPath}"` +
|
|
101
|
+
` --aspect-ratio ${CONFIG.aspectRatio}` +
|
|
102
|
+
` --reference-image "${CONFIG.baseImage}"` +
|
|
103
|
+
` --image-model "${CONFIG.editModel}"`;
|
|
104
|
+
|
|
105
|
+
try {
|
|
106
|
+
execSync(cmd, { stdio: 'inherit', timeout: 120_000 });
|
|
107
|
+
done++;
|
|
108
|
+
log(`[OK ] ${variant.name}`);
|
|
109
|
+
} catch (e) {
|
|
110
|
+
log(`[FAIL] ${variant.name}: ${e.message?.slice(0, 100)}`);
|
|
111
|
+
failures.push(variant.name);
|
|
112
|
+
failed++;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
log(`\n=== Complete: Done=${done} Skipped=${skipped} Failed=${failed}/${VARIANTS.length} ===`);
|
|
117
|
+
if (failures.length > 0) log(`Failed: ${failures.join(', ')}`);
|
|
118
|
+
if (failed > 0) process.exit(1);
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// process-batch.template.mjs — 批量图片处理脚本模板
|
|
3
|
+
// 用途:对一批图片执行去背景 / trim + resize + 验证
|
|
4
|
+
//
|
|
5
|
+
// 使用方式:
|
|
6
|
+
// 1. cp .claude/skills/playcraft-image-generation/reference/process-batch.template.mjs ta-workspace/scripts/process-<name>.mjs
|
|
7
|
+
// 2. 修改下方 CONFIG 区域(特别是 SKIP_REMOVE_BG 选项)
|
|
8
|
+
// 3. node ta-workspace/scripts/process-<name>.mjs
|
|
9
|
+
//
|
|
10
|
+
// 背景处理决策(修改 CONFIG.skipRemoveBg 前请阅读):
|
|
11
|
+
// - 独立元素(角色/道具/图标)需透明背景 → skipRemoveBg = false(默认)
|
|
12
|
+
// 建议生图时 prompt 加 "on solid bright green #00FF00 background, isolated"
|
|
13
|
+
// - 卡牌/棋子/UI面板(矩形本体不需透明)→ skipRemoveBg = true
|
|
14
|
+
// 生图时 prompt 加 "flat 2D, no shadow, no 3D effect, clean edges"
|
|
15
|
+
// ============================================================
|
|
16
|
+
|
|
17
|
+
import { execSync } from 'child_process';
|
|
18
|
+
import { readdirSync, existsSync, mkdirSync, appendFileSync, unlinkSync } from 'fs';
|
|
19
|
+
import { join, basename, extname } from 'path';
|
|
20
|
+
|
|
21
|
+
// ============ CONFIG — 修改这里 ============
|
|
22
|
+
const CONFIG = {
|
|
23
|
+
/** 输入目录(gen-batch 的输出目录) */
|
|
24
|
+
inputDir: 'assets/images/batch',
|
|
25
|
+
/** 输出目录 */
|
|
26
|
+
outputDir: 'assets/images/processed',
|
|
27
|
+
/** 临时文件目录(去背景中间结果) */
|
|
28
|
+
tmpDir: 'ta-workspace/tmp',
|
|
29
|
+
/** 目标宽度(像素) */
|
|
30
|
+
targetW: 128,
|
|
31
|
+
/** 目标高度(像素) */
|
|
32
|
+
targetH: 128,
|
|
33
|
+
/**
|
|
34
|
+
* 跳过去背景步骤
|
|
35
|
+
* - false(默认):执行 remove-background(绿幕素材/独立元素)
|
|
36
|
+
* - true:跳过,只做 trim + resize(卡牌/棋子等矩形本体素材)
|
|
37
|
+
*/
|
|
38
|
+
skipRemoveBg: false,
|
|
39
|
+
/**
|
|
40
|
+
* floodfill 容差(0–255)
|
|
41
|
+
* 绿幕背景建议 25;默认白背景可用 15
|
|
42
|
+
* 仅在 skipRemoveBg = false 时生效
|
|
43
|
+
*/
|
|
44
|
+
removeBgTolerance: 25,
|
|
45
|
+
/** resize 时的 fit 模式:contain / cover / fill / inside / outside */
|
|
46
|
+
resizeFit: 'contain',
|
|
47
|
+
};
|
|
48
|
+
// ============ LOGIC — 通常不需要修改 ============
|
|
49
|
+
|
|
50
|
+
const LOG_FILE = 'ta-workspace/logs/process-batch.log';
|
|
51
|
+
mkdirSync(CONFIG.outputDir, { recursive: true });
|
|
52
|
+
mkdirSync(CONFIG.tmpDir, { recursive: true });
|
|
53
|
+
mkdirSync('ta-workspace/logs', { recursive: true });
|
|
54
|
+
|
|
55
|
+
function log(msg) {
|
|
56
|
+
const line = `[${new Date().toISOString()}] ${msg}`;
|
|
57
|
+
console.log(line);
|
|
58
|
+
appendFileSync(LOG_FILE, line + '\n');
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const SUPPORTED_EXTS = new Set(['.png', '.jpg', '.jpeg', '.webp']);
|
|
62
|
+
const files = readdirSync(CONFIG.inputDir)
|
|
63
|
+
.filter(f => SUPPORTED_EXTS.has(extname(f).toLowerCase()))
|
|
64
|
+
.sort()
|
|
65
|
+
.map(f => join(CONFIG.inputDir, f));
|
|
66
|
+
|
|
67
|
+
log(`=== Batch Processing Start ===`);
|
|
68
|
+
log(`Files: ${files.length} | skipRemoveBg: ${CONFIG.skipRemoveBg} | Target: ${CONFIG.targetW}x${CONFIG.targetH}`);
|
|
69
|
+
|
|
70
|
+
let done = 0, skipped = 0, failed = 0;
|
|
71
|
+
const failures = [];
|
|
72
|
+
|
|
73
|
+
for (let i = 0; i < files.length; i++) {
|
|
74
|
+
const inputPath = files[i];
|
|
75
|
+
const name = basename(inputPath, extname(inputPath));
|
|
76
|
+
const outPath = join(CONFIG.outputDir, `${name}.png`);
|
|
77
|
+
|
|
78
|
+
if (existsSync(outPath)) {
|
|
79
|
+
log(`[SKIP] (${i + 1}/${files.length}) ${name}`);
|
|
80
|
+
skipped++;
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
log(`[PROC] (${i + 1}/${files.length}) ${name}`);
|
|
85
|
+
|
|
86
|
+
try {
|
|
87
|
+
if (CONFIG.skipRemoveBg) {
|
|
88
|
+
// 卡牌/棋子等矩形本体:直接 resize(不需要去背景)
|
|
89
|
+
execSync(
|
|
90
|
+
`playcraft image resize` +
|
|
91
|
+
` --input "${inputPath}"` +
|
|
92
|
+
` --output "${outPath}"` +
|
|
93
|
+
` --width ${CONFIG.targetW}` +
|
|
94
|
+
` --height ${CONFIG.targetH}` +
|
|
95
|
+
` --fit ${CONFIG.resizeFit}`,
|
|
96
|
+
{ stdio: 'inherit' },
|
|
97
|
+
);
|
|
98
|
+
} else {
|
|
99
|
+
// 独立元素:先去背景,再 resize
|
|
100
|
+
const tmpNobg = join(CONFIG.tmpDir, `${name}_nobg.png`);
|
|
101
|
+
|
|
102
|
+
// 步骤 1:去背景(绿幕 tolerance=25 效果最好)
|
|
103
|
+
execSync(
|
|
104
|
+
`playcraft image remove-background` +
|
|
105
|
+
` --input "${inputPath}"` +
|
|
106
|
+
` --output "${tmpNobg}"` +
|
|
107
|
+
` --tolerance ${CONFIG.removeBgTolerance}`,
|
|
108
|
+
{ stdio: 'inherit' },
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
// 步骤 2:resize 到目标尺寸
|
|
112
|
+
execSync(
|
|
113
|
+
`playcraft image resize` +
|
|
114
|
+
` --input "${tmpNobg}"` +
|
|
115
|
+
` --output "${outPath}"` +
|
|
116
|
+
` --width ${CONFIG.targetW}` +
|
|
117
|
+
` --height ${CONFIG.targetH}` +
|
|
118
|
+
` --fit ${CONFIG.resizeFit}`,
|
|
119
|
+
{ stdio: 'inherit' },
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
// 清理临时文件
|
|
123
|
+
if (existsSync(tmpNobg)) unlinkSync(tmpNobg);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
log(`[OK ] ${name}`);
|
|
127
|
+
done++;
|
|
128
|
+
} catch (e) {
|
|
129
|
+
log(`[FAIL] ${name}: ${e.message?.slice(0, 100)}`);
|
|
130
|
+
failures.push(name);
|
|
131
|
+
failed++;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
log(`\n=== Complete: Done=${done} Skipped=${skipped} Failed=${failed}/${files.length} ===`);
|
|
136
|
+
if (failures.length > 0) log(`Failed: ${failures.join(', ')}`);
|
|
137
|
+
if (failed > 0) process.exit(1);
|