@playcraft/cli 0.0.44 → 0.0.47
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 +18 -4
- 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/__pycache__/placeholder_audio_lib.cpython-311.pyc +0 -0
- package/project-template/skills/_shared/scripts/__pycache__/placeholder_lib.cpython-311.pyc +0 -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/__pycache__/import-gpt-art-sheets-v2.cpython-311.pyc +0 -0
- package/project-template/skills/playable-art/scripts/__pycache__/import_gpt_art_pipeline.cpython-311.pyc +0 -0
- package/project-template/skills/playable-art/scripts/__pycache__/review-processed-assets.cpython-311.pyc +0 -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/__pycache__/asset_manifest.cpython-311.pyc +0 -0
- package/project-template/skills/playable-verify-ui/scripts/__pycache__/verify_slice_plan.cpython-311.pyc +0 -0
- package/project-template/skills/playable-verify-ui/scripts/__pycache__/verify_vision_evidence.cpython-311.pyc +0 -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,526 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Slice a GPT FX sprite sheet and repack with PEAK-FRAME-driven canvas.
|
|
4
|
+
|
|
5
|
+
The largest frame (by content bbox area) defines:
|
|
6
|
+
- output canvas size (= peak bbox + padding, square by default)
|
|
7
|
+
- shared anchor (= canvas center; every frame's centroid pasted here)
|
|
8
|
+
- unified scale (= 1.0 unless peak exceeds --max-size cap)
|
|
9
|
+
|
|
10
|
+
Usage:
|
|
11
|
+
python scripts/repack-frame-sequence.py \\
|
|
12
|
+
--raw assets/images/fx/match_burst_v2_raw.png --name match_burst_v2 --cols 6
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import argparse
|
|
18
|
+
import json
|
|
19
|
+
import sys
|
|
20
|
+
from pathlib import Path
|
|
21
|
+
|
|
22
|
+
import numpy as np
|
|
23
|
+
from PIL import Image
|
|
24
|
+
|
|
25
|
+
ROOT = Path.cwd()
|
|
26
|
+
|
|
27
|
+
Isolated = tuple[Image.Image, tuple[float, float], tuple[int, int]]
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def luminance_mask(arr: np.ndarray, threshold: int = 32) -> np.ndarray:
|
|
31
|
+
rgb = arr[:, :, :3].astype(np.float32)
|
|
32
|
+
lum = rgb.max(axis=2)
|
|
33
|
+
if arr.shape[2] == 4:
|
|
34
|
+
alpha = arr[:, :, 3].astype(np.float32) / 255.0
|
|
35
|
+
lum = lum * np.maximum(alpha, 0.05)
|
|
36
|
+
return lum > threshold
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def content_bbox(mask: np.ndarray) -> tuple[int, int, int, int] | None:
|
|
40
|
+
ys, xs = np.where(mask)
|
|
41
|
+
if len(xs) == 0:
|
|
42
|
+
return None
|
|
43
|
+
return int(xs.min()), int(ys.min()), int(xs.max()) + 1, int(ys.max()) + 1
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def cell_touches_edge(bbox: tuple[int, int, int, int], w: int, h: int, margin: int) -> bool:
|
|
47
|
+
x0, y0, x1, y1 = bbox
|
|
48
|
+
return x0 < margin or y0 < margin or x1 > w - margin or y1 > h - margin
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def normalize_cell(
|
|
52
|
+
frame: Image.Image,
|
|
53
|
+
cell_margin: int = 48,
|
|
54
|
+
lum_threshold: int = 32,
|
|
55
|
+
) -> Image.Image:
|
|
56
|
+
"""
|
|
57
|
+
If slice content touches the cell border (mechanical cut / neighbor bleed),
|
|
58
|
+
shrink the whole burst into the cell safe zone so flat cut lines move inward.
|
|
59
|
+
"""
|
|
60
|
+
w, h = frame.size
|
|
61
|
+
arr = np.array(frame.convert("RGBA"))
|
|
62
|
+
arr = np.array(flatten_near_black(Image.fromarray(arr), threshold=lum_threshold))
|
|
63
|
+
mask = luminance_mask(arr, lum_threshold)
|
|
64
|
+
bbox = content_bbox(mask)
|
|
65
|
+
if bbox is None:
|
|
66
|
+
return Image.fromarray(arr)
|
|
67
|
+
|
|
68
|
+
x0, y0, x1, y1 = bbox
|
|
69
|
+
span_w, span_h = x1 - x0, y1 - y0
|
|
70
|
+
inner_w = max(1, w - 2 * cell_margin)
|
|
71
|
+
inner_h = max(1, h - 2 * cell_margin)
|
|
72
|
+
scale = min(inner_w / span_w, inner_h / span_h, 1.0)
|
|
73
|
+
|
|
74
|
+
if scale >= 1.0 and not cell_touches_edge(bbox, w, h, cell_margin):
|
|
75
|
+
return Image.fromarray(arr)
|
|
76
|
+
|
|
77
|
+
layer = Image.fromarray(arr).crop(bbox)
|
|
78
|
+
cx, cy = (x1 - x0) / 2, (y1 - y0) / 2
|
|
79
|
+
nw = max(1, round(span_w * scale))
|
|
80
|
+
nh = max(1, round(span_h * scale))
|
|
81
|
+
layer = layer.resize((nw, nh), Image.Resampling.LANCZOS)
|
|
82
|
+
out = Image.new("RGBA", (w, h), (0, 0, 0, 255))
|
|
83
|
+
paste_x = int(round(w / 2 - cx * scale))
|
|
84
|
+
paste_y = int(round(h / 2 - cy * scale))
|
|
85
|
+
out.alpha_composite(layer, (paste_x, paste_y))
|
|
86
|
+
return out
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def canvas_from_union(
|
|
90
|
+
isolated_list: list[Isolated | None],
|
|
91
|
+
pad_px: int,
|
|
92
|
+
square: bool = True,
|
|
93
|
+
) -> tuple[int, int]:
|
|
94
|
+
"""Canvas fits ALL frames when each centroid is pasted at center."""
|
|
95
|
+
half = 0.0
|
|
96
|
+
for iso in isolated_list:
|
|
97
|
+
if iso is None:
|
|
98
|
+
continue
|
|
99
|
+
_, (cx, cy), (w, h) = iso
|
|
100
|
+
half = max(half, cx, w - cx, cy, h - cy)
|
|
101
|
+
half = int(np.ceil(half))
|
|
102
|
+
if square:
|
|
103
|
+
side = 2 * half + 2 * pad_px
|
|
104
|
+
return side, side
|
|
105
|
+
# non-square: separate w/h halves
|
|
106
|
+
max_w_half = max((iso[2][0] for iso in isolated_list if iso), default=0)
|
|
107
|
+
max_h_half = max((iso[2][1] for iso in isolated_list if iso), default=0)
|
|
108
|
+
return 2 * int(np.ceil(max_w_half / 2)) + 2 * pad_px, 2 * int(np.ceil(max_h_half / 2)) + 2 * pad_px
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def fade_for_canvas(content_margin: int, requested: int) -> int:
|
|
112
|
+
"""Never fade into visible content — cap fade by smallest margin."""
|
|
113
|
+
if content_margin <= 0:
|
|
114
|
+
return 0
|
|
115
|
+
return min(requested, max(0, content_margin - 8))
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def min_content_margin(mask: np.ndarray) -> int:
|
|
119
|
+
h, w = mask.shape
|
|
120
|
+
ys, xs = np.where(mask)
|
|
121
|
+
if len(xs) == 0:
|
|
122
|
+
return min(w, h) // 2
|
|
123
|
+
return int(min(xs.min(), ys.min(), w - 1 - xs.max(), h - 1 - ys.max()))
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def largest_component_bbox(mask: np.ndarray) -> tuple[int, int, int, int] | None:
|
|
127
|
+
h, w = mask.shape
|
|
128
|
+
visited = np.zeros((h, w), dtype=bool)
|
|
129
|
+
best_area = 0
|
|
130
|
+
best_bbox = None
|
|
131
|
+
|
|
132
|
+
for y0 in range(h):
|
|
133
|
+
for x0 in range(w):
|
|
134
|
+
if not mask[y0, x0] or visited[y0, x0]:
|
|
135
|
+
continue
|
|
136
|
+
stack = [(x0, y0)]
|
|
137
|
+
visited[y0, x0] = True
|
|
138
|
+
min_x = max_x = x0
|
|
139
|
+
min_y = max_y = y0
|
|
140
|
+
area = 0
|
|
141
|
+
while stack:
|
|
142
|
+
x, y = stack.pop()
|
|
143
|
+
area += 1
|
|
144
|
+
min_x = min(min_x, x)
|
|
145
|
+
max_x = max(max_x, x)
|
|
146
|
+
min_y = min(min_y, y)
|
|
147
|
+
max_y = max(max_y, y)
|
|
148
|
+
for nx, ny in ((x + 1, y), (x - 1, y), (x, y + 1), (x, y - 1)):
|
|
149
|
+
if 0 <= nx < w and 0 <= ny < h and mask[ny, nx] and not visited[ny, nx]:
|
|
150
|
+
visited[ny, nx] = True
|
|
151
|
+
stack.append((nx, ny))
|
|
152
|
+
if area > best_area:
|
|
153
|
+
best_area = area
|
|
154
|
+
best_bbox = (min_x, min_y, max_x + 1, max_y + 1)
|
|
155
|
+
return best_bbox
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
def centroid_in_bbox(mask: np.ndarray, bbox: tuple[int, int, int, int]) -> tuple[float, float]:
|
|
159
|
+
x0, y0, x1, y1 = bbox
|
|
160
|
+
ys, xs = np.where(mask[y0:y1, x0:x1])
|
|
161
|
+
if len(xs) == 0:
|
|
162
|
+
return (x0 + x1) / 2, (y0 + y1) / 2
|
|
163
|
+
return x0 + xs.mean(), y0 + ys.mean()
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
def flatten_near_black(img: Image.Image, threshold: int = 40) -> Image.Image:
|
|
167
|
+
arr = np.array(img.convert("RGBA"))
|
|
168
|
+
rgb_max = arr[:, :, :3].max(axis=2)
|
|
169
|
+
keep = rgb_max > threshold
|
|
170
|
+
arr[~keep, :3] = 0
|
|
171
|
+
arr[~keep, 3] = 255
|
|
172
|
+
return Image.fromarray(arr)
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
def apply_edge_fade(img: Image.Image, fade_px: int) -> Image.Image:
|
|
176
|
+
arr = np.array(img.convert("RGBA"))
|
|
177
|
+
h, w = arr.shape[:2]
|
|
178
|
+
fade_px = min(fade_px, w // 2, h // 2)
|
|
179
|
+
if fade_px <= 0:
|
|
180
|
+
return img
|
|
181
|
+
mask = np.ones((h, w), dtype=np.float32)
|
|
182
|
+
for x in range(fade_px):
|
|
183
|
+
alpha = x / fade_px
|
|
184
|
+
mask[:, x] = np.minimum(mask[:, x], alpha)
|
|
185
|
+
mask[:, w - 1 - x] = np.minimum(mask[:, w - 1 - x], alpha)
|
|
186
|
+
for y in range(fade_px):
|
|
187
|
+
alpha = y / fade_px
|
|
188
|
+
mask[y, :] = np.minimum(mask[y, :], alpha)
|
|
189
|
+
mask[h - 1 - y, :] = np.minimum(mask[h - 1 - y, :], alpha)
|
|
190
|
+
old_alpha = arr[:, :, 3].astype(np.float32) / 255.0
|
|
191
|
+
arr[:, :, 3] = (old_alpha * mask * 255).astype(np.uint8)
|
|
192
|
+
for c in range(3):
|
|
193
|
+
arr[:, :, c] = (arr[:, :, c].astype(np.float32) * mask).astype(np.uint8)
|
|
194
|
+
return Image.fromarray(arr)
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
def isolate_subject(
|
|
198
|
+
frame: Image.Image, pad: int = 4, lum_threshold: int = 32
|
|
199
|
+
) -> Isolated | None:
|
|
200
|
+
arr = np.array(frame.convert("RGBA"))
|
|
201
|
+
arr = np.array(flatten_near_black(Image.fromarray(arr), threshold=lum_threshold))
|
|
202
|
+
mask = luminance_mask(arr, lum_threshold)
|
|
203
|
+
if not mask.any():
|
|
204
|
+
return None
|
|
205
|
+
bbox = largest_component_bbox(mask)
|
|
206
|
+
if bbox is None:
|
|
207
|
+
return None
|
|
208
|
+
x0, y0, x1, y1 = bbox
|
|
209
|
+
x0 = max(0, x0 - pad)
|
|
210
|
+
y0 = max(0, y0 - pad)
|
|
211
|
+
x1 = min(arr.shape[1], x1 + pad)
|
|
212
|
+
y1 = min(arr.shape[0], y1 + pad)
|
|
213
|
+
cropped = Image.fromarray(arr).crop((x0, y0, x1, y1))
|
|
214
|
+
cx, cy = centroid_in_bbox(mask, (x0, y0, x1, y1))
|
|
215
|
+
return cropped, (cx - x0, cy - y0), (x1 - x0, y1 - y0)
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
def scale_image(img: Image.Image, scale: float) -> Image.Image:
|
|
219
|
+
if abs(scale - 1.0) < 1e-6:
|
|
220
|
+
return img
|
|
221
|
+
w, h = img.size
|
|
222
|
+
nw = max(1, round(w * scale))
|
|
223
|
+
nh = max(1, round(h * scale))
|
|
224
|
+
return img.resize((nw, nh), Image.Resampling.LANCZOS)
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
def repack_subject(
|
|
228
|
+
subject: Image.Image,
|
|
229
|
+
subject_centroid: tuple[float, float],
|
|
230
|
+
out_w: int,
|
|
231
|
+
out_h: int,
|
|
232
|
+
anchor: tuple[float, float],
|
|
233
|
+
scale: float = 1.0,
|
|
234
|
+
) -> Image.Image:
|
|
235
|
+
scaled = scale_image(subject, scale)
|
|
236
|
+
scx, scy = subject_centroid[0] * scale, subject_centroid[1] * scale
|
|
237
|
+
out = Image.new("RGBA", (out_w, out_h), (0, 0, 0, 255))
|
|
238
|
+
paste_x = int(round(anchor[0] - scx))
|
|
239
|
+
paste_y = int(round(anchor[1] - scy))
|
|
240
|
+
out.alpha_composite(scaled, (paste_x, paste_y))
|
|
241
|
+
return out
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
def slice_sheet(raw: Path, cols: int, rows: int) -> list[Image.Image]:
|
|
245
|
+
img = Image.open(raw).convert("RGBA")
|
|
246
|
+
w, h = img.size
|
|
247
|
+
fw, fh = w // cols, h // rows
|
|
248
|
+
frames = []
|
|
249
|
+
for row in range(rows):
|
|
250
|
+
for col in range(cols):
|
|
251
|
+
left, upper = col * fw, row * fh
|
|
252
|
+
frames.append(img.crop((left, upper, left + fw, upper + fh)))
|
|
253
|
+
return frames
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
def find_peak_index(
|
|
257
|
+
isolated_list: list[Isolated | None],
|
|
258
|
+
peak_index: int | None = None,
|
|
259
|
+
) -> int:
|
|
260
|
+
if peak_index is not None:
|
|
261
|
+
if peak_index < 0 or peak_index >= len(isolated_list):
|
|
262
|
+
raise ValueError(f"peak-index {peak_index} out of range")
|
|
263
|
+
if isolated_list[peak_index] is None:
|
|
264
|
+
raise ValueError(f"peak-index {peak_index} has no content")
|
|
265
|
+
return peak_index
|
|
266
|
+
|
|
267
|
+
best_i = 0
|
|
268
|
+
best_area = 0
|
|
269
|
+
for i, iso in enumerate(isolated_list):
|
|
270
|
+
if iso is None:
|
|
271
|
+
continue
|
|
272
|
+
_, _, (w, h) = iso
|
|
273
|
+
area = w * h
|
|
274
|
+
if area > best_area:
|
|
275
|
+
best_area = area
|
|
276
|
+
best_i = i
|
|
277
|
+
if best_area == 0:
|
|
278
|
+
raise ValueError("no frame content found")
|
|
279
|
+
return best_i
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
def canvas_from_peak(
|
|
283
|
+
peak_wh: tuple[int, int],
|
|
284
|
+
pad_ratio: float = 0.12,
|
|
285
|
+
min_pad: int = 40,
|
|
286
|
+
square: bool = True,
|
|
287
|
+
) -> tuple[int, int, int]:
|
|
288
|
+
"""Return (out_w, out_h, pad_px) derived from peak frame bbox."""
|
|
289
|
+
pw, ph = peak_wh
|
|
290
|
+
pad = max(min_pad, round(max(pw, ph) * pad_ratio))
|
|
291
|
+
if square:
|
|
292
|
+
side = max(pw, ph) + 2 * pad
|
|
293
|
+
return side, side, pad
|
|
294
|
+
return pw + 2 * pad, ph + 2 * pad, pad
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
def scale_to_fit_canvas(
|
|
298
|
+
peak_wh: tuple[int, int],
|
|
299
|
+
canvas_wh: tuple[int, int],
|
|
300
|
+
pad_px: int,
|
|
301
|
+
) -> float:
|
|
302
|
+
"""Only scale DOWN if peak content + pad exceeds canvas (shouldn't if derived)."""
|
|
303
|
+
pw, ph = peak_wh
|
|
304
|
+
cw, ch = canvas_wh
|
|
305
|
+
inner_w = cw - 2 * pad_px
|
|
306
|
+
inner_h = ch - 2 * pad_px
|
|
307
|
+
if pw <= inner_w and ph <= inner_h:
|
|
308
|
+
return 1.0
|
|
309
|
+
return min(inner_w / pw, inner_h / ph, 1.0)
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
def apply_max_size_cap(
|
|
313
|
+
canvas_wh: tuple[int, int],
|
|
314
|
+
unified_scale: float,
|
|
315
|
+
max_size: int | None,
|
|
316
|
+
) -> tuple[tuple[int, int], float]:
|
|
317
|
+
if not max_size:
|
|
318
|
+
return canvas_wh, unified_scale
|
|
319
|
+
cw, ch = canvas_wh
|
|
320
|
+
side = max(cw, ch)
|
|
321
|
+
if side <= max_size:
|
|
322
|
+
return canvas_wh, unified_scale
|
|
323
|
+
cap_scale = max_size / side
|
|
324
|
+
new_cw = max(1, round(cw * cap_scale))
|
|
325
|
+
new_ch = max(1, round(ch * cap_scale))
|
|
326
|
+
return (new_cw, new_ch), unified_scale * cap_scale
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
def edge_touch_px(mask: np.ndarray, margin: int = 8) -> dict[str, int]:
|
|
330
|
+
h, w = mask.shape
|
|
331
|
+
return {
|
|
332
|
+
"left": int(mask[:, :margin].any()),
|
|
333
|
+
"right": int(mask[:, w - margin :].any()),
|
|
334
|
+
"top": int(mask[:margin, :].any()),
|
|
335
|
+
"bottom": int(mask[h - margin :, :].any()),
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
def process_sequence(
|
|
340
|
+
raw_path: Path,
|
|
341
|
+
out_dir: Path,
|
|
342
|
+
name: str,
|
|
343
|
+
cols: int,
|
|
344
|
+
rows: int,
|
|
345
|
+
fade_px: int = 24,
|
|
346
|
+
lum_threshold: int = 32,
|
|
347
|
+
peak_index: int | None = None,
|
|
348
|
+
pad_ratio: float = 0.12,
|
|
349
|
+
min_pad: int = 48,
|
|
350
|
+
cell_margin: int = 48,
|
|
351
|
+
square: bool = True,
|
|
352
|
+
max_size: int | None = None,
|
|
353
|
+
) -> dict:
|
|
354
|
+
out_dir.mkdir(parents=True, exist_ok=True)
|
|
355
|
+
slices = slice_sheet(raw_path, cols, rows)
|
|
356
|
+
|
|
357
|
+
normalized = [
|
|
358
|
+
normalize_cell(slc, cell_margin=cell_margin, lum_threshold=lum_threshold)
|
|
359
|
+
for slc in slices
|
|
360
|
+
]
|
|
361
|
+
|
|
362
|
+
isolated_list: list[Isolated | None] = []
|
|
363
|
+
for cell in normalized:
|
|
364
|
+
isolated_list.append(isolate_subject(cell, lum_threshold=lum_threshold))
|
|
365
|
+
|
|
366
|
+
peak_i = find_peak_index(isolated_list, peak_index)
|
|
367
|
+
_, _, peak_wh = isolated_list[peak_i] # type: ignore[misc]
|
|
368
|
+
|
|
369
|
+
pad_px = max(min_pad, round(max(peak_wh) * pad_ratio))
|
|
370
|
+
out_w, out_h = canvas_from_union(isolated_list, pad_px, square)
|
|
371
|
+
|
|
372
|
+
unified_scale = 1.0
|
|
373
|
+
(out_w, out_h), unified_scale = apply_max_size_cap(
|
|
374
|
+
(out_w, out_h), unified_scale, max_size
|
|
375
|
+
)
|
|
376
|
+
|
|
377
|
+
anchor = (out_w / 2, out_h / 2)
|
|
378
|
+
print(
|
|
379
|
+
f" peak=frame{peak_i:02d} peak_bbox={peak_wh[0]}x{peak_wh[1]} "
|
|
380
|
+
f"union_canvas={out_w}x{out_h} pad={pad_px}px scale={unified_scale:.3f} "
|
|
381
|
+
f"(cell_margin={cell_margin})"
|
|
382
|
+
)
|
|
383
|
+
|
|
384
|
+
report = {
|
|
385
|
+
"name": name,
|
|
386
|
+
"peak_frame": peak_i,
|
|
387
|
+
"peak_frame_key": f"{name}_frame{peak_i:02d}",
|
|
388
|
+
"peak_bbox": list(peak_wh),
|
|
389
|
+
"frameCanvas": [out_w, out_h],
|
|
390
|
+
"anchor": list(anchor),
|
|
391
|
+
"canvas": [out_w, out_h],
|
|
392
|
+
"pad_px": pad_px,
|
|
393
|
+
"unified_scale": round(unified_scale, 4),
|
|
394
|
+
"frames": [],
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
for i, isolated in enumerate(isolated_list):
|
|
398
|
+
if isolated is None:
|
|
399
|
+
repacked = Image.new("RGBA", (out_w, out_h), (0, 0, 0, 255))
|
|
400
|
+
cx, cy = anchor
|
|
401
|
+
left_mass = right_mass = 0
|
|
402
|
+
touch = {"left": 0, "right": 0, "top": 0, "bottom": 0}
|
|
403
|
+
else:
|
|
404
|
+
subject, sub_centroid, _wh = isolated
|
|
405
|
+
repacked = repack_subject(
|
|
406
|
+
subject, sub_centroid, out_w, out_h, anchor, unified_scale
|
|
407
|
+
)
|
|
408
|
+
arr = np.array(repacked)
|
|
409
|
+
mask = luminance_mask(arr, lum_threshold)
|
|
410
|
+
ys, xs = np.where(mask)
|
|
411
|
+
cx, cy = (xs.mean(), ys.mean()) if len(xs) else anchor
|
|
412
|
+
mid = out_w // 2
|
|
413
|
+
left_mass = int(mask[:, :mid].sum())
|
|
414
|
+
right_mass = int(mask[:, mid:].sum())
|
|
415
|
+
touch = edge_touch_px(mask, margin=10)
|
|
416
|
+
|
|
417
|
+
repacked = flatten_near_black(repacked, threshold=lum_threshold)
|
|
418
|
+
arr = np.array(repacked)
|
|
419
|
+
mask = luminance_mask(arr, lum_threshold)
|
|
420
|
+
margin = min_content_margin(mask)
|
|
421
|
+
eff_fade = fade_for_canvas(margin, fade_px)
|
|
422
|
+
if eff_fade > 0:
|
|
423
|
+
repacked = apply_edge_fade(repacked, eff_fade)
|
|
424
|
+
|
|
425
|
+
out_path = out_dir / f"{name}_frame{i:02d}.png"
|
|
426
|
+
repacked.save(out_path)
|
|
427
|
+
|
|
428
|
+
drift = ((cx - anchor[0]) ** 2 + (cy - anchor[1]) ** 2) ** 0.5
|
|
429
|
+
lr_ratio = left_mass / max(right_mass, 1)
|
|
430
|
+
frame_info = {
|
|
431
|
+
"index": i,
|
|
432
|
+
"path": str(out_path.relative_to(ROOT)),
|
|
433
|
+
"centroid": [round(cx, 1), round(cy, 1)],
|
|
434
|
+
"drift_px": round(drift, 1),
|
|
435
|
+
"left_right_ratio": round(lr_ratio, 2),
|
|
436
|
+
"edge_touch": touch,
|
|
437
|
+
"is_peak": i == peak_i,
|
|
438
|
+
}
|
|
439
|
+
report["frames"].append(frame_info)
|
|
440
|
+
touch_s = "+".join(k for k, v in touch.items() if v) or "none"
|
|
441
|
+
peak_mark = " *PEAK*" if i == peak_i else ""
|
|
442
|
+
print(
|
|
443
|
+
f" frame{i:02d}: drift={drift:.1f}px lr={lr_ratio:.2f} touch={touch_s}{peak_mark} "
|
|
444
|
+
f"-> {out_path.name}"
|
|
445
|
+
)
|
|
446
|
+
|
|
447
|
+
return report
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
def main() -> None:
|
|
451
|
+
parser = argparse.ArgumentParser(
|
|
452
|
+
description="Repack FX frames — canvas sized from peak (largest) frame"
|
|
453
|
+
)
|
|
454
|
+
parser.add_argument("--raw", required=True)
|
|
455
|
+
parser.add_argument("--name", required=True)
|
|
456
|
+
parser.add_argument("--cols", type=int, default=6)
|
|
457
|
+
parser.add_argument("--rows", type=int, default=1)
|
|
458
|
+
parser.add_argument("--out-dir", default="assets/images/fx")
|
|
459
|
+
parser.add_argument("--peak-index", type=int, default=None, help="Override auto peak detection")
|
|
460
|
+
parser.add_argument("--pad-ratio", type=float, default=0.12, help="Padding around peak bbox")
|
|
461
|
+
parser.add_argument("--min-pad", type=int, default=48)
|
|
462
|
+
parser.add_argument("--cell-margin", type=int, default=48, help="Safe zone inside each slice cell")
|
|
463
|
+
parser.add_argument("--no-square", action="store_true", help="Use peak bbox aspect, not square")
|
|
464
|
+
parser.add_argument("--max-size", type=int, default=1024, help="Cap max canvas side (0=disable)")
|
|
465
|
+
parser.add_argument("--fade-px", type=int, default=24)
|
|
466
|
+
parser.add_argument("--lum-threshold", type=int, default=32)
|
|
467
|
+
parser.add_argument("--report", default="")
|
|
468
|
+
parser.add_argument("--project-root", type=Path, default=Path.cwd(), help="Playable project root")
|
|
469
|
+
args = parser.parse_args()
|
|
470
|
+
|
|
471
|
+
root = args.project_root.resolve()
|
|
472
|
+
global ROOT
|
|
473
|
+
ROOT = root
|
|
474
|
+
|
|
475
|
+
raw_path = Path(args.raw)
|
|
476
|
+
if not raw_path.is_absolute():
|
|
477
|
+
raw_path = root / raw_path
|
|
478
|
+
if not raw_path.exists():
|
|
479
|
+
print(f"ERROR: raw not found: {raw_path}", file=sys.stderr)
|
|
480
|
+
sys.exit(1)
|
|
481
|
+
|
|
482
|
+
out_dir = Path(args.out_dir)
|
|
483
|
+
if not out_dir.is_absolute():
|
|
484
|
+
out_dir = root / out_dir
|
|
485
|
+
|
|
486
|
+
max_size = args.max_size if args.max_size > 0 else None
|
|
487
|
+
|
|
488
|
+
print(f"[repack] {raw_path.name} -> {args.name} ({args.cols}x{args.rows}) peak-driven canvas")
|
|
489
|
+
report = process_sequence(
|
|
490
|
+
raw_path, out_dir, args.name,
|
|
491
|
+
args.cols, args.rows,
|
|
492
|
+
fade_px=args.fade_px,
|
|
493
|
+
lum_threshold=args.lum_threshold,
|
|
494
|
+
peak_index=args.peak_index,
|
|
495
|
+
pad_ratio=args.pad_ratio,
|
|
496
|
+
min_pad=args.min_pad,
|
|
497
|
+
cell_margin=args.cell_margin,
|
|
498
|
+
square=not args.no_square,
|
|
499
|
+
max_size=max_size,
|
|
500
|
+
)
|
|
501
|
+
|
|
502
|
+
max_drift = max(f["drift_px"] for f in report["frames"])
|
|
503
|
+
max_lr = max(max(f["left_right_ratio"], 1 / max(f["left_right_ratio"], 0.01)) for f in report["frames"])
|
|
504
|
+
any_touch = any(any(f["edge_touch"].values()) for f in report["frames"])
|
|
505
|
+
report["summary"] = {
|
|
506
|
+
"max_drift_px": max_drift,
|
|
507
|
+
"max_lr_imbalance": round(max_lr, 2),
|
|
508
|
+
"edge_touch": any_touch,
|
|
509
|
+
}
|
|
510
|
+
print(f"[repack] max drift={max_drift}px max L/R={max_lr:.2f} edge_touch={any_touch}")
|
|
511
|
+
|
|
512
|
+
if args.report:
|
|
513
|
+
rp = Path(args.report)
|
|
514
|
+
if not rp.is_absolute():
|
|
515
|
+
rp = root / rp
|
|
516
|
+
rp.parent.mkdir(parents=True, exist_ok=True)
|
|
517
|
+
rp.write_text(json.dumps(report, indent=2), encoding="utf-8")
|
|
518
|
+
print(f"[repack] report -> {rp.relative_to(root)}")
|
|
519
|
+
|
|
520
|
+
if max_drift > 15 or max_lr > 1.8 or any_touch:
|
|
521
|
+
print("[repack] FAIL: alignment, dual-subject, or edge clip detected", file=sys.stderr)
|
|
522
|
+
sys.exit(2)
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
if __name__ == "__main__":
|
|
526
|
+
main()
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Validate frame animation anchor alignment and dual-subject detection."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import argparse
|
|
7
|
+
import glob
|
|
8
|
+
import json
|
|
9
|
+
import sys
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
|
|
12
|
+
import numpy as np
|
|
13
|
+
from PIL import Image
|
|
14
|
+
|
|
15
|
+
ROOT = Path.cwd()
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def analyze_frame(path: Path, lum_threshold: int = 32, edge_margin: int = 10) -> dict:
|
|
19
|
+
arr = np.array(Image.open(path).convert("RGBA"))
|
|
20
|
+
h, w = arr.shape[:2]
|
|
21
|
+
rgb = arr[:, :, :3].astype(np.float32)
|
|
22
|
+
lum = rgb.max(axis=2)
|
|
23
|
+
mask = lum > lum_threshold
|
|
24
|
+
grey = int(((lum > 8) & (lum <= lum_threshold)).sum())
|
|
25
|
+
if not mask.any():
|
|
26
|
+
return {"file": path.name, "empty": True}
|
|
27
|
+
|
|
28
|
+
ys, xs = np.where(mask)
|
|
29
|
+
cx, cy = float(xs.mean()), float(ys.mean())
|
|
30
|
+
mid = w // 2
|
|
31
|
+
left = int(mask[:, :mid].sum())
|
|
32
|
+
right = int(mask[:, mid:].sum())
|
|
33
|
+
lr = left / max(right, 1)
|
|
34
|
+
drift = ((cx - w / 2) ** 2 + (cy - h / 2) ** 2) ** 0.5
|
|
35
|
+
touch = {
|
|
36
|
+
"left": bool(mask[:, :edge_margin].any()),
|
|
37
|
+
"right": bool(mask[:, w - edge_margin :].any()),
|
|
38
|
+
"top": bool(mask[:edge_margin, :].any()),
|
|
39
|
+
"bottom": bool(mask[h - edge_margin :, :].any()),
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
"file": path.name,
|
|
43
|
+
"size": [w, h],
|
|
44
|
+
"centroid": [round(cx, 1), round(cy, 1)],
|
|
45
|
+
"drift_px": round(drift, 1),
|
|
46
|
+
"left_px": left,
|
|
47
|
+
"right_px": right,
|
|
48
|
+
"lr_ratio": round(lr, 2),
|
|
49
|
+
"grey_px": grey,
|
|
50
|
+
"edge_touch": touch,
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def main() -> None:
|
|
55
|
+
parser = argparse.ArgumentParser()
|
|
56
|
+
parser.add_argument("pattern", help="Glob for frame PNGs, e.g. assets/images/fx/match_burst_v2_frame*.png")
|
|
57
|
+
parser.add_argument("--max-drift", type=float, default=12.0)
|
|
58
|
+
parser.add_argument("--max-lr", type=float, default=1.6)
|
|
59
|
+
parser.add_argument("--json", default="")
|
|
60
|
+
parser.add_argument("--project-root", type=Path, default=Path.cwd(), help="Playable project root")
|
|
61
|
+
args = parser.parse_args()
|
|
62
|
+
|
|
63
|
+
global ROOT
|
|
64
|
+
ROOT = args.project_root.resolve()
|
|
65
|
+
|
|
66
|
+
pattern = args.pattern
|
|
67
|
+
if not Path(pattern).is_absolute():
|
|
68
|
+
pattern = str(ROOT / pattern)
|
|
69
|
+
|
|
70
|
+
files = sorted(glob.glob(pattern))
|
|
71
|
+
if not files:
|
|
72
|
+
print(f"ERROR: no files for {pattern}", file=sys.stderr)
|
|
73
|
+
sys.exit(1)
|
|
74
|
+
|
|
75
|
+
results = [analyze_frame(Path(f)) for f in files]
|
|
76
|
+
fails = []
|
|
77
|
+
for r in results:
|
|
78
|
+
if r.get("empty"):
|
|
79
|
+
fails.append(f"{r['file']}: empty frame")
|
|
80
|
+
continue
|
|
81
|
+
if r["drift_px"] > args.max_drift:
|
|
82
|
+
fails.append(f"{r['file']}: drift {r['drift_px']}px > {args.max_drift}")
|
|
83
|
+
lr = r["lr_ratio"]
|
|
84
|
+
if lr > args.max_lr or lr < 1 / args.max_lr:
|
|
85
|
+
fails.append(f"{r['file']}: L/R imbalance {lr} (dual-subject?)")
|
|
86
|
+
touch = r.get("edge_touch", {})
|
|
87
|
+
touched = [k for k, v in touch.items() if v]
|
|
88
|
+
if touched:
|
|
89
|
+
fails.append(f"{r['file']}: content touches edge ({', '.join(touched)})")
|
|
90
|
+
if r.get("grey_px", 0) > 500:
|
|
91
|
+
fails.append(f"{r['file']}: grey vignette {r['grey_px']}px > 500")
|
|
92
|
+
|
|
93
|
+
print(f"=== validate-frame-anchors ({len(results)} frames) ===")
|
|
94
|
+
for r in results:
|
|
95
|
+
if r.get("empty"):
|
|
96
|
+
print(f" {r['file']}: EMPTY")
|
|
97
|
+
else:
|
|
98
|
+
touch = r.get("edge_touch", {})
|
|
99
|
+
touch_s = "+".join(k for k, v in touch.items() if v) or "ok"
|
|
100
|
+
print(
|
|
101
|
+
f" {r['file']}: centroid=({r['centroid'][0]},{r['centroid'][1]}) "
|
|
102
|
+
f"drift={r['drift_px']}px lr={r['lr_ratio']} edge={touch_s} grey={r.get('grey_px', 0)}"
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
summary = {
|
|
106
|
+
"frames": results,
|
|
107
|
+
"pass": len(fails) == 0,
|
|
108
|
+
"failures": fails,
|
|
109
|
+
"thresholds": {"max_drift": args.max_drift, "max_lr": args.max_lr},
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if args.json:
|
|
113
|
+
jp = Path(args.json)
|
|
114
|
+
if not jp.is_absolute():
|
|
115
|
+
jp = ROOT / jp
|
|
116
|
+
jp.parent.mkdir(parents=True, exist_ok=True)
|
|
117
|
+
jp.write_text(json.dumps(summary, indent=2), encoding="utf-8")
|
|
118
|
+
|
|
119
|
+
if fails:
|
|
120
|
+
print("\nFAIL:")
|
|
121
|
+
for f in fails:
|
|
122
|
+
print(f" - {f}")
|
|
123
|
+
sys.exit(1)
|
|
124
|
+
|
|
125
|
+
print("\nPASS: all frames anchor-aligned")
|
|
126
|
+
sys.exit(0)
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
if __name__ == "__main__":
|
|
130
|
+
main()
|