@playcraft/cli 0.1.40-beta → 0.1.42

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.
Files changed (368) hide show
  1. package/README.md +3 -58
  2. package/dist/agent/local-backend.js +1 -1
  3. package/dist/cli-root-help.js +0 -2
  4. package/dist/commands/build-all.js +19 -5
  5. package/dist/commands/build.js +28 -15
  6. package/dist/commands/create.js +33 -26
  7. package/dist/commands/image.js +6 -2
  8. package/dist/commands/login.js +42 -84
  9. package/dist/commands/skills.js +0 -4
  10. package/dist/commands/tools-3d.js +0 -11
  11. package/dist/commands/tools-generation.js +137 -69
  12. package/dist/commands/tools-image-context.js +29 -0
  13. package/dist/commands/tools-utils.js +12 -0
  14. package/dist/commands/tools.js +2 -2
  15. package/dist/config.js +4 -59
  16. package/dist/index.js +3 -40
  17. package/dist/remix/clone.js +0 -2
  18. package/dist/remix/init-template.js +0 -2
  19. package/dist/remix/pull.js +0 -2
  20. package/dist/remix/push.js +1 -21
  21. package/dist/utils/agent-api-client.js +30 -185
  22. package/dist/utils/image-asset-context.js +228 -0
  23. package/dist/utils/playcraft-http-client.js +4 -6
  24. package/package.json +5 -15
  25. package/project-template/.claude/agents/refs/ta-image-generation-detail.md +67 -123
  26. package/project-template/.claude/skills/playcraft-image-generation/SKILL.md +135 -63
  27. package/project-template/.claude/skills/playcraft-image-generation/reference/gen-batch-sprite.template.mjs +42 -33
  28. package/project-template/.claude/skills/playcraft-image-generation/reference/gen-batch.template.mjs +18 -20
  29. package/project-template/.claude/skills/playcraft-image-generation/reference/process-batch.template.mjs +6 -7
  30. package/project-template/.claude/skills/playcraft-image-generation/reference/prompt-cookbook.md +39 -39
  31. package/project-templates/phaser/.claude/agents/refs/ta-image-generation-detail.md +59 -59
  32. package/project-templates/phaser/.claude/skills/playcraft-image-generation/SKILL.md +135 -63
  33. package/project-templates/phaser/.claude/skills/playcraft-image-generation/reference/gen-batch-sprite.template.mjs +42 -33
  34. package/project-templates/phaser/.claude/skills/playcraft-image-generation/reference/gen-batch.template.mjs +18 -20
  35. package/project-templates/phaser/.claude/skills/playcraft-image-generation/reference/process-batch.template.mjs +6 -7
  36. package/project-templates/phaser/.claude/skills/playcraft-image-generation/reference/prompt-cookbook.md +39 -39
  37. package/project-templates/threejs/.claude/agents/refs/ta-image-generation-detail.md +59 -59
  38. package/project-templates/threejs/.claude/skills/playcraft-image-generation/SKILL.md +135 -63
  39. package/project-templates/threejs/.claude/skills/playcraft-image-generation/reference/gen-batch-sprite.template.mjs +42 -33
  40. package/project-templates/threejs/.claude/skills/playcraft-image-generation/reference/gen-batch.template.mjs +18 -20
  41. package/project-templates/threejs/.claude/skills/playcraft-image-generation/reference/process-batch.template.mjs +6 -7
  42. package/project-templates/threejs/.claude/skills/playcraft-image-generation/reference/prompt-cookbook.md +39 -39
  43. package/SKILLS_REGISTRY.md +0 -149
  44. package/dist/auth/account-activation.js +0 -157
  45. package/dist/auth/messages.js +0 -30
  46. package/dist/commands/build-temp.js +0 -26
  47. package/dist/commands/platform-skills.generated.js +0 -19
  48. package/dist/commands/playable.js +0 -53
  49. package/dist/commands/tools-batch.js +0 -87
  50. package/dist/commands/video.js +0 -111
  51. package/dist/commands/workspace-runtime.js +0 -54
  52. package/dist/commands/workspace.js +0 -35
  53. package/dist/project-skills/builtin-import.js +0 -225
  54. package/dist/project-skills/commands.js +0 -77
  55. package/dist/project-skills/lifecycle.js +0 -28
  56. package/dist/project-skills/local-run.js +0 -112
  57. package/dist/project-skills/local-store.js +0 -221
  58. package/dist/project-skills/messages.js +0 -80
  59. package/dist/project-skills/reconcile.js +0 -62
  60. package/dist/project-skills/remote-cache.js +0 -51
  61. package/dist/project-skills/validation.js +0 -19
  62. package/dist/recording/messages.js +0 -40
  63. package/dist/recording/project-digest.js +0 -85
  64. package/dist/recording/recorder.js +0 -293
  65. package/dist/recording/scenario.js +0 -50
  66. package/dist/skill-registry/client.js +0 -345
  67. package/dist/skill-registry/commands.js +0 -180
  68. package/dist/skill-registry/evaluation-client.js +0 -156
  69. package/dist/skill-registry/evaluation-commands.js +0 -174
  70. package/dist/skill-registry/messages.js +0 -177
  71. package/dist/skill-registry/package.js +0 -275
  72. package/dist/skill-registry/platform-package.js +0 -100
  73. package/dist/utils/environment-endpoints.js +0 -17
  74. package/dist/utils/tool-operation-journal.js +0 -124
  75. package/dist/utils/video-evidence-git.js +0 -81
  76. package/dist/video-replication/client.js +0 -222
  77. package/dist/video-replication/comparison-evidence.js +0 -149
  78. package/dist/video-replication/comparison-files.js +0 -57
  79. package/dist/video-replication/comparison-log.js +0 -72
  80. package/dist/video-replication/comparison-messages.js +0 -104
  81. package/dist/video-replication/comparison-output.js +0 -63
  82. package/dist/video-replication/comparison-preflight.js +0 -66
  83. package/dist/video-replication/comparison.js +0 -216
  84. package/dist/video-replication/evidence.js +0 -165
  85. package/dist/video-replication/media.js +0 -111
  86. package/dist/video-replication/messages.js +0 -89
  87. package/dist/workspace/messages.js +0 -35
  88. package/dist/workspace/transfer-client.js +0 -174
  89. package/dist/workspace-runtime/codex/app-server.js +0 -1040
  90. package/dist/workspace-runtime/codex/compact.js +0 -46
  91. package/dist/workspace-runtime/codex/config-toml.js +0 -107
  92. package/dist/workspace-runtime/codex/jsonrpc-stdio.js +0 -145
  93. package/dist/workspace-runtime/codex/launcher-client.js +0 -177
  94. package/dist/workspace-runtime/codex/loopback.js +0 -146
  95. package/dist/workspace-runtime/codex/mcp-config.js +0 -39
  96. package/dist/workspace-runtime/codex/model-broker.js +0 -263
  97. package/dist/workspace-runtime/codex/native-adapter.js +0 -9
  98. package/dist/workspace-runtime/codex/permissions.js +0 -70
  99. package/dist/workspace-runtime/codex/thread-image.js +0 -38
  100. package/dist/workspace-runtime/codex/ui-instructions.js +0 -4
  101. package/dist/workspace-runtime/codex/ui-tools.js +0 -183
  102. package/dist/workspace-runtime/codex/work-mode.js +0 -15
  103. package/dist/workspace-runtime/main.js +0 -10
  104. package/dist/workspace-runtime/persistence/journal.js +0 -365
  105. package/dist/workspace-runtime/persistence/native-subagents.js +0 -162
  106. package/dist/workspace-runtime/persistence/sqlite-client.js +0 -77
  107. package/dist/workspace-runtime/persistence/sqlite-worker.js +0 -1161
  108. package/dist/workspace-runtime/persistence/stopped-execution.js +0 -77
  109. package/dist/workspace-runtime/previews/output.js +0 -36
  110. package/dist/workspace-runtime/previews/publish.js +0 -262
  111. package/dist/workspace-runtime/previews/single-file.js +0 -43
  112. package/dist/workspace-runtime/processes/managed-writes.js +0 -69
  113. package/dist/workspace-runtime/production/content-changes.js +0 -36
  114. package/dist/workspace-runtime/production/contracts.js +0 -19
  115. package/dist/workspace-runtime/production/controller.js +0 -218
  116. package/dist/workspace-runtime/production/dependencies.js +0 -60
  117. package/dist/workspace-runtime/production/native.js +0 -212
  118. package/dist/workspace-runtime/production/processes.js +0 -102
  119. package/dist/workspace-runtime/production/save-command.js +0 -35
  120. package/dist/workspace-runtime/production/source-archive.js +0 -137
  121. package/dist/workspace-runtime/production/source-copy.js +0 -91
  122. package/dist/workspace-runtime/production/stages.js +0 -334
  123. package/dist/workspace-runtime/production/storage.js +0 -75
  124. package/dist/workspace-runtime/serve.js +0 -214
  125. package/dist/workspace-runtime/server/auth.js +0 -21
  126. package/dist/workspace-runtime/server/connectivity.js +0 -201
  127. package/dist/workspace-runtime/server/desktop-host.js +0 -429
  128. package/dist/workspace-runtime/server/desktop-preview-config.js +0 -81
  129. package/dist/workspace-runtime/server/desktop-preview-service.js +0 -157
  130. package/dist/workspace-runtime/server/desktop-preview-static.js +0 -53
  131. package/dist/workspace-runtime/server/desktop-preview.js +0 -189
  132. package/dist/workspace-runtime/server/dispatch.js +0 -1217
  133. package/dist/workspace-runtime/server/endpoints.js +0 -21
  134. package/dist/workspace-runtime/server/execution-group.js +0 -90
  135. package/dist/workspace-runtime/server/http.js +0 -1243
  136. package/dist/workspace-runtime/server/lock.js +0 -53
  137. package/dist/workspace-runtime/server/rfb-watch-gate.js +0 -168
  138. package/dist/workspace-runtime/server/source-uploader.js +0 -138
  139. package/dist/workspace-runtime/server/terminal-host.js +0 -366
  140. package/dist/workspace-runtime/server/types.js +0 -1
  141. package/dist/workspace-runtime/server/workspace-transfer.js +0 -99
  142. package/dist/workspace-runtime/workspaces/archive.js +0 -207
  143. package/dist/workspace-runtime/workspaces/artifact-events.js +0 -55
  144. package/dist/workspace-runtime/workspaces/artifact-files.js +0 -197
  145. package/dist/workspace-runtime/workspaces/artifact-receipts.js +0 -89
  146. package/dist/workspace-runtime/workspaces/artifacts.js +0 -282
  147. package/dist/workspace-runtime/workspaces/attachment-content.js +0 -123
  148. package/dist/workspace-runtime/workspaces/attachments.js +0 -185
  149. package/dist/workspace-runtime/workspaces/batch-commit.js +0 -142
  150. package/dist/workspace-runtime/workspaces/cli-context.js +0 -23
  151. package/dist/workspace-runtime/workspaces/cli-credentials.js +0 -111
  152. package/dist/workspace-runtime/workspaces/composer-context.js +0 -147
  153. package/dist/workspace-runtime/workspaces/context-error.js +0 -2
  154. package/dist/workspace-runtime/workspaces/dependencies.js +0 -264
  155. package/dist/workspace-runtime/workspaces/developer-command.js +0 -64
  156. package/dist/workspace-runtime/workspaces/directories.js +0 -133
  157. package/dist/workspace-runtime/workspaces/directory-access.js +0 -37
  158. package/dist/workspace-runtime/workspaces/directory-attachments.js +0 -245
  159. package/dist/workspace-runtime/workspaces/directory-maintenance.js +0 -111
  160. package/dist/workspace-runtime/workspaces/directory-stats.js +0 -49
  161. package/dist/workspace-runtime/workspaces/disk-snapshot.js +0 -31
  162. package/dist/workspace-runtime/workspaces/empty-template.js +0 -42
  163. package/dist/workspace-runtime/workspaces/files-search.js +0 -116
  164. package/dist/workspace-runtime/workspaces/files.js +0 -138
  165. package/dist/workspace-runtime/workspaces/git-credential-broker.js +0 -312
  166. package/dist/workspace-runtime/workspaces/git-credential-helper.js +0 -68
  167. package/dist/workspace-runtime/workspaces/git-direct-store.js +0 -155
  168. package/dist/workspace-runtime/workspaces/git.js +0 -670
  169. package/dist/workspace-runtime/workspaces/instructions.js +0 -56
  170. package/dist/workspace-runtime/workspaces/json5-edit.js +0 -170
  171. package/dist/workspace-runtime/workspaces/library-attachments.js +0 -268
  172. package/dist/workspace-runtime/workspaces/optional-platform-skills.js +0 -14
  173. package/dist/workspace-runtime/workspaces/parameters.js +0 -272
  174. package/dist/workspace-runtime/workspaces/prepare.js +0 -278
  175. package/dist/workspace-runtime/workspaces/registry.js +0 -251
  176. package/dist/workspace-runtime/workspaces/remix-references.js +0 -301
  177. package/dist/workspace-runtime/workspaces/revisions.js +0 -31
  178. package/dist/workspace-runtime/workspaces/session-image.js +0 -104
  179. package/dist/workspace-runtime/workspaces/shared-git.js +0 -40
  180. package/dist/workspace-runtime/workspaces/skill-artifact-loader.js +0 -95
  181. package/dist/workspace-runtime/workspaces/skills.js +0 -191
  182. package/dist/workspace-runtime/workspaces/transfer.js +0 -288
  183. package/dist/workspace-runtime/workspaces/turn-changes.js +0 -75
  184. package/dist/workspace-runtime/workspaces/video-attachments.js +0 -49
  185. package/project-template/.claude/skills/playcraft-replica-validation/SKILL.md +0 -25
  186. package/project-template/.claude/skills/playcraft-replica-validation/references/contracts.md +0 -79
  187. package/project-template/.claude/skills/playcraft-video-understanding/SKILL.md +0 -29
  188. package/project-template/.claude/skills/playcraft-video-understanding/references/contracts.md +0 -37
  189. package/project-template-v2/.claude/agents/artist.md +0 -82
  190. package/project-template-v2/.claude/agents/developer.md +0 -153
  191. package/project-template-v2/.claude/agents/game-designer.md +0 -264
  192. package/project-template-v2/.claude/agents/refs/artist-art-style-catalog.md +0 -533
  193. package/project-template-v2/.claude/agents/refs/artist-color-audio-recipes.md +0 -153
  194. package/project-template-v2/.claude/agents/refs/artist-dimension-axis.md +0 -27
  195. package/project-template-v2/.claude/agents/refs/artist-master-composite-recipes.md +0 -208
  196. package/project-template-v2/.claude/agents/refs/atom-skill-library.md +0 -81
  197. package/project-template-v2/.claude/agents/refs/developer-impl-cookbook.md +0 -432
  198. package/project-template-v2/.claude/agents/refs/framework-5-component-filter.md +0 -252
  199. package/project-template-v2/.claude/agents/refs/framework-game-feel-juice.md +0 -266
  200. package/project-template-v2/.claude/agents/refs/framework-mda.md +0 -147
  201. package/project-template-v2/.claude/agents/refs/game-designer-gameplay-sufficiency.md +0 -123
  202. package/project-template-v2/.claude/agents/refs/ta-3d-flip-recipe.md +0 -88
  203. package/project-template-v2/.claude/agents/refs/ta-atlas-deliverable-standard.md +0 -67
  204. package/project-template-v2/.claude/agents/refs/ta-batch-pipeline-recipes.md +0 -120
  205. package/project-template-v2/.claude/agents/refs/ta-image-generation-detail.md +0 -300
  206. package/project-template-v2/.claude/agents/refs/ta-image-ops-reference.md +0 -495
  207. package/project-template-v2/.claude/agents/refs/ta-pipeline-cookbook.md +0 -1141
  208. package/project-template-v2/.claude/agents/refs/ta-tools-reference.md +0 -111
  209. package/project-template-v2/.claude/agents/refs/ta-vfx-preset-catalog.md +0 -365
  210. package/project-template-v2/.claude/agents/refs/threejs-cannon-pitfalls.md +0 -412
  211. package/project-template-v2/.claude/agents/reviewer.md +0 -75
  212. package/project-template-v2/.claude/agents/technical-artist.md +0 -86
  213. package/project-template-v2/.claude/hooks/snapshot-milestone.mjs +0 -243
  214. package/project-template-v2/.claude/hooks/user-prompt.mjs +0 -133
  215. package/project-template-v2/.claude/settings.json +0 -33
  216. package/project-template-v2/.claude/skills/brainstorming/SKILL.md +0 -161
  217. package/project-template-v2/.claude/skills/brainstorming/scripts/frame-template.html +0 -270
  218. package/project-template-v2/.claude/skills/brainstorming/scripts/helper.js +0 -177
  219. package/project-template-v2/.claude/skills/brainstorming/scripts/server.cjs +0 -354
  220. package/project-template-v2/.claude/skills/brainstorming/scripts/start-server.sh +0 -148
  221. package/project-template-v2/.claude/skills/brainstorming/scripts/stop-server.sh +0 -56
  222. package/project-template-v2/.claude/skills/brainstorming/scripts/wait-for-selection.sh +0 -62
  223. package/project-template-v2/.claude/skills/brainstorming/spec-document-reviewer-prompt.md +0 -49
  224. package/project-template-v2/.claude/skills/brainstorming/visual-companion.md +0 -309
  225. package/project-template-v2/.claude/skills/playcraft-ad-psychology/SKILL.md +0 -182
  226. package/project-template-v2/.claude/skills/playcraft-art-style-guide/SKILL.md +0 -123
  227. package/project-template-v2/.claude/skills/playcraft-asset-state-sheet/SKILL.md +0 -205
  228. package/project-template-v2/.claude/skills/playcraft-audio-generation/SKILL.md +0 -280
  229. package/project-template-v2/.claude/skills/playcraft-batch-pipeline/SKILL.md +0 -184
  230. package/project-template-v2/.claude/skills/playcraft-build-optimizer/SKILL.md +0 -306
  231. package/project-template-v2/.claude/skills/playcraft-image-generation/SKILL.md +0 -298
  232. package/project-template-v2/.claude/skills/playcraft-image-generation/reference/build-sprite-sheet.template.mjs +0 -123
  233. package/project-template-v2/.claude/skills/playcraft-image-generation/reference/compare-style.template.mjs +0 -254
  234. package/project-template-v2/.claude/skills/playcraft-image-generation/reference/gen-batch-sprite.template.mjs +0 -324
  235. package/project-template-v2/.claude/skills/playcraft-image-generation/reference/gen-batch.template.mjs +0 -97
  236. package/project-template-v2/.claude/skills/playcraft-image-generation/reference/gen-edit-variants.template.mjs +0 -118
  237. package/project-template-v2/.claude/skills/playcraft-image-generation/reference/process-batch.template.mjs +0 -137
  238. package/project-template-v2/.claude/skills/playcraft-image-generation/reference/prompt-cookbook.md +0 -397
  239. package/project-template-v2/.claude/skills/playcraft-image-generation/reference/validate-sprite-sheet.template.mjs +0 -296
  240. package/project-template-v2/.claude/skills/playcraft-image-ops/SKILL.md +0 -122
  241. package/project-template-v2/.claude/skills/playcraft-image-processing/SKILL.md +0 -219
  242. package/project-template-v2/.claude/skills/playcraft-masking/SKILL.md +0 -373
  243. package/project-template-v2/.claude/skills/playcraft-playable-optimization/SKILL.md +0 -161
  244. package/project-template-v2/.claude/skills/playcraft-research/SKILL.md +0 -215
  245. package/project-template-v2/.claude/skills/playcraft-skill-recommender/SKILL.md +0 -382
  246. package/project-template-v2/.claude/skills/playcraft-sprite-generation/SKILL.md +0 -423
  247. package/project-template-v2/.claude/skills/playcraft-sprite-remix/SKILL.md +0 -158
  248. package/project-template-v2/.claude/skills/playcraft-sprite-sheet/SKILL.md +0 -100
  249. package/project-template-v2/.claude/skills/playcraft-storyboard/SKILL.md +0 -167
  250. package/project-template-v2/.claude/skills/playcraft-style-qa/SKILL.md +0 -270
  251. package/project-template-v2/.claude/skills/playcraft-text-rendering/SKILL.md +0 -236
  252. package/project-template-v2/.claude/skills/playcraft-vfx-animation/SKILL.md +0 -130
  253. package/project-template-v2/.claude/skills/playwright-cli/SKILL.md +0 -390
  254. package/project-template-v2/.claude/skills/playwright-cli/references/element-attributes.md +0 -23
  255. package/project-template-v2/.claude/skills/playwright-cli/references/playwright-tests.md +0 -39
  256. package/project-template-v2/.claude/skills/playwright-cli/references/request-mocking.md +0 -87
  257. package/project-template-v2/.claude/skills/playwright-cli/references/running-code.md +0 -240
  258. package/project-template-v2/.claude/skills/playwright-cli/references/session-management.md +0 -226
  259. package/project-template-v2/.claude/skills/playwright-cli/references/spec-driven-testing.md +0 -308
  260. package/project-template-v2/.claude/skills/playwright-cli/references/storage-state.md +0 -275
  261. package/project-template-v2/.claude/skills/playwright-cli/references/test-generation.md +0 -134
  262. package/project-template-v2/.claude/skills/playwright-cli/references/tracing.md +0 -142
  263. package/project-template-v2/.claude/skills/playwright-cli/references/video-recording.md +0 -153
  264. package/project-template-v2/.claude/skills/session-analyzer/SKILL.md +0 -386
  265. package/project-template-v2/.claude/skills/session-analyzer/scripts/execution-breakdown.mjs +0 -182
  266. package/project-template-v2/.claude/skills/session-analyzer/scripts/find-turns.mjs +0 -72
  267. package/project-template-v2/.claude/skills/session-analyzer/scripts/heavy-output.mjs +0 -121
  268. package/project-template-v2/.claude/skills/session-analyzer/scripts/resolve-session.mjs +0 -102
  269. package/project-template-v2/.claude/skills/session-analyzer/scripts/subagent-stats.mjs +0 -127
  270. package/project-template-v2/.claude/skills/session-analyzer/scripts/subagent-tool-timeline.mjs +0 -106
  271. package/project-template-v2/.claude/skills/session-analyzer/scripts/time-gaps.mjs +0 -128
  272. package/project-template-v2/.claude/skills/session-analyzer/scripts/turn-timeline.mjs +0 -67
  273. package/project-template-v2/.claude/snapshot.mjs +0 -263
  274. package/project-template-v2/.playcraft/skills.lock.json +0 -152
  275. package/project-template-v2/CLAUDE.md +0 -146
  276. package/project-template-v2/assets/audio/bgm/.gitkeep +0 -0
  277. package/project-template-v2/assets/audio/sfx/.gitkeep +0 -0
  278. package/project-template-v2/assets/bundles/.gitkeep +0 -0
  279. package/project-template-v2/assets/images/bg/.gitkeep +0 -0
  280. package/project-template-v2/assets/images/reference/.gitkeep +0 -0
  281. package/project-template-v2/assets/images/storyboard/.gitkeep +0 -0
  282. package/project-template-v2/assets/images/tiles/.gitkeep +0 -0
  283. package/project-template-v2/assets/images/ui/.gitkeep +0 -0
  284. package/project-template-v2/assets/images/vfx/.gitkeep +0 -0
  285. package/project-template-v2/assets/models/.gitkeep +0 -0
  286. package/project-template-v2/docs/harness/iteration-1/context-flow.md +0 -254
  287. package/project-template-v2/docs/harness/iteration-1/generate-flow.md +0 -91
  288. package/project-template-v2/docs/harness/iteration-1/ideate-flow.md +0 -214
  289. package/project-template-v2/docs/harness/iteration-1/optimize-flow.md +0 -75
  290. package/project-template-v2/docs/harness/iteration-1/wrapup-flow.md +0 -63
  291. package/project-template-v2/docs/harness/iteration-2/context-flow.md +0 -223
  292. package/project-template-v2/docs/harness/iteration-2/generate-flow.md +0 -129
  293. package/project-template-v2/docs/harness/iteration-2/ideate-flow.md +0 -267
  294. package/project-template-v2/docs/harness/iteration-2/optimize-flow.md +0 -164
  295. package/project-template-v2/docs/harness/iteration-2/wrapup-flow.md +0 -115
  296. package/project-template-v2/docs/harness/orchestrator-flow.md +0 -364
  297. package/project-template-v2/docs/project-state.json +0 -60
  298. package/project-template-v2/docs/project-state.md +0 -72
  299. package/project-template-v2/docs/standards/README.md +0 -225
  300. package/project-template-v2/docs/standards/agent-behavior-standards.md +0 -174
  301. package/project-template-v2/docs/standards/artifacts/design-brief.md +0 -19
  302. package/project-template-v2/docs/standards/artifacts/design.md +0 -22
  303. package/project-template-v2/docs/standards/artifacts/game-code.md +0 -41
  304. package/project-template-v2/docs/standards/artifacts/todo-list.md +0 -41
  305. package/project-template-v2/docs/standards/iter1-agent-behavior-standards.md +0 -343
  306. package/project-template-v2/game/index.ts +0 -18
  307. package/project-template-v2/globals.d.ts +0 -51
  308. package/project-template-v2/index.css +0 -34
  309. package/project-template-v2/index.html +0 -18
  310. package/project-template-v2/main.ts +0 -9
  311. package/project-template-v2/package.json +0 -46
  312. package/project-template-v2/skills/_shared/scripts/dispatch-clear.mjs +0 -31
  313. package/project-template-v2/skills/_shared/scripts/dispatch-set.mjs +0 -86
  314. package/project-template-v2/skills/_shared/scripts/dod-check.mjs +0 -153
  315. package/project-template-v2/skills/_shared/scripts/handoff-append.mjs +0 -70
  316. package/project-template-v2/skills/_shared/scripts/lib/validator-artifacts.mjs +0 -91
  317. package/project-template-v2/skills/_shared/scripts/pipeline/dod-config.mjs +0 -131
  318. package/project-template-v2/skills/_shared/scripts/pipeline/index.mjs +0 -80
  319. package/project-template-v2/skills/_shared/scripts/pipeline/iteration-1-core.mjs +0 -90
  320. package/project-template-v2/skills/_shared/scripts/pipeline/iteration-2-wrap.mjs +0 -93
  321. package/project-template-v2/skills/_shared/scripts/pipeline/iteration-3-visual.mjs +0 -23
  322. package/project-template-v2/skills/_shared/scripts/render-project-state.mjs +0 -230
  323. package/project-template-v2/skills/_shared/scripts/state-advance-stage.mjs +0 -58
  324. package/project-template-v2/skills/_shared/scripts/state-get.mjs +0 -339
  325. package/project-template-v2/skills/_shared/scripts/state-handoff.mjs +0 -39
  326. package/project-template-v2/skills/_shared/scripts/state-set.mjs +0 -94
  327. package/project-template-v2/skills/_shared/scripts/state-store.mjs +0 -783
  328. package/project-template-v2/skills/_shared/scripts/todo-add.mjs +0 -88
  329. package/project-template-v2/skills/_shared/scripts/todo-get.mjs +0 -130
  330. package/project-template-v2/skills/_shared/scripts/todo-remove.mjs +0 -33
  331. package/project-template-v2/skills/_shared/scripts/todo-set.mjs +0 -47
  332. package/project-template-v2/skills/_shared/scripts/verify-asset-code-sync.mjs +0 -268
  333. package/project-template-v2/skills/_shared/scripts/verify-env.mjs +0 -285
  334. package/project-template-v2/skills/_shared/scripts/verify-placeholders.mjs +0 -161
  335. package/project-template-v2/skills/playable-autoplay/SKILL.md +0 -176
  336. package/project-template-v2/skills/playable-autoplay/agents/openai.yaml +0 -4
  337. package/project-template-v2/skills/playable-debug/SKILL.md +0 -116
  338. package/project-template-v2/skills/playable-debug/agents/openai.yaml +0 -4
  339. package/project-template-v2/skills/playable-debug/references/debug-config.md +0 -40
  340. package/project-template-v2/skills/playable-record/SKILL.md +0 -140
  341. package/project-template-v2/skills/playable-record/scripts/lib/dev-server.mjs +0 -104
  342. package/project-template-v2/skills/playable-record/scripts/lib/record-audio-bridge.js +0 -141
  343. package/project-template-v2/skills/playable-record/scripts/record-playable.mjs +0 -425
  344. package/project-template-v2/skills/playable-record/scripts/verify-contract.mjs +0 -261
  345. package/project-template-v2/skills/playable-record/scripts/verify-firstwin.mjs +0 -398
  346. package/project-template-v2/skills/playable-record/scripts/verify-fusion.mjs +0 -322
  347. package/project-template-v2/skills/playable-record/scripts/verify-lifecycle.mjs +0 -105
  348. package/project-template-v2/skills/playable-record/scripts/verify-vlm-video.mjs +0 -230
  349. package/project-template-v2/skills/playable-validate/SKILL.md +0 -61
  350. package/project-template-v2/skills/playable-validate/validation-rules.md +0 -14
  351. package/project-template-v2/skills/playable-verify-ui/SKILL.md +0 -63
  352. package/project-template-v2/skills/playable-verify-ui/scripts/lib/__init__.py +0 -1
  353. package/project-template-v2/skills/playable-verify-ui/scripts/lib/config_expr.js +0 -218
  354. package/project-template-v2/skills/playable-verify-ui/scripts/lib/node_utils.js +0 -51
  355. package/project-template-v2/skills/playable-verify-ui/scripts/lib/profile_loader.py +0 -59
  356. package/project-template-v2/skills/playable-verify-ui/scripts/lib/report.py +0 -106
  357. package/project-template-v2/skills/playable-verify-ui/scripts/lib/runtime_contract.js +0 -116
  358. package/project-template-v2/skills/playable-verify-ui/scripts/verify_fetch_antipatterns.py +0 -59
  359. package/project-template-v2/skills/playable-verify-ui/scripts/verify_hardcoded_layout.js +0 -64
  360. package/project-template-v2/skills/playable-verify-ui/scripts/verify_runtime_contract.js +0 -58
  361. package/project-template-v2/skills/playable-verify-ui/scripts/verify_text_overlap.py +0 -333
  362. package/project-template-v2/ta-workspace/scripts/.gitkeep +0 -0
  363. package/project-template-v2/tsconfig.json +0 -20
  364. package/project-template-v2/vite.config.ts +0 -27
  365. package/project-templates/batch-locks/phaser.yaml +0 -922
  366. package/project-templates/batch-locks/threejs.yaml +0 -978
  367. package/project-templates/empty/AGENTS.md +0 -41
  368. package/project-templates/empty/gitignore +0 -33
