@playcraft/cli 0.0.57 → 0.0.58
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 +34 -16
- package/dist/cli-root-help.js +1 -0
- package/dist/commands/build-all.js +10 -9
- package/dist/commands/build.js +13 -12
- package/dist/commands/create.js +26 -33
- package/dist/commands/platform-skills.generated.js +19 -0
- package/dist/commands/skills.js +2 -0
- package/dist/commands/tools-generation.js +1 -1
- package/dist/commands/workspace-runtime.js +54 -0
- package/dist/index.js +3 -1
- package/dist/project-skills/commands.js +72 -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 +149 -0
- package/dist/project-skills/messages.js +72 -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/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/utils/agent-api-client.js +54 -17
- package/dist/utils/tool-operation-journal.js +54 -0
- package/dist/workspace-runtime/codex/app-server.js +395 -0
- package/dist/workspace-runtime/codex/config-toml.js +25 -0
- package/dist/workspace-runtime/codex/jsonrpc-stdio.js +106 -0
- package/dist/workspace-runtime/codex/loopback.js +59 -0
- package/dist/workspace-runtime/codex/native-adapter.js +3 -0
- package/dist/workspace-runtime/main.js +10 -0
- package/dist/workspace-runtime/persistence/journal.js +350 -0
- package/dist/workspace-runtime/processes/managed-writes.js +69 -0
- package/dist/workspace-runtime/serve.js +111 -0
- package/dist/workspace-runtime/server/auth.js +21 -0
- package/dist/workspace-runtime/server/dispatch.js +861 -0
- package/dist/workspace-runtime/server/execution-group.js +88 -0
- package/dist/workspace-runtime/server/http.js +561 -0
- package/dist/workspace-runtime/server/lock.js +53 -0
- package/dist/workspace-runtime/server/types.js +1 -0
- package/dist/workspace-runtime/workspaces/context-error.js +2 -0
- package/dist/workspace-runtime/workspaces/file-snapshot.js +213 -0
- package/dist/workspace-runtime/workspaces/files.js +143 -0
- package/dist/workspace-runtime/workspaces/git.js +242 -0
- package/dist/workspace-runtime/workspaces/json5-edit.js +170 -0
- package/dist/workspace-runtime/workspaces/parameters.js +272 -0
- package/dist/workspace-runtime/workspaces/prepare.js +364 -0
- package/dist/workspace-runtime/workspaces/registry.js +107 -0
- package/dist/workspace-runtime/workspaces/revisions.js +31 -0
- package/package.json +4 -1
- 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 +280 -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 +298 -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 +324 -0
- package/project-template-v2/.claude/skills/playcraft-image-generation/reference/gen-batch.template.mjs +97 -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 +137 -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/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 +219 -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/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
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: playcraft-research
|
|
3
|
+
description: PlayCraft 网络研究协议。当本地 Skill 库不足以覆盖需求时触发——包括遇到陌生玩法机制、不熟悉的美术风格、特定音频类型、算法实现参考、需要图片参考等场景。使用 playcraft tools research / fetch-url / search-image 命令(统一鉴权,无需配置额外 key)直接搜索网络,将研究成果融入活 DAG。
|
|
4
|
+
triggers: 本地skill不够,没有现成skill,找不到参考,不了解这个风格,不熟悉这个玩法,陌生机制,需要调研,搜索参考,互联网搜索,研究,需要图片参考,找参考图,视觉参考
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# PlayCraft 网络研究协议
|
|
8
|
+
|
|
9
|
+
## 可用工具(统一鉴权,无需额外配置)
|
|
10
|
+
|
|
11
|
+
使用 PlayCraft CLI 提供的三个搜索工具:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# 文本研究 — Gemini + Google Search grounding,返回综合答案 + 引用来源
|
|
15
|
+
playcraft tools research --query "<问题>" [--focus <领域>] [--json]
|
|
16
|
+
|
|
17
|
+
# 读取 URL — Gemini 理解指定页面内容,返回结构化摘要
|
|
18
|
+
playcraft tools fetch-url --url "<URL>" [--query "<具体问题>"] [--json]
|
|
19
|
+
|
|
20
|
+
# 图片搜索 — Unsplash / Pexels 高质量图库,返回可直接用于 --reference-image 的 URL
|
|
21
|
+
playcraft tools search-image --query "<关键词(建议英文)>" [--source unsplash|pexels|auto] [--count 6] [--orientation landscape|portrait|square] [--json]
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
`--focus` 参数(research 命令):`gameplay` | `visual` | `audio` | `code` | `compliance`
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## 何时使用网络研究
|
|
29
|
+
|
|
30
|
+
**先本地,再网络**。网络研究是本地 Skill 发现的补充,不是替代。
|
|
31
|
+
|
|
32
|
+
| 场景 | 应做什么 |
|
|
33
|
+
| ------------------------------------------- | ------------------------------------------------------------- |
|
|
34
|
+
| `playcraft skills match` 完整匹配 | 直接用,无需研究 |
|
|
35
|
+
| 部分匹配,缺少细节 | 用本地 Skill,补充网络研究缺失部分 |
|
|
36
|
+
| 完全无匹配 | **触发 `research` 文本研究** |
|
|
37
|
+
| 遇到陌生专业名词 | **触发 `research` 文本研究** |
|
|
38
|
+
| 需要最新数据(2024+ 最佳实践) | **触发 `research` 文本研究** |
|
|
39
|
+
| 需要视觉参考图(Phase 1 概念图 / 风格探索) | **触发 `search-image` 图片搜索** |
|
|
40
|
+
| 生成后不满意,想用参考图引导风格 | **触发 `search-image` → 结果 URL 直接传 `--reference-image`** |
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## 各角色研究标准流程
|
|
45
|
+
|
|
46
|
+
### Game Designer — 玩法机制调研
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# 理解陌生的玩法类型
|
|
50
|
+
playcraft tools research \
|
|
51
|
+
--query "match-3 mobile game level design best practices difficulty curve" \
|
|
52
|
+
--focus gameplay --json
|
|
53
|
+
|
|
54
|
+
# 了解可玩广告设计原则
|
|
55
|
+
playcraft tools research \
|
|
56
|
+
--query "playable ad game mechanics player retention 15 seconds hook" \
|
|
57
|
+
--focus gameplay --json
|
|
58
|
+
|
|
59
|
+
# 读取具体设计文章
|
|
60
|
+
playcraft tools fetch-url \
|
|
61
|
+
--url "https://www.gamedeveloper.com/design/..." \
|
|
62
|
+
--query "what are the key level design parameters"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Artist — 视觉/音频风格调研
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# 搜索艺术风格生成参数
|
|
69
|
+
playcraft tools research \
|
|
70
|
+
--query "pixel art 8-bit game sprite limited color palette generation prompt keywords" \
|
|
71
|
+
--focus visual --json
|
|
72
|
+
|
|
73
|
+
# 读取调色板数据库
|
|
74
|
+
playcraft tools fetch-url \
|
|
75
|
+
--url "https://lospec.com/palette-list/..." \
|
|
76
|
+
--query "what are the exact hex colors and style characteristics"
|
|
77
|
+
|
|
78
|
+
# 搜索音频风格
|
|
79
|
+
playcraft tools research \
|
|
80
|
+
--query "chiptune BGM game music BPM range instruments characteristics" \
|
|
81
|
+
--focus audio --json
|
|
82
|
+
|
|
83
|
+
# ── 图片搜索(新增)─────────────────────────────────────────────────────────
|
|
84
|
+
|
|
85
|
+
# 搜索视觉参考图(用于 Phase 1 风格探索)
|
|
86
|
+
playcraft tools search-image \
|
|
87
|
+
--query "pixel art 8-bit forest game background" \
|
|
88
|
+
--source pexels --orientation portrait --json
|
|
89
|
+
|
|
90
|
+
# 搜索元素参考图(用于指导具体 asset 生成)
|
|
91
|
+
playcraft tools search-image \
|
|
92
|
+
--query "cute cartoon fruit character icon game UI" \
|
|
93
|
+
--count 4 --json
|
|
94
|
+
|
|
95
|
+
# 将搜索结果 URL 直接用作参考图(无需先下载)
|
|
96
|
+
playcraft tools generate-image \
|
|
97
|
+
--prompt "pixel art forest background, 8-bit style, limited color palette" \
|
|
98
|
+
--reference-image "https://images.unsplash.com/photo-xxxxx" \
|
|
99
|
+
--output assets/images/bg/background.png \
|
|
100
|
+
--aspect-ratio 9:16
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
> **关键提示**:`search-image` 返回的 `downloadUrl` 字段可直接传给 `--reference-image`,CLI 会自动下载,无需手动保存。`--json` 模式返回结构化列表,方便批量选用。
|
|
104
|
+
|
|
105
|
+
### Developer — 算法/技术实现调研
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
# 搜索具体实现
|
|
109
|
+
playcraft tools research \
|
|
110
|
+
--query "A* pathfinding javascript tile map Phaser 3 implementation performance" \
|
|
111
|
+
--focus code --json
|
|
112
|
+
|
|
113
|
+
# 读取官方文档
|
|
114
|
+
playcraft tools fetch-url \
|
|
115
|
+
--url "https://phaser.io/docs/3.60.0/Phaser.Physics.html" \
|
|
116
|
+
--query "how does StaticGroup work with tilemap collision"
|
|
117
|
+
|
|
118
|
+
# 搜索性能优化
|
|
119
|
+
playcraft tools research \
|
|
120
|
+
--query "Phaser 3 60fps mobile performance sprite batch rendering optimization" \
|
|
121
|
+
--focus code --json
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Reviewer — 质量标准调研
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
# 平台合规要求
|
|
128
|
+
playcraft tools research \
|
|
129
|
+
--query "Google Ads playable ad HTML5 policy requirements file size 2026" \
|
|
130
|
+
--focus compliance --json
|
|
131
|
+
|
|
132
|
+
# 读取最新政策文档
|
|
133
|
+
playcraft tools fetch-url \
|
|
134
|
+
--url "https://support.google.com/google-ads/answer/..." \
|
|
135
|
+
--query "what are the technical requirements for playable ads"
|
|
136
|
+
|
|
137
|
+
# 性能基准
|
|
138
|
+
playcraft tools research \
|
|
139
|
+
--query "web game 60fps performance budget mobile device HTML5 2025" \
|
|
140
|
+
--focus compliance --json
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## 研究结果融入活 DAG
|
|
146
|
+
|
|
147
|
+
研究结果**必须写入 `atom-tree.md`**,否则其他 Agent 无法从中受益。
|
|
148
|
+
|
|
149
|
+
### 写入格式
|
|
150
|
+
|
|
151
|
+
```markdown
|
|
152
|
+
<!-- 写入 atom-tree.md 的 `Execution Context` 或 `Revision Notes` -->
|
|
153
|
+
|
|
154
|
+
### {{atom_id}} — {{slot_name}}
|
|
155
|
+
|
|
156
|
+
- **本地 Skill**:无匹配(playcraft skills match 返回 0 结果)
|
|
157
|
+
- **文本研究结论**(若执行了 research / fetch-url):
|
|
158
|
+
- 命令:`playcraft tools research --query "..." --focus visual --json`
|
|
159
|
+
- 核心发现:{{1-3 句话,具体且可操作}}
|
|
160
|
+
- 关键参数:{{数值、关键词、具体配置}}
|
|
161
|
+
- 引用来源:{{URL}}
|
|
162
|
+
- **图片参考**(若执行了 search-image):
|
|
163
|
+
- 命令:`playcraft tools search-image --query "..." --json`
|
|
164
|
+
- 选用图片:{{description}} — {{downloadUrl}}
|
|
165
|
+
- 使用方式:作为 `--reference-image` 传入生成命令
|
|
166
|
+
- **实现/生成决策**:{{基于研究的具体方案}}
|
|
167
|
+
- **候选新 Skill**:`{{建议名称}}.{{bundleType}}` — {{为什么值得沉淀}}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### 示例:Artist 研究波普艺术 + 搜图参考
|
|
171
|
+
|
|
172
|
+
```markdown
|
|
173
|
+
### bg_atom — 背景图层
|
|
174
|
+
|
|
175
|
+
- 本地 Skill:无匹配
|
|
176
|
+
- 文本研究结论:
|
|
177
|
+
- 命令:`playcraft tools research --query "pop art game sprite color palette" --focus visual --json`
|
|
178
|
+
- 核心发现:波普艺术使用 4-6 色高饱和调色板,粗黑轮廓线,网点图案填充
|
|
179
|
+
- 关键参数:饱和度 >80%,互补色对比,轮廓线 3-5px
|
|
180
|
+
- 引用来源:lospec.com/palette-list/pop-art
|
|
181
|
+
- 图片参考:
|
|
182
|
+
- 命令:`playcraft tools search-image --query "pop art colorful bold graphic background" --source unsplash --json`
|
|
183
|
+
- 选用图片:Bold geometric pop art composition — https://images.unsplash.com/photo-xxxxx
|
|
184
|
+
- 使用方式:`--reference-image "https://images.unsplash.com/photo-xxxxx"`
|
|
185
|
+
- 生成决策:
|
|
186
|
+
- prompt: "pop art style, bold black outlines, halftone dots, vivid colors, {{element}}"
|
|
187
|
+
- style: "vibrant, graphic, flat colors, 1960s comic style"
|
|
188
|
+
- reference: 上方 Unsplash URL(CLI 自动下载)
|
|
189
|
+
- 候选新 Skill:`pop_art_sprite.aiimage`
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## "候选新 Skill" 贡献循环
|
|
195
|
+
|
|
196
|
+
每次网络研究形成可复用方案,在 `atom-tree.md` 的 **Revision Notes** 标注:
|
|
197
|
+
|
|
198
|
+
```markdown
|
|
199
|
+
### Revision N — {{Agent}} (propose-skill)
|
|
200
|
+
|
|
201
|
+
- **atomId**: {{atom_id}}
|
|
202
|
+
- **reason**: 本地无 Skill,通过网络研究形成可复用方案
|
|
203
|
+
- **change**: 建议创建:`{{skill_name}}.{{bundleType}}` — {{描述}},来源:{{URL}}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## 研究质量检查
|
|
209
|
+
|
|
210
|
+
| 检查项 | 要求 |
|
|
211
|
+
| -------------------------- | --------------------------------------------------------------------- |
|
|
212
|
+
| **来源可信度** | 优先官方文档、行业权威;引用来源来自 `--json` 输出的 `citations` 字段 |
|
|
213
|
+
| **信息时效** | 优先 2024-2026 年内容(在 query 中加年份可提高准确性) |
|
|
214
|
+
| **可操作性** | 结论必须直接用于生成参数或代码,不能泛泛而谈 |
|
|
215
|
+
| **与 StyleDirection 一致** | 视觉研究须与 design-brief 的 StyleDirection 对齐 |
|
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: playcraft-skill-recommender
|
|
3
|
+
description: 构建项目前的 Skill 推荐与脚手架工具。在开始任何新游戏项目前必须先调用,根据引擎(threejs/phaser)和意图关键词,自动推荐完整的代码 skill 集合(含引擎层/布局层/输入层/渲染层/动画层/玩法层)和媒体资产(背景图/BGM/SFX/UI 面板),并生成可直接执行的 scaffold 命令。
|
|
4
|
+
triggers: 构建新游戏项目, 选择 skill, 查找可用组件, 3D项目搭建, Three.js项目, Phaser项目
|
|
5
|
+
compatibility: agent,opencode
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# playcraft-skill-recommender
|
|
9
|
+
|
|
10
|
+
## 作用
|
|
11
|
+
|
|
12
|
+
解决 Agent 遗漏已有 skill 的根本问题:**在构建任何项目之前,先运行此命令,获取完整推荐清单,再动手写代码。**
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 按场景选择命令
|
|
17
|
+
|
|
18
|
+
| 你的场景 | 推荐命令 | 说明 |
|
|
19
|
+
| --------------------------- | -------------------- | --------------------------------------- |
|
|
20
|
+
| 开始新项目,需要完整推荐 | `match` | 按引擎+意图输出依赖树+媒体候选 |
|
|
21
|
+
| 探索库里有什么玩法/能力 | `gettags` → `filter` | 先看有哪些 tag,再按 tag 筛选 |
|
|
22
|
+
| 知道需要什么类型的组件 | `filter` | 按 tags/keywords/category 精确查找 |
|
|
23
|
+
| 想深入了解某个 skill | `read` | 输出完整 SKILL.md |
|
|
24
|
+
| 了解 skill 包含哪些文件资产 | `inspect` | 文件清单 + 用途描述(含图集格式) |
|
|
25
|
+
| 生成 Atom 引入中间文件 | `init-atom-tree` | 运行 match 并写入 `docs/atom-tree.json` |
|
|
26
|
+
| 选择 atom | `select-atom` | 追加 `meta.selectedAtoms` 并补齐硬依赖 |
|
|
27
|
+
| 将 skill 文件落地到项目 | `scaffold` | 复制 ref/ 文件到项目目录 |
|
|
28
|
+
| 让 Agent/IDE 持续感知 skill | `link` | 在 .claude/skills/ 创建符号链接 |
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 命令详解
|
|
33
|
+
|
|
34
|
+
### 1. `match` — 推荐完整 skill 集合(新项目首选)
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# 自动推断引擎
|
|
38
|
+
playcraft skills match --intent "<关键词,逗号分隔>" --json
|
|
39
|
+
|
|
40
|
+
# 指定引擎
|
|
41
|
+
playcraft skills match --engine <threejs|phaser> --intent "<关键词>" --json
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**适用时机**:你已经知道要做什么类型的游戏,需要一次性获取完整的技术栈推荐。
|
|
45
|
+
|
|
46
|
+
**输出结构**:
|
|
47
|
+
|
|
48
|
+
- 代码 skill(按层排序:引擎层 → 布局层 → 场景层 → 输入层 → 渲染层 → 动画层 → 玩法层 → UI层)
|
|
49
|
+
- 媒体资产候选(按 bindingRole 分组:背景图、BGM、SFX、面板等,每组多个候选任选其一)
|
|
50
|
+
- Scaffold 快捷命令(可直接复制执行)
|
|
51
|
+
|
|
52
|
+
**示例**:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# 三消游戏
|
|
56
|
+
playcraft skills match --intent "match3,grid,tile,eliminate" --json
|
|
57
|
+
|
|
58
|
+
# 麻将收集消除
|
|
59
|
+
playcraft skills match --intent "mahjong,tile,match,stacking,puzzle" --json
|
|
60
|
+
|
|
61
|
+
# Three.js 3D 棋盘
|
|
62
|
+
playcraft skills match --engine threejs --intent "board,3d,path,animation" --json
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
### 2. `gettags` — 发现库里有哪些标签
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# 看 gameplay 类 skill 有哪些 tag
|
|
71
|
+
playcraft skills gettags --category gameplay --json
|
|
72
|
+
|
|
73
|
+
# 看所有 tag
|
|
74
|
+
playcraft skills gettags --json
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**适用时机**:你不确定库里有什么,想先了解标签空间,再决定怎么筛选。
|
|
78
|
+
|
|
79
|
+
**输出**:去重排序的 tag 列表。
|
|
80
|
+
|
|
81
|
+
**典型用法**(启发阶段):
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# Step 1: 看 gameplay 下有什么玩法标签
|
|
85
|
+
playcraft skills gettags --category gameplay --json
|
|
86
|
+
# → ["billiards","casual","core","eliminate","grid","match3","physics","puzzle","stacking",...]
|
|
87
|
+
|
|
88
|
+
# Step 2: 发现 "billiards" 标签,筛选相关 skill
|
|
89
|
+
playcraft skills filter --category gameplay --tags billiards --json
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
### 3. `getkeywords` — 发现库里有哪些关键词
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
playcraft skills getkeywords --category gameplay --json
|
|
98
|
+
playcraft skills getkeywords --json
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**适用时机**:当 tag 维度找不到想要的内容时,keywords 覆盖同义词、中文词、行为动词等补充检索维度。
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
### 4. `filter` — 多维度精确筛选
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
playcraft skills filter --tags "<tag1,tag2>" [--keywords "<kw1,kw2>"] [--category "<cat>"] [--role "<role>"] [--and] [--json]
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**参数说明**:
|
|
112
|
+
|
|
113
|
+
| 参数 | 作用 | 默认行为 |
|
|
114
|
+
| ------------ | ----------------------------------------------------------- | ------------------ |
|
|
115
|
+
| `--tags` | 按 manifest.tags 匹配 | OR(命中任一即可) |
|
|
116
|
+
| `--keywords` | 按 manifest.keywords 匹配 | OR |
|
|
117
|
+
| `--category` | 按 manifest.category 过滤(逗号分隔多选) | OR |
|
|
118
|
+
| `--role` | 按 manifest.bindingRoles 匹配(逗号分隔) | OR |
|
|
119
|
+
| `--and` | 维度内改为 AND(必须同时命中所有) | 不加则 OR |
|
|
120
|
+
| `--json` | 输出详细 JSON(含 label, tags, bindingRoles, gameplayType) | 无则文本格式 |
|
|
121
|
+
|
|
122
|
+
**维度间关系**:跨维度始终是 AND — 即 `--tags match3 --category gameplay` 要求同时满足 tag 含 match3 且 category 是 gameplay。
|
|
123
|
+
|
|
124
|
+
**`--json` 输出格式**:
|
|
125
|
+
|
|
126
|
+
```json
|
|
127
|
+
[
|
|
128
|
+
{
|
|
129
|
+
"atomId": "match3_core.aigameplay",
|
|
130
|
+
"category": "gameplay",
|
|
131
|
+
"bundleType": "aigameplay",
|
|
132
|
+
"mode": "fixed",
|
|
133
|
+
"label": { "zh": "三消核心玩法", "en": "Match-3 core gameplay" },
|
|
134
|
+
"tags": ["gameplay", "match3", "casual", "grid", "eliminate", "core"],
|
|
135
|
+
"bindingRoles": ["gameplayRule"],
|
|
136
|
+
"gameplayType": "match3"
|
|
137
|
+
}
|
|
138
|
+
]
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**示例**:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
# 找所有 gameplay 类的 puzzle 相关 skill
|
|
145
|
+
playcraft skills filter --category gameplay --tags puzzle --json
|
|
146
|
+
|
|
147
|
+
# 找同时有 phaser 和 animation 标签的 skill
|
|
148
|
+
playcraft skills filter --tags "phaser,animation" --and --json
|
|
149
|
+
|
|
150
|
+
# 找 match3 相关的所有东西(跨 category)
|
|
151
|
+
playcraft skills filter --tags match3 --json
|
|
152
|
+
|
|
153
|
+
# 找含 "台球" 关键词的 skill(中文搜索)
|
|
154
|
+
playcraft skills filter --keywords "台球" --json
|
|
155
|
+
|
|
156
|
+
# 找所有 UI 组件
|
|
157
|
+
playcraft skills filter --category ui --json
|
|
158
|
+
|
|
159
|
+
# 按 role 查找:谁能扮演 "背景音乐" 角色
|
|
160
|
+
playcraft skills filter --role bgMusic --json
|
|
161
|
+
|
|
162
|
+
# 按 role 查找:谁能扮演 "贴图集" 角色
|
|
163
|
+
playcraft skills filter --role tileTextureSet --json
|
|
164
|
+
|
|
165
|
+
# 组合:找 gameplay 中声明了 gameplayRule 角色的 skill
|
|
166
|
+
playcraft skills filter --category gameplay --role gameplayRule --json
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
### 4.1 理解 Role(bindingRole)
|
|
172
|
+
|
|
173
|
+
**Role 是什么**:每个 skill 可以声明它能扮演的"语义角色"(`manifest.bindingRoles`)。Role 回答的是"这个 skill 在依赖图中能填什么槽位"。
|
|
174
|
+
|
|
175
|
+
**典型场景**:`match` 推荐结果中的 `mediaGroups` 按 role 分组展示候选。当你想替换某个候选或查看同 role 下还有哪些选择时,用 `filter --role` 查询。
|
|
176
|
+
|
|
177
|
+
**常见 role 举例**:
|
|
178
|
+
|
|
179
|
+
| role | 含义 | 典型 provider |
|
|
180
|
+
| ---------------------- | --------------- | ------------------------------------------------ |
|
|
181
|
+
| `bgMusic` | 背景音乐 | `calm_piano`, `cheerful_ukulele`, `bg_music` |
|
|
182
|
+
| `tileTextureSet` | 牌面/瓦片贴图集 | `candy_tile`, `fruit_tile`, `tile-sheets-normal` |
|
|
183
|
+
| `backgroundTexture` | 场景背景图 | `forest`, `castle`, `game-backgrounds` |
|
|
184
|
+
| `gameplayRule` | 玩法规则实现 | `match3_core`, `car_parking`, `eight_ball_pool` |
|
|
185
|
+
| `successFeedbackPanel` | 胜利面板 | `win_result_panel` |
|
|
186
|
+
| `failFeedbackPanel` | 失败面板 | `lose_result_panel` |
|
|
187
|
+
|
|
188
|
+
**操作流程(role 替换)**:
|
|
189
|
+
|
|
190
|
+
```
|
|
191
|
+
① match --json → 看到 mediaGroups 中某个 role 的候选
|
|
192
|
+
② 对候选不满意 → filter --role <role> --json → 查看该 role 的所有 provider
|
|
193
|
+
③ read <想用的 atomId> → 确认适合
|
|
194
|
+
④ 通过 `select-atom` 将选中的 atomId 写入 atom-tree.json 的 `meta.selectedAtoms` shortlist
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
### 5. `read` — 深读某个 skill 的完整文档
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
playcraft skills read "<atomId>"
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
**适用时机**:已经确定要用某个 skill,需要了解其 API、配置项、集成方式。
|
|
206
|
+
|
|
207
|
+
**示例**:
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
playcraft skills read "match3_core.aigameplay"
|
|
211
|
+
playcraft skills read "tile-slot-storage-phaser"
|
|
212
|
+
playcraft skills read "countdown-ui-phaser"
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
### 5.1 `inspect` — 查看 skill 的文件资产清单
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
playcraft skills inspect "<atomId>" # 人读格式
|
|
221
|
+
playcraft skills inspect "<atomId>" --json # JSON 格式
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
**适用时机**:`read` 之前想先快速确认这个 skill 包了什么文件、图片资产的格式和使用方式,而不必读完整个 SKILL.md。尤其对包含图集、spritesheet、多文件资产的 skill 有用。
|
|
225
|
+
|
|
226
|
+
**输出两个区块**:
|
|
227
|
+
|
|
228
|
+
- **Scaffold 文件**:`scaffold` 命令会复制的路径列表(dest → source → mode)
|
|
229
|
+
- **Files 列表**:skill 内所有登记文件的路径 + 用途说明(含图集裁切方式、运行时使用注意等)
|
|
230
|
+
|
|
231
|
+
**示例**:
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
# 了解台球场景 skill 包含哪些图集和资产
|
|
235
|
+
playcraft skills inspect billiards-shot-scene-phaser
|
|
236
|
+
|
|
237
|
+
# 了解 Phaser 引擎骨架包含哪些文件
|
|
238
|
+
playcraft skills inspect phaser.aicomponent --json
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
### 6. `scaffold` — 将 ref 文件复制到项目
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
playcraft skills scaffold \
|
|
247
|
+
--engine <threejs|phaser> \
|
|
248
|
+
--atoms <atomId1,atomId2,...> \
|
|
249
|
+
--out ./src \
|
|
250
|
+
[--dry-run] [--force]
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
**scaffold 语义**:scaffold 不是临时代码草稿。文件一旦落地,就成为当前项目 runtime 的实现基座。后续 developer 应优先 `adopt-scaffold` / `configure-scaffold` / `extend-scaffold`,只有在任务卡的 `scaffoldValue` 与实际代码不匹配时才 `use-as-reference` 或 `reject-for-slice`,并在 handoff 记录原因。不要一边保留 scaffold 文件,一边静默重写同一能力。
|
|
254
|
+
|
|
255
|
+
**命令输出**:
|
|
256
|
+
|
|
257
|
+
- `--dry-run` 与实际执行都会打印每个文件的 `source → dest`,例如 `ref/BoardLayout.ts → game/scenes/GameUI/BoardLayout.ts`。
|
|
258
|
+
- 如果 atom 有硬依赖,会打印 `[import-link] [当前 atom] 依赖 atom -> skill 目录`,用于提醒后续还要读依赖 skill。
|
|
259
|
+
- 实际执行会生成或更新 `docs/scaffold-manifest.md`,记录本次 scaffold 的 atom 与落地文件。
|
|
260
|
+
|
|
261
|
+
**developer 摄入规则**:
|
|
262
|
+
|
|
263
|
+
- 开始实现时,如果 `docs/scaffold-manifest.md` 存在或在 dispatch `requiredContext` 中,先读它,再读对应 `.claude/skills/<atomId>/SKILL.md`、关键 `ref/` 源码和已落地文件。
|
|
264
|
+
- `docs/scaffold-manifest.md` 当前主要记录 atom 和目标文件;若需要确认来源文件、mode 或依赖,使用 context 阶段留下的任务卡 `sourceOfTruth`,或回看 `playcraft skills inspect <atomId>` / scaffold 输出。
|
|
265
|
+
- scaffold 后继续编码前,必须重新读取落地文件。落地文件是当前项目现实,`ref/` 是来源真相,二者都不能被未读重写。
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
### 7. `init-atom-tree` / `select-atom` — 维护 Atom 引入中间文件
|
|
270
|
+
|
|
271
|
+
```bash
|
|
272
|
+
# 先由推荐器运行 match,生成 docs/atom-tree.json 的 meta.skillsMatch 快照
|
|
273
|
+
playcraft skills init-atom-tree --intent "<genre,core-action,feedback>" --engine <phaser|threejs>
|
|
274
|
+
|
|
275
|
+
# 从 meta.skillsMatch.items 里选择要进入本项目的 atom,逗号分隔可批量
|
|
276
|
+
playcraft skills select-atom --id "<atomId1,atomId2>"
|
|
277
|
+
|
|
278
|
+
# 校验选择集合,然后把 selectedAtoms link 到 .claude/skills/
|
|
279
|
+
playcraft skills validate-atom-tree-selection
|
|
280
|
+
playcraft skills link --from-atom-tree --prune
|
|
281
|
+
|
|
282
|
+
# 可选:生成人读指南 docs/atom-tree.md
|
|
283
|
+
playcraft skills gen-atom-tree-md
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
**适用时机**:context 阶段需要把 design 结果和 Skill 推荐固化成 Atom 引入链路时。atom-tree 是中间产物,用于完成 atom 的选择、link、模板初始化和 scaffold,不承载任务计划、执行日志或 handoff 状态。
|
|
287
|
+
|
|
288
|
+
**输出结构**:
|
|
289
|
+
|
|
290
|
+
- `docs/atom-tree.json`:Atom 引入中间文件,包含 `meta.engineDecision`、`meta.skillsMatch`、`meta.selectedAtoms`;应由本命令族维护,避免手写完整 JSON (JavaScript Object Notation, JavaScript 对象表示法)。
|
|
291
|
+
- `docs/atom-tree.md`:可选人读 companion,由 `gen-atom-tree-md` 生成,只用于辅助阅读,不作为第二份真源。
|
|
292
|
+
|
|
293
|
+
`meta.skillsMatch` 由 `init-atom-tree` 写入;`meta.selectedAtoms` 由 `select-atom` 写入,是 `link --from-atom-tree` 和 `remix init-template --from-atom-tree` 的输入。
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
### 8. `link` — 创建符号链接(IDE 感知)
|
|
298
|
+
|
|
299
|
+
```bash
|
|
300
|
+
playcraft skills link --atoms <atomId1,atomId2,...> [--prune]
|
|
301
|
+
playcraft skills link --from-atom-tree --prune
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
**输出位置**:
|
|
305
|
+
|
|
306
|
+
- 每个 selected atom 会链接到项目内 `.claude/skills/<atomId>/`。
|
|
307
|
+
- 链接清单写入 `.claude/skills/.playcraft-dag-links.json`。
|
|
308
|
+
- 下游 developer 应优先读取项目内 `.claude/skills/<atomId>/SKILL.md` 与 `.claude/skills/<atomId>/ref/...`;`playcraft skills read/inspect` 只作为链接缺失时的兜底。
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## 推荐算法说明
|
|
313
|
+
|
|
314
|
+
### 代码 skill 匹配
|
|
315
|
+
|
|
316
|
+
打分规则(满足任意条件累加,阈值 >= 8 进入推荐):
|
|
317
|
+
|
|
318
|
+
| 信号 | 分值 | 说明 |
|
|
319
|
+
| ----------------------------- | ----- | ---------------------- |
|
|
320
|
+
| `engineVariants[engine]` 存在 | +15 | 有该引擎的专属变体文件 |
|
|
321
|
+
| `renderBackend` 包含该引擎 | +15 | 声明支持该引擎 |
|
|
322
|
+
| `tags` 包含引擎名 | +8 | 标签匹配 |
|
|
323
|
+
| 每个 intent 标签命中 `tags` | +3/个 | 意图相关 |
|
|
324
|
+
| `imports` 中依赖该引擎 skill | +5 | 直接依赖链 |
|
|
325
|
+
|
|
326
|
+
依赖图遍历时,优先使用 `engineVariants[engine].imports`(引擎-aware),避免把其他引擎的依赖拉进来。
|
|
327
|
+
|
|
328
|
+
### 媒体资产匹配
|
|
329
|
+
|
|
330
|
+
媒体 skill(`.aiimage` / `.aiaudio` / `.aiconfig`)通过 `bindingRoles` 分组:
|
|
331
|
+
|
|
332
|
+
- 有 `bindingRoles` 的 skill → 按 role 分组,同 role 多个 = 候选项(任选其一)
|
|
333
|
+
- 无 `bindingRoles` 但有 `background` tag → 归入"背景图"候选组
|
|
334
|
+
- 无 `bindingRoles` 但有 `bgm` tag → 归入"背景音乐"备选
|
|
335
|
+
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
## 工作流指南
|
|
339
|
+
|
|
340
|
+
### 流程 A:新项目(从零开始)
|
|
341
|
+
|
|
342
|
+
```
|
|
343
|
+
① match → ② inspect 各个 skill(了解包含哪些文件) → ③ read 各个 skill(深读 API) → ④ 在 todo 写 scaffoldValue / sourceOfTruth → ⑤ scaffold → ⑥ developer 读 scaffold-manifest 和落地文件后编码
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
### 流程 B:启发探索(不确定做什么)
|
|
347
|
+
|
|
348
|
+
```
|
|
349
|
+
① gettags --category gameplay → 了解有哪些玩法类型
|
|
350
|
+
② filter --category gameplay --tags <感兴趣的> --json → 看相关 skill 列表
|
|
351
|
+
③ read <某个 aigameplay skill> → 深入了解规则和变体
|
|
352
|
+
④ 决定方向后 → match --intent <确定的关键词> → 获取完整推荐
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
### 流程 C:中途查找(开发中需要某个能力)
|
|
356
|
+
|
|
357
|
+
```
|
|
358
|
+
① filter --tags <能力关键词> --json → 找到候选
|
|
359
|
+
② inspect <atomId> → 快速确认文件资产
|
|
360
|
+
③ read <atomId> → 确认 API 和用法
|
|
361
|
+
④ 判断 scaffoldValue 是否服务当前 slice → ⑤ scaffold/link → 落地 → ⑥ 读 scaffold-manifest 和落地文件后集成
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
---
|
|
365
|
+
|
|
366
|
+
## Skill 目录发现优先级
|
|
367
|
+
|
|
368
|
+
1. `--skills-dir <path>` 参数
|
|
369
|
+
2. `AGENT_SKILLS_PATHS` 环境变量(逗号分隔)
|
|
370
|
+
3. `<cwd>/node_modules/@playcraft/skills/playcraft-skills`(项目安装的 skills 包)
|
|
371
|
+
4. `<CLI包>/../../../skills/playcraft-skills`(monorepo 开发时自动发现)
|
|
372
|
+
|
|
373
|
+
---
|
|
374
|
+
|
|
375
|
+
## Agent 禁止事项
|
|
376
|
+
|
|
377
|
+
- ❌ 未运行 `skills match` 就开始写引擎/布局/输入/渲染代码
|
|
378
|
+
- ❌ 手动猜测 skill 名称(如只搜到 `phaser.aicomponent` 就开始,忽略 `grid_board_layout`)
|
|
379
|
+
- ❌ 对已有 ref 文件重新实现相同功能
|
|
380
|
+
- ❌ 使用 `filter` 找到 skill 后不 `read` 就直接引用(先了解 API 再使用)
|
|
381
|
+
- ❌ scaffold 含图集/多帧资产的 skill 前不 `inspect`(会误解图集格式和裁切方式)
|
|
382
|
+
- ❌ scaffold 后不读 `docs/scaffold-manifest.md` 和落地文件,直接另写一套同能力实现
|