@playcraft/cli 0.1.54 → 0.1.56-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -15
- package/SKILLS_REGISTRY.md +149 -0
- package/dist/agent/local-backend.js +1 -1
- package/dist/assets/client.js +157 -0
- package/dist/assets/messages.js +48 -0
- package/dist/auth/account-activation.js +157 -0
- package/dist/auth/messages.js +30 -0
- package/dist/cli-root-help.js +4 -0
- package/dist/commands/assets.js +123 -0
- package/dist/commands/build-all.js +5 -19
- package/dist/commands/build-temp.js +26 -0
- package/dist/commands/build.js +53 -28
- package/dist/commands/create.js +26 -33
- package/dist/commands/image-layer-messages.js +37 -0
- package/dist/commands/image-layer-tools.js +185 -0
- package/dist/commands/image.js +2 -73
- package/dist/commands/library-messages.js +46 -0
- package/dist/commands/library.js +130 -0
- package/dist/commands/login.js +84 -42
- package/dist/commands/platform-skills.generated.js +19 -0
- package/dist/commands/playable.js +53 -0
- package/dist/commands/preview-runtime.js +21 -0
- package/dist/commands/skills.js +4 -0
- package/dist/commands/tools-3d.js +11 -0
- package/dist/commands/tools-batch.js +113 -0
- package/dist/commands/tools-generation.js +6 -0
- package/dist/commands/tools.js +2 -0
- package/dist/commands/video.js +122 -0
- package/dist/commands/workspace-runtime.js +54 -0
- package/dist/commands/workspace.js +40 -0
- package/dist/config.js +59 -4
- package/dist/index.js +47 -3
- package/dist/preview-runtime/distribution.js +77 -0
- package/dist/project-skills/builtin-import.js +225 -0
- package/dist/project-skills/commands.js +77 -0
- package/dist/project-skills/lifecycle.js +28 -0
- package/dist/project-skills/local-run.js +112 -0
- package/dist/project-skills/local-store.js +221 -0
- package/dist/project-skills/messages.js +80 -0
- package/dist/project-skills/reconcile.js +62 -0
- package/dist/project-skills/remote-cache.js +51 -0
- package/dist/project-skills/validation.js +19 -0
- package/dist/recording/messages.js +40 -0
- package/dist/recording/project-digest.js +85 -0
- package/dist/recording/recorder.js +293 -0
- package/dist/recording/scenario.js +50 -0
- package/dist/remix/clone.js +2 -0
- package/dist/remix/init-template.js +2 -0
- package/dist/remix/pull.js +2 -0
- package/dist/remix/push.js +21 -1
- package/dist/skill-registry/client.js +345 -0
- package/dist/skill-registry/commands.js +180 -0
- package/dist/skill-registry/evaluation-client.js +156 -0
- package/dist/skill-registry/evaluation-commands.js +174 -0
- package/dist/skill-registry/messages.js +177 -0
- package/dist/skill-registry/package.js +275 -0
- package/dist/skill-registry/platform-package.js +100 -0
- package/dist/utils/agent-api-client.js +245 -30
- package/dist/utils/environment-endpoints.js +17 -0
- package/dist/utils/error-diagnostics.js +20 -0
- package/dist/utils/playcraft-http-client.js +6 -4
- package/dist/utils/tool-operation-journal.js +124 -0
- package/dist/utils/video-evidence-git.js +81 -0
- package/dist/video-replication/client.js +234 -0
- package/dist/video-replication/comparison-evidence.js +149 -0
- package/dist/video-replication/comparison-files.js +57 -0
- package/dist/video-replication/comparison-log.js +72 -0
- package/dist/video-replication/comparison-messages.js +104 -0
- package/dist/video-replication/comparison-output.js +63 -0
- package/dist/video-replication/comparison-preflight.js +66 -0
- package/dist/video-replication/comparison.js +230 -0
- package/dist/video-replication/diagnostics.js +41 -0
- package/dist/video-replication/evidence.js +165 -0
- package/dist/video-replication/media.js +112 -0
- package/dist/video-replication/messages.js +97 -0
- package/dist/workspace/messages.js +67 -0
- package/dist/workspace/transfer-client.js +237 -0
- package/dist/workspace/transfer-errors.js +48 -0
- package/dist/workspace-runtime/batch/content-changes.js +30 -0
- package/dist/workspace-runtime/batch/control.js +86 -0
- package/dist/workspace-runtime/batch/deliver.js +173 -0
- package/dist/workspace-runtime/batch/freeze.js +101 -0
- package/dist/workspace-runtime/batch/generate.js +249 -0
- package/dist/workspace-runtime/batch/git.js +40 -0
- package/dist/workspace-runtime/batch/occupancy.js +8 -0
- package/dist/workspace-runtime/batch/policy.js +70 -0
- package/dist/workspace-runtime/batch/prepare.js +317 -0
- package/dist/workspace-runtime/batch/processes.js +72 -0
- package/dist/workspace-runtime/batch/records.js +113 -0
- package/dist/workspace-runtime/batch/routes.js +61 -0
- package/dist/workspace-runtime/batch/source-candidate.js +86 -0
- package/dist/workspace-runtime/batch/source-capture.js +146 -0
- package/dist/workspace-runtime/batch/source-failure.js +43 -0
- package/dist/workspace-runtime/batch/source-publish.js +130 -0
- package/dist/workspace-runtime/codex/app-server.js +1065 -0
- package/dist/workspace-runtime/codex/compact.js +46 -0
- package/dist/workspace-runtime/codex/config-toml.js +107 -0
- package/dist/workspace-runtime/codex/delivery-tools.js +144 -0
- package/dist/workspace-runtime/codex/jsonrpc-stdio.js +145 -0
- package/dist/workspace-runtime/codex/launcher-client.js +177 -0
- package/dist/workspace-runtime/codex/loopback.js +146 -0
- package/dist/workspace-runtime/codex/mcp-config.js +39 -0
- package/dist/workspace-runtime/codex/model-broker.js +263 -0
- package/dist/workspace-runtime/codex/native-adapter.js +9 -0
- package/dist/workspace-runtime/codex/permissions.js +79 -0
- package/dist/workspace-runtime/codex/thread-image.js +38 -0
- package/dist/workspace-runtime/codex/tool-response.js +10 -0
- package/dist/workspace-runtime/codex/ui-instructions.js +4 -0
- package/dist/workspace-runtime/codex/ui-tools.js +203 -0
- package/dist/workspace-runtime/codex/work-mode.js +15 -0
- package/dist/workspace-runtime/main.js +10 -0
- package/dist/workspace-runtime/persistence/journal.js +365 -0
- package/dist/workspace-runtime/persistence/native-subagents.js +162 -0
- package/dist/workspace-runtime/persistence/sqlite-client.js +77 -0
- package/dist/workspace-runtime/persistence/sqlite-worker.js +1161 -0
- package/dist/workspace-runtime/persistence/stopped-execution.js +77 -0
- package/dist/workspace-runtime/previews/diagnostics.js +44 -0
- package/dist/workspace-runtime/previews/finalize.js +64 -0
- package/dist/workspace-runtime/previews/output.js +36 -0
- package/dist/workspace-runtime/previews/publish.js +306 -0
- package/dist/workspace-runtime/previews/runtime-preview.js +251 -0
- package/dist/workspace-runtime/previews/single-file.js +43 -0
- package/dist/workspace-runtime/processes/managed-writes.js +69 -0
- package/dist/workspace-runtime/serve.js +441 -0
- package/dist/workspace-runtime/server/accept-operation.js +61 -0
- package/dist/workspace-runtime/server/asset-transfers.js +63 -0
- package/dist/workspace-runtime/server/auth.js +21 -0
- package/dist/workspace-runtime/server/connectivity.js +211 -0
- package/dist/workspace-runtime/server/desktop-host.js +429 -0
- package/dist/workspace-runtime/server/desktop-preview-config.js +81 -0
- package/dist/workspace-runtime/server/desktop-preview-service.js +157 -0
- package/dist/workspace-runtime/server/desktop-preview-static.js +53 -0
- package/dist/workspace-runtime/server/desktop-preview.js +189 -0
- package/dist/workspace-runtime/server/dispatch.js +1655 -0
- package/dist/workspace-runtime/server/endpoints.js +21 -0
- package/dist/workspace-runtime/server/execution-group.js +90 -0
- package/dist/workspace-runtime/server/http.js +1363 -0
- package/dist/workspace-runtime/server/lock.js +53 -0
- package/dist/workspace-runtime/server/operation-record.js +33 -0
- package/dist/workspace-runtime/server/rfb-watch-gate.js +168 -0
- package/dist/workspace-runtime/server/session-restore.js +84 -0
- package/dist/workspace-runtime/server/source-uploader.js +138 -0
- package/dist/workspace-runtime/server/submit-operation.js +41 -0
- package/dist/workspace-runtime/server/terminal-host.js +366 -0
- package/dist/workspace-runtime/server/types.js +1 -0
- package/dist/workspace-runtime/server/workspace-transfer.js +168 -0
- package/dist/workspace-runtime/verify-artifact.js +59 -0
- package/dist/workspace-runtime/workspaces/append-only-log.js +62 -0
- package/dist/workspace-runtime/workspaces/archive.js +207 -0
- package/dist/workspace-runtime/workspaces/artifact-events.js +168 -0
- package/dist/workspace-runtime/workspaces/artifact-files.js +201 -0
- package/dist/workspace-runtime/workspaces/artifact-receipts.js +112 -0
- package/dist/workspace-runtime/workspaces/artifacts.js +380 -0
- package/dist/workspace-runtime/workspaces/asset-library-import.js +387 -0
- package/dist/workspace-runtime/workspaces/asset-publication-access.js +29 -0
- package/dist/workspace-runtime/workspaces/asset-transfer-dependencies.js +81 -0
- package/dist/workspace-runtime/workspaces/asset-transfer-publish.js +438 -0
- package/dist/workspace-runtime/workspaces/asset-transfer-storage.js +389 -0
- package/dist/workspace-runtime/workspaces/attachment-content.js +73 -0
- package/dist/workspace-runtime/workspaces/attachments.js +185 -0
- package/dist/workspace-runtime/workspaces/batch-commit.js +142 -0
- package/dist/workspace-runtime/workspaces/binary-content.js +65 -0
- package/dist/workspace-runtime/workspaces/binary-write.js +117 -0
- package/dist/workspace-runtime/workspaces/cli-context.js +23 -0
- package/dist/workspace-runtime/workspaces/cli-credentials.js +115 -0
- package/dist/workspace-runtime/workspaces/composer-context.js +147 -0
- package/dist/workspace-runtime/workspaces/context-error.js +2 -0
- package/dist/workspace-runtime/workspaces/delivery-build.js +421 -0
- package/dist/workspace-runtime/workspaces/delivery-store.js +168 -0
- package/dist/workspace-runtime/workspaces/delivery.js +64 -0
- package/dist/workspace-runtime/workspaces/dependencies.js +279 -0
- package/dist/workspace-runtime/workspaces/developer-command.js +98 -0
- package/dist/workspace-runtime/workspaces/directories.js +135 -0
- package/dist/workspace-runtime/workspaces/directory-access.js +50 -0
- package/dist/workspace-runtime/workspaces/directory-attachments.js +245 -0
- package/dist/workspace-runtime/workspaces/directory-create.js +57 -0
- package/dist/workspace-runtime/workspaces/directory-maintenance.js +111 -0
- package/dist/workspace-runtime/workspaces/directory-mutations.js +238 -0
- package/dist/workspace-runtime/workspaces/directory-revisions.js +56 -0
- package/dist/workspace-runtime/workspaces/directory-stats.js +49 -0
- package/dist/workspace-runtime/workspaces/disk-snapshot.js +31 -0
- package/dist/workspace-runtime/workspaces/empty-template.js +43 -0
- package/dist/workspace-runtime/workspaces/file-content.js +48 -0
- package/dist/workspace-runtime/workspaces/files-search.js +116 -0
- package/dist/workspace-runtime/workspaces/files.js +150 -0
- package/dist/workspace-runtime/workspaces/git-credential-broker.js +312 -0
- package/dist/workspace-runtime/workspaces/git-credential-helper.js +68 -0
- package/dist/workspace-runtime/workspaces/git-direct-store.js +155 -0
- package/dist/workspace-runtime/workspaces/git.js +683 -0
- package/dist/workspace-runtime/workspaces/instructions.js +56 -0
- package/dist/workspace-runtime/workspaces/json5-edit.js +313 -0
- package/dist/workspace-runtime/workspaces/library-attachments.js +268 -0
- package/dist/workspace-runtime/workspaces/operation-log.js +23 -0
- package/dist/workspace-runtime/workspaces/optional-platform-skills.js +14 -0
- package/dist/workspace-runtime/workspaces/parameter-agent-inputs.js +97 -0
- package/dist/workspace-runtime/workspaces/parameter-agent-protocol.js +40 -0
- package/dist/workspace-runtime/workspaces/parameter-agent-store.js +58 -0
- package/dist/workspace-runtime/workspaces/parameter-agent.js +284 -0
- package/dist/workspace-runtime/workspaces/parameter-assets.js +212 -0
- package/dist/workspace-runtime/workspaces/parameters.js +369 -0
- package/dist/workspace-runtime/workspaces/prepare.js +284 -0
- package/dist/workspace-runtime/workspaces/registry.js +251 -0
- package/dist/workspace-runtime/workspaces/remix-references.js +301 -0
- package/dist/workspace-runtime/workspaces/revisions.js +31 -0
- package/dist/workspace-runtime/workspaces/session-image.js +104 -0
- package/dist/workspace-runtime/workspaces/shared-git.js +40 -0
- package/dist/workspace-runtime/workspaces/skill-artifact-loader.js +95 -0
- package/dist/workspace-runtime/workspaces/skills.js +191 -0
- package/dist/workspace-runtime/workspaces/theme-asset-index.js +267 -0
- package/dist/workspace-runtime/workspaces/transfer-quota.js +69 -0
- package/dist/workspace-runtime/workspaces/transfer.js +471 -0
- package/dist/workspace-runtime/workspaces/turn-changes.js +75 -0
- package/dist/workspace-runtime/workspaces/video-attachments.js +49 -0
- package/dist/workspace-runtime/workspaces/worktree-attachments.js +74 -0
- package/dist/workspace-runtime/workspaces/worktree-checkout.js +67 -0
- package/dist/workspace-runtime/workspaces/worktrees.js +73 -0
- package/package.json +16 -5
- package/project-template/.claude/skills/playcraft-audio-generation/SKILL.md +31 -4
- package/project-template/.claude/skills/playcraft-image-generation/SKILL.md +36 -5
- package/project-template/.claude/skills/playcraft-image-generation/reference/build-sprite-sheet.template.mjs +1 -1
- package/project-template/.claude/skills/playcraft-image-generation/reference/compare-style.template.mjs +1 -1
- package/project-template/.claude/skills/playcraft-image-generation/reference/gen-batch-sprite.template.mjs +1 -1
- package/project-template/.claude/skills/playcraft-image-generation/reference/gen-batch.template.mjs +1 -1
- package/project-template/.claude/skills/playcraft-image-generation/reference/gen-edit-variants.template.mjs +1 -1
- package/project-template/.claude/skills/playcraft-image-generation/reference/process-batch.template.mjs +1 -1
- package/project-template/.claude/skills/playcraft-image-generation/reference/ta-image-generation-detail.md +300 -0
- package/project-template/.claude/skills/playcraft-image-generation/reference/validate-sprite-sheet.template.mjs +1 -1
- package/project-template/.claude/skills/playcraft-image-processing/SKILL.md +50 -25
- package/project-template/.claude/skills/playcraft-replica-validation/SKILL.md +25 -0
- package/project-template/.claude/skills/playcraft-replica-validation/references/contracts.md +79 -0
- package/project-template/.claude/skills/playcraft-video-understanding/SKILL.md +29 -0
- package/project-template/.claude/skills/playcraft-video-understanding/references/contracts.md +37 -0
- package/project-template/.claude/skills/playcraft-workspace-assets/SKILL.md +53 -0
- package/project-template/.claude/skills/playcraft-workspace-assets/references/requests.json +32 -0
- package/project-template-v2/.claude/agents/artist.md +82 -0
- package/project-template-v2/.claude/agents/developer.md +153 -0
- package/project-template-v2/.claude/agents/game-designer.md +264 -0
- package/project-template-v2/.claude/agents/refs/artist-art-style-catalog.md +533 -0
- package/project-template-v2/.claude/agents/refs/artist-color-audio-recipes.md +153 -0
- package/project-template-v2/.claude/agents/refs/artist-dimension-axis.md +27 -0
- package/project-template-v2/.claude/agents/refs/artist-master-composite-recipes.md +208 -0
- package/project-template-v2/.claude/agents/refs/atom-skill-library.md +81 -0
- package/project-template-v2/.claude/agents/refs/developer-impl-cookbook.md +432 -0
- package/project-template-v2/.claude/agents/refs/framework-5-component-filter.md +252 -0
- package/project-template-v2/.claude/agents/refs/framework-game-feel-juice.md +266 -0
- package/project-template-v2/.claude/agents/refs/framework-mda.md +147 -0
- package/project-template-v2/.claude/agents/refs/game-designer-gameplay-sufficiency.md +123 -0
- package/project-template-v2/.claude/agents/refs/ta-3d-flip-recipe.md +88 -0
- package/project-template-v2/.claude/agents/refs/ta-atlas-deliverable-standard.md +67 -0
- package/project-template-v2/.claude/agents/refs/ta-batch-pipeline-recipes.md +120 -0
- package/project-template-v2/.claude/agents/refs/ta-image-generation-detail.md +300 -0
- package/project-template-v2/.claude/agents/refs/ta-image-ops-reference.md +495 -0
- package/project-template-v2/.claude/agents/refs/ta-pipeline-cookbook.md +1141 -0
- package/project-template-v2/.claude/agents/refs/ta-tools-reference.md +111 -0
- package/project-template-v2/.claude/agents/refs/ta-vfx-preset-catalog.md +365 -0
- package/project-template-v2/.claude/agents/refs/threejs-cannon-pitfalls.md +412 -0
- package/project-template-v2/.claude/agents/reviewer.md +75 -0
- package/project-template-v2/.claude/agents/technical-artist.md +86 -0
- package/project-template-v2/.claude/hooks/snapshot-milestone.mjs +243 -0
- package/project-template-v2/.claude/hooks/user-prompt.mjs +133 -0
- package/project-template-v2/.claude/settings.json +33 -0
- package/project-template-v2/.claude/skills/brainstorming/SKILL.md +161 -0
- package/project-template-v2/.claude/skills/brainstorming/scripts/frame-template.html +270 -0
- package/project-template-v2/.claude/skills/brainstorming/scripts/helper.js +177 -0
- package/project-template-v2/.claude/skills/brainstorming/scripts/server.cjs +354 -0
- package/project-template-v2/.claude/skills/brainstorming/scripts/start-server.sh +148 -0
- package/project-template-v2/.claude/skills/brainstorming/scripts/stop-server.sh +56 -0
- package/project-template-v2/.claude/skills/brainstorming/scripts/wait-for-selection.sh +62 -0
- package/project-template-v2/.claude/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/project-template-v2/.claude/skills/brainstorming/visual-companion.md +309 -0
- package/project-template-v2/.claude/skills/playcraft-ad-psychology/SKILL.md +182 -0
- package/project-template-v2/.claude/skills/playcraft-art-style-guide/SKILL.md +123 -0
- package/project-template-v2/.claude/skills/playcraft-asset-state-sheet/SKILL.md +205 -0
- package/project-template-v2/.claude/skills/playcraft-audio-generation/SKILL.md +307 -0
- package/project-template-v2/.claude/skills/playcraft-batch-pipeline/SKILL.md +184 -0
- package/project-template-v2/.claude/skills/playcraft-build-optimizer/SKILL.md +306 -0
- package/project-template-v2/.claude/skills/playcraft-image-generation/SKILL.md +401 -0
- package/project-template-v2/.claude/skills/playcraft-image-generation/reference/build-sprite-sheet.template.mjs +123 -0
- package/project-template-v2/.claude/skills/playcraft-image-generation/reference/compare-style.template.mjs +254 -0
- package/project-template-v2/.claude/skills/playcraft-image-generation/reference/gen-batch-sprite.template.mjs +333 -0
- package/project-template-v2/.claude/skills/playcraft-image-generation/reference/gen-batch.template.mjs +95 -0
- package/project-template-v2/.claude/skills/playcraft-image-generation/reference/gen-edit-variants.template.mjs +118 -0
- package/project-template-v2/.claude/skills/playcraft-image-generation/reference/process-batch.template.mjs +136 -0
- package/project-template-v2/.claude/skills/playcraft-image-generation/reference/prompt-cookbook.md +397 -0
- package/project-template-v2/.claude/skills/playcraft-image-generation/reference/ta-image-generation-detail.md +300 -0
- package/project-template-v2/.claude/skills/playcraft-image-generation/reference/validate-sprite-sheet.template.mjs +296 -0
- package/project-template-v2/.claude/skills/playcraft-image-ops/SKILL.md +122 -0
- package/project-template-v2/.claude/skills/playcraft-image-processing/SKILL.md +244 -0
- package/project-template-v2/.claude/skills/playcraft-masking/SKILL.md +373 -0
- package/project-template-v2/.claude/skills/playcraft-playable-optimization/SKILL.md +161 -0
- package/project-template-v2/.claude/skills/playcraft-research/SKILL.md +215 -0
- package/project-template-v2/.claude/skills/playcraft-skill-recommender/SKILL.md +382 -0
- package/project-template-v2/.claude/skills/playcraft-sprite-generation/SKILL.md +423 -0
- package/project-template-v2/.claude/skills/playcraft-sprite-remix/SKILL.md +158 -0
- package/project-template-v2/.claude/skills/playcraft-sprite-sheet/SKILL.md +100 -0
- package/project-template-v2/.claude/skills/playcraft-storyboard/SKILL.md +167 -0
- package/project-template-v2/.claude/skills/playcraft-style-qa/SKILL.md +270 -0
- package/project-template-v2/.claude/skills/playcraft-text-rendering/SKILL.md +236 -0
- package/project-template-v2/.claude/skills/playcraft-vfx-animation/SKILL.md +130 -0
- package/project-template-v2/.claude/skills/playcraft-workspace-assets/SKILL.md +53 -0
- package/project-template-v2/.claude/skills/playcraft-workspace-assets/references/requests.json +32 -0
- package/project-template-v2/.claude/skills/playwright-cli/SKILL.md +390 -0
- package/project-template-v2/.claude/skills/playwright-cli/references/element-attributes.md +23 -0
- package/project-template-v2/.claude/skills/playwright-cli/references/playwright-tests.md +39 -0
- package/project-template-v2/.claude/skills/playwright-cli/references/request-mocking.md +87 -0
- package/project-template-v2/.claude/skills/playwright-cli/references/running-code.md +240 -0
- package/project-template-v2/.claude/skills/playwright-cli/references/session-management.md +226 -0
- package/project-template-v2/.claude/skills/playwright-cli/references/spec-driven-testing.md +308 -0
- package/project-template-v2/.claude/skills/playwright-cli/references/storage-state.md +275 -0
- package/project-template-v2/.claude/skills/playwright-cli/references/test-generation.md +134 -0
- package/project-template-v2/.claude/skills/playwright-cli/references/tracing.md +142 -0
- package/project-template-v2/.claude/skills/playwright-cli/references/video-recording.md +153 -0
- package/project-template-v2/.claude/skills/session-analyzer/SKILL.md +386 -0
- package/project-template-v2/.claude/skills/session-analyzer/scripts/execution-breakdown.mjs +182 -0
- package/project-template-v2/.claude/skills/session-analyzer/scripts/find-turns.mjs +72 -0
- package/project-template-v2/.claude/skills/session-analyzer/scripts/heavy-output.mjs +121 -0
- package/project-template-v2/.claude/skills/session-analyzer/scripts/resolve-session.mjs +102 -0
- package/project-template-v2/.claude/skills/session-analyzer/scripts/subagent-stats.mjs +127 -0
- package/project-template-v2/.claude/skills/session-analyzer/scripts/subagent-tool-timeline.mjs +106 -0
- package/project-template-v2/.claude/skills/session-analyzer/scripts/time-gaps.mjs +128 -0
- package/project-template-v2/.claude/skills/session-analyzer/scripts/turn-timeline.mjs +67 -0
- package/project-template-v2/.claude/snapshot.mjs +263 -0
- package/project-template-v2/.playcraft/skills.lock.json +152 -0
- package/project-template-v2/CLAUDE.md +146 -0
- package/project-template-v2/assets/audio/bgm/.gitkeep +0 -0
- package/project-template-v2/assets/audio/sfx/.gitkeep +0 -0
- package/project-template-v2/assets/bundles/.gitkeep +0 -0
- package/project-template-v2/assets/images/bg/.gitkeep +0 -0
- package/project-template-v2/assets/images/reference/.gitkeep +0 -0
- package/project-template-v2/assets/images/storyboard/.gitkeep +0 -0
- package/project-template-v2/assets/images/tiles/.gitkeep +0 -0
- package/project-template-v2/assets/images/ui/.gitkeep +0 -0
- package/project-template-v2/assets/images/vfx/.gitkeep +0 -0
- package/project-template-v2/assets/models/.gitkeep +0 -0
- package/project-template-v2/docs/harness/iteration-1/context-flow.md +254 -0
- package/project-template-v2/docs/harness/iteration-1/generate-flow.md +91 -0
- package/project-template-v2/docs/harness/iteration-1/ideate-flow.md +214 -0
- package/project-template-v2/docs/harness/iteration-1/optimize-flow.md +75 -0
- package/project-template-v2/docs/harness/iteration-1/wrapup-flow.md +63 -0
- package/project-template-v2/docs/harness/iteration-2/context-flow.md +223 -0
- package/project-template-v2/docs/harness/iteration-2/generate-flow.md +129 -0
- package/project-template-v2/docs/harness/iteration-2/ideate-flow.md +267 -0
- package/project-template-v2/docs/harness/iteration-2/optimize-flow.md +164 -0
- package/project-template-v2/docs/harness/iteration-2/wrapup-flow.md +115 -0
- package/project-template-v2/docs/harness/orchestrator-flow.md +364 -0
- package/project-template-v2/docs/project-state.json +60 -0
- package/project-template-v2/docs/project-state.md +72 -0
- package/project-template-v2/docs/standards/README.md +225 -0
- package/project-template-v2/docs/standards/agent-behavior-standards.md +174 -0
- package/project-template-v2/docs/standards/artifacts/design-brief.md +19 -0
- package/project-template-v2/docs/standards/artifacts/design.md +22 -0
- package/project-template-v2/docs/standards/artifacts/game-code.md +41 -0
- package/project-template-v2/docs/standards/artifacts/todo-list.md +41 -0
- package/project-template-v2/docs/standards/iter1-agent-behavior-standards.md +343 -0
- package/project-template-v2/game/index.ts +18 -0
- package/project-template-v2/globals.d.ts +51 -0
- package/project-template-v2/index.css +34 -0
- package/project-template-v2/index.html +18 -0
- package/project-template-v2/main.ts +9 -0
- package/project-template-v2/package.json +46 -0
- package/project-template-v2/skills/_shared/scripts/dispatch-clear.mjs +31 -0
- package/project-template-v2/skills/_shared/scripts/dispatch-set.mjs +86 -0
- package/project-template-v2/skills/_shared/scripts/dod-check.mjs +153 -0
- package/project-template-v2/skills/_shared/scripts/handoff-append.mjs +70 -0
- package/project-template-v2/skills/_shared/scripts/lib/validator-artifacts.mjs +91 -0
- package/project-template-v2/skills/_shared/scripts/pipeline/dod-config.mjs +131 -0
- package/project-template-v2/skills/_shared/scripts/pipeline/index.mjs +80 -0
- package/project-template-v2/skills/_shared/scripts/pipeline/iteration-1-core.mjs +90 -0
- package/project-template-v2/skills/_shared/scripts/pipeline/iteration-2-wrap.mjs +93 -0
- package/project-template-v2/skills/_shared/scripts/pipeline/iteration-3-visual.mjs +23 -0
- package/project-template-v2/skills/_shared/scripts/render-project-state.mjs +230 -0
- package/project-template-v2/skills/_shared/scripts/state-advance-stage.mjs +58 -0
- package/project-template-v2/skills/_shared/scripts/state-get.mjs +339 -0
- package/project-template-v2/skills/_shared/scripts/state-handoff.mjs +39 -0
- package/project-template-v2/skills/_shared/scripts/state-set.mjs +94 -0
- package/project-template-v2/skills/_shared/scripts/state-store.mjs +783 -0
- package/project-template-v2/skills/_shared/scripts/todo-add.mjs +88 -0
- package/project-template-v2/skills/_shared/scripts/todo-get.mjs +130 -0
- package/project-template-v2/skills/_shared/scripts/todo-remove.mjs +33 -0
- package/project-template-v2/skills/_shared/scripts/todo-set.mjs +47 -0
- package/project-template-v2/skills/_shared/scripts/verify-asset-code-sync.mjs +268 -0
- package/project-template-v2/skills/_shared/scripts/verify-env.mjs +285 -0
- package/project-template-v2/skills/_shared/scripts/verify-placeholders.mjs +161 -0
- package/project-template-v2/skills/playable-autoplay/SKILL.md +176 -0
- package/project-template-v2/skills/playable-autoplay/agents/openai.yaml +4 -0
- package/project-template-v2/skills/playable-debug/SKILL.md +116 -0
- package/project-template-v2/skills/playable-debug/agents/openai.yaml +4 -0
- package/project-template-v2/skills/playable-debug/references/debug-config.md +40 -0
- package/project-template-v2/skills/playable-record/SKILL.md +140 -0
- package/project-template-v2/skills/playable-record/scripts/lib/dev-server.mjs +104 -0
- package/project-template-v2/skills/playable-record/scripts/lib/record-audio-bridge.js +141 -0
- package/project-template-v2/skills/playable-record/scripts/record-playable.mjs +425 -0
- package/project-template-v2/skills/playable-record/scripts/verify-contract.mjs +261 -0
- package/project-template-v2/skills/playable-record/scripts/verify-firstwin.mjs +398 -0
- package/project-template-v2/skills/playable-record/scripts/verify-fusion.mjs +322 -0
- package/project-template-v2/skills/playable-record/scripts/verify-lifecycle.mjs +105 -0
- package/project-template-v2/skills/playable-record/scripts/verify-vlm-video.mjs +230 -0
- package/project-template-v2/skills/playable-validate/SKILL.md +61 -0
- package/project-template-v2/skills/playable-validate/validation-rules.md +14 -0
- package/project-template-v2/skills/playable-verify-ui/SKILL.md +63 -0
- package/project-template-v2/skills/playable-verify-ui/scripts/lib/__init__.py +1 -0
- package/project-template-v2/skills/playable-verify-ui/scripts/lib/config_expr.js +218 -0
- package/project-template-v2/skills/playable-verify-ui/scripts/lib/node_utils.js +51 -0
- package/project-template-v2/skills/playable-verify-ui/scripts/lib/profile_loader.py +59 -0
- package/project-template-v2/skills/playable-verify-ui/scripts/lib/report.py +106 -0
- package/project-template-v2/skills/playable-verify-ui/scripts/lib/runtime_contract.js +116 -0
- package/project-template-v2/skills/playable-verify-ui/scripts/verify_fetch_antipatterns.py +59 -0
- package/project-template-v2/skills/playable-verify-ui/scripts/verify_hardcoded_layout.js +64 -0
- package/project-template-v2/skills/playable-verify-ui/scripts/verify_runtime_contract.js +58 -0
- package/project-template-v2/skills/playable-verify-ui/scripts/verify_text_overlap.py +333 -0
- package/project-template-v2/ta-workspace/scripts/.gitkeep +0 -0
- package/project-template-v2/tsconfig.json +20 -0
- package/project-template-v2/vite.config.ts +27 -0
- package/project-templates/batch-locks/phaser.yaml +922 -0
- package/project-templates/batch-locks/threejs.yaml +978 -0
- package/project-templates/empty/AGENTS.md +53 -0
- package/project-templates/empty/gitignore +33 -0
- package/project-templates/phaser/.claude/skills/playcraft-audio-generation/SKILL.md +31 -4
- package/project-templates/phaser/.claude/skills/playcraft-image-generation/SKILL.md +36 -5
- package/project-templates/phaser/.claude/skills/playcraft-image-generation/reference/build-sprite-sheet.template.mjs +1 -1
- package/project-templates/phaser/.claude/skills/playcraft-image-generation/reference/compare-style.template.mjs +1 -1
- package/project-templates/phaser/.claude/skills/playcraft-image-generation/reference/gen-batch-sprite.template.mjs +1 -1
- package/project-templates/phaser/.claude/skills/playcraft-image-generation/reference/gen-batch.template.mjs +1 -1
- package/project-templates/phaser/.claude/skills/playcraft-image-generation/reference/gen-edit-variants.template.mjs +1 -1
- package/project-templates/phaser/.claude/skills/playcraft-image-generation/reference/process-batch.template.mjs +1 -1
- package/project-templates/phaser/.claude/skills/playcraft-image-generation/reference/ta-image-generation-detail.md +300 -0
- package/project-templates/phaser/.claude/skills/playcraft-image-generation/reference/validate-sprite-sheet.template.mjs +1 -1
- package/project-templates/phaser/.claude/skills/playcraft-image-processing/SKILL.md +50 -25
- package/project-templates/phaser/.claude/skills/playcraft-workspace-assets/SKILL.md +53 -0
- package/project-templates/phaser/.claude/skills/playcraft-workspace-assets/references/requests.json +32 -0
- package/project-templates/threejs/.claude/skills/playcraft-audio-generation/SKILL.md +31 -4
- package/project-templates/threejs/.claude/skills/playcraft-image-generation/SKILL.md +36 -5
- package/project-templates/threejs/.claude/skills/playcraft-image-generation/reference/build-sprite-sheet.template.mjs +1 -1
- package/project-templates/threejs/.claude/skills/playcraft-image-generation/reference/compare-style.template.mjs +1 -1
- package/project-templates/threejs/.claude/skills/playcraft-image-generation/reference/gen-batch-sprite.template.mjs +1 -1
- package/project-templates/threejs/.claude/skills/playcraft-image-generation/reference/gen-batch.template.mjs +1 -1
- package/project-templates/threejs/.claude/skills/playcraft-image-generation/reference/gen-edit-variants.template.mjs +1 -1
- package/project-templates/threejs/.claude/skills/playcraft-image-generation/reference/process-batch.template.mjs +1 -1
- package/project-templates/threejs/.claude/skills/playcraft-image-generation/reference/ta-image-generation-detail.md +300 -0
- package/project-templates/threejs/.claude/skills/playcraft-image-generation/reference/validate-sprite-sheet.template.mjs +1 -1
- package/project-templates/threejs/.claude/skills/playcraft-image-processing/SKILL.md +50 -25
- package/project-templates/threejs/.claude/skills/playcraft-workspace-assets/SKILL.md +53 -0
- package/project-templates/threejs/.claude/skills/playcraft-workspace-assets/references/requests.json +32 -0
- package/templates/preview-runtime/v1/README.md +79 -0
- package/templates/preview-runtime/v1/build-preview.mjs +1324 -0
- package/templates/preview-runtime/v1/manifest.json +17 -0
- package/templates/preview-runtime/v1/release-guard.mjs +87 -0
- package/templates/preview-runtime/v1/runtime.d.mts +3 -0
- package/templates/preview-runtime/v1/runtime.d.ts +3 -0
- package/templates/preview-runtime/v1/runtime.mjs +1312 -0
- package/templates/preview-runtime/v1/types/adapters.d.ts +28 -0
- package/templates/preview-runtime/v1/types/preview.d.ts +24 -0
- package/templates/preview-runtime/v1/types/protocol.d.ts +131 -0
- package/templates/preview-runtime/v1/types/runtime.d.ts +14 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: playcraft-vfx-animation
|
|
3
|
+
description: VFX 特效与动画精灵图选型决策树与核心命令速查。按游戏事件快速选定预设,详细预设目录见 refs/ta-vfx-preset-catalog.md。
|
|
4
|
+
triggers: VFX,特效,动画,animate,animation,use-vfx,精灵动画,sprite animation,爆炸特效,闪光效果,vfx预设,animate预设,bounce,spin,pulse,shake,float,blink,swing,wobble,flip,confetti,sparkle,explosion,starburst,smoke,glow,impact
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# PlayCraft VFX 特效与动画精灵图生成指南
|
|
8
|
+
|
|
9
|
+
## 0. Overview
|
|
10
|
+
|
|
11
|
+
VFX(视觉特效精灵图)和 animate(运动动画精灵图)是可玩广告视觉品质的关键层。它们属于 TA 工作流的 **Stage B**(精灵图处理阶段),在 Stage A 元素生成完成后执行。
|
|
12
|
+
|
|
13
|
+
- **VFX**:预制粒子/爆炸/光效精灵表,用于游戏事件反馈(消除、得分、胜利等)
|
|
14
|
+
- **animate**:将静态素材转为循环动画精灵表,用于 idle 状态、UI 引导、装饰运动
|
|
15
|
+
|
|
16
|
+
**发现可用预设**:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
playcraft image list-vfx # 列出所有 VFX 预设(含帧数、体积)
|
|
20
|
+
playcraft image animate --list-presets # 列出所有 animate 预设
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## 1. VFX 选型决策树
|
|
24
|
+
|
|
25
|
+
按游戏事件选择预设:
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
需要为哪种游戏事件添加 VFX?
|
|
29
|
+
+-- 元素消除/击破 -> explosion_small (8帧, ~30KB)
|
|
30
|
+
| 理由: 中心爆发+碎片扩散, 8帧在视觉冲击与体积间取得平衡
|
|
31
|
+
+-- 得分/收集奖励 -> sparkle (6帧, ~15KB)
|
|
32
|
+
| 理由: 轻量粒子迸发, 15KB 可高频触发而不累积体积压力
|
|
33
|
+
+-- 关卡完成/大胜利 -> confetti (12帧, ~25KB)
|
|
34
|
+
| 理由: 多彩纸片飘落, 12帧保证庆祝感的持续时长
|
|
35
|
+
+-- 连击触发/特殊技能 -> starburst (8帧, ~20KB)
|
|
36
|
+
| 理由: 金色放射线条, 视觉冲击强且不遮挡游戏元素
|
|
37
|
+
+-- 元素消失/冲刺残影 -> smoke (8帧, ~20KB)
|
|
38
|
+
| 理由: 烟雾自然消散, 柔和过渡不抢视觉焦点
|
|
39
|
+
+-- 元素高亮/选中状态 -> glow (6帧, ~10KB)
|
|
40
|
+
| 理由: 最小体积, 适合持续循环播放(选中状态)
|
|
41
|
+
+-- 落地/点击反馈 -> impact_ring (6帧, ~15KB)
|
|
42
|
+
| 理由: 快速扩散环, 6帧短促匹配瞬时反馈的时间尺度
|
|
43
|
+
+-- 金币/货币拾取 -> coin_collect (8帧, ~20KB)
|
|
44
|
+
理由: 专用金色闪光发散, 与通用 sparkle 区分货币语义
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## 2. Animate 选型决策树
|
|
48
|
+
|
|
49
|
+
按运动需求选择预设:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
需要什么运动效果?
|
|
53
|
+
+-- 引起注意(CTA/重要按钮) -> pulse (缩放脉冲, 周期1.5-2s)
|
|
54
|
+
| 理由: 缩放振荡是最有效的注意力引导, 不依赖位移空间
|
|
55
|
+
+-- 持续旋转(加载/转盘/金币) -> spin (X轴缩放模拟Y轴旋转)
|
|
56
|
+
| 理由: 2D压缩模拟3D翻转, 适合圆形/对称元素
|
|
57
|
+
+-- 弹跳反馈(点击/收集/idle) -> bounce (Y轴正弦平移)
|
|
58
|
+
| 理由: 最自然的"活着"感, 适用面最广
|
|
59
|
+
+-- 错误/警告/受击 -> shake (随机小幅XY偏移)
|
|
60
|
+
| 理由: 随机位移制造紧张感, 强制引导注意力
|
|
61
|
+
+-- 悬浮装饰(idle/魔法道具) -> float (轻柔漂浮+微旋转)
|
|
62
|
+
| 理由: 比bounce更轻柔, 加入+-3度旋转增添神秘感
|
|
63
|
+
+-- 闪烁提示(光标/倒计时) -> blink (不透明度振荡)
|
|
64
|
+
| 理由: 最简单的"请注意我"动画, 最小视觉干扰
|
|
65
|
+
+-- 钟摆装饰(悬挂物/灯笼) -> swing (绕顶部中心摆动)
|
|
66
|
+
| 理由: 物理感强, 专为"挂着"的元素设计
|
|
67
|
+
+-- 可爱/卡通idle(果冻/气泡) -> wobble (左右交替小幅旋转)
|
|
68
|
+
| 理由: +-5-10度交替旋转产生弹性感, 适合软体元素
|
|
69
|
+
+-- 卡牌翻转/3D旋转 -> flip (需要正面+背面两张素材)
|
|
70
|
+
理由: 完整正面->过渡->背面翻转; 详见 ta-3d-flip-recipe.md
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## 3. Core Commands
|
|
74
|
+
|
|
75
|
+
### use-vfx 完整示例
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
playcraft image use-vfx \
|
|
79
|
+
--preset explosion_small \ # 预设名(必填), 从决策树选定
|
|
80
|
+
--tint "#FF6B35" \ # 颜色叠加(可选), hex格式, 按元素颜色调整
|
|
81
|
+
--scale 1.2 \ # 缩放(可选, 默认1.0), 范围0.5-3.0
|
|
82
|
+
--output assets/images/vfx/tile_break.png # 输出路径(必填)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
| 参数 | 类型 | 默认值 | 说明 |
|
|
86
|
+
| ---------- | ------ | ---------- | -------------------- |
|
|
87
|
+
| `--preset` | string | 必填 | VFX 预设名 |
|
|
88
|
+
| `--output` | string | 必填 | 输出精灵表路径(.png) |
|
|
89
|
+
| `--tint` | hex | 预设默认色 | 颜色叠加 `#RRGGBB` |
|
|
90
|
+
| `--scale` | number | 1.0 | 整体缩放(0.5-3.0) |
|
|
91
|
+
|
|
92
|
+
### animate 完整示例
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
playcraft image animate \
|
|
96
|
+
--input assets/images/ui/cta_button.png \ # 输入静态素材(必填)
|
|
97
|
+
--preset pulse \ # 动画预设(默认bounce)
|
|
98
|
+
--frames 8 \ # 总帧数(2-64, 默认8)
|
|
99
|
+
--columns 4 \ # 精灵表列数(默认4)
|
|
100
|
+
--output assets/images/ui/cta_button_pulse.png # 输出路径(必填)
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
| 参数 | 类型 | 默认值 | 说明 |
|
|
104
|
+
| ----------- | ------ | ------ | ----------------------- |
|
|
105
|
+
| `--input` | string | 必填 | 输入图片路径 |
|
|
106
|
+
| `--output` | string | 必填 | 输出精灵表路径(.png) |
|
|
107
|
+
| `--preset` | string | bounce | 动画预设名 |
|
|
108
|
+
| `--frames` | number | 8 | 总帧数(2-64) |
|
|
109
|
+
| `--columns` | number | 4 | 精灵表列数 |
|
|
110
|
+
| `--back` | string | 无 | flip 专用: 背面图片路径 |
|
|
111
|
+
|
|
112
|
+
## 4. Post-Generation Checklist
|
|
113
|
+
|
|
114
|
+
| 检查项 | 方法 | 不通过时 |
|
|
115
|
+
| ------------------ | ---------------------------------- | ---------------------------- |
|
|
116
|
+
| 帧数与预设规格匹配 | 计算精灵表格子数 = 行x列 | 重新生成, 检查 --frames 参数 |
|
|
117
|
+
| 精灵表尺寸合理 | 单帧 <= 256x256, 总图 <= 1024px 宽 | 降低 --scale 或减少帧数 |
|
|
118
|
+
| 文件体积在预算内 | VFX 总计 <= 150KB | 减少预设数量或降帧 |
|
|
119
|
+
| 记录到 ta-log.md | grid 参数(帧数/列数/单帧尺寸) | 补写, Developer 需要此信息 |
|
|
120
|
+
|
|
121
|
+
## 5. Detailed Reference
|
|
122
|
+
|
|
123
|
+
完整预设目录与组合配方见 `refs/ta-vfx-preset-catalog.md`,包含:
|
|
124
|
+
|
|
125
|
+
- 每个 VFX 预设的完整详解(动画感描述、Tint 建议、Scale 建议、典型错误)
|
|
126
|
+
- 每个 animate 预设的完整详解(参数建议、最佳用途、典型错误)
|
|
127
|
+
- 按游戏类型的 VFX + 动画组合配方(Match-3 / 跑酷 / 卡牌 / 泡泡射击)
|
|
128
|
+
- flip 工作流详情
|
|
129
|
+
- 自定义帧数决策指南与非均匀帧时长技巧
|
|
130
|
+
- 体积预算分配参考
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: playcraft-workspace-assets
|
|
3
|
+
description: Use when finding or downloading shared library assets, or creating and managing durable image, audio, sprite, animation, model, or video generation tasks in a PlayCraft cloud workspace.
|
|
4
|
+
compatibility: agent,opencode
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
surfaces:
|
|
7
|
+
- sandbox-agent
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# 工作区素材工作流
|
|
11
|
+
|
|
12
|
+
使用 PlayCraft CLI (Command Line Interface, 命令行界面) 的 `library` 和 `assets` 命令。运行对应子命令的 `--help` 核对参数;当前命令行缺少这些入口时,先报告需要匹配的命令行与服务版本。凭据由工作区提供。
|
|
13
|
+
|
|
14
|
+
## 查找并复用素材
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
playcraft library search "角色" --type texture --tags character --limit 20 --json
|
|
18
|
+
playcraft library facets --json
|
|
19
|
+
playcraft library get <assetId> --json
|
|
20
|
+
playcraft library files <assetId> --json
|
|
21
|
+
playcraft library download <assetId> --output ./assets/character
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
检索字段是名称、素材库路径和标签;还可按分类、子分类、团队和分页筛选。使用检索结果返回的素材库编号,与 `tools list-assets` 的项目资产编号分别处理。不要把下载预览图当作完整素材包。
|
|
25
|
+
|
|
26
|
+
`--output` 对单文件表示文件路径,对素材包表示目录;`--output-dir` 始终表示目录。目标路径必须尚不存在。素材包包含清单、嵌套目录和模型贴图等依赖,下载后保留其相对路径。用户要求修改已有素材时,先下载到新路径并核对,再按用户要求替换。
|
|
27
|
+
|
|
28
|
+
## 创建持久化生成任务
|
|
29
|
+
|
|
30
|
+
从 `references/requests.json` 选取所需类型的示例,将**单个请求对象**写入工程内的请求文件,并改成完整的用户需求。六种类型分别为 `image`、`audio`、`sprite`、`animation`、`model`、`video`。请求使用 JSON (JavaScript Object Notation, 数据交换格式);参考图需同时提供 `referenceImageBase64` 和对应 `referenceImageMimeType`。模型参数以可用配置和共享契约为准。
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
playcraft assets estimate --request .tmp/asset-request.json
|
|
34
|
+
playcraft assets generate --request .tmp/asset-request.json --client-request-id <stable-request-id>
|
|
35
|
+
playcraft assets get <taskId>
|
|
36
|
+
playcraft assets wait <taskId> --timeout 1800
|
|
37
|
+
playcraft assets download <taskId> --output ./assets/generated-result
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
同一次生成保持 `--client-request-id` 和请求内容不变。提交结果不确定时重用原请求;拿到 `taskId` 后用 `get` 或 `wait` 恢复,不能新建任务来代替查状态。新候选使用新请求编号。`--wait --output <path>` 可合并等待和下载。
|
|
41
|
+
|
|
42
|
+
命令在当前工程推断工作区和工程目录;工程外须传 `--workspace <workspaceId> --directory <directoryName>`,范围应对应目标工程。`tasks` 列出该范围任务;`cancel <taskId>` 请求取消,上游已提交请求可能继续结算。等待超时返回退出状态 75,远端任务仍可查询。
|
|
43
|
+
|
|
44
|
+
下载前任务应为 `awaiting_adoption` 或 `saved`。精灵图与动画输出为完整包目录,下载会校验各文件大小与内容摘要。`queued` 和 `running` 只表示任务尚未完成;`failed`、`cancelled`、`interrupted` 应根据真实状态汇报。
|
|
45
|
+
|
|
46
|
+
## 结果保存和动画版本
|
|
47
|
+
|
|
48
|
+
- 生成结果保存到共享素材库:先 `assets library-targets` 获取允许的目的地,再通过 `assets library-save <taskId> --request <save-request.json>` 保存。用 `library-saves <taskId>` 查看状态,失败时 `library-retry <taskId> --save-id <saveId>` 沿用原保存任务。请求字段以命令帮助和 `asset-library-save` 共享契约为准。
|
|
49
|
+
- 动画编辑:`assets animation get <taskId>` 读取草稿及修订号,`draft`、`upload-frame`、`version` 使用请求文件更新草稿、替换帧和导出版本。草稿写入结果不确定时先重新读取草稿修订号。
|
|
50
|
+
- 指定动画版本下载:`assets download <taskId> --version <versionId> --output <new-directory>`。
|
|
51
|
+
- `assets saved` 和 `assets animation saved` 需要已有的平台写入回执,不能用普通本地下载路径声明已经采纳。
|
|
52
|
+
|
|
53
|
+
工作素材写入工程的 `assets/`,请求与回执放在 `dist/` 外。最终交付使用工程根目录 `dist/`,包内依赖一起交付。单张图片的直接生成仍可用 `tools generate-image`;裁剪、分割、分层及九宫格分析使用 `image` 子命令,先查看各自帮助。
|
package/project-template-v2/.claude/skills/playcraft-workspace-assets/references/requests.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"image": { "kind": "image", "prompt": "A transparent game character", "removeBackground": true },
|
|
3
|
+
"audio": { "kind": "audio", "category": "sfx", "description": "A short bright reward chime" },
|
|
4
|
+
"sprite": {
|
|
5
|
+
"kind": "sprite",
|
|
6
|
+
"prompt": "A character walking sequence",
|
|
7
|
+
"frameCount": 8,
|
|
8
|
+
"frameWidth": 256,
|
|
9
|
+
"frameHeight": 256,
|
|
10
|
+
"columns": 4,
|
|
11
|
+
"fps": 12
|
|
12
|
+
},
|
|
13
|
+
"animation": {
|
|
14
|
+
"kind": "animation",
|
|
15
|
+
"prompt": "A character waving in a loop",
|
|
16
|
+
"frameCount": 8,
|
|
17
|
+
"frameWidth": 256,
|
|
18
|
+
"frameHeight": 256,
|
|
19
|
+
"columns": 4,
|
|
20
|
+
"fps": 12
|
|
21
|
+
},
|
|
22
|
+
"model": { "kind": "model", "mode": "text", "prompt": "A low polygon treasure chest" },
|
|
23
|
+
"video": {
|
|
24
|
+
"kind": "video",
|
|
25
|
+
"mode": "text",
|
|
26
|
+
"prompt": "A treasure chest opening",
|
|
27
|
+
"duration": 5,
|
|
28
|
+
"aspectRatio": "16:9",
|
|
29
|
+
"resolution": "720P",
|
|
30
|
+
"audio": false
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: playwright-cli
|
|
3
|
+
description: Automate browser interactions, test web pages and work with Playwright tests.
|
|
4
|
+
allowed-tools: Bash(playwright-cli:*) Bash(npx:*) Bash(npm:*)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Browser Automation with playwright-cli
|
|
8
|
+
|
|
9
|
+
## Quick start
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# open new browser
|
|
13
|
+
playwright-cli open
|
|
14
|
+
# navigate to a page
|
|
15
|
+
playwright-cli goto https://playwright.dev
|
|
16
|
+
# interact with the page using refs from the snapshot
|
|
17
|
+
playwright-cli click e15
|
|
18
|
+
playwright-cli type "page.click"
|
|
19
|
+
playwright-cli press Enter
|
|
20
|
+
# take a screenshot (rarely used, as snapshot is more common)
|
|
21
|
+
playwright-cli screenshot
|
|
22
|
+
# close the browser
|
|
23
|
+
playwright-cli close
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Commands
|
|
27
|
+
|
|
28
|
+
### Core
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
playwright-cli open
|
|
32
|
+
# open and navigate right away
|
|
33
|
+
playwright-cli open https://example.com/
|
|
34
|
+
playwright-cli goto https://playwright.dev
|
|
35
|
+
playwright-cli type "search query"
|
|
36
|
+
playwright-cli click e3
|
|
37
|
+
playwright-cli dblclick e7
|
|
38
|
+
# --submit presses Enter after filling the element
|
|
39
|
+
playwright-cli fill e5 "user@example.com" --submit
|
|
40
|
+
playwright-cli drag e2 e8
|
|
41
|
+
# drop files or data onto an element (from outside the page)
|
|
42
|
+
playwright-cli drop e4 --path=./image.png
|
|
43
|
+
playwright-cli drop e4 --data="text/plain=hello world"
|
|
44
|
+
playwright-cli hover e4
|
|
45
|
+
playwright-cli select e9 "option-value"
|
|
46
|
+
playwright-cli upload ./document.pdf
|
|
47
|
+
playwright-cli check e12
|
|
48
|
+
playwright-cli uncheck e12
|
|
49
|
+
playwright-cli snapshot
|
|
50
|
+
playwright-cli eval "document.title"
|
|
51
|
+
playwright-cli eval "el => el.textContent" e5
|
|
52
|
+
# get element id, class, or any attribute not visible in the snapshot
|
|
53
|
+
playwright-cli eval "el => el.id" e5
|
|
54
|
+
playwright-cli eval "el => el.getAttribute('data-testid')" e5
|
|
55
|
+
playwright-cli dialog-accept
|
|
56
|
+
playwright-cli dialog-accept "confirmation text"
|
|
57
|
+
playwright-cli dialog-dismiss
|
|
58
|
+
playwright-cli resize 1920 1080
|
|
59
|
+
playwright-cli close
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Navigation
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
playwright-cli go-back
|
|
66
|
+
playwright-cli go-forward
|
|
67
|
+
playwright-cli reload
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Keyboard
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
playwright-cli press Enter
|
|
74
|
+
playwright-cli press ArrowDown
|
|
75
|
+
playwright-cli keydown Shift
|
|
76
|
+
playwright-cli keyup Shift
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Mouse
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
playwright-cli mousemove 150 300
|
|
83
|
+
playwright-cli mousedown
|
|
84
|
+
playwright-cli mousedown right
|
|
85
|
+
playwright-cli mouseup
|
|
86
|
+
playwright-cli mouseup right
|
|
87
|
+
playwright-cli mousewheel 0 100
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Save as
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
playwright-cli screenshot
|
|
94
|
+
playwright-cli screenshot e5
|
|
95
|
+
playwright-cli screenshot --filename=page.png
|
|
96
|
+
playwright-cli pdf --filename=page.pdf
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Tabs
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
playwright-cli tab-list
|
|
103
|
+
playwright-cli tab-new
|
|
104
|
+
playwright-cli tab-new https://example.com/page
|
|
105
|
+
playwright-cli tab-close
|
|
106
|
+
playwright-cli tab-close 2
|
|
107
|
+
playwright-cli tab-select 0
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Storage
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
playwright-cli state-save
|
|
114
|
+
playwright-cli state-save auth.json
|
|
115
|
+
playwright-cli state-load auth.json
|
|
116
|
+
|
|
117
|
+
# Cookies
|
|
118
|
+
playwright-cli cookie-list
|
|
119
|
+
playwright-cli cookie-list --domain=example.com
|
|
120
|
+
playwright-cli cookie-get session_id
|
|
121
|
+
playwright-cli cookie-set session_id abc123
|
|
122
|
+
playwright-cli cookie-set session_id abc123 --domain=example.com --httpOnly --secure
|
|
123
|
+
playwright-cli cookie-delete session_id
|
|
124
|
+
playwright-cli cookie-clear
|
|
125
|
+
|
|
126
|
+
# LocalStorage
|
|
127
|
+
playwright-cli localstorage-list
|
|
128
|
+
playwright-cli localstorage-get theme
|
|
129
|
+
playwright-cli localstorage-set theme dark
|
|
130
|
+
playwright-cli localstorage-delete theme
|
|
131
|
+
playwright-cli localstorage-clear
|
|
132
|
+
|
|
133
|
+
# SessionStorage
|
|
134
|
+
playwright-cli sessionstorage-list
|
|
135
|
+
playwright-cli sessionstorage-get step
|
|
136
|
+
playwright-cli sessionstorage-set step 3
|
|
137
|
+
playwright-cli sessionstorage-delete step
|
|
138
|
+
playwright-cli sessionstorage-clear
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Network
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
playwright-cli route "**/*.jpg" --status=404
|
|
145
|
+
playwright-cli route "https://api.example.com/**" --body='{"mock": true}'
|
|
146
|
+
playwright-cli route-list
|
|
147
|
+
playwright-cli unroute "**/*.jpg"
|
|
148
|
+
playwright-cli unroute
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### DevTools
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
playwright-cli console
|
|
155
|
+
playwright-cli console warning
|
|
156
|
+
playwright-cli requests
|
|
157
|
+
playwright-cli request 5
|
|
158
|
+
playwright-cli run-code "async page => await page.context().grantPermissions(['geolocation'])"
|
|
159
|
+
playwright-cli run-code --filename=script.js
|
|
160
|
+
playwright-cli tracing-start
|
|
161
|
+
playwright-cli tracing-stop
|
|
162
|
+
playwright-cli video-start video.webm
|
|
163
|
+
playwright-cli video-chapter "Chapter Title" --description="Details" --duration=2000
|
|
164
|
+
playwright-cli video-stop
|
|
165
|
+
|
|
166
|
+
# launch the dashboard for UI review / design feedback — user annotates the page, you receive the annotated screenshot, snapshot, and notes
|
|
167
|
+
playwright-cli show --annotate
|
|
168
|
+
|
|
169
|
+
# generate a Playwright locator for an element from its ref or selector
|
|
170
|
+
playwright-cli generate-locator e5 --raw
|
|
171
|
+
|
|
172
|
+
# show a persistent highlight overlay for an element, optionally with a custom style
|
|
173
|
+
playwright-cli highlight e5
|
|
174
|
+
playwright-cli highlight e5 --style="outline: 3px dashed red"
|
|
175
|
+
# hide a single element highlight, or all page highlights when no target is given
|
|
176
|
+
playwright-cli highlight e5 --hide
|
|
177
|
+
playwright-cli highlight --hide
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## Raw output
|
|
181
|
+
|
|
182
|
+
The global `--raw` option strips page status, generated code, and snapshot sections from the output, returning only the result value. Use it to pipe command output into other tools. Commands that don't produce output return nothing.
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
playwright-cli --raw eval "JSON.stringify(performance.timing)" | jq '.loadEventEnd - .navigationStart'
|
|
186
|
+
playwright-cli --raw eval "JSON.stringify([...document.querySelectorAll('a')].map(a => a.href))" > links.json
|
|
187
|
+
playwright-cli --raw snapshot > before.yml
|
|
188
|
+
playwright-cli click e5
|
|
189
|
+
playwright-cli --raw snapshot > after.yml
|
|
190
|
+
diff before.yml after.yml
|
|
191
|
+
TOKEN=$(playwright-cli --raw cookie-get session_id)
|
|
192
|
+
playwright-cli --raw localstorage-get theme
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
For structured output wrapping every reply as JSON, pass --json
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
playwright-cli list --json
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Open parameters
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
# Use specific browser when creating session
|
|
205
|
+
playwright-cli open --browser=chrome
|
|
206
|
+
playwright-cli open --browser=firefox
|
|
207
|
+
playwright-cli open --browser=webkit
|
|
208
|
+
playwright-cli open --browser=msedge
|
|
209
|
+
|
|
210
|
+
# Use persistent profile (by default profile is in-memory)
|
|
211
|
+
playwright-cli open --persistent
|
|
212
|
+
# Use persistent profile with custom directory
|
|
213
|
+
playwright-cli open --profile=/path/to/profile
|
|
214
|
+
|
|
215
|
+
# Connect to browser via Playwright Extension
|
|
216
|
+
playwright-cli attach --extension=chrome
|
|
217
|
+
|
|
218
|
+
# Connect to a running Chrome or Edge by channel name
|
|
219
|
+
playwright-cli attach --cdp=chrome
|
|
220
|
+
playwright-cli attach --cdp=msedge
|
|
221
|
+
|
|
222
|
+
# Connect to a running browser via CDP endpoint
|
|
223
|
+
playwright-cli attach --cdp=http://localhost:9222
|
|
224
|
+
|
|
225
|
+
# Start with config file
|
|
226
|
+
playwright-cli open --config=my-config.json
|
|
227
|
+
|
|
228
|
+
# Close the browser
|
|
229
|
+
playwright-cli close
|
|
230
|
+
# Detach from an attached browser (leaves the external browser running)
|
|
231
|
+
playwright-cli -s=msedge detach
|
|
232
|
+
# Delete user data for the default session
|
|
233
|
+
playwright-cli delete-data
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
## Snapshots
|
|
237
|
+
|
|
238
|
+
After each command, playwright-cli provides a snapshot of the current browser state.
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
> playwright-cli goto https://example.com
|
|
242
|
+
### Page
|
|
243
|
+
- Page URL: https://example.com/
|
|
244
|
+
- Page Title: Example Domain
|
|
245
|
+
### Snapshot
|
|
246
|
+
[Snapshot](.playwright-cli/page-2026-02-14T19-22-42-679Z.yml)
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
You can also take a snapshot on demand using `playwright-cli snapshot` command. All the options below can be combined as needed.
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
# default - save to a file with timestamp-based name
|
|
253
|
+
playwright-cli snapshot
|
|
254
|
+
|
|
255
|
+
# save to file, use when snapshot is a part of the workflow result
|
|
256
|
+
playwright-cli snapshot --filename=after-click.yaml
|
|
257
|
+
|
|
258
|
+
# snapshot an element instead of the whole page
|
|
259
|
+
playwright-cli snapshot "#main"
|
|
260
|
+
|
|
261
|
+
# limit snapshot depth for efficiency, take a partial snapshot afterwards
|
|
262
|
+
playwright-cli snapshot --depth=4
|
|
263
|
+
playwright-cli snapshot e34
|
|
264
|
+
|
|
265
|
+
# include each element's bounding box as [box=x,y,width,height]
|
|
266
|
+
playwright-cli snapshot --boxes
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
## Targeting elements
|
|
270
|
+
|
|
271
|
+
By default, use refs from the snapshot to interact with page elements.
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
# get snapshot with refs
|
|
275
|
+
playwright-cli snapshot
|
|
276
|
+
|
|
277
|
+
# interact using a ref
|
|
278
|
+
playwright-cli click e15
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
You can also use css selectors or Playwright locators.
|
|
282
|
+
|
|
283
|
+
```bash
|
|
284
|
+
# css selector
|
|
285
|
+
playwright-cli click "#main > button.submit"
|
|
286
|
+
|
|
287
|
+
# role locator
|
|
288
|
+
playwright-cli click "getByRole('button', { name: 'Submit' })"
|
|
289
|
+
|
|
290
|
+
# test id
|
|
291
|
+
playwright-cli click "getByTestId('submit-button')"
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
## Browser Sessions
|
|
295
|
+
|
|
296
|
+
```bash
|
|
297
|
+
# create new browser session named "mysession" with persistent profile
|
|
298
|
+
playwright-cli -s=mysession open example.com --persistent
|
|
299
|
+
# same with manually specified profile directory (use when requested explicitly)
|
|
300
|
+
playwright-cli -s=mysession open example.com --profile=/path/to/profile
|
|
301
|
+
playwright-cli -s=mysession click e6
|
|
302
|
+
playwright-cli -s=mysession close # stop a named browser
|
|
303
|
+
playwright-cli -s=mysession delete-data # delete user data for persistent session
|
|
304
|
+
|
|
305
|
+
playwright-cli list
|
|
306
|
+
# Close all browsers
|
|
307
|
+
playwright-cli close-all
|
|
308
|
+
# Forcefully kill all browser processes
|
|
309
|
+
playwright-cli kill-all
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
## Installation
|
|
313
|
+
|
|
314
|
+
If global `playwright-cli` command is not available, try a local version via `npx playwright-cli`:
|
|
315
|
+
|
|
316
|
+
```bash
|
|
317
|
+
npx --no-install playwright-cli --version
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
When local version is available, use `npx playwright-cli` in all commands. Otherwise, install `playwright-cli` as a global command:
|
|
321
|
+
|
|
322
|
+
```bash
|
|
323
|
+
npm install -g @playwright/cli@latest
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
## Example: Form submission
|
|
327
|
+
|
|
328
|
+
```bash
|
|
329
|
+
playwright-cli open https://example.com/form
|
|
330
|
+
playwright-cli snapshot
|
|
331
|
+
|
|
332
|
+
playwright-cli fill e1 "user@example.com"
|
|
333
|
+
playwright-cli fill e2 "password123"
|
|
334
|
+
playwright-cli click e3
|
|
335
|
+
playwright-cli snapshot
|
|
336
|
+
playwright-cli close
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
## Example: Multi-tab workflow
|
|
340
|
+
|
|
341
|
+
```bash
|
|
342
|
+
playwright-cli open https://example.com
|
|
343
|
+
playwright-cli tab-new https://example.com/other
|
|
344
|
+
playwright-cli tab-list
|
|
345
|
+
playwright-cli tab-select 0
|
|
346
|
+
playwright-cli snapshot
|
|
347
|
+
playwright-cli close
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
## Example: Debugging with DevTools
|
|
351
|
+
|
|
352
|
+
```bash
|
|
353
|
+
playwright-cli open https://example.com
|
|
354
|
+
playwright-cli click e4
|
|
355
|
+
playwright-cli fill e7 "test"
|
|
356
|
+
playwright-cli console
|
|
357
|
+
playwright-cli requests
|
|
358
|
+
playwright-cli close
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
```bash
|
|
362
|
+
playwright-cli open https://example.com
|
|
363
|
+
playwright-cli tracing-start
|
|
364
|
+
playwright-cli click e4
|
|
365
|
+
playwright-cli fill e7 "test"
|
|
366
|
+
playwright-cli tracing-stop
|
|
367
|
+
playwright-cli close
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
## Example: Interactive session
|
|
371
|
+
|
|
372
|
+
Ask the user for UI review or design feedback. The user draws boxes on the live page and types comments; you receive the annotated screenshot, the snapshot of the marked region, and the user's notes. Use this whenever the user asks for "UI review", "design feedback", or to "ask the user what they think / want / mean":
|
|
373
|
+
|
|
374
|
+
```bash
|
|
375
|
+
playwright-cli open https://example.com
|
|
376
|
+
playwright-cli show --annotate
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
## Specific tasks
|
|
380
|
+
|
|
381
|
+
- **Running and Debugging Playwright tests** [references/playwright-tests.md](references/playwright-tests.md)
|
|
382
|
+
- **Request mocking** [references/request-mocking.md](references/request-mocking.md)
|
|
383
|
+
- **Running Playwright code** [references/running-code.md](references/running-code.md)
|
|
384
|
+
- **Browser session management** [references/session-management.md](references/session-management.md)
|
|
385
|
+
- **Spec-driven testing (plan / generate / heal)** [references/spec-driven-testing.md](references/spec-driven-testing.md)
|
|
386
|
+
- **Storage state (cookies, localStorage)** [references/storage-state.md](references/storage-state.md)
|
|
387
|
+
- **Test generation** [references/test-generation.md](references/test-generation.md)
|
|
388
|
+
- **Tracing** [references/tracing.md](references/tracing.md)
|
|
389
|
+
- **Video recording** [references/video-recording.md](references/video-recording.md)
|
|
390
|
+
- **Inspecting element attributes** [references/element-attributes.md](references/element-attributes.md)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Inspecting Element Attributes
|
|
2
|
+
|
|
3
|
+
When the snapshot doesn't show an element's `id`, `class`, `data-*` attributes, or other DOM properties, use `eval` to inspect them.
|
|
4
|
+
|
|
5
|
+
## Examples
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
playwright-cli snapshot
|
|
9
|
+
# snapshot shows a button as e7 but doesn't reveal its id or data attributes
|
|
10
|
+
|
|
11
|
+
# get the element's id
|
|
12
|
+
playwright-cli eval "el => el.id" e7
|
|
13
|
+
|
|
14
|
+
# get all CSS classes
|
|
15
|
+
playwright-cli eval "el => el.className" e7
|
|
16
|
+
|
|
17
|
+
# get a specific attribute
|
|
18
|
+
playwright-cli eval "el => el.getAttribute('data-testid')" e7
|
|
19
|
+
playwright-cli eval "el => el.getAttribute('aria-label')" e7
|
|
20
|
+
|
|
21
|
+
# get a computed style property
|
|
22
|
+
playwright-cli eval "el => getComputedStyle(el).display" e7
|
|
23
|
+
```
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Running Playwright Tests
|
|
2
|
+
|
|
3
|
+
To run Playwright tests, use the `npx playwright test` command, or a package manager script. To avoid opening the interactive html report, use `PLAYWRIGHT_HTML_OPEN=never` environment variable.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
# Run all tests
|
|
7
|
+
PLAYWRIGHT_HTML_OPEN=never npx playwright test
|
|
8
|
+
|
|
9
|
+
# Run all tests through a custom npm script
|
|
10
|
+
PLAYWRIGHT_HTML_OPEN=never npm run special-test-command
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
# Debugging Playwright Tests
|
|
14
|
+
|
|
15
|
+
To debug a failing Playwright test, run it with `--debug=cli` option. This command will pause the test at the start and print the debugging instructions.
|
|
16
|
+
|
|
17
|
+
**IMPORTANT**: run the command in the background and check the output until "Debugging Instructions" is printed. Make sure to stop the command after you have finished.
|
|
18
|
+
|
|
19
|
+
Once instructions containing a session name are printed, use `playwright-cli` to attach the session and explore the page.
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Run the test
|
|
23
|
+
PLAYWRIGHT_HTML_OPEN=never npx playwright test --debug=cli
|
|
24
|
+
# ...
|
|
25
|
+
# ... debugging instructions for "tw-abcdef" session ...
|
|
26
|
+
# ...
|
|
27
|
+
|
|
28
|
+
# Attach to the test
|
|
29
|
+
playwright-cli attach tw-abcdef
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Keep the test running in the background while you explore and look for a fix.
|
|
33
|
+
The test is paused at the start, so you should step over or pause at a particular location
|
|
34
|
+
where the problem is most likely to be.
|
|
35
|
+
|
|
36
|
+
Every action you perform with `playwright-cli` generates corresponding Playwright TypeScript code.
|
|
37
|
+
This code appears in the output and can be copied directly into the test. Most of the time, a specific locator or an expectation should be updated, but it could also be a bug in the app. Use your judgement.
|
|
38
|
+
|
|
39
|
+
After fixing the test, stop the background test run. Rerun to check that test passes.
|