@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,894 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Thin vision evidence layer for ui_diff and Video Validator.
|
|
4
|
+
|
|
5
|
+
Uses Pillow only (already a required harness dependency). Does not run detection
|
|
6
|
+
models. When --detections is omitted, auto-collects spatial hints from the same
|
|
7
|
+
Ring 4 local verifiers (bg-clean, tile-consistency, text-overlap) so Reviewer
|
|
8
|
+
gets annotated screenshots without LLM-prepared JSON.
|
|
9
|
+
|
|
10
|
+
Exit 0 = pass / degraded skip, 2 = strict failure.
|
|
11
|
+
"""
|
|
12
|
+
from __future__ import annotations
|
|
13
|
+
|
|
14
|
+
import argparse
|
|
15
|
+
import json
|
|
16
|
+
import subprocess
|
|
17
|
+
import sys
|
|
18
|
+
from dataclasses import dataclass
|
|
19
|
+
from pathlib import Path
|
|
20
|
+
from typing import Any
|
|
21
|
+
|
|
22
|
+
DEFAULT_SCREENSHOT_PATTERNS = ("ui-diff-*.png", "load-check.png", "conform-*.png", "review-*.png")
|
|
23
|
+
VERIFIER_SCRIPTS = (
|
|
24
|
+
"skills/playable-verify-ui/scripts/verify_bg_clean.py",
|
|
25
|
+
"skills/playable-verify-ui/scripts/verify_tile_consistency.py",
|
|
26
|
+
"skills/playable-verify-ui/scripts/verify_text_overlap.py",
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@dataclass
|
|
31
|
+
class PillowDeps:
|
|
32
|
+
Image: Any
|
|
33
|
+
ImageDraw: Any
|
|
34
|
+
ImageFont: Any
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def load_pillow() -> tuple[PillowDeps | None, str | None]:
|
|
38
|
+
try:
|
|
39
|
+
from PIL import Image, ImageDraw, ImageFont
|
|
40
|
+
|
|
41
|
+
return PillowDeps(Image=Image, ImageDraw=ImageDraw, ImageFont=ImageFont), None
|
|
42
|
+
except Exception as exc: # pragma: no cover
|
|
43
|
+
return None, str(exc)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def read_json(path: Path | None) -> dict[str, Any]:
|
|
47
|
+
if path is None or not path.exists():
|
|
48
|
+
return {}
|
|
49
|
+
return json.loads(path.read_text(encoding="utf-8"))
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def normalize_box(raw: Any) -> list[float] | None:
|
|
53
|
+
if isinstance(raw, dict):
|
|
54
|
+
if "xyxy" in raw:
|
|
55
|
+
vals = raw["xyxy"]
|
|
56
|
+
elif all(k in raw for k in ("x1", "y1", "x2", "y2")):
|
|
57
|
+
vals = [raw["x1"], raw["y1"], raw["x2"], raw["y2"]]
|
|
58
|
+
elif all(k in raw for k in ("x", "y", "width", "height")):
|
|
59
|
+
vals = [raw["x"], raw["y"], raw["x"] + raw["width"], raw["y"] + raw["height"]]
|
|
60
|
+
elif all(k in raw for k in ("left", "top", "width", "height")):
|
|
61
|
+
vals = [raw["left"], raw["top"], raw["left"] + raw["width"], raw["top"] + raw["height"]]
|
|
62
|
+
else:
|
|
63
|
+
return None
|
|
64
|
+
elif isinstance(raw, (list, tuple)) and len(raw) >= 4:
|
|
65
|
+
vals = raw[:4]
|
|
66
|
+
else:
|
|
67
|
+
return None
|
|
68
|
+
try:
|
|
69
|
+
x1, y1, x2, y2 = [float(v) for v in vals]
|
|
70
|
+
except (TypeError, ValueError):
|
|
71
|
+
return None
|
|
72
|
+
if x2 <= x1 or y2 <= y1:
|
|
73
|
+
return None
|
|
74
|
+
return [x1, y1, x2, y2]
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def iter_raw_detections(payload: dict[str, Any]) -> list[dict[str, Any]]:
|
|
78
|
+
if isinstance(payload.get("detections"), list):
|
|
79
|
+
return [d for d in payload["detections"] if isinstance(d, dict)]
|
|
80
|
+
if isinstance(payload.get("items"), list):
|
|
81
|
+
return [d for d in payload["items"] if isinstance(d, dict)]
|
|
82
|
+
boxes = payload.get("boxes")
|
|
83
|
+
if not isinstance(boxes, list):
|
|
84
|
+
return []
|
|
85
|
+
class_names = payload.get("className") or payload.get("classNames") or []
|
|
86
|
+
confidences = payload.get("confidence") or payload.get("confidences") or []
|
|
87
|
+
frames = payload.get("frame") or payload.get("frames") or []
|
|
88
|
+
source_paths = payload.get("sourcePath") or payload.get("sourcePaths") or []
|
|
89
|
+
out: list[dict[str, Any]] = []
|
|
90
|
+
for i, box in enumerate(boxes):
|
|
91
|
+
out.append(
|
|
92
|
+
{
|
|
93
|
+
"box": box,
|
|
94
|
+
"className": class_names[i] if i < len(class_names) else "object",
|
|
95
|
+
"confidence": confidences[i] if i < len(confidences) else 1.0,
|
|
96
|
+
"frame": frames[i] if i < len(frames) else None,
|
|
97
|
+
"sourcePath": source_paths[i] if i < len(source_paths) else None,
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
return out
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def normalize_detections(payload: dict[str, Any]) -> list[dict[str, Any]]:
|
|
104
|
+
normalized: list[dict[str, Any]] = []
|
|
105
|
+
for raw in iter_raw_detections(payload):
|
|
106
|
+
box = normalize_box(raw.get("box") or raw.get("bbox") or raw.get("xyxy") or raw)
|
|
107
|
+
if not box:
|
|
108
|
+
continue
|
|
109
|
+
class_name = str(raw.get("className") or raw.get("class_name") or raw.get("label") or "object")
|
|
110
|
+
try:
|
|
111
|
+
confidence = float(raw.get("confidence", raw.get("score", 1.0)))
|
|
112
|
+
except (TypeError, ValueError):
|
|
113
|
+
confidence = 1.0
|
|
114
|
+
frame = raw.get("frame")
|
|
115
|
+
try:
|
|
116
|
+
frame = None if frame is None else int(frame)
|
|
117
|
+
except (TypeError, ValueError):
|
|
118
|
+
frame = None
|
|
119
|
+
normalized.append(
|
|
120
|
+
{
|
|
121
|
+
"box": box,
|
|
122
|
+
"className": class_name,
|
|
123
|
+
"confidence": max(0.0, min(1.0, confidence)),
|
|
124
|
+
"frame": frame,
|
|
125
|
+
"sourcePath": str(raw.get("sourcePath") or raw.get("source_path") or ""),
|
|
126
|
+
"recommendedSkill": route_skill(class_name),
|
|
127
|
+
"alphaStrategy": route_alpha_strategy(class_name),
|
|
128
|
+
}
|
|
129
|
+
)
|
|
130
|
+
return normalized
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def iter_raw_issues(payload: dict[str, Any]) -> list[dict[str, Any]]:
|
|
134
|
+
if isinstance(payload.get("issues"), list):
|
|
135
|
+
return [i for i in payload["issues"] if isinstance(i, dict)]
|
|
136
|
+
if isinstance(payload.get("findings"), list):
|
|
137
|
+
issues: list[dict[str, Any]] = []
|
|
138
|
+
for idx, finding in enumerate(payload["findings"]):
|
|
139
|
+
if not isinstance(finding, dict):
|
|
140
|
+
continue
|
|
141
|
+
details = finding.get("details") if isinstance(finding.get("details"), dict) else {}
|
|
142
|
+
issues.append(
|
|
143
|
+
{
|
|
144
|
+
"id": details.get("id") or f"finding:{idx}",
|
|
145
|
+
"status": finding.get("status", "warn"),
|
|
146
|
+
"severity": details.get("severity", "P2"),
|
|
147
|
+
"className": details.get("className") or finding.get("check") or "validator_finding",
|
|
148
|
+
"message": finding.get("message", ""),
|
|
149
|
+
"evidenceType": details.get("evidenceType", "screenshot"),
|
|
150
|
+
"sourcePath": details.get("sourcePath", ""),
|
|
151
|
+
"box": details.get("box"),
|
|
152
|
+
"recommendedSkill": details.get("recommendedSkill"),
|
|
153
|
+
"alphaStrategy": details.get("alphaStrategy"),
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
return issues
|
|
157
|
+
return []
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
def normalize_issue(raw: dict[str, Any], idx: int) -> dict[str, Any]:
|
|
161
|
+
class_name = str(raw.get("className") or raw.get("class_name") or raw.get("label") or "validator_issue")
|
|
162
|
+
status = str(raw.get("status") or "warn")
|
|
163
|
+
if status not in {"pass", "warn", "fail"}:
|
|
164
|
+
status = "warn"
|
|
165
|
+
evidence_type = str(raw.get("evidenceType") or raw.get("evidence_type") or "screenshot")
|
|
166
|
+
if evidence_type not in {"screenshot", "asset", "asset-group"}:
|
|
167
|
+
evidence_type = "screenshot"
|
|
168
|
+
issue = {
|
|
169
|
+
"id": str(raw.get("id") or f"{class_name}:{idx}"),
|
|
170
|
+
"status": status,
|
|
171
|
+
"severity": str(raw.get("severity") or ("P1" if status == "fail" else "P2")),
|
|
172
|
+
"className": class_name,
|
|
173
|
+
"message": str(raw.get("message") or class_name),
|
|
174
|
+
"evidenceType": evidence_type,
|
|
175
|
+
"sourcePath": str(raw.get("sourcePath") or raw.get("source_path") or ""),
|
|
176
|
+
"recommendedSkill": str(raw.get("recommendedSkill") or route_skill(class_name)),
|
|
177
|
+
"alphaStrategy": str(raw.get("alphaStrategy") or route_alpha_strategy(class_name)),
|
|
178
|
+
}
|
|
179
|
+
box = normalize_box(raw.get("box") or raw.get("bbox") or raw.get("xyxy"))
|
|
180
|
+
if box:
|
|
181
|
+
issue["box"] = box
|
|
182
|
+
if isinstance(raw.get("sources"), list):
|
|
183
|
+
issue["sources"] = raw["sources"]
|
|
184
|
+
if isinstance(raw.get("metrics"), dict):
|
|
185
|
+
issue["metrics"] = raw["metrics"]
|
|
186
|
+
return issue
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
def normalize_issues(payload: dict[str, Any]) -> list[dict[str, Any]]:
|
|
190
|
+
return [normalize_issue(raw, idx) for idx, raw in enumerate(iter_raw_issues(payload))]
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
def detection_from_issue(issue: dict[str, Any]) -> dict[str, Any] | None:
|
|
194
|
+
box = normalize_box(issue.get("box"))
|
|
195
|
+
if not box:
|
|
196
|
+
return None
|
|
197
|
+
return {
|
|
198
|
+
"id": issue["id"],
|
|
199
|
+
"status": issue["status"],
|
|
200
|
+
"severity": issue["severity"],
|
|
201
|
+
"message": issue["message"],
|
|
202
|
+
"evidenceType": issue["evidenceType"],
|
|
203
|
+
"box": box,
|
|
204
|
+
"className": issue["className"],
|
|
205
|
+
"confidence": 1.0,
|
|
206
|
+
"frame": issue.get("frame"),
|
|
207
|
+
"sourcePath": issue.get("sourcePath", ""),
|
|
208
|
+
"recommendedSkill": issue["recommendedSkill"],
|
|
209
|
+
"alphaStrategy": issue["alphaStrategy"],
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
def detections_from_issues(issues: list[dict[str, Any]]) -> tuple[list[dict[str, Any]], list[dict[str, Any]]]:
|
|
214
|
+
detections: list[dict[str, Any]] = []
|
|
215
|
+
dropped: list[dict[str, Any]] = []
|
|
216
|
+
for issue in issues:
|
|
217
|
+
if issue.get("evidenceType") == "asset-group":
|
|
218
|
+
continue
|
|
219
|
+
det = detection_from_issue(issue)
|
|
220
|
+
if det is None:
|
|
221
|
+
dropped.append(
|
|
222
|
+
{
|
|
223
|
+
"id": issue.get("id"),
|
|
224
|
+
"sourcePath": issue.get("sourcePath", ""),
|
|
225
|
+
"className": issue.get("className"),
|
|
226
|
+
"reason": "issue has no valid box for deterministic annotation",
|
|
227
|
+
}
|
|
228
|
+
)
|
|
229
|
+
continue
|
|
230
|
+
detections.append(det)
|
|
231
|
+
return detections, dropped
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
def route_skill(class_name: str) -> str:
|
|
235
|
+
name = class_name.lower()
|
|
236
|
+
if any(token in name for token in ("halo", "glow", "particle", "vfx", "black_block")):
|
|
237
|
+
return "playable-fx-peak"
|
|
238
|
+
if any(token in name for token in ("crack", "shard", "decompose", "wrong_tile")):
|
|
239
|
+
return "playable-fx-decompose"
|
|
240
|
+
if any(token in name for token in ("fringe", "white_edge", "green_edge", "alpha", "matte")):
|
|
241
|
+
return "playable-art"
|
|
242
|
+
if any(token in name for token in ("overlap", "cta", "hud", "layout", "text", "grid", "baked")):
|
|
243
|
+
return "playable-verify-ui"
|
|
244
|
+
return "n-a"
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
def route_alpha_strategy(class_name: str) -> str:
|
|
248
|
+
name = class_name.lower()
|
|
249
|
+
if any(token in name for token in ("halo", "glow", "particle", "vfx", "black_block")):
|
|
250
|
+
return "black-add"
|
|
251
|
+
if any(token in name for token in ("fringe", "white_edge", "green_edge", "matte", "alpha")):
|
|
252
|
+
return "rgb-alpha-split"
|
|
253
|
+
if "dual" in name or "double" in name:
|
|
254
|
+
return "rgb-alpha-split"
|
|
255
|
+
return "n-a"
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
def region_box(w: int, h: int, name: str) -> list[float]:
|
|
259
|
+
if name == "top":
|
|
260
|
+
return [0.0, 0.0, float(w), float(h) * 0.18]
|
|
261
|
+
if name == "bottom":
|
|
262
|
+
return [0.0, float(h) * 0.82, float(w), float(h)]
|
|
263
|
+
if name == "board":
|
|
264
|
+
return [float(w) * 0.08, float(h) * 0.22, float(w) * 0.92, float(h) * 0.72]
|
|
265
|
+
return [0.0, 0.0, float(w), float(h)]
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
def run_verifier_json(root: Path, script_rel: str) -> dict[str, Any]:
|
|
269
|
+
script = root / script_rel
|
|
270
|
+
if not script.exists():
|
|
271
|
+
return {}
|
|
272
|
+
proc = subprocess.run(
|
|
273
|
+
[sys.executable, str(script), "--root", str(root)],
|
|
274
|
+
capture_output=True,
|
|
275
|
+
text=True,
|
|
276
|
+
check=False,
|
|
277
|
+
)
|
|
278
|
+
if proc.returncode not in (0, 2):
|
|
279
|
+
return {}
|
|
280
|
+
try:
|
|
281
|
+
return json.loads(proc.stdout or "{}")
|
|
282
|
+
except json.JSONDecodeError:
|
|
283
|
+
return {}
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
def tile_content_bbox(image_mod: Any, path: Path) -> list[float] | None:
|
|
287
|
+
img = image_mod.open(path).convert("RGBA")
|
|
288
|
+
w, h = img.size
|
|
289
|
+
pixels = img.load()
|
|
290
|
+
min_x, min_y, max_x, max_y = w, h, 0, 0
|
|
291
|
+
found = False
|
|
292
|
+
for y in range(h):
|
|
293
|
+
for x in range(w):
|
|
294
|
+
if pixels[x, y][3] > 16:
|
|
295
|
+
found = True
|
|
296
|
+
min_x = min(min_x, x)
|
|
297
|
+
min_y = min(min_y, y)
|
|
298
|
+
max_x = max(max_x, x)
|
|
299
|
+
max_y = max(max_y, y)
|
|
300
|
+
if not found:
|
|
301
|
+
return None
|
|
302
|
+
return [float(min_x), float(min_y), float(max_x + 1), float(max_y + 1)]
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
def ocr_boxes_for_cta(image_mod: Any, path: Path) -> list[dict[str, Any]]:
|
|
306
|
+
try:
|
|
307
|
+
import pytesseract
|
|
308
|
+
from pytesseract import Output
|
|
309
|
+
except Exception:
|
|
310
|
+
return []
|
|
311
|
+
img = image_mod.open(path)
|
|
312
|
+
w, h = img.size
|
|
313
|
+
crop = img.crop((0, int(h * 0.55), w, h))
|
|
314
|
+
offset_y = int(h * 0.55)
|
|
315
|
+
data = pytesseract.image_to_data(crop, output_type=Output.DICT)
|
|
316
|
+
boxes: list[dict[str, Any]] = []
|
|
317
|
+
n = len(data.get("text", []))
|
|
318
|
+
for i in range(n):
|
|
319
|
+
try:
|
|
320
|
+
conf = int(data["conf"][i])
|
|
321
|
+
except (TypeError, ValueError):
|
|
322
|
+
continue
|
|
323
|
+
if conf < 45:
|
|
324
|
+
continue
|
|
325
|
+
text = str(data["text"][i]).strip()
|
|
326
|
+
if len(text) < 2:
|
|
327
|
+
continue
|
|
328
|
+
left = int(data["left"][i])
|
|
329
|
+
top = int(data["top"][i]) + offset_y
|
|
330
|
+
width = int(data["width"][i])
|
|
331
|
+
height = int(data["height"][i])
|
|
332
|
+
boxes.append(
|
|
333
|
+
{
|
|
334
|
+
"box": [left, top, left + width, top + height],
|
|
335
|
+
"className": "text_overlap",
|
|
336
|
+
"confidence": max(0.0, min(1.0, conf / 100.0)),
|
|
337
|
+
"sourcePath": str(path),
|
|
338
|
+
"text": text,
|
|
339
|
+
}
|
|
340
|
+
)
|
|
341
|
+
return boxes
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
def detections_from_bg_clean(root: Path, payload: dict[str, Any], image_mod: Any) -> list[dict[str, Any]]:
|
|
345
|
+
if payload.get("ok") is True and not payload.get("failures"):
|
|
346
|
+
return []
|
|
347
|
+
out: list[dict[str, Any]] = []
|
|
348
|
+
for asset in payload.get("assets") or []:
|
|
349
|
+
if not isinstance(asset, dict):
|
|
350
|
+
continue
|
|
351
|
+
rel = str(asset.get("path") or "")
|
|
352
|
+
if not rel or not asset.get("failures"):
|
|
353
|
+
continue
|
|
354
|
+
path = root / rel
|
|
355
|
+
if not path.exists():
|
|
356
|
+
continue
|
|
357
|
+
img = image_mod.open(path)
|
|
358
|
+
w, h = img.size
|
|
359
|
+
flagged_regions: set[str] = set()
|
|
360
|
+
for failure in asset.get("failures") or []:
|
|
361
|
+
text = str(failure).lower()
|
|
362
|
+
if "top roi" in text:
|
|
363
|
+
flagged_regions.add("top")
|
|
364
|
+
elif "bottom roi" in text:
|
|
365
|
+
flagged_regions.add("bottom")
|
|
366
|
+
elif "board roi" in text or "grid" in text or "composite" in text:
|
|
367
|
+
flagged_regions.add("board")
|
|
368
|
+
if not flagged_regions:
|
|
369
|
+
flagged_regions.add("board")
|
|
370
|
+
for region in flagged_regions:
|
|
371
|
+
box = region_box(w, h, region)
|
|
372
|
+
class_name = "baked_grid" if region == "board" else f"bg_{region}_text"
|
|
373
|
+
out.append(
|
|
374
|
+
{
|
|
375
|
+
"box": box,
|
|
376
|
+
"className": class_name,
|
|
377
|
+
"confidence": 0.85,
|
|
378
|
+
"sourcePath": rel,
|
|
379
|
+
"recommendedSkill": route_skill(class_name),
|
|
380
|
+
"alphaStrategy": route_alpha_strategy(class_name),
|
|
381
|
+
}
|
|
382
|
+
)
|
|
383
|
+
return out
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
def detections_from_tile_consistency(root: Path, payload: dict[str, Any], image_mod: Any) -> list[dict[str, Any]]:
|
|
387
|
+
if payload.get("ok") is True and not payload.get("failures"):
|
|
388
|
+
return []
|
|
389
|
+
out: list[dict[str, Any]] = []
|
|
390
|
+
tiles_dir = root / "assets" / "images" / "tiles"
|
|
391
|
+
group = payload.get("silhouetteGroup") or []
|
|
392
|
+
for name in group:
|
|
393
|
+
path = tiles_dir / name
|
|
394
|
+
if not path.exists():
|
|
395
|
+
continue
|
|
396
|
+
box = tile_content_bbox(image_mod, path)
|
|
397
|
+
if not box:
|
|
398
|
+
continue
|
|
399
|
+
out.append(
|
|
400
|
+
{
|
|
401
|
+
"box": box,
|
|
402
|
+
"className": "tile_inconsistent",
|
|
403
|
+
"confidence": 0.8,
|
|
404
|
+
"sourcePath": str(path.relative_to(root)),
|
|
405
|
+
"recommendedSkill": route_skill("wrong_tile"),
|
|
406
|
+
"alphaStrategy": route_alpha_strategy("wrong_tile"),
|
|
407
|
+
}
|
|
408
|
+
)
|
|
409
|
+
return out
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
def detections_from_text_overlap(root: Path, payload: dict[str, Any], image_mod: Any) -> list[dict[str, Any]]:
|
|
413
|
+
if payload.get("ok") is True and not payload.get("failures"):
|
|
414
|
+
return []
|
|
415
|
+
if not payload.get("ocrAvailable", True):
|
|
416
|
+
return []
|
|
417
|
+
logs = root / "logs"
|
|
418
|
+
out: list[dict[str, Any]] = []
|
|
419
|
+
for pattern in ("ui-diff-*.png", "load-check.png"):
|
|
420
|
+
for path in sorted(logs.glob(pattern)):
|
|
421
|
+
for raw in ocr_boxes_for_cta(image_mod, path):
|
|
422
|
+
rel = str(path.relative_to(root))
|
|
423
|
+
out.append(
|
|
424
|
+
{
|
|
425
|
+
"box": raw["box"],
|
|
426
|
+
"className": raw["className"],
|
|
427
|
+
"confidence": raw["confidence"],
|
|
428
|
+
"sourcePath": rel,
|
|
429
|
+
"recommendedSkill": route_skill("text_overlap"),
|
|
430
|
+
"alphaStrategy": route_alpha_strategy("text_overlap"),
|
|
431
|
+
}
|
|
432
|
+
)
|
|
433
|
+
return out
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
def collect_auto_detections(root: Path, image_mod: Any) -> tuple[list[dict[str, Any]], list[str]]:
|
|
437
|
+
sources: list[str] = []
|
|
438
|
+
merged: list[dict[str, Any]] = []
|
|
439
|
+
collectors = (
|
|
440
|
+
("verify_bg_clean", detections_from_bg_clean),
|
|
441
|
+
("verify_tile_consistency", detections_from_tile_consistency),
|
|
442
|
+
("verify_text_overlap", detections_from_text_overlap),
|
|
443
|
+
)
|
|
444
|
+
for i, (name, collector) in enumerate(collectors):
|
|
445
|
+
payload = run_verifier_json(root, VERIFIER_SCRIPTS[i])
|
|
446
|
+
if payload:
|
|
447
|
+
sources.append(name)
|
|
448
|
+
merged.extend(collector(root, payload, image_mod))
|
|
449
|
+
return merged, sources
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
def collect_auto_issues(root: Path) -> tuple[list[dict[str, Any]], list[str]]:
|
|
453
|
+
sources: list[str] = []
|
|
454
|
+
issues: list[dict[str, Any]] = []
|
|
455
|
+
for script_rel in VERIFIER_SCRIPTS:
|
|
456
|
+
name = Path(script_rel).stem
|
|
457
|
+
payload = run_verifier_json(root, script_rel)
|
|
458
|
+
if not payload:
|
|
459
|
+
continue
|
|
460
|
+
sources.append(name)
|
|
461
|
+
normalized = normalize_issues(payload)
|
|
462
|
+
if normalized:
|
|
463
|
+
issues.extend(normalized)
|
|
464
|
+
return issues, sources
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
def collect_screenshots(root: Path, logs_dir: Path) -> list[Path]:
|
|
468
|
+
found: list[Path] = []
|
|
469
|
+
seen: set[Path] = set()
|
|
470
|
+
if not logs_dir.exists():
|
|
471
|
+
return []
|
|
472
|
+
for pattern in DEFAULT_SCREENSHOT_PATTERNS:
|
|
473
|
+
for path in sorted(logs_dir.glob(pattern)):
|
|
474
|
+
resolved = path.resolve()
|
|
475
|
+
if resolved not in seen:
|
|
476
|
+
seen.add(resolved)
|
|
477
|
+
found.append(path)
|
|
478
|
+
return found
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
def detections_for_source(detections: list[dict[str, Any]], source: Path, root: Path) -> list[dict[str, Any]]:
|
|
482
|
+
source_posix = source.as_posix()
|
|
483
|
+
rel = source.relative_to(root).as_posix()
|
|
484
|
+
by_path = [
|
|
485
|
+
d
|
|
486
|
+
for d in detections
|
|
487
|
+
if d.get("sourcePath") and (d["sourcePath"] in source_posix or d["sourcePath"] in rel)
|
|
488
|
+
]
|
|
489
|
+
if by_path:
|
|
490
|
+
return by_path
|
|
491
|
+
return [d for d in detections if not d.get("sourcePath")]
|
|
492
|
+
|
|
493
|
+
|
|
494
|
+
def annotate_image(deps: PillowDeps, image: Any, detections: list[dict[str, Any]]) -> Any:
|
|
495
|
+
annotated = image.copy().convert("RGBA")
|
|
496
|
+
overlay = deps.Image.new("RGBA", annotated.size, (0, 0, 0, 0))
|
|
497
|
+
draw = deps.ImageDraw.Draw(overlay)
|
|
498
|
+
try:
|
|
499
|
+
font = deps.ImageFont.load_default()
|
|
500
|
+
except Exception:
|
|
501
|
+
font = None
|
|
502
|
+
for det in detections:
|
|
503
|
+
x1, y1, x2, y2 = [int(v) for v in det["box"]]
|
|
504
|
+
draw.rectangle([x1, y1, x2, y2], outline=(255, 64, 64, 255), width=3)
|
|
505
|
+
label = f"{det['className']} {det['confidence']:.2f}"
|
|
506
|
+
if font is not None:
|
|
507
|
+
text_box = draw.textbbox((x1, max(0, y1 - 14)), label, font=font)
|
|
508
|
+
draw.rectangle(text_box, fill=(255, 64, 64, 200))
|
|
509
|
+
draw.text((x1, max(0, y1 - 14)), label, fill=(255, 255, 255, 255), font=font)
|
|
510
|
+
return deps.Image.alpha_composite(annotated, overlay).convert("RGB")
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
def summarize_detection(
|
|
514
|
+
det: dict[str, Any],
|
|
515
|
+
source: Path,
|
|
516
|
+
root: Path,
|
|
517
|
+
evidence_type: str = "screenshot",
|
|
518
|
+
) -> dict[str, Any]:
|
|
519
|
+
return {
|
|
520
|
+
"id": det.get("id"),
|
|
521
|
+
"source": str(source.relative_to(root)),
|
|
522
|
+
"evidenceType": evidence_type,
|
|
523
|
+
"status": det.get("status", "warn"),
|
|
524
|
+
"severity": det.get("severity", "evidence"),
|
|
525
|
+
"message": det.get("message"),
|
|
526
|
+
"frame": det.get("frame"),
|
|
527
|
+
"className": det["className"],
|
|
528
|
+
"confidence": det["confidence"],
|
|
529
|
+
"box": det["box"],
|
|
530
|
+
"recommendedSkill": det["recommendedSkill"],
|
|
531
|
+
"alphaStrategy": det["alphaStrategy"],
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
|
|
535
|
+
def process_screenshots(
|
|
536
|
+
deps: PillowDeps,
|
|
537
|
+
root: Path,
|
|
538
|
+
screenshots: list[Path],
|
|
539
|
+
detections: list[dict[str, Any]],
|
|
540
|
+
out_dir: Path,
|
|
541
|
+
) -> tuple[list[dict[str, Any]], list[dict[str, Any]], set[tuple[str, str, tuple[float, float, float, float], int | None]]]:
|
|
542
|
+
images: list[dict[str, Any]] = []
|
|
543
|
+
findings: list[dict[str, Any]] = []
|
|
544
|
+
used: set[tuple[str, str, tuple[float, float, float, float], int | None]] = set()
|
|
545
|
+
out_dir.mkdir(parents=True, exist_ok=True)
|
|
546
|
+
for path in screenshots:
|
|
547
|
+
try:
|
|
548
|
+
image = deps.Image.open(path)
|
|
549
|
+
except Exception:
|
|
550
|
+
findings.append({"source": str(path.relative_to(root)), "severity": "warn", "message": "image unreadable"})
|
|
551
|
+
continue
|
|
552
|
+
source_dets = detections_for_source(detections, path, root)
|
|
553
|
+
for det in source_dets:
|
|
554
|
+
used.add(detection_key(det))
|
|
555
|
+
annotated = annotate_image(deps, image, source_dets)
|
|
556
|
+
out_path = out_dir / f"{path.stem}-vision.png"
|
|
557
|
+
annotated.save(out_path, format="PNG")
|
|
558
|
+
images.append(
|
|
559
|
+
{
|
|
560
|
+
"source": str(path.relative_to(root)),
|
|
561
|
+
"annotated": str(out_path.relative_to(root)),
|
|
562
|
+
"detections": len(source_dets),
|
|
563
|
+
}
|
|
564
|
+
)
|
|
565
|
+
for det in source_dets:
|
|
566
|
+
finding = summarize_detection(det, path, root, "screenshot")
|
|
567
|
+
findings.append(finding)
|
|
568
|
+
return images, findings, used
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
def detection_key(det: dict[str, Any]) -> tuple[str, str, tuple[float, float, float, float], int | None]:
|
|
572
|
+
box = tuple(round(float(v), 3) for v in det["box"])
|
|
573
|
+
return (str(det.get("sourcePath") or ""), str(det.get("className") or ""), box, det.get("frame"))
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
def source_path_for_detection(root: Path, det: dict[str, Any]) -> Path | None:
|
|
577
|
+
raw = str(det.get("sourcePath") or "").strip()
|
|
578
|
+
if not raw:
|
|
579
|
+
return None
|
|
580
|
+
path = Path(raw)
|
|
581
|
+
if not path.is_absolute():
|
|
582
|
+
path = root / raw
|
|
583
|
+
try:
|
|
584
|
+
path.relative_to(root)
|
|
585
|
+
except ValueError:
|
|
586
|
+
return None
|
|
587
|
+
return path if path.exists() else None
|
|
588
|
+
|
|
589
|
+
|
|
590
|
+
def process_asset_detections(
|
|
591
|
+
deps: PillowDeps,
|
|
592
|
+
root: Path,
|
|
593
|
+
detections: list[dict[str, Any]],
|
|
594
|
+
used: set[tuple[str, str, tuple[float, float, float, float], int | None]],
|
|
595
|
+
out_dir: Path,
|
|
596
|
+
) -> tuple[list[dict[str, Any]], list[dict[str, Any]], list[dict[str, Any]]]:
|
|
597
|
+
assets: list[dict[str, Any]] = []
|
|
598
|
+
findings: list[dict[str, Any]] = []
|
|
599
|
+
dropped: list[dict[str, Any]] = []
|
|
600
|
+
out_dir.mkdir(parents=True, exist_ok=True)
|
|
601
|
+
|
|
602
|
+
for det in detections:
|
|
603
|
+
key = detection_key(det)
|
|
604
|
+
if key in used:
|
|
605
|
+
continue
|
|
606
|
+
source = source_path_for_detection(root, det)
|
|
607
|
+
if source is None:
|
|
608
|
+
dropped.append(
|
|
609
|
+
{
|
|
610
|
+
"sourcePath": str(det.get("sourcePath") or ""),
|
|
611
|
+
"className": det.get("className"),
|
|
612
|
+
"reason": "sourcePath does not match a screenshot and is not a readable asset under project root",
|
|
613
|
+
}
|
|
614
|
+
)
|
|
615
|
+
continue
|
|
616
|
+
try:
|
|
617
|
+
image = deps.Image.open(source)
|
|
618
|
+
except Exception:
|
|
619
|
+
dropped.append(
|
|
620
|
+
{
|
|
621
|
+
"sourcePath": str(det.get("sourcePath") or ""),
|
|
622
|
+
"className": det.get("className"),
|
|
623
|
+
"reason": "asset image unreadable",
|
|
624
|
+
}
|
|
625
|
+
)
|
|
626
|
+
continue
|
|
627
|
+
|
|
628
|
+
annotated = annotate_image(deps, image, [det])
|
|
629
|
+
rel = source.relative_to(root)
|
|
630
|
+
safe_stem = "-".join(rel.with_suffix("").parts)
|
|
631
|
+
out_path = out_dir / f"{safe_stem}-asset-vision.png"
|
|
632
|
+
annotated.save(out_path, format="PNG")
|
|
633
|
+
assets.append(
|
|
634
|
+
{
|
|
635
|
+
"source": str(rel),
|
|
636
|
+
"annotated": str(out_path.relative_to(root)),
|
|
637
|
+
"detections": 1,
|
|
638
|
+
}
|
|
639
|
+
)
|
|
640
|
+
finding = summarize_detection(det, source, root, "asset")
|
|
641
|
+
finding["annotated"] = str(out_path.relative_to(root))
|
|
642
|
+
findings.append(finding)
|
|
643
|
+
|
|
644
|
+
return assets, findings, dropped
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
def safe_output_stem(value: str) -> str:
|
|
648
|
+
cleaned = "".join(ch if ch.isalnum() or ch in ("-", "_", ".") else "-" for ch in value)
|
|
649
|
+
return cleaned.strip("-") or "issue"
|
|
650
|
+
|
|
651
|
+
|
|
652
|
+
def source_entry_path(root: Path, entry: Any) -> tuple[str, Path | None]:
|
|
653
|
+
if isinstance(entry, dict):
|
|
654
|
+
raw = str(entry.get("sourcePath") or entry.get("path") or "")
|
|
655
|
+
else:
|
|
656
|
+
raw = str(entry or "")
|
|
657
|
+
if not raw:
|
|
658
|
+
return "", None
|
|
659
|
+
path = Path(raw)
|
|
660
|
+
if not path.is_absolute():
|
|
661
|
+
path = root / raw
|
|
662
|
+
try:
|
|
663
|
+
rel = path.relative_to(root).as_posix()
|
|
664
|
+
except ValueError:
|
|
665
|
+
return raw, None
|
|
666
|
+
return rel, path if path.exists() else None
|
|
667
|
+
|
|
668
|
+
|
|
669
|
+
def render_group_evidence(
|
|
670
|
+
deps: PillowDeps,
|
|
671
|
+
root: Path,
|
|
672
|
+
issue: dict[str, Any],
|
|
673
|
+
out_dir: Path,
|
|
674
|
+
) -> tuple[dict[str, Any] | None, dict[str, Any] | None, list[dict[str, Any]]]:
|
|
675
|
+
sources = issue.get("sources") if isinstance(issue.get("sources"), list) else []
|
|
676
|
+
dropped: list[dict[str, Any]] = []
|
|
677
|
+
tiles: list[dict[str, Any]] = []
|
|
678
|
+
thumb_w, thumb_h = 176, 150
|
|
679
|
+
for entry in sources:
|
|
680
|
+
rel, path = source_entry_path(root, entry)
|
|
681
|
+
if path is None:
|
|
682
|
+
dropped.append(
|
|
683
|
+
{
|
|
684
|
+
"id": issue.get("id"),
|
|
685
|
+
"sourcePath": rel,
|
|
686
|
+
"className": issue.get("className"),
|
|
687
|
+
"reason": "asset-group source is missing or outside project root",
|
|
688
|
+
}
|
|
689
|
+
)
|
|
690
|
+
continue
|
|
691
|
+
try:
|
|
692
|
+
image = deps.Image.open(path).convert("RGBA")
|
|
693
|
+
except Exception:
|
|
694
|
+
dropped.append(
|
|
695
|
+
{
|
|
696
|
+
"id": issue.get("id"),
|
|
697
|
+
"sourcePath": rel,
|
|
698
|
+
"className": issue.get("className"),
|
|
699
|
+
"reason": "asset-group source image unreadable",
|
|
700
|
+
}
|
|
701
|
+
)
|
|
702
|
+
continue
|
|
703
|
+
image.thumbnail((thumb_w, thumb_h))
|
|
704
|
+
metrics = entry.get("metrics") if isinstance(entry, dict) and isinstance(entry.get("metrics"), dict) else {}
|
|
705
|
+
tiles.append({"rel": rel, "image": image, "metrics": metrics})
|
|
706
|
+
|
|
707
|
+
if not tiles:
|
|
708
|
+
return None, None, dropped
|
|
709
|
+
|
|
710
|
+
cols = min(4, max(1, len(tiles)))
|
|
711
|
+
rows = (len(tiles) + cols - 1) // cols
|
|
712
|
+
label_h = 76
|
|
713
|
+
pad = 14
|
|
714
|
+
canvas_w = cols * (thumb_w + pad) + pad
|
|
715
|
+
canvas_h = rows * (thumb_h + label_h + pad) + pad
|
|
716
|
+
canvas = deps.Image.new("RGB", (canvas_w, canvas_h), (248, 248, 248))
|
|
717
|
+
draw = deps.ImageDraw.Draw(canvas)
|
|
718
|
+
try:
|
|
719
|
+
font = deps.ImageFont.load_default()
|
|
720
|
+
except Exception:
|
|
721
|
+
font = None
|
|
722
|
+
|
|
723
|
+
for idx, tile in enumerate(tiles):
|
|
724
|
+
col = idx % cols
|
|
725
|
+
row = idx // cols
|
|
726
|
+
x = pad + col * (thumb_w + pad)
|
|
727
|
+
y = pad + row * (thumb_h + label_h + pad)
|
|
728
|
+
draw.rectangle([x, y, x + thumb_w, y + thumb_h + label_h], outline=(220, 220, 220), width=1)
|
|
729
|
+
image = tile["image"]
|
|
730
|
+
ox = x + (thumb_w - image.width) // 2
|
|
731
|
+
oy = y + (thumb_h - image.height) // 2
|
|
732
|
+
canvas.paste(image.convert("RGB"), (ox, oy), image if image.mode == "RGBA" else None)
|
|
733
|
+
label = Path(tile["rel"]).name
|
|
734
|
+
metrics = tile.get("metrics") or {}
|
|
735
|
+
metric_lines = [
|
|
736
|
+
f"{k}={metrics[k]}"
|
|
737
|
+
for k in ("bboxOccupancy", "aspect", "fillRatio")
|
|
738
|
+
if k in metrics
|
|
739
|
+
]
|
|
740
|
+
draw.text((x + 6, y + thumb_h + 8), label[:28], fill=(30, 30, 30), font=font)
|
|
741
|
+
for line_idx, metric_label in enumerate(metric_lines[:3]):
|
|
742
|
+
draw.text(
|
|
743
|
+
(x + 6, y + thumb_h + 26 + line_idx * 14),
|
|
744
|
+
metric_label[:30],
|
|
745
|
+
fill=(120, 40, 40),
|
|
746
|
+
font=font,
|
|
747
|
+
)
|
|
748
|
+
|
|
749
|
+
out_dir.mkdir(parents=True, exist_ok=True)
|
|
750
|
+
out_path = out_dir / f"{safe_output_stem(str(issue.get('id') or issue.get('className')))}-group-vision.png"
|
|
751
|
+
canvas.save(out_path, format="PNG")
|
|
752
|
+
output = {
|
|
753
|
+
"id": issue.get("id"),
|
|
754
|
+
"source": issue.get("sourcePath", ""),
|
|
755
|
+
"annotated": str(out_path.relative_to(root)),
|
|
756
|
+
"sources": [tile["rel"] for tile in tiles],
|
|
757
|
+
"detections": len(tiles),
|
|
758
|
+
}
|
|
759
|
+
finding = {
|
|
760
|
+
"id": issue.get("id"),
|
|
761
|
+
"source": issue.get("sourcePath", ""),
|
|
762
|
+
"evidenceType": "asset-group",
|
|
763
|
+
"status": issue.get("status", "warn"),
|
|
764
|
+
"severity": issue.get("severity", "P1"),
|
|
765
|
+
"message": issue.get("message"),
|
|
766
|
+
"className": issue.get("className"),
|
|
767
|
+
"recommendedSkill": issue.get("recommendedSkill"),
|
|
768
|
+
"alphaStrategy": issue.get("alphaStrategy"),
|
|
769
|
+
"annotated": str(out_path.relative_to(root)),
|
|
770
|
+
"metrics": issue.get("metrics", {}),
|
|
771
|
+
}
|
|
772
|
+
return output, finding, dropped
|
|
773
|
+
|
|
774
|
+
|
|
775
|
+
def process_group_issues(
|
|
776
|
+
deps: PillowDeps,
|
|
777
|
+
root: Path,
|
|
778
|
+
issues: list[dict[str, Any]],
|
|
779
|
+
out_dir: Path,
|
|
780
|
+
) -> tuple[list[dict[str, Any]], list[dict[str, Any]], list[dict[str, Any]]]:
|
|
781
|
+
groups: list[dict[str, Any]] = []
|
|
782
|
+
findings: list[dict[str, Any]] = []
|
|
783
|
+
dropped: list[dict[str, Any]] = []
|
|
784
|
+
for issue in issues:
|
|
785
|
+
if issue.get("evidenceType") != "asset-group":
|
|
786
|
+
continue
|
|
787
|
+
output, finding, group_dropped = render_group_evidence(deps, root, issue, out_dir)
|
|
788
|
+
if output:
|
|
789
|
+
groups.append(output)
|
|
790
|
+
if finding:
|
|
791
|
+
findings.append(finding)
|
|
792
|
+
dropped.extend(group_dropped)
|
|
793
|
+
return groups, findings, dropped
|
|
794
|
+
|
|
795
|
+
|
|
796
|
+
def write_report(path: Path, report: dict[str, Any]) -> None:
|
|
797
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
798
|
+
path.write_text(json.dumps(report, ensure_ascii=False, indent=2), encoding="utf-8")
|
|
799
|
+
|
|
800
|
+
|
|
801
|
+
def main() -> int:
|
|
802
|
+
parser = argparse.ArgumentParser(description="Generate thin Pillow vision evidence for Reviewer")
|
|
803
|
+
parser.add_argument("--root", default=".")
|
|
804
|
+
parser.add_argument("--issues", type=Path, default=None, help="Validator issues JSON generated by verify:ui")
|
|
805
|
+
parser.add_argument("--detections", type=Path, default=None, help="Optional detector JSON from playcraft tools detect")
|
|
806
|
+
parser.add_argument("--strict", action="store_true", help="Fail when Pillow or evidence inputs are missing")
|
|
807
|
+
parser.add_argument("--json", action="store_true", help="Print report JSON to stdout")
|
|
808
|
+
args = parser.parse_args()
|
|
809
|
+
|
|
810
|
+
root = Path(args.root).resolve()
|
|
811
|
+
out_dir = root / "validate" / "vision"
|
|
812
|
+
report_path = out_dir / "vision-evidence.json"
|
|
813
|
+
deps, dep_error = load_pillow()
|
|
814
|
+
if deps is None:
|
|
815
|
+
report = {
|
|
816
|
+
"ok": not args.strict,
|
|
817
|
+
"status": "degraded",
|
|
818
|
+
"reason": "Pillow is not installed",
|
|
819
|
+
"detail": dep_error,
|
|
820
|
+
"install": "pip install -r skills/playable-verify-ui/requirements.txt",
|
|
821
|
+
"issues": [],
|
|
822
|
+
"findings": [],
|
|
823
|
+
}
|
|
824
|
+
write_report(report_path, report)
|
|
825
|
+
if args.json:
|
|
826
|
+
print(json.dumps(report, ensure_ascii=False, indent=2))
|
|
827
|
+
return 2 if args.strict else 0
|
|
828
|
+
|
|
829
|
+
issue_payload = read_json(args.issues.resolve() if args.issues else None)
|
|
830
|
+
issues = normalize_issues(issue_payload)
|
|
831
|
+
auto_sources: list[str] = []
|
|
832
|
+
if not issues:
|
|
833
|
+
issues, auto_sources = collect_auto_issues(root)
|
|
834
|
+
|
|
835
|
+
issue_detections, issue_dropped = detections_from_issues(issues)
|
|
836
|
+
detector_payload = read_json(args.detections.resolve() if args.detections else None)
|
|
837
|
+
detector_detections = normalize_detections(detector_payload)
|
|
838
|
+
detections = issue_detections + detector_detections
|
|
839
|
+
|
|
840
|
+
screenshots = collect_screenshots(root, root / "logs")
|
|
841
|
+
image_outputs, image_findings, used_detections = process_screenshots(deps, root, screenshots, detections, out_dir)
|
|
842
|
+
asset_outputs, asset_findings, dropped_detections = process_asset_detections(
|
|
843
|
+
deps,
|
|
844
|
+
root,
|
|
845
|
+
detections,
|
|
846
|
+
used_detections,
|
|
847
|
+
out_dir,
|
|
848
|
+
)
|
|
849
|
+
group_outputs, group_findings, group_dropped = process_group_issues(deps, root, issues, out_dir)
|
|
850
|
+
dropped_detections = issue_dropped + dropped_detections + group_dropped
|
|
851
|
+
|
|
852
|
+
status = "pass"
|
|
853
|
+
failures: list[str] = []
|
|
854
|
+
if args.strict and not image_outputs:
|
|
855
|
+
status = "fail"
|
|
856
|
+
failures.append("no screenshots found for vision evidence")
|
|
857
|
+
report = {
|
|
858
|
+
"ok": status != "fail",
|
|
859
|
+
"status": status,
|
|
860
|
+
"issuesJson": str(args.issues) if args.issues else None,
|
|
861
|
+
"detectorJson": str(args.detections) if args.detections else None,
|
|
862
|
+
"autoSources": auto_sources,
|
|
863
|
+
"summary": {
|
|
864
|
+
"screenshots": len(screenshots),
|
|
865
|
+
"detections": len(detections),
|
|
866
|
+
"annotatedImages": len(image_outputs),
|
|
867
|
+
"assetEvidence": len(asset_outputs),
|
|
868
|
+
"groupEvidence": len(group_outputs),
|
|
869
|
+
"droppedDetections": len(dropped_detections),
|
|
870
|
+
},
|
|
871
|
+
"issues": issues,
|
|
872
|
+
"images": image_outputs,
|
|
873
|
+
"assets": asset_outputs,
|
|
874
|
+
"groups": group_outputs,
|
|
875
|
+
"findings": image_findings + asset_findings + group_findings,
|
|
876
|
+
"droppedDetections": dropped_detections,
|
|
877
|
+
"failures": failures,
|
|
878
|
+
}
|
|
879
|
+
write_report(report_path, report)
|
|
880
|
+
if args.json:
|
|
881
|
+
print(json.dumps(report, ensure_ascii=False, indent=2))
|
|
882
|
+
else:
|
|
883
|
+
print(f"[verify:vision] {status.upper()} — {report_path.relative_to(root)}")
|
|
884
|
+
print(
|
|
885
|
+
f" screenshots={report['summary']['screenshots']} "
|
|
886
|
+
f"detections={report['summary']['detections']} "
|
|
887
|
+
f"groups={report['summary']['groupEvidence']} "
|
|
888
|
+
f"autoSources={','.join(auto_sources) if auto_sources else 'none'}"
|
|
889
|
+
)
|
|
890
|
+
return 0 if report["ok"] else 2
|
|
891
|
+
|
|
892
|
+
|
|
893
|
+
if __name__ == "__main__":
|
|
894
|
+
raise SystemExit(main())
|