@playcraft/cli 0.0.43 → 0.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atom-tree/build-skeleton.js +180 -0
- package/dist/atom-tree/fusion-hints.js +86 -0
- package/dist/atom-tree/selection.js +402 -0
- package/dist/commands/build-all.js +33 -5
- package/dist/commands/build.js +13 -7
- package/dist/commands/create.js +774 -50
- package/dist/commands/image.js +11 -0
- package/dist/commands/prad.js +3 -3
- 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/check.test.js +23 -1
- package/dist/prad/skills-index.js +1 -1
- 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/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/index.ts +76 -0
- package/engine-packs/threejs/game/runtime-contract.ts +15 -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/build-evidence-gate.mjs +87 -0
- package/project-template/skills/_shared/scripts/context-budget.mjs +215 -0
- package/project-template/skills/_shared/scripts/create-playable.mjs +140 -0
- package/project-template/skills/_shared/scripts/dev-start.mjs +151 -0
- package/project-template/skills/_shared/scripts/disclosure-config.mjs +480 -0
- package/project-template/skills/_shared/scripts/ensure-project.mjs +532 -0
- package/project-template/skills/_shared/scripts/gen-placeholder-audio.py +345 -0
- package/project-template/skills/_shared/scripts/gen-placeholder.py +244 -0
- package/project-template/skills/_shared/scripts/harness-smoke.mjs +257 -0
- package/project-template/skills/_shared/scripts/lib/validator-artifacts.mjs +129 -0
- package/project-template/skills/_shared/scripts/placeholder-pack-sheet.mjs +67 -0
- package/project-template/skills/_shared/scripts/placeholder_audio_lib.py +142 -0
- package/project-template/skills/_shared/scripts/placeholder_lib.py +993 -0
- package/project-template/skills/_shared/scripts/render-project-state.mjs +278 -0
- package/project-template/skills/_shared/scripts/ring-config.mjs +252 -0
- package/project-template/skills/_shared/scripts/skills-check.mjs +176 -0
- package/project-template/skills/_shared/scripts/slice-set.mjs +77 -0
- package/project-template/skills/_shared/scripts/state-advance-ring.mjs +63 -0
- package/project-template/skills/_shared/scripts/state-get.mjs +215 -0
- package/project-template/skills/_shared/scripts/state-handoff.mjs +120 -0
- package/project-template/skills/_shared/scripts/state-set.mjs +113 -0
- package/project-template/skills/_shared/scripts/state-store.mjs +893 -0
- package/project-template/skills/_shared/scripts/sync-template-skills.mjs +112 -0
- package/project-template/skills/_shared/scripts/verify-asset-code-sync.mjs +265 -0
- package/project-template/skills/_shared/scripts/verify-atom-conformance.mjs +181 -0
- package/project-template/skills/_shared/scripts/verify-env.mjs +285 -0
- package/project-template/skills/_shared/scripts/verify-placeholders.mjs +161 -0
- package/project-template/skills/_shared/scripts/workflow-doctor.mjs +348 -0
- package/project-template/skills/playable-animate/SKILL.md +52 -0
- package/project-template/skills/playable-animate/agents/openai.yaml +4 -0
- package/project-template/skills/playable-animate/references/board-refresh.md +30 -0
- package/project-template/skills/playable-animate/references/diagnosis-checklist.md +25 -0
- package/project-template/skills/playable-animate/references/entrance-sequencing.md +33 -0
- package/project-template/skills/playable-animate/references/interaction-timing.md +23 -0
- package/project-template/skills/playable-art/SKILL.md +203 -0
- package/project-template/skills/playable-art/agents/openai.yaml +4 -0
- package/project-template/skills/playable-art/references/alpha-postprocess.md +46 -0
- package/project-template/skills/playable-art/references/cta-art-spec.md +59 -0
- package/project-template/skills/playable-art/references/layout-proportions.md +30 -0
- package/project-template/skills/playable-art/references/prompt-patterns.md +83 -0
- package/project-template/skills/playable-art/references/reference-comparison.md +30 -0
- package/project-template/skills/playable-art/references/sheet-import-v2.md +91 -0
- package/project-template/skills/playable-art/scripts/build-atlas.py +332 -0
- package/project-template/skills/playable-art/scripts/chroma-key.py +50 -0
- package/project-template/skills/playable-art/scripts/extract-alpha-split.py +65 -0
- package/project-template/skills/playable-art/scripts/extract-dual-bg-alpha.py +118 -0
- package/project-template/skills/playable-art/scripts/import-gpt-art-sheets-v2.py +403 -0
- package/project-template/skills/playable-art/scripts/import-gpt-art-sheets.py +280 -0
- package/project-template/skills/playable-art/scripts/import-gpt-tile-sheet.py +114 -0
- package/project-template/skills/playable-art/scripts/import_gpt_art_pipeline.py +321 -0
- package/project-template/skills/playable-art/scripts/import_gpt_art_sheets_v2_test.py +126 -0
- package/project-template/skills/playable-art/scripts/placeholder_common.py +98 -0
- package/project-template/skills/playable-art/scripts/remove-bg.py +91 -0
- package/project-template/skills/playable-art/scripts/review-processed-assets.py +468 -0
- package/project-template/skills/playable-art/scripts/review_processed_assets_test.py +116 -0
- package/project-template/skills/playable-art/scripts/verify-alpha-clean.py +105 -0
- package/project-template/skills/playable-debug/SKILL.md +116 -0
- package/project-template/skills/playable-debug/agents/openai.yaml +4 -0
- package/project-template/skills/playable-debug/references/debug-config.md +40 -0
- package/project-template/skills/playable-focus/SKILL.md +148 -0
- package/project-template/skills/playable-focus/scripts/bootstrap-playground.mjs +84 -0
- package/project-template/skills/playable-focus/scripts/extract-focus-frames.mjs +87 -0
- package/project-template/skills/playable-focus/scripts/generate-focus-reports.mjs +121 -0
- package/project-template/skills/playable-focus/scripts/playground.mjs +390 -0
- package/project-template/skills/playable-focus/templates/focus-lab/frame.html +39 -0
- package/project-template/skills/playable-focus/templates/focus-lab/harness/clean-stage.js +114 -0
- package/project-template/skills/playable-focus/templates/focus-lab/harness/frame-lab-scene.js +94 -0
- package/project-template/skills/playable-focus/templates/focus-lab/harness/particle-lab-scene.js +224 -0
- package/project-template/skills/playable-focus/templates/focus-lab/model.html +16 -0
- package/project-template/skills/playable-focus/templates/focus-lab/particle.html +38 -0
- package/project-template/skills/playable-focus/templates/focus-lab/shatter.html +47 -0
- package/project-template/skills/playable-focus/templates/playground/registry.template.json +55 -0
- package/project-template/skills/playable-focus/templates/playground/vfx-catalog.template.json +280 -0
- package/project-template/skills/playable-fx-decompose/SKILL.md +212 -0
- package/project-template/skills/playable-fx-decompose/examples.md +89 -0
- package/project-template/skills/playable-fx-decompose/reference.md +201 -0
- package/project-template/skills/playable-fx-decompose/requirements.txt +2 -0
- package/project-template/skills/playable-fx-decompose/scripts/build-blank-tile-crack.py +192 -0
- package/project-template/skills/playable-fx-decompose/scripts/fix-shard-debris-frames.py +60 -0
- package/project-template/skills/playable-fx-decompose/scripts/generate-shard-debris.py +276 -0
- package/project-template/skills/playable-fx-peak/SKILL.md +237 -0
- package/project-template/skills/playable-fx-peak/requirements.txt +2 -0
- package/project-template/skills/playable-fx-peak/scripts/fix-frame-edges.py +70 -0
- package/project-template/skills/playable-fx-peak/scripts/repack-frame-sequence.py +526 -0
- package/project-template/skills/playable-fx-peak/scripts/validate-frame-anchors.py +130 -0
- package/project-template/skills/playable-placeholder/SKILL.md +239 -0
- package/project-template/skills/playable-record/SKILL.md +166 -0
- package/project-template/skills/playable-record/scripts/lib/build-artifact.mjs +92 -0
- package/project-template/skills/playable-record/scripts/lib/dev-server.mjs +104 -0
- package/project-template/skills/playable-record/scripts/lib/record-audio-bridge.js +141 -0
- package/project-template/skills/playable-record/scripts/lib/slice-structure-verify.mjs +199 -0
- package/project-template/skills/playable-record/scripts/record-playable.mjs +583 -0
- package/project-template/skills/playable-record/scripts/verify-build.mjs +185 -0
- package/project-template/skills/playable-record/scripts/verify-contract.mjs +261 -0
- package/project-template/skills/playable-record/scripts/verify-firstwin.mjs +398 -0
- package/project-template/skills/playable-record/scripts/verify-fusion.mjs +320 -0
- package/project-template/skills/playable-record/scripts/verify-lifecycle.mjs +78 -0
- package/project-template/skills/playable-record/scripts/verify-slice-artist.mjs +53 -0
- package/project-template/skills/playable-record/scripts/verify-slice-ta.mjs +53 -0
- package/project-template/skills/playable-record/scripts/verify-slice.mjs +142 -0
- package/project-template/skills/playable-record/scripts/verify-visual-ring.mjs +250 -0
- package/project-template/skills/playable-record/scripts/verify-visual-ring1.mjs +190 -0
- package/project-template/skills/playable-record/scripts/verify-vlm-video.mjs +227 -0
- package/project-template/skills/playable-validate/SKILL.md +260 -0
- package/project-template/skills/playable-validate/references/checklist-detail.md +36 -0
- package/project-template/skills/playable-validate/references/single-html-bundle.md +76 -0
- package/project-template/skills/playable-validate/validation-rules.md +200 -0
- package/project-template/skills/playable-verify-ui/SKILL.md +295 -0
- package/project-template/skills/playable-verify-ui/examples/asset-manifest.example.json +36 -0
- package/project-template/skills/playable-verify-ui/examples/mahjong-match.profile.yaml +334 -0
- package/project-template/skills/playable-verify-ui/profiles/template.profile.yaml +84 -0
- package/project-template/skills/playable-verify-ui/reference.md +165 -0
- package/project-template/skills/playable-verify-ui/references/phaser-patterns.md +67 -0
- package/project-template/skills/playable-verify-ui/references/scaling-decision-tree.md +51 -0
- package/project-template/skills/playable-verify-ui/requirements.txt +7 -0
- package/project-template/skills/playable-verify-ui/schema/asset-manifest.schema.json +68 -0
- package/project-template/skills/playable-verify-ui/schema/playable-ui-profile.schema.json +171 -0
- package/project-template/skills/playable-verify-ui/scripts/asset_manifest.py +231 -0
- package/project-template/skills/playable-verify-ui/scripts/lib/__init__.py +1 -0
- package/project-template/skills/playable-verify-ui/scripts/lib/config_expr.js +218 -0
- package/project-template/skills/playable-verify-ui/scripts/lib/node_utils.js +51 -0
- package/project-template/skills/playable-verify-ui/scripts/lib/profile_loader.py +59 -0
- package/project-template/skills/playable-verify-ui/scripts/lib/report.py +106 -0
- package/project-template/skills/playable-verify-ui/scripts/lib/runtime_contract.js +116 -0
- package/project-template/skills/playable-verify-ui/scripts/measure_frame_content.py +77 -0
- package/project-template/skills/playable-verify-ui/scripts/run_all.py +265 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_asset_sizes.py +77 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_assets_present.py +62 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_atlas_budget.py +84 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_atlas_frames.py +79 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_bg_clean.py +365 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_doc_asset_sync.py +90 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_fetch_antipatterns.py +59 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_game_config_load.js +54 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_hardcoded_layout.js +64 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_layout_regions.js +110 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_profile_schema.py +37 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_ring1_visual.py +211 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_runtime_contract.js +58 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_script_load_order.js +73 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_slice_plan.py +238 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_slice_plan_test.py +125 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_text_overlap.py +333 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_tile_consistency.py +323 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_vision_evidence.py +894 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_vision_evidence_test.py +122 -0
- package/project-template/skills/playable-verify-ui/scripts/verify_visual.py +422 -0
- package/project-template/templates/{designer-log.template.md → artist-log.template.md} +26 -31
- package/project-template/templates/atom-tree.template.json +133 -0
- package/project-template/templates/design-brief.template.md +59 -162
- package/project-template/templates/design-lens-checklist.reference.md +14 -14
- package/project-template/templates/design-methodology.md +25 -25
- package/project-template/templates/design.template.md +50 -0
- package/project-template/templates/developer-log.template.md +187 -63
- package/project-template/templates/five-axis-framework.md +89 -44
- package/project-template/templates/gen-placeholder-audio.template.mjs +63 -0
- package/project-template/templates/gen-placeholders.template.mjs +81 -0
- package/project-template/templates/intent-clarifications.template.md +7 -7
- package/project-template/templates/layout-spec.template.md +32 -20
- package/project-template/templates/plan.template.md +80 -0
- package/project-template/templates/project-state.template.md +90 -191
- package/project-template/templates/review-report.template.md +208 -24
- package/project-template/templates/style-exploration.template.md +8 -8
- package/project-template/templates/ta-log.template.md +58 -35
- package/project-template/tsconfig.json +20 -0
- package/project-template/vite.config.ts +27 -0
- package/project-templates/phaser/.claude/agents/artist.md +101 -0
- package/project-templates/phaser/.claude/agents/developer.md +123 -0
- package/project-templates/phaser/.claude/agents/game-designer.md +192 -0
- package/project-templates/phaser/.claude/agents/refs/README.md +77 -0
- package/project-templates/phaser/.claude/agents/refs/artist-art-style-catalog.md +533 -0
- package/project-templates/phaser/.claude/agents/refs/artist-color-audio-recipes.md +153 -0
- package/project-templates/phaser/.claude/agents/refs/artist-deliverable-spec.md +230 -0
- package/project-templates/phaser/.claude/agents/refs/artist-dimension-axis.md +27 -0
- package/project-templates/phaser/.claude/agents/refs/artist-handoff-v2-checklist.md +76 -0
- package/project-templates/phaser/.claude/agents/refs/artist-legacy-fallback.md +14 -0
- package/project-templates/phaser/.claude/agents/refs/artist-master-composite-recipes.md +208 -0
- package/project-templates/phaser/.claude/agents/refs/artist-style-exploration-flow.md +55 -0
- package/project-templates/phaser/.claude/agents/refs/developer-dev-handoff.md +152 -0
- package/project-templates/phaser/.claude/agents/refs/developer-impl-cookbook.md +432 -0
- package/project-templates/phaser/.claude/agents/refs/developer-legacy-fallback.md +15 -0
- package/project-templates/phaser/.claude/agents/refs/developer-phase1-flow.md +404 -0
- package/project-templates/phaser/.claude/agents/refs/framework-5-component-filter.md +252 -0
- package/project-templates/phaser/.claude/agents/refs/framework-game-feel-juice.md +266 -0
- package/project-templates/phaser/.claude/agents/refs/framework-mda.md +147 -0
- package/project-templates/phaser/.claude/agents/refs/game-designer-gameplay-sufficiency.md +123 -0
- package/project-templates/phaser/.claude/agents/refs/game-designer-legacy-fallback.md +15 -0
- package/project-templates/phaser/.claude/agents/refs/game-designer-workflow-detail.md +69 -0
- package/project-templates/phaser/.claude/agents/refs/implementation-plan-guide.md +309 -0
- package/project-templates/phaser/.claude/agents/refs/reviewer-convergence-eval.md +350 -0
- package/project-templates/phaser/.claude/agents/refs/reviewer-legacy-fallback.md +14 -0
- package/project-templates/phaser/.claude/agents/refs/reviewer-six-dimension-eval.md +6 -0
- package/project-templates/phaser/.claude/agents/refs/skill-selector-guide.md +465 -0
- package/project-templates/phaser/.claude/agents/refs/skill-value-layers.md +145 -0
- package/project-templates/phaser/.claude/agents/refs/storyboard-generation-guide.md +110 -0
- package/project-templates/phaser/.claude/agents/refs/ta-3d-flip-recipe.md +88 -0
- package/project-templates/phaser/.claude/agents/refs/ta-atlas-deliverable-standard.md +67 -0
- package/project-templates/phaser/.claude/agents/refs/ta-batch-pipeline-recipes.md +120 -0
- package/project-templates/phaser/.claude/agents/refs/ta-image-generation-detail.md +300 -0
- package/project-templates/phaser/.claude/agents/refs/ta-image-ops-reference.md +495 -0
- package/project-templates/phaser/.claude/agents/refs/ta-pipeline-cookbook.md +1141 -0
- package/project-templates/phaser/.claude/agents/refs/ta-tools-reference.md +111 -0
- package/project-templates/phaser/.claude/agents/refs/ta-vfx-preset-catalog.md +365 -0
- package/project-templates/phaser/.claude/agents/refs/technical-artist-legacy-fallback.md +14 -0
- package/project-templates/phaser/.claude/agents/reviewer.md +116 -0
- package/project-templates/phaser/.claude/agents/technical-artist.md +100 -0
- package/project-templates/phaser/.claude/hooks/README.md +120 -0
- package/project-templates/phaser/.claude/hooks/asr-coverage-validate.mjs +381 -0
- package/project-templates/phaser/.claude/hooks/block-developer-preflight.mjs +185 -0
- package/project-templates/phaser/.claude/hooks/block-ring1-tasklist.mjs +95 -0
- package/project-templates/phaser/.claude/hooks/gate-dispatcher.mjs +78 -0
- package/project-templates/phaser/.claude/hooks/gate-runner.mjs +557 -0
- package/project-templates/phaser/.claude/hooks/gate.mjs +171 -0
- package/project-templates/phaser/.claude/hooks/snapshot-milestone.mjs +247 -0
- package/project-templates/phaser/.claude/hooks/user-prompt.mjs +194 -0
- package/project-templates/phaser/.claude/hooks/validate-atom-tree-selection.mjs +281 -0
- package/project-templates/phaser/.claude/hooks/validate-workflow-stop.mjs +1889 -0
- package/project-templates/phaser/.claude/settings.json +81 -0
- package/project-templates/phaser/.claude/skills/brainstorming/SKILL.md +161 -0
- package/project-templates/phaser/.claude/skills/brainstorming/scripts/frame-template.html +270 -0
- package/project-templates/phaser/.claude/skills/brainstorming/scripts/helper.js +177 -0
- package/project-templates/phaser/.claude/skills/brainstorming/scripts/server.cjs +354 -0
- package/project-templates/phaser/.claude/skills/brainstorming/scripts/start-server.sh +148 -0
- package/project-templates/phaser/.claude/skills/brainstorming/scripts/stop-server.sh +56 -0
- package/project-templates/phaser/.claude/skills/brainstorming/scripts/wait-for-selection.sh +62 -0
- package/project-templates/phaser/.claude/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/project-templates/phaser/.claude/skills/brainstorming/visual-companion.md +309 -0
- package/project-templates/phaser/.claude/skills/playcraft-ad-psychology/SKILL.md +182 -0
- package/project-templates/phaser/.claude/skills/playcraft-art-style-guide/SKILL.md +123 -0
- package/project-templates/phaser/.claude/skills/playcraft-asset-state-sheet/SKILL.md +205 -0
- package/project-templates/phaser/.claude/skills/playcraft-audio-generation/SKILL.md +280 -0
- package/project-templates/phaser/.claude/skills/playcraft-batch-pipeline/SKILL.md +184 -0
- package/project-templates/phaser/.claude/skills/playcraft-build-optimizer/SKILL.md +306 -0
- package/project-templates/phaser/.claude/skills/playcraft-image-generation/SKILL.md +298 -0
- package/project-templates/phaser/.claude/skills/playcraft-image-generation/reference/build-sprite-sheet.template.mjs +123 -0
- package/project-templates/phaser/.claude/skills/playcraft-image-generation/reference/compare-style.template.mjs +254 -0
- package/project-templates/phaser/.claude/skills/playcraft-image-generation/reference/gen-batch-sprite.template.mjs +324 -0
- package/project-templates/phaser/.claude/skills/playcraft-image-generation/reference/gen-batch.template.mjs +97 -0
- package/project-templates/phaser/.claude/skills/playcraft-image-generation/reference/gen-edit-variants.template.mjs +118 -0
- package/project-templates/phaser/.claude/skills/playcraft-image-generation/reference/process-batch.template.mjs +137 -0
- package/project-templates/phaser/.claude/skills/playcraft-image-generation/reference/prompt-cookbook.md +397 -0
- package/project-templates/phaser/.claude/skills/playcraft-image-generation/reference/validate-sprite-sheet.template.mjs +296 -0
- package/project-templates/phaser/.claude/skills/playcraft-image-ops/SKILL.md +122 -0
- package/project-templates/phaser/.claude/skills/playcraft-image-processing/SKILL.md +219 -0
- package/project-templates/phaser/.claude/skills/playcraft-masking/SKILL.md +373 -0
- package/project-templates/phaser/.claude/skills/playcraft-playable-optimization/SKILL.md +161 -0
- package/project-templates/phaser/.claude/skills/playcraft-research/SKILL.md +215 -0
- package/project-templates/phaser/.claude/skills/playcraft-skill-recommender/SKILL.md +331 -0
- package/project-templates/phaser/.claude/skills/playcraft-sprite-generation/SKILL.md +423 -0
- package/project-templates/phaser/.claude/skills/playcraft-sprite-remix/SKILL.md +158 -0
- package/project-templates/phaser/.claude/skills/playcraft-sprite-sheet/SKILL.md +100 -0
- package/project-templates/phaser/.claude/skills/playcraft-storyboard/SKILL.md +167 -0
- package/project-templates/phaser/.claude/skills/playcraft-style-qa/SKILL.md +270 -0
- package/project-templates/phaser/.claude/skills/playcraft-text-rendering/SKILL.md +236 -0
- package/project-templates/phaser/.claude/skills/playcraft-vfx-animation/SKILL.md +130 -0
- package/project-templates/phaser/.claude/skills/playwright-cli/SKILL.md +390 -0
- package/project-templates/phaser/.claude/skills/playwright-cli/references/element-attributes.md +23 -0
- package/project-templates/phaser/.claude/skills/playwright-cli/references/playwright-tests.md +39 -0
- package/project-templates/phaser/.claude/skills/playwright-cli/references/request-mocking.md +87 -0
- package/project-templates/phaser/.claude/skills/playwright-cli/references/running-code.md +240 -0
- package/project-templates/phaser/.claude/skills/playwright-cli/references/session-management.md +226 -0
- package/project-templates/phaser/.claude/skills/playwright-cli/references/spec-driven-testing.md +308 -0
- package/project-templates/phaser/.claude/skills/playwright-cli/references/storage-state.md +275 -0
- package/project-templates/phaser/.claude/skills/playwright-cli/references/test-generation.md +134 -0
- package/project-templates/phaser/.claude/skills/playwright-cli/references/tracing.md +142 -0
- package/project-templates/phaser/.claude/skills/playwright-cli/references/video-recording.md +153 -0
- package/project-templates/phaser/.claude/skills/session-analyzer/SKILL.md +386 -0
- package/project-templates/phaser/.claude/skills/session-analyzer/scripts/execution-breakdown.mjs +182 -0
- package/project-templates/phaser/.claude/skills/session-analyzer/scripts/find-turns.mjs +72 -0
- package/project-templates/phaser/.claude/skills/session-analyzer/scripts/heavy-output.mjs +121 -0
- package/project-templates/phaser/.claude/skills/session-analyzer/scripts/resolve-session.mjs +103 -0
- package/project-templates/phaser/.claude/skills/session-analyzer/scripts/subagent-stats.mjs +127 -0
- package/project-templates/phaser/.claude/skills/session-analyzer/scripts/subagent-tool-timeline.mjs +106 -0
- package/project-templates/phaser/.claude/skills/session-analyzer/scripts/time-gaps.mjs +128 -0
- package/project-templates/phaser/.claude/skills/session-analyzer/scripts/turn-timeline.mjs +67 -0
- package/project-templates/phaser/.claude/snapshot.mjs +257 -0
- package/project-templates/phaser/.cursor/hooks.json +17 -0
- package/project-templates/phaser/.cursor/rules/playcraft-orchestrator.mdc +142 -0
- package/project-templates/phaser/.cursor/rules/playcraft-subagent-boundary.mdc +29 -0
- package/project-templates/phaser/.playcraft-engine +1 -0
- package/project-templates/phaser/CHANGELOG.md +105 -0
- package/project-templates/phaser/CLAUDE.md +84 -0
- package/project-templates/phaser/assets/audio/bgm/.gitkeep +0 -0
- package/project-templates/phaser/assets/audio/sfx/.gitkeep +0 -0
- package/project-templates/phaser/assets/bundles/.gitkeep +0 -0
- package/project-templates/phaser/assets/images/bg/.gitkeep +0 -0
- package/project-templates/phaser/assets/images/reference/.gitkeep +0 -0
- package/project-templates/phaser/assets/images/storyboard/.gitkeep +0 -0
- package/project-templates/phaser/assets/images/tiles/.gitkeep +0 -0
- package/project-templates/phaser/assets/images/ui/.gitkeep +0 -0
- package/project-templates/phaser/assets/images/vfx/.gitkeep +0 -0
- package/project-templates/phaser/assets/models/.gitkeep +0 -0
- package/project-templates/phaser/docs/DESIGN.md +65 -0
- package/project-templates/phaser/docs/intent-clarifications.md +58 -0
- package/project-templates/phaser/docs/pipeline-overview.md +69 -0
- package/project-templates/phaser/docs/project-state.md +211 -0
- package/project-templates/phaser/docs/scaffold-manifest.md +10 -0
- package/project-templates/phaser/docs/team/agent-conduct.md +67 -0
- package/project-templates/phaser/docs/team/agent-runtime-matrix.md +80 -0
- package/project-templates/phaser/docs/team/atom-tree-format.md +114 -0
- package/project-templates/phaser/docs/team/collaboration.md +391 -0
- package/project-templates/phaser/docs/team/core-model.md +85 -0
- package/project-templates/phaser/docs/team/game-designer-migration-todo.md +8 -0
- package/project-templates/phaser/docs/team/harness-legacy-deprecation.md +23 -0
- package/project-templates/phaser/docs/team/platform-capabilities.md +18 -0
- package/project-templates/phaser/docs/team/workflow-changelog.md +137 -0
- package/project-templates/phaser/docs/team/workflow-consistency-checklist.md +240 -0
- package/project-templates/phaser/focus-lab/.gitkeep +0 -0
- package/project-templates/phaser/game/adapters/phaser.ts +52 -0
- package/project-templates/phaser/game/config/.gitkeep +0 -0
- package/project-templates/phaser/game/config/game-config.ts +46 -0
- package/project-templates/phaser/game/contract/publish.ts +141 -0
- package/project-templates/phaser/game/contract/types.ts +34 -0
- package/project-templates/phaser/game/gameplay/.gitkeep +0 -0
- package/project-templates/phaser/game/index.ts +81 -0
- package/project-templates/phaser/game/runtime-contract.ts +28 -0
- package/project-templates/phaser/game/scenes/.gitkeep +0 -0
- package/project-templates/phaser/globals.d.ts +51 -0
- package/project-templates/phaser/index.css +34 -0
- package/project-templates/phaser/index.html +18 -0
- package/project-templates/phaser/main.ts +9 -0
- package/project-templates/phaser/package.json +79 -0
- package/project-templates/phaser/skills/README.md +52 -0
- package/project-templates/phaser/skills/_shared/agent-prep.md +136 -0
- package/project-templates/phaser/skills/_shared/requirements.txt +1 -0
- package/project-templates/phaser/skills/_shared/scripts/build-evidence-gate.mjs +87 -0
- package/project-templates/phaser/skills/_shared/scripts/context-budget.mjs +215 -0
- package/project-templates/phaser/skills/_shared/scripts/create-playable.mjs +140 -0
- package/project-templates/phaser/skills/_shared/scripts/dev-start.mjs +151 -0
- package/project-templates/phaser/skills/_shared/scripts/disclosure-config.mjs +480 -0
- package/project-templates/phaser/skills/_shared/scripts/ensure-project.mjs +532 -0
- package/project-templates/phaser/skills/_shared/scripts/gen-placeholder-audio.py +345 -0
- package/project-templates/phaser/skills/_shared/scripts/gen-placeholder.py +244 -0
- package/project-templates/phaser/skills/_shared/scripts/harness-smoke.mjs +257 -0
- package/project-templates/phaser/skills/_shared/scripts/lib/validator-artifacts.mjs +129 -0
- package/project-templates/phaser/skills/_shared/scripts/placeholder-pack-sheet.mjs +67 -0
- package/project-templates/phaser/skills/_shared/scripts/placeholder_audio_lib.py +142 -0
- package/project-templates/phaser/skills/_shared/scripts/placeholder_lib.py +993 -0
- package/project-templates/phaser/skills/_shared/scripts/render-project-state.mjs +278 -0
- package/project-templates/phaser/skills/_shared/scripts/ring-config.mjs +252 -0
- package/project-templates/phaser/skills/_shared/scripts/skills-check.mjs +176 -0
- package/project-templates/phaser/skills/_shared/scripts/slice-set.mjs +77 -0
- package/project-templates/phaser/skills/_shared/scripts/state-advance-ring.mjs +63 -0
- package/project-templates/phaser/skills/_shared/scripts/state-get.mjs +215 -0
- package/project-templates/phaser/skills/_shared/scripts/state-handoff.mjs +120 -0
- package/project-templates/phaser/skills/_shared/scripts/state-set.mjs +113 -0
- package/project-templates/phaser/skills/_shared/scripts/state-store.mjs +893 -0
- package/project-templates/phaser/skills/_shared/scripts/sync-template-skills.mjs +112 -0
- package/project-templates/phaser/skills/_shared/scripts/verify-asset-code-sync.mjs +265 -0
- package/project-templates/phaser/skills/_shared/scripts/verify-atom-conformance.mjs +181 -0
- package/project-templates/phaser/skills/_shared/scripts/verify-env.mjs +285 -0
- package/project-templates/phaser/skills/_shared/scripts/verify-placeholders.mjs +161 -0
- package/project-templates/phaser/skills/_shared/scripts/workflow-doctor.mjs +348 -0
- package/project-templates/phaser/skills/playable-animate/SKILL.md +52 -0
- package/project-templates/phaser/skills/playable-animate/agents/openai.yaml +4 -0
- package/project-templates/phaser/skills/playable-animate/references/board-refresh.md +30 -0
- package/project-templates/phaser/skills/playable-animate/references/diagnosis-checklist.md +25 -0
- package/project-templates/phaser/skills/playable-animate/references/entrance-sequencing.md +33 -0
- package/project-templates/phaser/skills/playable-animate/references/interaction-timing.md +23 -0
- package/project-templates/phaser/skills/playable-art/SKILL.md +203 -0
- package/project-templates/phaser/skills/playable-art/agents/openai.yaml +4 -0
- package/project-templates/phaser/skills/playable-art/references/alpha-postprocess.md +46 -0
- package/project-templates/phaser/skills/playable-art/references/cta-art-spec.md +59 -0
- package/project-templates/phaser/skills/playable-art/references/layout-proportions.md +30 -0
- package/project-templates/phaser/skills/playable-art/references/prompt-patterns.md +83 -0
- package/project-templates/phaser/skills/playable-art/references/reference-comparison.md +30 -0
- package/project-templates/phaser/skills/playable-art/references/sheet-import-v2.md +91 -0
- package/project-templates/phaser/skills/playable-art/scripts/build-atlas.py +332 -0
- package/project-templates/phaser/skills/playable-art/scripts/chroma-key.py +50 -0
- package/project-templates/phaser/skills/playable-art/scripts/extract-alpha-split.py +65 -0
- package/project-templates/phaser/skills/playable-art/scripts/extract-dual-bg-alpha.py +118 -0
- package/project-templates/phaser/skills/playable-art/scripts/import-gpt-art-sheets-v2.py +403 -0
- package/project-templates/phaser/skills/playable-art/scripts/import-gpt-art-sheets.py +280 -0
- package/project-templates/phaser/skills/playable-art/scripts/import-gpt-tile-sheet.py +114 -0
- package/project-templates/phaser/skills/playable-art/scripts/import_gpt_art_pipeline.py +321 -0
- package/project-templates/phaser/skills/playable-art/scripts/import_gpt_art_sheets_v2_test.py +126 -0
- package/project-templates/phaser/skills/playable-art/scripts/placeholder_common.py +98 -0
- package/project-templates/phaser/skills/playable-art/scripts/remove-bg.py +91 -0
- package/project-templates/phaser/skills/playable-art/scripts/review-processed-assets.py +468 -0
- package/project-templates/phaser/skills/playable-art/scripts/review_processed_assets_test.py +116 -0
- package/project-templates/phaser/skills/playable-art/scripts/verify-alpha-clean.py +105 -0
- package/project-templates/phaser/skills/playable-debug/SKILL.md +116 -0
- package/project-templates/phaser/skills/playable-debug/agents/openai.yaml +4 -0
- package/project-templates/phaser/skills/playable-debug/references/debug-config.md +40 -0
- package/project-templates/phaser/skills/playable-focus/SKILL.md +148 -0
- package/project-templates/phaser/skills/playable-focus/scripts/bootstrap-playground.mjs +84 -0
- package/project-templates/phaser/skills/playable-focus/scripts/extract-focus-frames.mjs +87 -0
- package/project-templates/phaser/skills/playable-focus/scripts/generate-focus-reports.mjs +121 -0
- package/project-templates/phaser/skills/playable-focus/scripts/playground.mjs +390 -0
- package/project-templates/phaser/skills/playable-focus/templates/focus-lab/frame.html +39 -0
- package/project-templates/phaser/skills/playable-focus/templates/focus-lab/harness/clean-stage.js +114 -0
- package/project-templates/phaser/skills/playable-focus/templates/focus-lab/harness/frame-lab-scene.js +94 -0
- package/project-templates/phaser/skills/playable-focus/templates/focus-lab/harness/particle-lab-scene.js +224 -0
- package/project-templates/phaser/skills/playable-focus/templates/focus-lab/model.html +16 -0
- package/project-templates/phaser/skills/playable-focus/templates/focus-lab/particle.html +38 -0
- package/project-templates/phaser/skills/playable-focus/templates/focus-lab/shatter.html +47 -0
- package/project-templates/phaser/skills/playable-fx-decompose/SKILL.md +212 -0
- package/project-templates/phaser/skills/playable-fx-decompose/examples.md +89 -0
- package/project-templates/phaser/skills/playable-fx-decompose/reference.md +201 -0
- package/project-templates/phaser/skills/playable-fx-decompose/requirements.txt +2 -0
- package/project-templates/phaser/skills/playable-fx-decompose/scripts/build-blank-tile-crack.py +192 -0
- package/project-templates/phaser/skills/playable-fx-decompose/scripts/fix-shard-debris-frames.py +60 -0
- package/project-templates/phaser/skills/playable-fx-decompose/scripts/generate-shard-debris.py +276 -0
- package/project-templates/phaser/skills/playable-fx-peak/SKILL.md +237 -0
- package/project-templates/phaser/skills/playable-fx-peak/requirements.txt +2 -0
- package/project-templates/phaser/skills/playable-fx-peak/scripts/fix-frame-edges.py +70 -0
- package/project-templates/phaser/skills/playable-fx-peak/scripts/repack-frame-sequence.py +526 -0
- package/project-templates/phaser/skills/playable-fx-peak/scripts/validate-frame-anchors.py +130 -0
- package/project-templates/phaser/skills/playable-placeholder/SKILL.md +239 -0
- package/project-templates/phaser/skills/playable-record/SKILL.md +166 -0
- package/project-templates/phaser/skills/playable-record/scripts/lib/build-artifact.mjs +92 -0
- package/project-templates/phaser/skills/playable-record/scripts/lib/dev-server.mjs +104 -0
- package/project-templates/phaser/skills/playable-record/scripts/lib/record-audio-bridge.js +141 -0
- package/project-templates/phaser/skills/playable-record/scripts/lib/slice-structure-verify.mjs +199 -0
- package/project-templates/phaser/skills/playable-record/scripts/record-playable.mjs +583 -0
- package/project-templates/phaser/skills/playable-record/scripts/verify-build.mjs +185 -0
- package/project-templates/phaser/skills/playable-record/scripts/verify-contract.mjs +261 -0
- package/project-templates/phaser/skills/playable-record/scripts/verify-firstwin.mjs +398 -0
- package/project-templates/phaser/skills/playable-record/scripts/verify-fusion.mjs +320 -0
- package/project-templates/phaser/skills/playable-record/scripts/verify-lifecycle.mjs +78 -0
- package/project-templates/phaser/skills/playable-record/scripts/verify-slice-artist.mjs +53 -0
- package/project-templates/phaser/skills/playable-record/scripts/verify-slice-ta.mjs +53 -0
- package/project-templates/phaser/skills/playable-record/scripts/verify-slice.mjs +142 -0
- package/project-templates/phaser/skills/playable-record/scripts/verify-visual-ring.mjs +250 -0
- package/project-templates/phaser/skills/playable-record/scripts/verify-visual-ring1.mjs +190 -0
- package/project-templates/phaser/skills/playable-record/scripts/verify-vlm-video.mjs +227 -0
- package/project-templates/phaser/skills/playable-validate/SKILL.md +260 -0
- package/project-templates/phaser/skills/playable-validate/references/checklist-detail.md +36 -0
- package/project-templates/phaser/skills/playable-validate/references/single-html-bundle.md +76 -0
- package/project-templates/phaser/skills/playable-validate/validation-rules.md +200 -0
- package/project-templates/phaser/skills/playable-verify-ui/SKILL.md +295 -0
- package/project-templates/phaser/skills/playable-verify-ui/examples/asset-manifest.example.json +36 -0
- package/project-templates/phaser/skills/playable-verify-ui/examples/mahjong-match.profile.yaml +334 -0
- package/project-templates/phaser/skills/playable-verify-ui/profiles/template.profile.yaml +84 -0
- package/project-templates/phaser/skills/playable-verify-ui/reference.md +165 -0
- package/project-templates/phaser/skills/playable-verify-ui/references/phaser-patterns.md +67 -0
- package/project-templates/phaser/skills/playable-verify-ui/references/scaling-decision-tree.md +51 -0
- package/project-templates/phaser/skills/playable-verify-ui/requirements.txt +7 -0
- package/project-templates/phaser/skills/playable-verify-ui/schema/asset-manifest.schema.json +68 -0
- package/project-templates/phaser/skills/playable-verify-ui/schema/playable-ui-profile.schema.json +171 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/asset_manifest.py +231 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/lib/__init__.py +1 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/lib/config_expr.js +218 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/lib/node_utils.js +51 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/lib/profile_loader.py +59 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/lib/report.py +106 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/lib/runtime_contract.js +116 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/measure_frame_content.py +77 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/run_all.py +265 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_asset_sizes.py +77 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_assets_present.py +62 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_atlas_budget.py +84 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_atlas_frames.py +79 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_bg_clean.py +365 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_doc_asset_sync.py +90 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_fetch_antipatterns.py +59 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_game_config_load.js +54 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_hardcoded_layout.js +64 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_layout_regions.js +110 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_profile_schema.py +37 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_ring1_visual.py +211 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_runtime_contract.js +58 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_script_load_order.js +73 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_slice_plan.py +238 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_slice_plan_test.py +125 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_text_overlap.py +333 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_tile_consistency.py +323 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_vision_evidence.py +894 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_vision_evidence_test.py +122 -0
- package/project-templates/phaser/skills/playable-verify-ui/scripts/verify_visual.py +422 -0
- package/project-templates/phaser/ta-workspace/scripts/.gitkeep +0 -0
- package/project-templates/phaser/templates/artist-log.template.md +182 -0
- package/project-templates/phaser/templates/atom-tree.template.json +133 -0
- package/project-templates/phaser/templates/design-brief.template.md +92 -0
- package/project-templates/phaser/templates/design-lens-checklist.reference.md +117 -0
- package/project-templates/phaser/templates/design-methodology.md +99 -0
- package/project-templates/phaser/templates/design.template.md +50 -0
- package/project-templates/phaser/templates/developer-log.template.md +258 -0
- package/project-templates/phaser/templates/five-axis-framework.md +194 -0
- package/project-templates/phaser/templates/gen-placeholder-audio.template.mjs +63 -0
- package/project-templates/phaser/templates/gen-placeholders.template.mjs +81 -0
- package/project-templates/phaser/templates/intent-clarifications.template.md +58 -0
- package/project-templates/phaser/templates/layout-spec.template.md +198 -0
- package/project-templates/phaser/templates/plan.template.md +80 -0
- package/project-templates/phaser/templates/project-state.template.md +136 -0
- package/project-templates/phaser/templates/review-report.template.md +275 -0
- package/project-templates/phaser/templates/style-exploration.template.md +93 -0
- package/project-templates/phaser/templates/ta-log.template.md +394 -0
- package/project-templates/phaser/tsconfig.json +20 -0
- package/project-templates/phaser/vite.config.ts +27 -0
- package/project-templates/threejs/.claude/agents/artist.md +101 -0
- package/project-templates/threejs/.claude/agents/developer.md +123 -0
- package/project-templates/threejs/.claude/agents/game-designer.md +192 -0
- package/project-templates/threejs/.claude/agents/refs/README.md +77 -0
- package/project-templates/threejs/.claude/agents/refs/artist-art-style-catalog.md +533 -0
- package/project-templates/threejs/.claude/agents/refs/artist-color-audio-recipes.md +153 -0
- package/project-templates/threejs/.claude/agents/refs/artist-deliverable-spec.md +230 -0
- package/project-templates/threejs/.claude/agents/refs/artist-dimension-axis.md +27 -0
- package/project-templates/threejs/.claude/agents/refs/artist-handoff-v2-checklist.md +76 -0
- package/project-templates/threejs/.claude/agents/refs/artist-legacy-fallback.md +14 -0
- package/project-templates/threejs/.claude/agents/refs/artist-master-composite-recipes.md +208 -0
- package/project-templates/threejs/.claude/agents/refs/artist-style-exploration-flow.md +55 -0
- package/project-templates/threejs/.claude/agents/refs/developer-dev-handoff.md +152 -0
- package/project-templates/threejs/.claude/agents/refs/developer-impl-cookbook.md +432 -0
- package/project-templates/threejs/.claude/agents/refs/developer-legacy-fallback.md +15 -0
- package/project-templates/threejs/.claude/agents/refs/developer-phase1-flow.md +404 -0
- package/project-templates/threejs/.claude/agents/refs/framework-5-component-filter.md +252 -0
- package/project-templates/threejs/.claude/agents/refs/framework-game-feel-juice.md +266 -0
- package/project-templates/threejs/.claude/agents/refs/framework-mda.md +147 -0
- package/project-templates/threejs/.claude/agents/refs/game-designer-gameplay-sufficiency.md +123 -0
- package/project-templates/threejs/.claude/agents/refs/game-designer-legacy-fallback.md +15 -0
- package/project-templates/threejs/.claude/agents/refs/game-designer-workflow-detail.md +69 -0
- package/project-templates/threejs/.claude/agents/refs/implementation-plan-guide.md +309 -0
- package/project-templates/threejs/.claude/agents/refs/reviewer-convergence-eval.md +350 -0
- package/project-templates/threejs/.claude/agents/refs/reviewer-legacy-fallback.md +14 -0
- package/project-templates/threejs/.claude/agents/refs/reviewer-six-dimension-eval.md +6 -0
- package/project-templates/threejs/.claude/agents/refs/skill-selector-guide.md +465 -0
- package/project-templates/threejs/.claude/agents/refs/skill-value-layers.md +145 -0
- package/project-templates/threejs/.claude/agents/refs/storyboard-generation-guide.md +110 -0
- package/project-templates/threejs/.claude/agents/refs/ta-3d-flip-recipe.md +88 -0
- package/project-templates/threejs/.claude/agents/refs/ta-atlas-deliverable-standard.md +67 -0
- package/project-templates/threejs/.claude/agents/refs/ta-batch-pipeline-recipes.md +120 -0
- package/project-templates/threejs/.claude/agents/refs/ta-image-generation-detail.md +300 -0
- package/project-templates/threejs/.claude/agents/refs/ta-image-ops-reference.md +495 -0
- package/project-templates/threejs/.claude/agents/refs/ta-pipeline-cookbook.md +1141 -0
- package/project-templates/threejs/.claude/agents/refs/ta-tools-reference.md +111 -0
- package/project-templates/threejs/.claude/agents/refs/ta-vfx-preset-catalog.md +365 -0
- package/project-templates/threejs/.claude/agents/refs/technical-artist-legacy-fallback.md +14 -0
- package/project-templates/threejs/.claude/agents/reviewer.md +116 -0
- package/project-templates/threejs/.claude/agents/technical-artist.md +100 -0
- package/project-templates/threejs/.claude/hooks/README.md +120 -0
- package/project-templates/threejs/.claude/hooks/asr-coverage-validate.mjs +381 -0
- package/project-templates/threejs/.claude/hooks/block-developer-preflight.mjs +185 -0
- package/project-templates/threejs/.claude/hooks/block-ring1-tasklist.mjs +95 -0
- package/project-templates/threejs/.claude/hooks/gate-dispatcher.mjs +78 -0
- package/project-templates/threejs/.claude/hooks/gate-runner.mjs +557 -0
- package/project-templates/threejs/.claude/hooks/gate.mjs +171 -0
- package/project-templates/threejs/.claude/hooks/snapshot-milestone.mjs +247 -0
- package/project-templates/threejs/.claude/hooks/user-prompt.mjs +194 -0
- package/project-templates/threejs/.claude/hooks/validate-atom-tree-selection.mjs +281 -0
- package/project-templates/threejs/.claude/hooks/validate-workflow-stop.mjs +1889 -0
- package/project-templates/threejs/.claude/settings.json +81 -0
- package/project-templates/threejs/.claude/skills/brainstorming/SKILL.md +161 -0
- package/project-templates/threejs/.claude/skills/brainstorming/scripts/frame-template.html +270 -0
- package/project-templates/threejs/.claude/skills/brainstorming/scripts/helper.js +177 -0
- package/project-templates/threejs/.claude/skills/brainstorming/scripts/server.cjs +354 -0
- package/project-templates/threejs/.claude/skills/brainstorming/scripts/start-server.sh +148 -0
- package/project-templates/threejs/.claude/skills/brainstorming/scripts/stop-server.sh +56 -0
- package/project-templates/threejs/.claude/skills/brainstorming/scripts/wait-for-selection.sh +62 -0
- package/project-templates/threejs/.claude/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/project-templates/threejs/.claude/skills/brainstorming/visual-companion.md +309 -0
- package/project-templates/threejs/.claude/skills/playcraft-ad-psychology/SKILL.md +182 -0
- package/project-templates/threejs/.claude/skills/playcraft-art-style-guide/SKILL.md +123 -0
- package/project-templates/threejs/.claude/skills/playcraft-asset-state-sheet/SKILL.md +205 -0
- package/project-templates/threejs/.claude/skills/playcraft-audio-generation/SKILL.md +280 -0
- package/project-templates/threejs/.claude/skills/playcraft-batch-pipeline/SKILL.md +184 -0
- package/project-templates/threejs/.claude/skills/playcraft-build-optimizer/SKILL.md +306 -0
- package/project-templates/threejs/.claude/skills/playcraft-image-generation/SKILL.md +298 -0
- package/project-templates/threejs/.claude/skills/playcraft-image-generation/reference/build-sprite-sheet.template.mjs +123 -0
- package/project-templates/threejs/.claude/skills/playcraft-image-generation/reference/compare-style.template.mjs +254 -0
- package/project-templates/threejs/.claude/skills/playcraft-image-generation/reference/gen-batch-sprite.template.mjs +324 -0
- package/project-templates/threejs/.claude/skills/playcraft-image-generation/reference/gen-batch.template.mjs +97 -0
- package/project-templates/threejs/.claude/skills/playcraft-image-generation/reference/gen-edit-variants.template.mjs +118 -0
- package/project-templates/threejs/.claude/skills/playcraft-image-generation/reference/process-batch.template.mjs +137 -0
- package/project-templates/threejs/.claude/skills/playcraft-image-generation/reference/prompt-cookbook.md +397 -0
- package/project-templates/threejs/.claude/skills/playcraft-image-generation/reference/validate-sprite-sheet.template.mjs +296 -0
- package/project-templates/threejs/.claude/skills/playcraft-image-ops/SKILL.md +122 -0
- package/project-templates/threejs/.claude/skills/playcraft-image-processing/SKILL.md +219 -0
- package/project-templates/threejs/.claude/skills/playcraft-masking/SKILL.md +373 -0
- package/project-templates/threejs/.claude/skills/playcraft-playable-optimization/SKILL.md +161 -0
- package/project-templates/threejs/.claude/skills/playcraft-research/SKILL.md +215 -0
- package/project-templates/threejs/.claude/skills/playcraft-skill-recommender/SKILL.md +331 -0
- package/project-templates/threejs/.claude/skills/playcraft-sprite-generation/SKILL.md +423 -0
- package/project-templates/threejs/.claude/skills/playcraft-sprite-remix/SKILL.md +158 -0
- package/project-templates/threejs/.claude/skills/playcraft-sprite-sheet/SKILL.md +100 -0
- package/project-templates/threejs/.claude/skills/playcraft-storyboard/SKILL.md +167 -0
- package/project-templates/threejs/.claude/skills/playcraft-style-qa/SKILL.md +270 -0
- package/project-templates/threejs/.claude/skills/playcraft-text-rendering/SKILL.md +236 -0
- package/project-templates/threejs/.claude/skills/playcraft-vfx-animation/SKILL.md +130 -0
- package/project-templates/threejs/.claude/skills/playwright-cli/SKILL.md +390 -0
- package/project-templates/threejs/.claude/skills/playwright-cli/references/element-attributes.md +23 -0
- package/project-templates/threejs/.claude/skills/playwright-cli/references/playwright-tests.md +39 -0
- package/project-templates/threejs/.claude/skills/playwright-cli/references/request-mocking.md +87 -0
- package/project-templates/threejs/.claude/skills/playwright-cli/references/running-code.md +240 -0
- package/project-templates/threejs/.claude/skills/playwright-cli/references/session-management.md +226 -0
- package/project-templates/threejs/.claude/skills/playwright-cli/references/spec-driven-testing.md +308 -0
- package/project-templates/threejs/.claude/skills/playwright-cli/references/storage-state.md +275 -0
- package/project-templates/threejs/.claude/skills/playwright-cli/references/test-generation.md +134 -0
- package/project-templates/threejs/.claude/skills/playwright-cli/references/tracing.md +142 -0
- package/project-templates/threejs/.claude/skills/playwright-cli/references/video-recording.md +153 -0
- package/project-templates/threejs/.claude/skills/session-analyzer/SKILL.md +386 -0
- package/project-templates/threejs/.claude/skills/session-analyzer/scripts/execution-breakdown.mjs +182 -0
- package/project-templates/threejs/.claude/skills/session-analyzer/scripts/find-turns.mjs +72 -0
- package/project-templates/threejs/.claude/skills/session-analyzer/scripts/heavy-output.mjs +121 -0
- package/project-templates/threejs/.claude/skills/session-analyzer/scripts/resolve-session.mjs +103 -0
- package/project-templates/threejs/.claude/skills/session-analyzer/scripts/subagent-stats.mjs +127 -0
- package/project-templates/threejs/.claude/skills/session-analyzer/scripts/subagent-tool-timeline.mjs +106 -0
- package/project-templates/threejs/.claude/skills/session-analyzer/scripts/time-gaps.mjs +128 -0
- package/project-templates/threejs/.claude/skills/session-analyzer/scripts/turn-timeline.mjs +67 -0
- package/project-templates/threejs/.claude/snapshot.mjs +257 -0
- package/project-templates/threejs/.cursor/hooks.json +17 -0
- package/project-templates/threejs/.cursor/rules/playcraft-orchestrator.mdc +142 -0
- package/project-templates/threejs/.cursor/rules/playcraft-subagent-boundary.mdc +29 -0
- package/project-templates/threejs/.playcraft-engine +1 -0
- package/project-templates/threejs/CHANGELOG.md +105 -0
- package/project-templates/threejs/CLAUDE.md +84 -0
- package/project-templates/threejs/assets/audio/bgm/.gitkeep +0 -0
- package/project-templates/threejs/assets/audio/sfx/.gitkeep +0 -0
- package/project-templates/threejs/assets/bundles/.gitkeep +0 -0
- package/project-templates/threejs/assets/images/bg/.gitkeep +0 -0
- package/project-templates/threejs/assets/images/reference/.gitkeep +0 -0
- package/project-templates/threejs/assets/images/storyboard/.gitkeep +0 -0
- package/project-templates/threejs/assets/images/tiles/.gitkeep +0 -0
- package/project-templates/threejs/assets/images/ui/.gitkeep +0 -0
- package/project-templates/threejs/assets/images/vfx/.gitkeep +0 -0
- package/project-templates/threejs/assets/models/.gitkeep +0 -0
- package/project-templates/threejs/docs/DESIGN.md +65 -0
- package/project-templates/threejs/docs/intent-clarifications.md +58 -0
- package/project-templates/threejs/docs/pipeline-overview.md +69 -0
- package/project-templates/threejs/docs/project-state.md +211 -0
- package/project-templates/threejs/docs/scaffold-manifest.md +10 -0
- package/project-templates/threejs/docs/team/agent-conduct.md +67 -0
- package/project-templates/threejs/docs/team/agent-runtime-matrix.md +80 -0
- package/project-templates/threejs/docs/team/atom-tree-format.md +114 -0
- package/project-templates/threejs/docs/team/collaboration.md +391 -0
- package/project-templates/threejs/docs/team/core-model.md +85 -0
- package/project-templates/threejs/docs/team/game-designer-migration-todo.md +8 -0
- package/project-templates/threejs/docs/team/harness-legacy-deprecation.md +23 -0
- package/project-templates/threejs/docs/team/platform-capabilities.md +18 -0
- package/project-templates/threejs/docs/team/workflow-changelog.md +137 -0
- package/project-templates/threejs/docs/team/workflow-consistency-checklist.md +240 -0
- package/project-templates/threejs/focus-lab/.gitkeep +0 -0
- package/project-templates/threejs/game/config/.gitkeep +0 -0
- package/project-templates/threejs/game/config/game-config.ts +46 -0
- package/project-templates/threejs/game/contract/publish.ts +141 -0
- package/project-templates/threejs/game/contract/types.ts +34 -0
- package/project-templates/threejs/game/gameplay/.gitkeep +0 -0
- package/project-templates/threejs/game/index.ts +76 -0
- package/project-templates/threejs/game/runtime-contract.ts +15 -0
- package/project-templates/threejs/game/scenes/.gitkeep +0 -0
- package/project-templates/threejs/globals.d.ts +51 -0
- package/project-templates/threejs/index.css +34 -0
- package/project-templates/threejs/index.html +18 -0
- package/project-templates/threejs/main.ts +9 -0
- package/project-templates/threejs/package.json +79 -0
- package/project-templates/threejs/skills/README.md +52 -0
- package/project-templates/threejs/skills/_shared/agent-prep.md +136 -0
- package/project-templates/threejs/skills/_shared/requirements.txt +1 -0
- package/project-templates/threejs/skills/_shared/scripts/build-evidence-gate.mjs +87 -0
- package/project-templates/threejs/skills/_shared/scripts/context-budget.mjs +215 -0
- package/project-templates/threejs/skills/_shared/scripts/create-playable.mjs +140 -0
- package/project-templates/threejs/skills/_shared/scripts/dev-start.mjs +151 -0
- package/project-templates/threejs/skills/_shared/scripts/disclosure-config.mjs +480 -0
- package/project-templates/threejs/skills/_shared/scripts/ensure-project.mjs +532 -0
- package/project-templates/threejs/skills/_shared/scripts/gen-placeholder-audio.py +345 -0
- package/project-templates/threejs/skills/_shared/scripts/gen-placeholder.py +244 -0
- package/project-templates/threejs/skills/_shared/scripts/harness-smoke.mjs +257 -0
- package/project-templates/threejs/skills/_shared/scripts/lib/validator-artifacts.mjs +129 -0
- package/project-templates/threejs/skills/_shared/scripts/placeholder-pack-sheet.mjs +67 -0
- package/project-templates/threejs/skills/_shared/scripts/placeholder_audio_lib.py +142 -0
- package/project-templates/threejs/skills/_shared/scripts/placeholder_lib.py +993 -0
- package/project-templates/threejs/skills/_shared/scripts/render-project-state.mjs +278 -0
- package/project-templates/threejs/skills/_shared/scripts/ring-config.mjs +252 -0
- package/project-templates/threejs/skills/_shared/scripts/skills-check.mjs +176 -0
- package/project-templates/threejs/skills/_shared/scripts/slice-set.mjs +77 -0
- package/project-templates/threejs/skills/_shared/scripts/state-advance-ring.mjs +63 -0
- package/project-templates/threejs/skills/_shared/scripts/state-get.mjs +215 -0
- package/project-templates/threejs/skills/_shared/scripts/state-handoff.mjs +120 -0
- package/project-templates/threejs/skills/_shared/scripts/state-set.mjs +113 -0
- package/project-templates/threejs/skills/_shared/scripts/state-store.mjs +893 -0
- package/project-templates/threejs/skills/_shared/scripts/sync-template-skills.mjs +112 -0
- package/project-templates/threejs/skills/_shared/scripts/verify-asset-code-sync.mjs +265 -0
- package/project-templates/threejs/skills/_shared/scripts/verify-atom-conformance.mjs +181 -0
- package/project-templates/threejs/skills/_shared/scripts/verify-env.mjs +285 -0
- package/project-templates/threejs/skills/_shared/scripts/verify-placeholders.mjs +161 -0
- package/project-templates/threejs/skills/_shared/scripts/workflow-doctor.mjs +348 -0
- package/project-templates/threejs/skills/playable-animate/SKILL.md +52 -0
- package/project-templates/threejs/skills/playable-animate/agents/openai.yaml +4 -0
- package/project-templates/threejs/skills/playable-animate/references/board-refresh.md +30 -0
- package/project-templates/threejs/skills/playable-animate/references/diagnosis-checklist.md +25 -0
- package/project-templates/threejs/skills/playable-animate/references/entrance-sequencing.md +33 -0
- package/project-templates/threejs/skills/playable-animate/references/interaction-timing.md +23 -0
- package/project-templates/threejs/skills/playable-art/SKILL.md +203 -0
- package/project-templates/threejs/skills/playable-art/agents/openai.yaml +4 -0
- package/project-templates/threejs/skills/playable-art/references/alpha-postprocess.md +46 -0
- package/project-templates/threejs/skills/playable-art/references/cta-art-spec.md +59 -0
- package/project-templates/threejs/skills/playable-art/references/layout-proportions.md +30 -0
- package/project-templates/threejs/skills/playable-art/references/prompt-patterns.md +83 -0
- package/project-templates/threejs/skills/playable-art/references/reference-comparison.md +30 -0
- package/project-templates/threejs/skills/playable-art/references/sheet-import-v2.md +91 -0
- package/project-templates/threejs/skills/playable-art/scripts/build-atlas.py +332 -0
- package/project-templates/threejs/skills/playable-art/scripts/chroma-key.py +50 -0
- package/project-templates/threejs/skills/playable-art/scripts/extract-alpha-split.py +65 -0
- package/project-templates/threejs/skills/playable-art/scripts/extract-dual-bg-alpha.py +118 -0
- package/project-templates/threejs/skills/playable-art/scripts/import-gpt-art-sheets-v2.py +403 -0
- package/project-templates/threejs/skills/playable-art/scripts/import-gpt-art-sheets.py +280 -0
- package/project-templates/threejs/skills/playable-art/scripts/import-gpt-tile-sheet.py +114 -0
- package/project-templates/threejs/skills/playable-art/scripts/import_gpt_art_pipeline.py +321 -0
- package/project-templates/threejs/skills/playable-art/scripts/import_gpt_art_sheets_v2_test.py +126 -0
- package/project-templates/threejs/skills/playable-art/scripts/placeholder_common.py +98 -0
- package/project-templates/threejs/skills/playable-art/scripts/remove-bg.py +91 -0
- package/project-templates/threejs/skills/playable-art/scripts/review-processed-assets.py +468 -0
- package/project-templates/threejs/skills/playable-art/scripts/review_processed_assets_test.py +116 -0
- package/project-templates/threejs/skills/playable-art/scripts/verify-alpha-clean.py +105 -0
- package/project-templates/threejs/skills/playable-debug/SKILL.md +116 -0
- package/project-templates/threejs/skills/playable-debug/agents/openai.yaml +4 -0
- package/project-templates/threejs/skills/playable-debug/references/debug-config.md +40 -0
- package/project-templates/threejs/skills/playable-focus/SKILL.md +148 -0
- package/project-templates/threejs/skills/playable-focus/scripts/bootstrap-playground.mjs +84 -0
- package/project-templates/threejs/skills/playable-focus/scripts/extract-focus-frames.mjs +87 -0
- package/project-templates/threejs/skills/playable-focus/scripts/generate-focus-reports.mjs +121 -0
- package/project-templates/threejs/skills/playable-focus/scripts/playground.mjs +390 -0
- package/project-templates/threejs/skills/playable-focus/templates/focus-lab/frame.html +39 -0
- package/project-templates/threejs/skills/playable-focus/templates/focus-lab/harness/clean-stage.js +114 -0
- package/project-templates/threejs/skills/playable-focus/templates/focus-lab/harness/frame-lab-scene.js +94 -0
- package/project-templates/threejs/skills/playable-focus/templates/focus-lab/harness/particle-lab-scene.js +224 -0
- package/project-templates/threejs/skills/playable-focus/templates/focus-lab/model.html +16 -0
- package/project-templates/threejs/skills/playable-focus/templates/focus-lab/particle.html +38 -0
- package/project-templates/threejs/skills/playable-focus/templates/focus-lab/shatter.html +47 -0
- package/project-templates/threejs/skills/playable-fx-decompose/SKILL.md +212 -0
- package/project-templates/threejs/skills/playable-fx-decompose/examples.md +89 -0
- package/project-templates/threejs/skills/playable-fx-decompose/reference.md +201 -0
- package/project-templates/threejs/skills/playable-fx-decompose/requirements.txt +2 -0
- package/project-templates/threejs/skills/playable-fx-decompose/scripts/build-blank-tile-crack.py +192 -0
- package/project-templates/threejs/skills/playable-fx-decompose/scripts/fix-shard-debris-frames.py +60 -0
- package/project-templates/threejs/skills/playable-fx-decompose/scripts/generate-shard-debris.py +276 -0
- package/project-templates/threejs/skills/playable-fx-peak/SKILL.md +237 -0
- package/project-templates/threejs/skills/playable-fx-peak/requirements.txt +2 -0
- package/project-templates/threejs/skills/playable-fx-peak/scripts/fix-frame-edges.py +70 -0
- package/project-templates/threejs/skills/playable-fx-peak/scripts/repack-frame-sequence.py +526 -0
- package/project-templates/threejs/skills/playable-fx-peak/scripts/validate-frame-anchors.py +130 -0
- package/project-templates/threejs/skills/playable-placeholder/SKILL.md +239 -0
- package/project-templates/threejs/skills/playable-record/SKILL.md +166 -0
- package/project-templates/threejs/skills/playable-record/scripts/lib/build-artifact.mjs +92 -0
- package/project-templates/threejs/skills/playable-record/scripts/lib/dev-server.mjs +104 -0
- package/project-templates/threejs/skills/playable-record/scripts/lib/record-audio-bridge.js +141 -0
- package/project-templates/threejs/skills/playable-record/scripts/lib/slice-structure-verify.mjs +199 -0
- package/project-templates/threejs/skills/playable-record/scripts/record-playable.mjs +583 -0
- package/project-templates/threejs/skills/playable-record/scripts/verify-build.mjs +185 -0
- package/project-templates/threejs/skills/playable-record/scripts/verify-contract.mjs +261 -0
- package/project-templates/threejs/skills/playable-record/scripts/verify-firstwin.mjs +398 -0
- package/project-templates/threejs/skills/playable-record/scripts/verify-fusion.mjs +320 -0
- package/project-templates/threejs/skills/playable-record/scripts/verify-lifecycle.mjs +78 -0
- package/project-templates/threejs/skills/playable-record/scripts/verify-slice-artist.mjs +53 -0
- package/project-templates/threejs/skills/playable-record/scripts/verify-slice-ta.mjs +53 -0
- package/project-templates/threejs/skills/playable-record/scripts/verify-slice.mjs +142 -0
- package/project-templates/threejs/skills/playable-record/scripts/verify-visual-ring.mjs +250 -0
- package/project-templates/threejs/skills/playable-record/scripts/verify-visual-ring1.mjs +190 -0
- package/project-templates/threejs/skills/playable-record/scripts/verify-vlm-video.mjs +227 -0
- package/project-templates/threejs/skills/playable-validate/SKILL.md +260 -0
- package/project-templates/threejs/skills/playable-validate/references/checklist-detail.md +36 -0
- package/project-templates/threejs/skills/playable-validate/references/single-html-bundle.md +76 -0
- package/project-templates/threejs/skills/playable-validate/validation-rules.md +200 -0
- package/project-templates/threejs/skills/playable-verify-ui/SKILL.md +295 -0
- package/project-templates/threejs/skills/playable-verify-ui/examples/asset-manifest.example.json +36 -0
- package/project-templates/threejs/skills/playable-verify-ui/examples/mahjong-match.profile.yaml +334 -0
- package/project-templates/threejs/skills/playable-verify-ui/profiles/template.profile.yaml +84 -0
- package/project-templates/threejs/skills/playable-verify-ui/reference.md +165 -0
- package/project-templates/threejs/skills/playable-verify-ui/references/phaser-patterns.md +67 -0
- package/project-templates/threejs/skills/playable-verify-ui/references/scaling-decision-tree.md +51 -0
- package/project-templates/threejs/skills/playable-verify-ui/requirements.txt +7 -0
- package/project-templates/threejs/skills/playable-verify-ui/schema/asset-manifest.schema.json +68 -0
- package/project-templates/threejs/skills/playable-verify-ui/schema/playable-ui-profile.schema.json +171 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/asset_manifest.py +231 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/lib/__init__.py +1 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/lib/config_expr.js +218 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/lib/node_utils.js +51 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/lib/profile_loader.py +59 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/lib/report.py +106 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/lib/runtime_contract.js +116 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/measure_frame_content.py +77 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/run_all.py +265 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_asset_sizes.py +77 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_assets_present.py +62 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_atlas_budget.py +84 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_atlas_frames.py +79 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_bg_clean.py +365 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_doc_asset_sync.py +90 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_fetch_antipatterns.py +59 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_game_config_load.js +54 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_hardcoded_layout.js +64 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_layout_regions.js +110 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_profile_schema.py +37 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_ring1_visual.py +211 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_runtime_contract.js +58 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_script_load_order.js +73 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_slice_plan.py +238 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_slice_plan_test.py +125 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_text_overlap.py +333 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_tile_consistency.py +323 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_vision_evidence.py +894 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_vision_evidence_test.py +122 -0
- package/project-templates/threejs/skills/playable-verify-ui/scripts/verify_visual.py +422 -0
- package/project-templates/threejs/ta-workspace/scripts/.gitkeep +0 -0
- package/project-templates/threejs/templates/artist-log.template.md +182 -0
- package/project-templates/threejs/templates/atom-tree.template.json +133 -0
- package/project-templates/threejs/templates/design-brief.template.md +92 -0
- package/project-templates/threejs/templates/design-lens-checklist.reference.md +117 -0
- package/project-templates/threejs/templates/design-methodology.md +99 -0
- package/project-templates/threejs/templates/design.template.md +50 -0
- package/project-templates/threejs/templates/developer-log.template.md +258 -0
- package/project-templates/threejs/templates/five-axis-framework.md +194 -0
- package/project-templates/threejs/templates/gen-placeholder-audio.template.mjs +63 -0
- package/project-templates/threejs/templates/gen-placeholders.template.mjs +81 -0
- package/project-templates/threejs/templates/intent-clarifications.template.md +58 -0
- package/project-templates/threejs/templates/layout-spec.template.md +198 -0
- package/project-templates/threejs/templates/plan.template.md +80 -0
- package/project-templates/threejs/templates/project-state.template.md +136 -0
- package/project-templates/threejs/templates/review-report.template.md +275 -0
- package/project-templates/threejs/templates/style-exploration.template.md +93 -0
- package/project-templates/threejs/templates/ta-log.template.md +394 -0
- package/project-templates/threejs/tsconfig.json +20 -0
- package/project-templates/threejs/vite.config.ts +27 -0
- package/dist/atom-plan/validate-atom-plan.js +0 -298
- package/dist/playable/base-builder.js +0 -265
- package/dist/playable/builder.js +0 -1462
- package/dist/playable/converter.js +0 -150
- package/dist/playable/index.js +0 -3
- package/dist/playable/platforms/base.js +0 -12
- package/dist/playable/platforms/facebook.js +0 -37
- package/dist/playable/platforms/index.js +0 -24
- package/dist/playable/platforms/snapchat.js +0 -59
- package/dist/playable/playable-builder.js +0 -521
- package/dist/playable/types.js +0 -1
- package/dist/playable/vite/config-builder.js +0 -136
- package/dist/playable/vite/platform-configs.js +0 -102
- package/dist/playable/vite/plugin-model-compression.js +0 -63
- package/dist/playable/vite/plugin-platform.js +0 -65
- package/dist/playable/vite/plugin-playcanvas.js +0 -454
- package/dist/playable/vite-builder.js +0 -125
- 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/settings.local.json +0 -4
- 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/logs → engine-packs/threejs/game/config}/.gitkeep +0 -0
- /package/{project-template/ta-workspace/logs → engine-packs/threejs/game/gameplay}/.gitkeep +0 -0
- /package/{project-template/ta-workspace/tmp → engine-packs/threejs/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,893 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single read/write layer over docs/project-state.json — the machine source of
|
|
3
|
+
* truth for project state. The human-readable docs/project-state.md is a
|
|
4
|
+
* GENERATED view rendered from this JSON after every write (see
|
|
5
|
+
* render-project-state.mjs). Agents read via `npm run state:get` and write via
|
|
6
|
+
* `npm run state:set` / `npm run ring:gate` / STOP hooks — they never hand-edit
|
|
7
|
+
* the markdown.
|
|
8
|
+
*
|
|
9
|
+
* Dual-path read: if docs/project-state.json is absent but a legacy
|
|
10
|
+
* docs/project-state.md exists, it is imported on read (best-effort) so old
|
|
11
|
+
* projects and md-only test fixtures keep working. Writes always persist JSON
|
|
12
|
+
* and re-render the md.
|
|
13
|
+
*
|
|
14
|
+
* See docs/harness/experiment-lessons.md §9.1.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import fs from 'node:fs';
|
|
18
|
+
import path from 'node:path';
|
|
19
|
+
import {
|
|
20
|
+
RING_GOALS,
|
|
21
|
+
allDoDPassed,
|
|
22
|
+
normalizeIteration,
|
|
23
|
+
parseRingDoDFlow,
|
|
24
|
+
parseArchivedRingsFlow,
|
|
25
|
+
ringDoDKeysForIteration,
|
|
26
|
+
} from './ring-config.mjs';
|
|
27
|
+
import { renderProjectState } from './render-project-state.mjs';
|
|
28
|
+
|
|
29
|
+
export const STATE_JSON_REL = 'docs/project-state.json';
|
|
30
|
+
export const STATE_MD_REL = 'docs/project-state.md';
|
|
31
|
+
export const STATE_SCHEMA_VERSION = 1;
|
|
32
|
+
|
|
33
|
+
export function resolveStateJsonPath(root) {
|
|
34
|
+
return path.join(path.resolve(root), STATE_JSON_REL);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function resolveStateMdPath(root) {
|
|
38
|
+
return path.join(path.resolve(root), STATE_MD_REL);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Keys that live under devPreview (set via state:set or rendered to Dev Preview). */
|
|
42
|
+
export const DEV_PREVIEW_KEYS = new Set([
|
|
43
|
+
'devStatus',
|
|
44
|
+
'devUrl',
|
|
45
|
+
'devStartedBy',
|
|
46
|
+
'devLastChecked',
|
|
47
|
+
'loadCheck',
|
|
48
|
+
'loadCheckNotes',
|
|
49
|
+
'uiReviewStatus',
|
|
50
|
+
'uiDiffNotes',
|
|
51
|
+
'uiReworkRound',
|
|
52
|
+
'devBlockers',
|
|
53
|
+
]);
|
|
54
|
+
|
|
55
|
+
/** Keys written by the ring:gate runner. */
|
|
56
|
+
export const RING_GATE_RUNNER_KEYS = new Set([
|
|
57
|
+
'ringGateCurrent',
|
|
58
|
+
'ringGateVerdict',
|
|
59
|
+
'ringGateCheckedAt',
|
|
60
|
+
'ringGateBlockingIssues',
|
|
61
|
+
'ringGateCanAskUser',
|
|
62
|
+
'ringGateRouteTo',
|
|
63
|
+
'ringGateFailReason',
|
|
64
|
+
'ringGateNonRegression',
|
|
65
|
+
]);
|
|
66
|
+
|
|
67
|
+
/** Top-level scalar keys (not part of the handoff routing block). */
|
|
68
|
+
export const TOP_LEVEL_KEYS = new Set([
|
|
69
|
+
'userIntent',
|
|
70
|
+
'selectedMcOption',
|
|
71
|
+
'assetMappingLocked',
|
|
72
|
+
'designerAutoDecide',
|
|
73
|
+
]);
|
|
74
|
+
|
|
75
|
+
/** Ordered handoff scalar keys for stable YAML rendering. */
|
|
76
|
+
export const HANDOFF_KEY_ORDER = [
|
|
77
|
+
'iteration',
|
|
78
|
+
'ringGoal',
|
|
79
|
+
'loop',
|
|
80
|
+
'subagent',
|
|
81
|
+
'subagent_stop',
|
|
82
|
+
'waiting_for',
|
|
83
|
+
'ringGate',
|
|
84
|
+
'next_orchestrator_action',
|
|
85
|
+
'last_completed_by',
|
|
86
|
+
'block_reason',
|
|
87
|
+
];
|
|
88
|
+
|
|
89
|
+
export function defaultState() {
|
|
90
|
+
return {
|
|
91
|
+
schemaVersion: STATE_SCHEMA_VERSION,
|
|
92
|
+
templateVersion: '0.3.2-alpha.0',
|
|
93
|
+
workflowSpecVersion: 'growth-rings-v1',
|
|
94
|
+
userIntent: '',
|
|
95
|
+
settings: { designerAutoDecide: false },
|
|
96
|
+
selectedMcOption: 'unset',
|
|
97
|
+
assetMappingLocked: false,
|
|
98
|
+
handoff: {
|
|
99
|
+
iteration: '1',
|
|
100
|
+
ringGoal: 'engine-root + core gameplay (placeholder art)',
|
|
101
|
+
loop: 'clarify',
|
|
102
|
+
subagent: 'none',
|
|
103
|
+
subagent_stop: 'false',
|
|
104
|
+
waiting_for: 'orchestrator',
|
|
105
|
+
ringGate: 'pending',
|
|
106
|
+
next_orchestrator_action: 'null',
|
|
107
|
+
last_completed_by: 'null',
|
|
108
|
+
block_reason: 'null',
|
|
109
|
+
},
|
|
110
|
+
ringDoD: {
|
|
111
|
+
contract: 'pending',
|
|
112
|
+
lifecycle: 'pending',
|
|
113
|
+
firstLevelWin: 'pending',
|
|
114
|
+
placeholders: 'pending',
|
|
115
|
+
ring2Visual: 'pending',
|
|
116
|
+
ring3Visual: 'pending',
|
|
117
|
+
},
|
|
118
|
+
handoffContext: {
|
|
119
|
+
ring: {
|
|
120
|
+
summary: 'Ring 1 starts as a semantic placeholder playable demo.',
|
|
121
|
+
goal: 'engine-root + core gameplay (placeholder art)',
|
|
122
|
+
passedDoD: [],
|
|
123
|
+
},
|
|
124
|
+
lastRole: {
|
|
125
|
+
role: 'none',
|
|
126
|
+
summary: 'No sub-agent has completed work yet.',
|
|
127
|
+
decisions: [],
|
|
128
|
+
artifactRefs: [],
|
|
129
|
+
validation: [],
|
|
130
|
+
blockers: [],
|
|
131
|
+
},
|
|
132
|
+
nextRole: {
|
|
133
|
+
role: 'orchestrator',
|
|
134
|
+
mustKnow: ['Run state:get and follow currentAction / nextCommands.'],
|
|
135
|
+
requiredFiles: ['CLAUDE.md'],
|
|
136
|
+
forbiddenFiles: [],
|
|
137
|
+
artifactRefs: [],
|
|
138
|
+
},
|
|
139
|
+
sharedDecisions: {
|
|
140
|
+
engine: 'unset',
|
|
141
|
+
coreAction: 'unset',
|
|
142
|
+
semanticPlaceholders: [],
|
|
143
|
+
assetContractRefs: [],
|
|
144
|
+
},
|
|
145
|
+
openQuestions: [],
|
|
146
|
+
},
|
|
147
|
+
ringArtifacts: {},
|
|
148
|
+
archivedRings: {},
|
|
149
|
+
archivedRingContexts: {},
|
|
150
|
+
ringGateRunner: {
|
|
151
|
+
ringGateCurrent: 'none',
|
|
152
|
+
ringGateVerdict: 'not_run',
|
|
153
|
+
ringGateCheckedAt: 'unset',
|
|
154
|
+
ringGateBlockingIssues: '0',
|
|
155
|
+
ringGateCanAskUser: 'no',
|
|
156
|
+
ringGateRouteTo: 'none',
|
|
157
|
+
ringGateFailReason: 'none',
|
|
158
|
+
ringGateNonRegression: 'n-a',
|
|
159
|
+
},
|
|
160
|
+
devPreview: {
|
|
161
|
+
devStatus: 'pending',
|
|
162
|
+
devUrl: 'unset',
|
|
163
|
+
devStartedBy: 'none',
|
|
164
|
+
devLastChecked: 'unset',
|
|
165
|
+
loadCheck: 'pending',
|
|
166
|
+
loadCheckNotes: 'unset',
|
|
167
|
+
uiReviewStatus: 'deferred',
|
|
168
|
+
uiDiffNotes: 'deferred',
|
|
169
|
+
uiReworkRound: '0',
|
|
170
|
+
devBlockers: [],
|
|
171
|
+
},
|
|
172
|
+
progressCheckpoint: [],
|
|
173
|
+
productionPipeline: { waves: [] },
|
|
174
|
+
fileIndex: [],
|
|
175
|
+
// slice-axis-v1 (see docs/harness/slice-axis-design.md): the slice state
|
|
176
|
+
// machine. Additive — when activeSliceId is 'none' the harness falls back to
|
|
177
|
+
// the existing ring:loop behavior, so existing projects/tests are unaffected.
|
|
178
|
+
sliceState: {
|
|
179
|
+
schemaVersion: 1,
|
|
180
|
+
activeSliceId: 'none',
|
|
181
|
+
slices: [],
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/** A single slice's full default shape (dispatchPacket fields + runtime state). */
|
|
187
|
+
export function defaultSlice() {
|
|
188
|
+
return {
|
|
189
|
+
sliceId: '',
|
|
190
|
+
role: 'developer',
|
|
191
|
+
doWhat: '',
|
|
192
|
+
flow: 'implement',
|
|
193
|
+
hypothesis: '',
|
|
194
|
+
requiredContext: [],
|
|
195
|
+
allowedFiles: [],
|
|
196
|
+
forbiddenTasks: [],
|
|
197
|
+
acceptance: [],
|
|
198
|
+
evidenceTier: 'probe',
|
|
199
|
+
skillRefs: [],
|
|
200
|
+
skillUse: '',
|
|
201
|
+
fromScratchReason: '',
|
|
202
|
+
verifier: 'verify:build',
|
|
203
|
+
fallbackRoute: {},
|
|
204
|
+
status: 'pending',
|
|
205
|
+
verification: [],
|
|
206
|
+
routeTo: null,
|
|
207
|
+
blockedBy: null,
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
const SLICE_STATUSES = new Set(['pending', 'in_progress', 'verified', 'failed', 'blocked']);
|
|
212
|
+
|
|
213
|
+
/** Mirror validate-workflow-stop isSliceResolved — shared by STOP hook and ring:gate. */
|
|
214
|
+
export function isSliceResolved(slice) {
|
|
215
|
+
if (!slice) return true;
|
|
216
|
+
if (slice.status === 'verified') return true;
|
|
217
|
+
if (slice.status === 'failed') {
|
|
218
|
+
return !!(slice.routeTo && slice.routeTo.role && slice.routeTo.reason);
|
|
219
|
+
}
|
|
220
|
+
return false;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* slice-axis-v1 (Knife 9): ring gate outer boundary — aggregates slice queue terminal
|
|
225
|
+
* state. Does NOT run per-slice verifiers (verify:slice / verify:slice-artist / …).
|
|
226
|
+
* Legacy projects with empty slices[] → applicable:false (ring DoD only).
|
|
227
|
+
*/
|
|
228
|
+
export function evaluateSliceQueueForRingGate(sliceState) {
|
|
229
|
+
const ss = normalizeSliceState(sliceState || {});
|
|
230
|
+
if (!ss.slices.length) {
|
|
231
|
+
return {
|
|
232
|
+
applicable: false,
|
|
233
|
+
ok: true,
|
|
234
|
+
blockingIssues: [],
|
|
235
|
+
routeTo: 'none',
|
|
236
|
+
nextAction: 'No slice queue — ring gate uses ring DoD verifiers only',
|
|
237
|
+
summary: null,
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
const blockingIssues = [];
|
|
242
|
+
const pending = [];
|
|
243
|
+
|
|
244
|
+
for (const slice of ss.slices) {
|
|
245
|
+
if (isSliceResolved(slice)) continue;
|
|
246
|
+
pending.push(slice);
|
|
247
|
+
if (slice.status === 'failed') {
|
|
248
|
+
blockingIssues.push(
|
|
249
|
+
`slice "${slice.sliceId}" is failed without route — run slice:set with route=<role> reason="..." before ring gate`,
|
|
250
|
+
);
|
|
251
|
+
} else {
|
|
252
|
+
blockingIssues.push(
|
|
253
|
+
`slice "${slice.sliceId}" (${slice.role}) is ${slice.status} — resolve via ${slice.verifier || 'verify:slice'} + slice:set; ring:gate does not substitute per-slice verification`,
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
const first = pending[0];
|
|
259
|
+
const routeTo = first?.routeTo?.role || first?.role || 'developer';
|
|
260
|
+
const ok = pending.length === 0;
|
|
261
|
+
|
|
262
|
+
return {
|
|
263
|
+
applicable: true,
|
|
264
|
+
ok,
|
|
265
|
+
blockingIssues,
|
|
266
|
+
routeTo,
|
|
267
|
+
nextAction: ok
|
|
268
|
+
? 'Slice queue acceptably terminal — ring gate may proceed to user acceptance if ring DoD passes'
|
|
269
|
+
: `Dispatch @${routeTo} to resolve slice "${first?.sliceId}" before ring gate (per-slice verify:slice runs at STOP, not here)`,
|
|
270
|
+
summary: {
|
|
271
|
+
total: ss.slices.length,
|
|
272
|
+
verified: ss.slices.filter((s) => s.status === 'verified').length,
|
|
273
|
+
failedRouted: ss.slices.filter((s) => s.status === 'failed' && isSliceResolved(s)).length,
|
|
274
|
+
pending: pending.map((s) => s.sliceId),
|
|
275
|
+
activeSliceId: ss.activeSliceId,
|
|
276
|
+
},
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/** @deprecated use isSliceResolved */
|
|
281
|
+
function isSliceResolvedForStore(slice) {
|
|
282
|
+
return isSliceResolved(slice);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/** Normalize the sliceState block: coerce arrays, fill slice defaults, dedupe. */
|
|
286
|
+
export function normalizeSliceState(sliceState) {
|
|
287
|
+
const base = { schemaVersion: 1, activeSliceId: 'none', slices: [], lastResolvedForStop: null };
|
|
288
|
+
const merged = isPlainObject(sliceState) ? { ...base, ...sliceState } : base;
|
|
289
|
+
const rawSlices = Array.isArray(merged.slices) ? merged.slices : [];
|
|
290
|
+
const slices = rawSlices
|
|
291
|
+
.filter((s) => isPlainObject(s) && String(s.sliceId || '').trim())
|
|
292
|
+
.map((s) => {
|
|
293
|
+
const slice = { ...defaultSlice(), ...s };
|
|
294
|
+
slice.requiredContext = parseStringList(slice.requiredContext);
|
|
295
|
+
slice.allowedFiles = parseStringList(slice.allowedFiles);
|
|
296
|
+
slice.forbiddenTasks = parseStringList(slice.forbiddenTasks);
|
|
297
|
+
slice.acceptance = parseStringList(slice.acceptance);
|
|
298
|
+
if (slice.acceptance.length === 0 && Array.isArray(s.dod) && s.dod.length) {
|
|
299
|
+
slice.acceptance = parseStringList(s.dod);
|
|
300
|
+
}
|
|
301
|
+
slice.verification = parseStringList(slice.verification);
|
|
302
|
+
slice.skillRefs = parseStringList(slice.skillRefs);
|
|
303
|
+
slice.skillUse = String(slice.skillUse || '').trim();
|
|
304
|
+
slice.fromScratchReason = String(slice.fromScratchReason || '').trim();
|
|
305
|
+
if (!slice.evidenceTier) slice.evidenceTier = 'probe';
|
|
306
|
+
if (!slice.verifier) slice.verifier = 'verify:build';
|
|
307
|
+
if (!SLICE_STATUSES.has(String(slice.status))) slice.status = 'pending';
|
|
308
|
+
if (!isPlainObject(slice.fallbackRoute)) slice.fallbackRoute = {};
|
|
309
|
+
if (slice.routeTo != null && !isPlainObject(slice.routeTo)) slice.routeTo = null;
|
|
310
|
+
return slice;
|
|
311
|
+
});
|
|
312
|
+
const ids = new Set(slices.map((s) => s.sliceId));
|
|
313
|
+
// 'none' is an explicit sentinel (e.g. queue drained after the last slice is
|
|
314
|
+
// verified) and must survive normalization even when slices still exist —
|
|
315
|
+
// otherwise a completed queue would silently re-point to slices[0] and re-dispatch.
|
|
316
|
+
const activeSliceId = merged.activeSliceId === 'none'
|
|
317
|
+
? 'none'
|
|
318
|
+
: (ids.has(merged.activeSliceId) ? merged.activeSliceId : (slices[0]?.sliceId ?? 'none'));
|
|
319
|
+
let lastResolvedForStop = null;
|
|
320
|
+
if (
|
|
321
|
+
isPlainObject(merged.lastResolvedForStop)
|
|
322
|
+
&& merged.lastResolvedForStop.sliceId
|
|
323
|
+
&& merged.lastResolvedForStop.role
|
|
324
|
+
) {
|
|
325
|
+
lastResolvedForStop = {
|
|
326
|
+
sliceId: String(merged.lastResolvedForStop.sliceId),
|
|
327
|
+
role: String(merged.lastResolvedForStop.role),
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
// A newly active unresolved slice supersedes the drain marker (next dispatch cycle).
|
|
331
|
+
if (activeSliceId !== 'none') {
|
|
332
|
+
const activeSlice = slices.find((s) => s.sliceId === activeSliceId);
|
|
333
|
+
if (activeSlice && !isSliceResolvedForStore(activeSlice)) {
|
|
334
|
+
lastResolvedForStop = null;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
return {
|
|
338
|
+
schemaVersion: 1,
|
|
339
|
+
activeSliceId: slices.length ? activeSliceId : 'none',
|
|
340
|
+
slices,
|
|
341
|
+
lastResolvedForStop,
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
function isPlainObject(v) {
|
|
346
|
+
return v != null && typeof v === 'object' && !Array.isArray(v);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
export function normalizeDevBlockers(value) {
|
|
350
|
+
if (Array.isArray(value)) return value.map((v) => String(v).trim()).filter(Boolean);
|
|
351
|
+
const raw = String(value ?? '').trim();
|
|
352
|
+
if (!raw || raw === 'none' || raw === '[]' || raw === 'null') return [];
|
|
353
|
+
try {
|
|
354
|
+
const parsed = JSON.parse(raw);
|
|
355
|
+
if (Array.isArray(parsed)) return parsed.map((v) => String(v).trim()).filter(Boolean);
|
|
356
|
+
} catch {
|
|
357
|
+
// Keep supporting concise CLI input such as "asset missing;route to TA".
|
|
358
|
+
}
|
|
359
|
+
return raw
|
|
360
|
+
.split(';')
|
|
361
|
+
.map((v) => v.trim())
|
|
362
|
+
.filter(Boolean);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
export function parseStringList(value) {
|
|
366
|
+
if (Array.isArray(value)) return value.map((v) => String(v).trim()).filter(Boolean);
|
|
367
|
+
const raw = String(value ?? '').trim();
|
|
368
|
+
if (!raw || raw === 'none' || raw === '[]' || raw === 'null') return [];
|
|
369
|
+
try {
|
|
370
|
+
const parsed = JSON.parse(raw);
|
|
371
|
+
if (Array.isArray(parsed)) return parsed.map((v) => String(v).trim()).filter(Boolean);
|
|
372
|
+
} catch {
|
|
373
|
+
// Support terse CLI input such as "a;b,c".
|
|
374
|
+
}
|
|
375
|
+
return raw
|
|
376
|
+
.split(/[;,]/)
|
|
377
|
+
.map((v) => v.trim())
|
|
378
|
+
.filter(Boolean);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
function parseJsonObject(value, key) {
|
|
382
|
+
const raw = String(value ?? '').trim();
|
|
383
|
+
if (!raw) return {};
|
|
384
|
+
try {
|
|
385
|
+
const parsed = JSON.parse(raw);
|
|
386
|
+
if (!isPlainObject(parsed)) throw new Error('not object');
|
|
387
|
+
return parsed;
|
|
388
|
+
} catch {
|
|
389
|
+
throw new Error(`${key} must be a JSON object`);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
function normalizeHandoffContext(context) {
|
|
394
|
+
const base = defaultState().handoffContext;
|
|
395
|
+
const merged = mergeState(base, isPlainObject(context) ? context : {});
|
|
396
|
+
merged.ring.passedDoD = parseStringList(merged.ring.passedDoD);
|
|
397
|
+
merged.lastRole.decisions = parseStringList(merged.lastRole.decisions);
|
|
398
|
+
merged.lastRole.artifactRefs = parseStringList(merged.lastRole.artifactRefs);
|
|
399
|
+
merged.lastRole.validation = parseStringList(merged.lastRole.validation);
|
|
400
|
+
merged.lastRole.blockers = parseStringList(merged.lastRole.blockers);
|
|
401
|
+
merged.nextRole.mustKnow = parseStringList(merged.nextRole.mustKnow);
|
|
402
|
+
merged.nextRole.requiredFiles = parseStringList(merged.nextRole.requiredFiles);
|
|
403
|
+
merged.nextRole.forbiddenFiles = parseStringList(merged.nextRole.forbiddenFiles);
|
|
404
|
+
merged.nextRole.artifactRefs = parseStringList(merged.nextRole.artifactRefs);
|
|
405
|
+
merged.sharedDecisions.semanticPlaceholders = parseStringList(
|
|
406
|
+
merged.sharedDecisions.semanticPlaceholders,
|
|
407
|
+
);
|
|
408
|
+
merged.sharedDecisions.assetContractRefs = parseStringList(
|
|
409
|
+
merged.sharedDecisions.assetContractRefs,
|
|
410
|
+
);
|
|
411
|
+
merged.openQuestions = parseStringList(merged.openQuestions);
|
|
412
|
+
return merged;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/** Deep-merge `patch` into `base`: nested plain objects merge, arrays/scalars replace. */
|
|
416
|
+
export function mergeState(base, patch) {
|
|
417
|
+
const out = Array.isArray(base) ? [...base] : { ...base };
|
|
418
|
+
for (const [key, value] of Object.entries(patch || {})) {
|
|
419
|
+
if (isPlainObject(value) && isPlainObject(out[key])) {
|
|
420
|
+
out[key] = mergeState(out[key], value);
|
|
421
|
+
} else {
|
|
422
|
+
out[key] = value;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
return out;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/** Normalize a freshly-parsed JSON state to the full default shape. */
|
|
429
|
+
export function normalizeState(raw) {
|
|
430
|
+
const state = mergeState(defaultState(), raw || {});
|
|
431
|
+
state.handoffContext = normalizeHandoffContext(state.handoffContext);
|
|
432
|
+
state.sliceState = normalizeSliceState(state.sliceState);
|
|
433
|
+
return state;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
// ── Markdown importer (legacy md → JSON) ───────────────────────────────────
|
|
437
|
+
|
|
438
|
+
function parseHandoffBlock(content) {
|
|
439
|
+
const match = content.match(/## Agent handoff[\s\S]*?```yaml\s*([\s\S]*?)```/i);
|
|
440
|
+
if (!match) return {};
|
|
441
|
+
const handoff = {};
|
|
442
|
+
for (const line of match[1].split('\n')) {
|
|
443
|
+
const kv = line.match(/^\s*([A-Za-z0-9_]+):\s*(.*?)\s*$/);
|
|
444
|
+
if (!kv) continue;
|
|
445
|
+
handoff[kv[1]] = kv[2].replace(/^['"]|['"]$/g, '').trim();
|
|
446
|
+
}
|
|
447
|
+
return handoff;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
/** Parse `| key | value |` style rows in a `## Heading` section into a Map. */
|
|
451
|
+
function parseSectionKeyValues(content, heading) {
|
|
452
|
+
const map = new Map();
|
|
453
|
+
const start = content.indexOf(heading);
|
|
454
|
+
if (start === -1) return map;
|
|
455
|
+
const after = content.slice(start + heading.length);
|
|
456
|
+
const next = after.search(/\n##\s+/);
|
|
457
|
+
const section = next === -1 ? after : after.slice(0, next);
|
|
458
|
+
for (const line of section.split('\n')) {
|
|
459
|
+
const trimmed = line.trim();
|
|
460
|
+
if (!trimmed.startsWith('|')) continue;
|
|
461
|
+
if (/^\|[\s|:-]+\|?$/.test(trimmed)) continue;
|
|
462
|
+
const parts = trimmed
|
|
463
|
+
.split('|')
|
|
464
|
+
.map((p) => p.trim())
|
|
465
|
+
.filter((_, i, arr) => i > 0 && i < arr.length - 1);
|
|
466
|
+
if (parts.length < 2) continue;
|
|
467
|
+
const key = parts[0].replace(/\*\*/g, '').replace(/`/g, '').trim();
|
|
468
|
+
if (/^(field|owner|verifier)$/i.test(key)) continue;
|
|
469
|
+
const value = parts.length >= 3 ? parts[parts.length - 1] : parts[1];
|
|
470
|
+
if (!map.has(key)) map.set(key, value);
|
|
471
|
+
}
|
|
472
|
+
return map;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
/** Best-effort import of a legacy docs/project-state.md into a state object. */
|
|
476
|
+
export function importStateFromMarkdown(content) {
|
|
477
|
+
const state = defaultState();
|
|
478
|
+
const handoff = parseHandoffBlock(content);
|
|
479
|
+
|
|
480
|
+
for (const key of HANDOFF_KEY_ORDER) {
|
|
481
|
+
if (handoff[key] != null && handoff[key] !== '') state.handoff[key] = handoff[key];
|
|
482
|
+
}
|
|
483
|
+
if (handoff.ringDoD) state.ringDoD = parseRingDoDFlow(handoff.ringDoD);
|
|
484
|
+
if (handoff.archivedRings) state.archivedRings = parseArchivedRingsFlow(handoff.archivedRings);
|
|
485
|
+
|
|
486
|
+
// Human-table views (present in older / hand-authored md only).
|
|
487
|
+
const devPreview = parseSectionKeyValues(content, '## Dev Preview');
|
|
488
|
+
for (const key of DEV_PREVIEW_KEYS) {
|
|
489
|
+
if (devPreview.has(key)) state.devPreview[key] = devPreview.get(key);
|
|
490
|
+
}
|
|
491
|
+
const runner = parseSectionKeyValues(content, '## Ring Gate Runner');
|
|
492
|
+
for (const key of RING_GATE_RUNNER_KEYS) {
|
|
493
|
+
if (runner.has(key)) state.ringGateRunner[key] = runner.get(key);
|
|
494
|
+
}
|
|
495
|
+
// Some fixtures keep loadCheck / ringGateCanAskUser in ad-hoc tables anywhere.
|
|
496
|
+
const looseDev = parseSectionKeyValues(content, '## Dev Preview');
|
|
497
|
+
if (looseDev.has('devBlockers')) {
|
|
498
|
+
const raw = looseDev.get('devBlockers');
|
|
499
|
+
state.devPreview.devBlockers = !raw || raw === 'none' ? [] : [raw];
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
const intent = content.match(/##\s*User Intent\s*\n+>?\s*(.+)/i);
|
|
503
|
+
if (intent && !/\{\{/.test(intent[1])) state.userIntent = intent[1].trim();
|
|
504
|
+
|
|
505
|
+
const settings = parseSectionKeyValues(content, '## Settings');
|
|
506
|
+
if (settings.has('designerAutoDecide')) {
|
|
507
|
+
state.settings.designerAutoDecide = /true/i.test(settings.get('designerAutoDecide'));
|
|
508
|
+
}
|
|
509
|
+
return state;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
// ── Read / write ────────────────────────────────────────────────────────────
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* Read the project state. Prefers docs/project-state.json; falls back to
|
|
516
|
+
* importing a legacy docs/project-state.md; otherwise returns defaults.
|
|
517
|
+
* @param {string} root
|
|
518
|
+
*/
|
|
519
|
+
export function readState(root) {
|
|
520
|
+
const jsonPath = resolveStateJsonPath(root);
|
|
521
|
+
if (fs.existsSync(jsonPath)) {
|
|
522
|
+
try {
|
|
523
|
+
return normalizeState(JSON.parse(fs.readFileSync(jsonPath, 'utf8')));
|
|
524
|
+
} catch {
|
|
525
|
+
/* fall through to md import */
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
const mdPath = resolveStateMdPath(root);
|
|
529
|
+
if (fs.existsSync(mdPath)) {
|
|
530
|
+
return importStateFromMarkdown(fs.readFileSync(mdPath, 'utf8'));
|
|
531
|
+
}
|
|
532
|
+
return defaultState();
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
/** True when a JSON or md state file exists for `root`. */
|
|
536
|
+
export function stateExists(root) {
|
|
537
|
+
return fs.existsSync(resolveStateJsonPath(root)) || fs.existsSync(resolveStateMdPath(root));
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* Persist `state` to JSON and re-render the markdown view.
|
|
542
|
+
* @param {string} root
|
|
543
|
+
* @param {object} state full state object
|
|
544
|
+
*/
|
|
545
|
+
export function persistState(root, state) {
|
|
546
|
+
const jsonPath = resolveStateJsonPath(root);
|
|
547
|
+
fs.mkdirSync(path.dirname(jsonPath), { recursive: true });
|
|
548
|
+
fs.writeFileSync(jsonPath, `${JSON.stringify(state, null, 2)}\n`, 'utf8');
|
|
549
|
+
try {
|
|
550
|
+
fs.writeFileSync(resolveStateMdPath(root), renderProjectState(state), 'utf8');
|
|
551
|
+
} catch {
|
|
552
|
+
/* rendering must never block a state write */
|
|
553
|
+
}
|
|
554
|
+
return state;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
/**
|
|
558
|
+
* Merge `patch` into the current state and persist. Returns the new state.
|
|
559
|
+
* @param {string} root
|
|
560
|
+
* @param {object} patch
|
|
561
|
+
*/
|
|
562
|
+
export function writeState(root, patch) {
|
|
563
|
+
const next = mergeState(readState(root), patch || {});
|
|
564
|
+
return persistState(root, next);
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
// ── Structured mutators ───────────────────────────────────────────────────
|
|
568
|
+
|
|
569
|
+
/** Apply flat handoff key/value updates (string values), routing by key. */
|
|
570
|
+
export function applyStateUpdates(root, updates) {
|
|
571
|
+
const state = readState(root);
|
|
572
|
+
for (const [key, rawValue] of Object.entries(updates || {})) {
|
|
573
|
+
const value = String(rawValue);
|
|
574
|
+
if (DEV_PREVIEW_KEYS.has(key)) {
|
|
575
|
+
state.devPreview[key] = key === 'devBlockers' ? normalizeDevBlockers(value) : value;
|
|
576
|
+
} else if (RING_GATE_RUNNER_KEYS.has(key)) {
|
|
577
|
+
state.ringGateRunner[key] = value;
|
|
578
|
+
} else if (key === 'designerAutoDecide') {
|
|
579
|
+
state.settings.designerAutoDecide = /true/i.test(value);
|
|
580
|
+
} else if (key === 'userIntent') {
|
|
581
|
+
state.userIntent = value;
|
|
582
|
+
} else if (key === 'selectedMcOption') {
|
|
583
|
+
state.selectedMcOption = value;
|
|
584
|
+
} else if (key === 'assetMappingLocked') {
|
|
585
|
+
state.assetMappingLocked = /true/i.test(value);
|
|
586
|
+
} else if (key === 'handoffContext') {
|
|
587
|
+
state.handoffContext = normalizeHandoffContext(parseJsonObject(value, key));
|
|
588
|
+
} else if (key === 'handoffContextPatch') {
|
|
589
|
+
state.handoffContext = normalizeHandoffContext(
|
|
590
|
+
mergeState(state.handoffContext, parseJsonObject(value, key)),
|
|
591
|
+
);
|
|
592
|
+
} else if (key === 'sliceState') {
|
|
593
|
+
state.sliceState = normalizeSliceState(parseJsonObject(value, key));
|
|
594
|
+
} else if (key === 'sliceStatePatch') {
|
|
595
|
+
state.sliceState = normalizeSliceState(
|
|
596
|
+
mergeState(state.sliceState, parseJsonObject(value, key)),
|
|
597
|
+
);
|
|
598
|
+
} else if (key === 'activeSliceId') {
|
|
599
|
+
state.sliceState = normalizeSliceState({ ...state.sliceState, activeSliceId: value });
|
|
600
|
+
} else if (key === 'contextSummary') {
|
|
601
|
+
state.handoffContext.lastRole.summary = value;
|
|
602
|
+
} else if (key === 'contextRole') {
|
|
603
|
+
state.handoffContext.lastRole.role = value;
|
|
604
|
+
} else if (key === 'contextNextRole') {
|
|
605
|
+
state.handoffContext.nextRole.role = value;
|
|
606
|
+
} else if (key === 'contextMustKnow') {
|
|
607
|
+
state.handoffContext.nextRole.mustKnow = parseStringList(value);
|
|
608
|
+
} else if (key === 'contextRequiredFiles') {
|
|
609
|
+
state.handoffContext.nextRole.requiredFiles = parseStringList(value);
|
|
610
|
+
} else if (key === 'contextForbiddenFiles') {
|
|
611
|
+
state.handoffContext.nextRole.forbiddenFiles = parseStringList(value);
|
|
612
|
+
} else if (key === 'contextArtifactRefs') {
|
|
613
|
+
state.handoffContext.lastRole.artifactRefs = parseStringList(value);
|
|
614
|
+
} else if (key === 'contextValidation') {
|
|
615
|
+
state.handoffContext.lastRole.validation = parseStringList(value);
|
|
616
|
+
} else if (key === 'contextBlockers') {
|
|
617
|
+
state.handoffContext.lastRole.blockers = parseStringList(value);
|
|
618
|
+
} else if (key === 'contextOpenQuestions') {
|
|
619
|
+
state.handoffContext.openQuestions = parseStringList(value);
|
|
620
|
+
} else if (key === 'contextEngine') {
|
|
621
|
+
state.handoffContext.sharedDecisions.engine = value;
|
|
622
|
+
} else if (key === 'contextCoreAction') {
|
|
623
|
+
state.handoffContext.sharedDecisions.coreAction = value;
|
|
624
|
+
} else if (key === 'contextSemanticPlaceholders') {
|
|
625
|
+
state.handoffContext.sharedDecisions.semanticPlaceholders = parseStringList(value);
|
|
626
|
+
} else if (key === 'contextAssetContractRefs') {
|
|
627
|
+
state.handoffContext.sharedDecisions.assetContractRefs = parseStringList(value);
|
|
628
|
+
} else {
|
|
629
|
+
state.handoff[key] = value;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
state.handoffContext = normalizeHandoffContext(state.handoffContext);
|
|
633
|
+
persistState(root, state);
|
|
634
|
+
return state;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
export function setHandoffContext(root, patch) {
|
|
638
|
+
const state = readState(root);
|
|
639
|
+
state.handoffContext = normalizeHandoffContext(mergeState(state.handoffContext, patch || {}));
|
|
640
|
+
persistState(root, state);
|
|
641
|
+
return state;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
// ── slice state machine (slice-axis-v1) ───────────────────────────────────
|
|
645
|
+
|
|
646
|
+
/** Return the active slice object (or null). */
|
|
647
|
+
export function getActiveSlice(state) {
|
|
648
|
+
const ss = state.sliceState || {};
|
|
649
|
+
if (!ss.activeSliceId || ss.activeSliceId === 'none') return null;
|
|
650
|
+
return (ss.slices || []).find((s) => s.sliceId === ss.activeSliceId) || null;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
/**
|
|
654
|
+
* Update the active slice's status/verification/routeTo and persist. When a slice
|
|
655
|
+
* transitions to `verified`, the next slice blocked on it is unblocked and becomes
|
|
656
|
+
* active (auto-promotion). Returns { state, slice, promotedTo }.
|
|
657
|
+
*/
|
|
658
|
+
export function updateActiveSlice(root, { status, verification, routeTo } = {}) {
|
|
659
|
+
const state = readState(root);
|
|
660
|
+
const slices = state.sliceState.slices;
|
|
661
|
+
const active = slices.find((s) => s.sliceId === state.sliceState.activeSliceId);
|
|
662
|
+
if (!active) throw new Error('No active slice (sliceState.activeSliceId is none)');
|
|
663
|
+
|
|
664
|
+
if (status) {
|
|
665
|
+
if (!SLICE_STATUSES.has(status)) throw new Error(`Invalid slice status: ${status}`);
|
|
666
|
+
active.status = status;
|
|
667
|
+
}
|
|
668
|
+
if (verification) {
|
|
669
|
+
active.verification = Array.isArray(active.verification) ? active.verification : [];
|
|
670
|
+
active.verification.push(String(verification));
|
|
671
|
+
}
|
|
672
|
+
if (routeTo && isPlainObject(routeTo)) active.routeTo = routeTo;
|
|
673
|
+
|
|
674
|
+
let promotedTo = null;
|
|
675
|
+
if (active.status === 'verified') {
|
|
676
|
+
active.routeTo = null;
|
|
677
|
+
const next = slices.find((s) => s.status === 'blocked' && s.blockedBy === active.sliceId)
|
|
678
|
+
|| slices.find((s) => s.status === 'pending' && s.sliceId !== active.sliceId);
|
|
679
|
+
if (next) {
|
|
680
|
+
if (next.status === 'blocked') next.blockedBy = null;
|
|
681
|
+
next.status = next.status === 'blocked' ? 'pending' : next.status;
|
|
682
|
+
state.sliceState.activeSliceId = next.sliceId;
|
|
683
|
+
promotedTo = next.sliceId;
|
|
684
|
+
} else {
|
|
685
|
+
// Queue drained: clear the active pointer so dispatchPacket goes null and a
|
|
686
|
+
// completed slice is never re-dispatched. Harness falls back to ring:loop.
|
|
687
|
+
state.sliceState.activeSliceId = 'none';
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
if (
|
|
692
|
+
active.status === 'verified'
|
|
693
|
+
|| (active.status === 'failed' && active.routeTo?.role && active.routeTo?.reason)
|
|
694
|
+
) {
|
|
695
|
+
state.sliceState.lastResolvedForStop = {
|
|
696
|
+
sliceId: active.sliceId,
|
|
697
|
+
role: String(active.role || 'developer'),
|
|
698
|
+
};
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
state.sliceState = normalizeSliceState(state.sliceState);
|
|
702
|
+
persistState(root, state);
|
|
703
|
+
return { state, slice: active, promotedTo };
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
/** Append a Progress Checkpoint entry programmatically. */
|
|
707
|
+
export function appendCheckpoint(root, entry) {
|
|
708
|
+
const state = readState(root);
|
|
709
|
+
const at = entry.at || new Date().toISOString();
|
|
710
|
+
state.progressCheckpoint.push({
|
|
711
|
+
at,
|
|
712
|
+
by: entry.by ?? 'unknown',
|
|
713
|
+
iteration: entry.iteration ?? state.handoff.iteration,
|
|
714
|
+
loop: entry.loop ?? state.handoff.loop,
|
|
715
|
+
note: entry.note ?? '',
|
|
716
|
+
});
|
|
717
|
+
persistState(root, state);
|
|
718
|
+
return state;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
/** Set (replace by id) a Production Pipeline wave row. */
|
|
722
|
+
export function setPipelineWave(root, wave) {
|
|
723
|
+
const state = readState(root);
|
|
724
|
+
const waves = state.productionPipeline.waves;
|
|
725
|
+
const idx = waves.findIndex((w) => String(w.id) === String(wave.id));
|
|
726
|
+
if (idx >= 0) waves[idx] = { ...waves[idx], ...wave };
|
|
727
|
+
else waves.push(wave);
|
|
728
|
+
persistState(root, state);
|
|
729
|
+
return state;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
/** Replace the File Index list. */
|
|
733
|
+
export function setFileIndex(root, files) {
|
|
734
|
+
const state = readState(root);
|
|
735
|
+
state.fileIndex = Array.isArray(files) ? files : [];
|
|
736
|
+
persistState(root, state);
|
|
737
|
+
return state;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
/** Update ringDoD entries (object merge). */
|
|
741
|
+
export function setRingDoD(root, ringDoD) {
|
|
742
|
+
return writeState(root, { ringDoD });
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
/**
|
|
746
|
+
* Update programmatic validator artifact paths for a specific ring.
|
|
747
|
+
* ringArtifacts is stored as { "1": {...}, "2": {...}, ... }.
|
|
748
|
+
* @param {string} root
|
|
749
|
+
* @param {number|string} ring Ring number (1-4)
|
|
750
|
+
* @param {Record<string, string>} paths Map of artifact name → relative path
|
|
751
|
+
*/
|
|
752
|
+
export function setRingArtifacts(root, ring, paths) {
|
|
753
|
+
const state = readState(root);
|
|
754
|
+
const existing = state.ringArtifacts || {};
|
|
755
|
+
const key = String(ring);
|
|
756
|
+
const updated = { ...existing, [key]: { ...(existing[key] || {}), ...paths } };
|
|
757
|
+
return writeState(root, { ringArtifacts: updated });
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
/** Update ring gate runner fields (object merge). */
|
|
761
|
+
export function setRingGateRunner(root, fields) {
|
|
762
|
+
return writeState(root, { ringGateRunner: fields });
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
export function advanceRing(root, { iteration, accepted = false } = {}) {
|
|
766
|
+
const state = readState(root);
|
|
767
|
+
const current = normalizeIteration(iteration ?? state.handoff?.iteration);
|
|
768
|
+
if (!accepted) {
|
|
769
|
+
throw new Error('Ring advance requires --accepted');
|
|
770
|
+
}
|
|
771
|
+
if (!current) {
|
|
772
|
+
throw new Error('Ring advance requires a valid iteration 1..4');
|
|
773
|
+
}
|
|
774
|
+
if (String(state.ringGateRunner?.ringGateCanAskUser || '').toLowerCase() !== 'yes') {
|
|
775
|
+
throw new Error('Ring advance blocked: ringGateCanAskUser is not yes — run npm run ring:gate first');
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
const activeKeys = ringDoDKeysForIteration(current, root);
|
|
779
|
+
if (!allDoDPassed(state.ringDoD || {}, activeKeys)) {
|
|
780
|
+
throw new Error(`Ring advance blocked: ring ${current} DoD is not fully passed`);
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
const archivedSnapshot = {};
|
|
784
|
+
for (const key of activeKeys) archivedSnapshot[key] = state.ringDoD[key];
|
|
785
|
+
state.archivedRings = { ...(state.archivedRings || {}), [current]: archivedSnapshot };
|
|
786
|
+
state.archivedRingContexts = {
|
|
787
|
+
...(state.archivedRingContexts || {}),
|
|
788
|
+
[current]: normalizeHandoffContext(state.handoffContext),
|
|
789
|
+
};
|
|
790
|
+
|
|
791
|
+
if (current < 4) {
|
|
792
|
+
const next = current + 1;
|
|
793
|
+
const nextKeys = ringDoDKeysForIteration(next, root);
|
|
794
|
+
state.handoff = {
|
|
795
|
+
...state.handoff,
|
|
796
|
+
iteration: String(next),
|
|
797
|
+
ringGoal: RING_GOALS[next],
|
|
798
|
+
loop: 'clarify',
|
|
799
|
+
subagent: 'none',
|
|
800
|
+
subagent_stop: 'false',
|
|
801
|
+
waiting_for: 'orchestrator',
|
|
802
|
+
ringGate: 'pending',
|
|
803
|
+
next_orchestrator_action: 'null',
|
|
804
|
+
last_completed_by: 'orchestrator',
|
|
805
|
+
block_reason: 'null',
|
|
806
|
+
};
|
|
807
|
+
state.ringDoD = Object.fromEntries(nextKeys.map((key) => [key, 'pending']));
|
|
808
|
+
state.handoffContext = normalizeHandoffContext({
|
|
809
|
+
...state.handoffContext,
|
|
810
|
+
ring: {
|
|
811
|
+
summary: `Ring ${next} ready to start.`,
|
|
812
|
+
goal: RING_GOALS[next],
|
|
813
|
+
passedDoD: [],
|
|
814
|
+
},
|
|
815
|
+
lastRole: {
|
|
816
|
+
role: 'orchestrator',
|
|
817
|
+
summary: `Ring ${current} accepted; stable shared decisions carried forward.`,
|
|
818
|
+
decisions: [],
|
|
819
|
+
artifactRefs: [],
|
|
820
|
+
validation: activeKeys.map((key) => `${key}:${archivedSnapshot[key] || 'passed'}`),
|
|
821
|
+
blockers: [],
|
|
822
|
+
},
|
|
823
|
+
nextRole: {
|
|
824
|
+
role: 'orchestrator',
|
|
825
|
+
mustKnow: [
|
|
826
|
+
`Start Ring ${next} clarify from sharedDecisions; read only state:get disclosed files.`,
|
|
827
|
+
],
|
|
828
|
+
requiredFiles: ['CLAUDE.md'],
|
|
829
|
+
forbiddenFiles: [],
|
|
830
|
+
artifactRefs: [],
|
|
831
|
+
},
|
|
832
|
+
openQuestions: [],
|
|
833
|
+
});
|
|
834
|
+
state.ringGateRunner = {
|
|
835
|
+
ringGateCurrent: 'none',
|
|
836
|
+
ringGateVerdict: 'not_run',
|
|
837
|
+
ringGateCheckedAt: 'unset',
|
|
838
|
+
ringGateBlockingIssues: '0',
|
|
839
|
+
ringGateCanAskUser: 'no',
|
|
840
|
+
ringGateRouteTo: 'none',
|
|
841
|
+
ringGateFailReason: 'none',
|
|
842
|
+
ringGateNonRegression: 'n-a',
|
|
843
|
+
};
|
|
844
|
+
} else {
|
|
845
|
+
state.handoff = {
|
|
846
|
+
...state.handoff,
|
|
847
|
+
iteration: '4',
|
|
848
|
+
ringGoal: RING_GOALS[4],
|
|
849
|
+
loop: 'verify',
|
|
850
|
+
subagent: 'none',
|
|
851
|
+
subagent_stop: 'true',
|
|
852
|
+
waiting_for: 'none',
|
|
853
|
+
ringGate: 'passed',
|
|
854
|
+
next_orchestrator_action: 'Project workflow complete',
|
|
855
|
+
last_completed_by: 'orchestrator',
|
|
856
|
+
block_reason: 'null',
|
|
857
|
+
};
|
|
858
|
+
state.assetMappingLocked = true;
|
|
859
|
+
state.ringGateRunner = {
|
|
860
|
+
...(state.ringGateRunner || {}),
|
|
861
|
+
ringGateCurrent: '4',
|
|
862
|
+
ringGateVerdict: 'pass',
|
|
863
|
+
ringGateCanAskUser: 'no',
|
|
864
|
+
ringGateRouteTo: 'none',
|
|
865
|
+
ringGateFailReason: 'none',
|
|
866
|
+
};
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
return persistState(root, state);
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
/** Flatten state.handoff + ringDoD/archivedRings into a string map for legacy readers. */
|
|
873
|
+
export function flatHandoff(state) {
|
|
874
|
+
return {
|
|
875
|
+
...state.handoff,
|
|
876
|
+
ringDoD: serializeRingDoD(state.ringDoD),
|
|
877
|
+
archivedRings: serializeArchivedRings(state.archivedRings),
|
|
878
|
+
};
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
export function serializeRingDoD(ringDoD) {
|
|
882
|
+
const pairs = Object.entries(ringDoD || {}).map(([k, v]) => `${k}: ${v}`);
|
|
883
|
+
return `{ ${pairs.join(', ')} }`;
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
export function serializeArchivedRings(archived) {
|
|
887
|
+
const entries = Object.entries(archived || {});
|
|
888
|
+
if (entries.length === 0) return '{}';
|
|
889
|
+
const body = entries
|
|
890
|
+
.map(([ring, dod]) => `${ring}: ${serializeRingDoD(dod)}`)
|
|
891
|
+
.join(', ');
|
|
892
|
+
return `{ ${body} }`;
|
|
893
|
+
}
|