chore: freeze v1.1.3 filing submission build (60 levels, full-screen safe layout)

This commit is contained in:
fannyxl committed 2026-11-25 23:14:45 +08:00
commit 96c19dca82
174 files changed
+37935

No files matched your search

@@ -0,0 +1,24 @@
{
"schemaVersion": 2,
"skillId": "cocos-mcp-workflow",
"skillName": "funplay-cocos-mcp-workflow",
"templateVersion": 4,
"templateHash": "80d0dda747fe5ed422d851db7b550af6802bfe61289f915a4ff1b95b2c059f5a",
"installedHash": "80d0dda747fe5ed422d851db7b550af6802bfe61289f915a4ff1b95b2c059f5a",
"files": {
"SKILL.md": {
"templateHash": "80d0dda747fe5ed422d851db7b550af6802bfe61289f915a4ff1b95b2c059f5a",
"installedHash": "80d0dda747fe5ed422d851db7b550af6802bfe61289f915a4ff1b95b2c059f5a"
},
"references/project-readiness.md": {
"templateHash": "e5fb0ffc4320f6b108cc0f852124b7dd3f6f0acadd9c5d552a3f58f8ddf3b141",
"installedHash": "e5fb0ffc4320f6b108cc0f852124b7dd3f6f0acadd9c5d552a3f58f8ddf3b141"
},
"references/project-identity-and-input.md": {
"templateHash": "5d2e1490645031a8fe16fb43526f3749002b723c45b656f1ea4925c1ec5d6daa",
"installedHash": "5d2e1490645031a8fe16fb43526f3749002b723c45b656f1ea4925c1ec5d6daa"
}
},
"extensionVersion": "0.7.6",
"updatedAt": "2026-11-23T08:36:02.340Z"
}
@@ -0,0 +1,65 @@
---
name: funplay-cocos-mcp-workflow
description: "Edit, inspect, validate, preview, and debug Cocos Creator projects through Funplay Cocos MCP. Use when working with scenes, nodes, prefabs, assets, TypeScript, logs, screenshots, preview behavior, runtime state, or MCP connectivity."
---
# Funplay Cocos MCP Workflow
## Instructions
## Operating Loop
1. Establish context.
- Before writes, independently match the intended project to initialize.funplay.context; do not adopt whichever server answered. For old endpoints, reconnects, or frame-paced gestures, read [project identity and input](references/project-identity-and-input.md).
- Read `cocos://project/context` or call `get_editor_state` before assuming the project, active scene, MCP URL, selection, visible windows, or tool profile.
- Inspect the active scene with `get_scene_info` and `get_hierarchy`; use `get_selection`, `list_scenes`, `list_assets`, or `list_prefabs` when identity or ownership is unclear.
- Treat user-provided node and asset names as hints. Resolve the real hierarchy path, node UUID, asset UUID, or `db://assets/...` URL before editing.
- Call `get_tool_catalog` when a required tool may be hidden by the `core`, `full`, or custom exposure profile.
2. Choose the edit surface.
- Edit TypeScript and ordinary project files with repository tools or the MCP file tools, then refresh the affected asset and run diagnostics.
- Edit live scene nodes with focused scene/component tools or `execute_javascript` using `context="scene"`; save the scene when the change must persist.
- Use `execute_javascript` with `context="editor"` for asset-db, Editor messages, project orchestration, and filesystem work that belongs in the editor process.
- Inspect prefab ownership and references before mutation. Prefer focused prefab tools, or edit a verified linked instance and apply it back through the editor workflow.
- Preserve an existing UI or gameplay prefab hierarchy and change only the necessary nodes, components, and serialized fields; do not rebuild the entire prefab unless explicitly requested.
3. Execute the smallest coherent change.
- Prefer one guarded `execute_javascript` operation for tightly related editor work, but use focused tools when they provide clearer validation or safer arguments.
- Keep JavaScript safety checks enabled unless the code and its paths were reviewed explicitly.
- Null-check every scene, node, component, asset, and filesystem lookup. Return concise structured before/after values, including stable UUIDs or asset URLs where useful.
- Save or refresh only the assets and scenes intentionally changed.
- Do not guess alternate paths, silently create replacement objects, or run self-healing fallback loops after a missing reference or unsupported editor message.
4. Read back and validate.
- Re-inspect the exact node, component, prefab instance, or asset after mutation; a successful command response alone is not proof of the final editor state.
- Run `run_script_diagnostics` or `get_script_diagnostic_context` after TypeScript changes, then use `validate_scene` and project logs before claiming success.
- For visual or runtime work, run the appropriate browser, Game View, or simulator preview and verify with runtime state, input, logs, and screenshots.
- State exactly what was verified and what still requires a native build, device, network, store, or manual check.
## Scene, Prefab, and Asset Safety
- Do not treat Cocos `.scene`, `.prefab`, or `.meta` files as ordinary text. Prefer scene-process, prefab, and asset-db operations that preserve UUID references and editor import state.
- If `edit_prefab_json` is used, target a verified prefab path and the smallest exact JSON path or literal replacement, then run `validate_prefab_references` and inspect the result.
- Before structural prefab work, call `inspect_prefab`; for scene instances, call `inspect_prefab_instance` and choose deliberately between apply and revert.
- Replacing a prefab at the same path can keep the asset UUID while changing internal object IDs and breaking serialized references, animation tracks, nested prefab links, and scene overrides.
- Inspect dependencies with `inspect_asset_dependencies` and validate them with `validate_asset_dependencies` before and after sensitive asset changes.
- Never copy a `.meta` file when duplicating an asset. Use `duplicate_prefab` or asset-db operations so the new asset receives its own UUID.
## Tool Exposure and Execution Contexts
- The default `core` profile exposes the main inspection, diagnostics, logs, screenshots, scene, asset, and unified JavaScript workflow.
- The `full` profile adds focused mutation tools for nodes, components, prefabs, UI, runtime control, input simulation, files, and project preview.
- If a named tool is unavailable under a custom profile, adapt to the exposed catalog and report the missing capability instead of pretending it ran.
- In scene context, use the Cocos runtime and scene APIs for live hierarchy and component work. In editor context, use `Editor` APIs and messages for asset-db and extension orchestration.
- Use `execute_scene_script` and `execute_editor_script` only as compatibility entrypoints; prefer `execute_javascript` with an explicit context for new workflows.
## Readiness and Preview Evidence
- For imports, scripts, preview startup, calibrated input, or persistence checks, read [project readiness](references/project-readiness.md). Do not load this conditional reference for an unrelated inspection.
- `check_asset_ready` checks stable AssetDB identity, not script compilation or runtime loading. Discover its exposure before use.
- `get_runtime_state` describes the editor Game View and toolbar, not browser/simulator runtime or edit-scene counters.
- Read `get_recent_logs` or `search_project_logs` for relevant errors. Do not clear persistent logs without explicit confirmation.
## Failure Handling
- If MCP is unreachable, limit claims to safe filesystem inspection or code edits; do not claim scene, prefab, editor, preview, or runtime verification.
- If a node lookup is ambiguous, return the matching paths and UUIDs and choose only after identifying the user-visible or prefab-owned target.
- If editor readback and serialized text disagree, trust editor and asset-db readback first and investigate whether the wrong asset, scene instance, or stale import was inspected.
- Fix diagnostics or new error logs caused by the change before visual or runtime validation.
@@ -0,0 +1,21 @@
# Project identity and frame-paced input
## Before editing through MCP
Generated connections use /mcp/project/<project-id>/ on the existing project port. Independently compare initialize.funplay.context.project_path and project_id to the user's intended project. Context metadata identifies an extension/Editor lifetime, not authentication or permission to edit another project.
Legacy / and /mcp addresses still support initialization and exposed read-only tools. Mutating tools require expected_context from that verified initialization, either as a tool argument or params._meta.expected_context. A project-scoped URL binds the project; an explicit expected_context also pins the extension/Editor instance. Missing, wrong-project, conflicting or stale pins execute nothing. Never automatically fetch a token from an arbitrary responding server just to bypass a rejection.
Prefer reconfiguration from MCP Server's existing connection/Skills notice, then reconnect or restart the client. Existing user edits remain protected. Unreadable client files need review; unrelated entries and historical shared entries are not silently deleted. A reload can invalidate the instance pin and calibrated screenshots even while the port remains the same. Read fresh identity and capture again; never replay a mutation solely to get a cleaner reply.
## Frame-paced mouse drag (Full profile)
Use this only when a drag test is requested and the originating input tool is exposed. Keep legacy timing for existing steps/stepDelayMs callers. For a new frame-paced gesture, capture the exact target, use coordinateSpace=image-pixels with its captureId, and choose a unique requestKey. Set timing=frame-paced and supply startX/startY/endX/endY from that PNG. durationMs is 50..10000 (default 600); pressHoldMs and endHoldMs are 0..2000 (default 100). Each edge still gets separate renderer frames at zero hold. Do not mix legacy step timing with these fields.
The tool waits up to waitMs (default 1200), then may return a running receipt. Read it through the SAME tool with action=status and jobId or requestKey; cancel through action=cancel without coordinates. A retained identical start recovers its original receipt and never dispatches the gesture again. Changed arguments conflict. Only the latest 32 receipts are retained; these are not durable transactions across eviction/reload. A missing receipt requires inspection of the resulting state, not an automatic retry with a new key. The preview wrapper and direct mouse-drag tool have separate ownership; do not change custom exposure lists to access another tool's receipts.
Frame-paced input observes the captured Electron renderer's requestAnimationFrame callbacks. Native Game View pause/stop state is checked separately; renderer progression does not prove that native game Update advanced or a game accepted the gesture. Receipts deliberately report nativeGameUpdateVerified=false and businessOutcomeVerified=false. Compare authored state, actual preview/game state and fresh screenshots independently. This is mouse input, not touch injection or proof of physical-device provenance.
Focus loss, stale geometry, stalled frames, cancellation, preview pause/stop and extension shutdown interrupt the job. Only its own mouse release is attempted, without business callbacks or a legacy fallback. Cleanup failure leaves the target window locked; explicitly cancel that job to retry cleanup. Status reads never send input. No background/focus policy, preview pause state, project input setting or dependency is automatically changed.
Sources: [MCP transport](https://modelcontextprotocol.io/specification/2025-11-25/basic/transports), [Electron input](https://www.electronjs.org/docs/latest/api/web-contents#contentssendinputeventinputevent) and [Creator Director](https://docs.cocos.com/creator/3.8/api/en/class/Director).
@@ -0,0 +1,26 @@
# Project, import, and preview readiness
## Asset and script changes
- Resolve the exact AssetDB UUID or db:// URL. Refresh only the changed source assets; do not guess an extension or silently substitute another asset.
- Import is asynchronous. If exposed, use `check_asset_ready` with the exact target after refresh/import and before assigning the asset or attaching its script. A stable imported UUID/URL identity is not proof that the importer queue is empty, TypeScript compiled, or the preview loaded those bytes.
- `check_asset_ready` is a Full-profile read-only tool. Discover exposure with `get_tool_catalog`; do not change a custom allowlist without authorization. If unavailable, query exact asset info and report the narrower evidence instead of claiming full readiness.
- After TypeScript edits, run `run_script_diagnostics` and inspect import/preview errors. Its no-emit compiler result is separate from Creator's compilation and preview loading.
- A zero-wait readiness query is one observation, not stable readiness. Busy, missing, importing, timeout, unavailable, and unknown results are not success. Wait within a bounded budget or report the unresolved state; never repeat a mutation to obtain a cleaner response.
- Check APIs against the actual Creator version and loaded project components, not only a package.json declaration. Preserve existing dependencies and project conventions.
## Preview evidence
- Query `get_preview_mode` before choosing browser, editor Game View, or simulator. Browser `localUrl` is same-host; `networkUrl` is Creator's LAN address.
- `get_runtime_state`, pause, and resume address the editor Game View and its native toolbar. They do not inspect external browser/simulator runtime state. Edit-scene director counters and time scale are not Game View state.
- A listening MCP server, opened window, non-empty screenshot, current scene drawing, and correct business behavior are different claims. Verify only the layers relevant to the user's request and identify missing evidence.
- Use `capture_scene_screenshot` for editor Scene composition and Game/preview capture for game output. For real pointer testing, bind `simulate_mouse_click` or drag to the returned `captureId` with `coordinateSpace="image-pixels"`; use coordinates from that exact image.
- Recapture after a resize, zoom, reload, scene change, or stale-capture rejection. Do not scale coordinates from an unrelated/resized reference image yourself. Button event emission tests handlers but does not prove hit testing, clipping, focus, or occlusion.
- If an input reports an unknown outcome, inspect the resulting state before deciding on another action. Do not automatically resend it. Restore only temporary state owned by this task; preserve user changes.
## Persistence
- Prefer scene-process, prefab, and AssetDB tools for .scene/.prefab/.meta changes. A successful native message alone does not prove saved content or preserved UUID links.
- Reinspect the exact object and relevant serialized references, save only the requested changes, and reopen when persistence matters. Keep incomplete checks explicit.
Sources: [Creator messages](https://docs.cocos.com/creator/3.8/manual/en/editor/extension/messages.html) and [asset workflow](https://docs.cocos.com/creator/3.8/manual/en/asset/asset-workflow.html).