@@ -1,130 +0,0 @@
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
- - 体积预算分配参考
@@ -1,390 +0,0 @@
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)
@@ -1,23 +0,0 @@
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
- ```
@@ -1,39 +0,0 @@
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.
@@ -1,87 +0,0 @@
1
- # Request Mocking
2
-
3
- Intercept, mock, modify, and block network requests.
4
-
5
- ## CLI Route Commands
6
-
7
- ```bash
8
- # Mock with custom status
9
- playwright-cli route "**/*.jpg" --status=404
10
-
11
- # Mock with JSON body
12
- playwright-cli route "**/api/users" --body='[{"id":1,"name":"Alice"}]' --content-type=application/json
13
-
14
- # Mock with custom headers
15
- playwright-cli route "**/api/data" --body='{"ok":true}' --header="X-Custom: value"
16
-
17
- # Remove headers from requests
18
- playwright-cli route "**/*" --remove-header=cookie,authorization
19
-
20
- # List active routes
21
- playwright-cli route-list
22
-
23
- # Remove a route or all routes
24
- playwright-cli unroute "**/*.jpg"
25
- playwright-cli unroute
26
- ```
27
-
28
- ## URL Patterns
29
-
30
- ```
31
- **/api/users - Exact path match
32
- **/api/*/details - Wildcard in path
33
- **/*.{png,jpg,jpeg} - Match file extensions
34
- **/search?q=* - Match query parameters
35
- ```
36
-
37
- ## Advanced Mocking with run-code
38
-
39
- For conditional responses, request body inspection, response modification, or delays:
40
-
41
- ### Conditional Response Based on Request
42
-
43
- ```bash
44
- playwright-cli run-code "async page => {
45
- await page.route('**/api/login', route => {
46
- const body = route.request().postDataJSON();
47
- if (body.username === 'admin') {
48
- route.fulfill({ body: JSON.stringify({ token: 'mock-token' }) });
49
- } else {
50
- route.fulfill({ status: 401, body: JSON.stringify({ error: 'Invalid' }) });
51
- }
52
- });
53
- }"
54
- ```
55
-
56
- ### Modify Real Response
57
-
58
- ```bash
59
- playwright-cli run-code "async page => {
60
- await page.route('**/api/user', async route => {
61
- const response = await route.fetch();
62
- const json = await response.json();
63
- json.isPremium = true;
64
- await route.fulfill({ response, json });
65
- });
66
- }"
67
- ```
68
-
69
- ### Simulate Network Failures
70
-
71
- ```bash
72
- playwright-cli run-code "async page => {
73
- await page.route('**/api/offline', route => route.abort('internetdisconnected'));
74
- }"
75
- # Options: connectionrefused, timedout, connectionreset, internetdisconnected
76
- ```
77
-
78
- ### Delayed Response
79
-
80
- ```bash
81
- playwright-cli run-code "async page => {
82
- await page.route('**/api/slow', async route => {
83
- await new Promise(r => setTimeout(r, 3000));
84
- route.fulfill({ body: JSON.stringify({ data: 'loaded' }) });
85
- });
86
- }"
87
- ```