with one click
cocos2d-cli
用户提供 UI 截图并要求生成白盒预制体时,使用此技能
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
用户提供 UI 截图并要求生成白盒预制体时,使用此技能
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Iterate plans or implementations through fresh reviewer subagents until convergence. Use when the user explicitly asks for a "fresh reviewer loop", "plan iteration loop", "review and critique until clean", "spin up a reviewer to review my changes", or any phrasing where the goal is delegated adversarial review-then-fix cycles either on a plan before code or on a working implementation after code. Each round uses a new subagent so it has no prior-round context or groupthink.
通过企查查 OpenAPI 查询中国企业的工商、股东、司法、经营、知识产权、招投标、舆情等数据。当用户说"查 XX 公司"、"看 XX 的工商/股东/有没有官司/有没有被执行/有没有商标专利/有没有经营异常"、"XX 是不是空壳"、"XX 法人是谁"、"XX 注册资本"、"查企查查"、"查企业"等任何企业信息查询需求时,使用此技能。已注册 45 个商业接口(用户需自行在企查查后台逐个申请开通)。零依赖纯 Python,跨平台 Mac/Windows/Linux。
Use this skill when the user is working with LyteNyte Grid (@1771technologies/lytenyte-pro or @1771technologies/lytenyte-core), a headless React data grid. Activate for tasks like: installing or licensing the grid, configuring columns or rows, building cell renderers or editors, adding filters or sort controls, grouping or aggregating rows, pivoting, exporting to CSV/Excel/Parquet/Arrow, row selection, cell range selection, theming or styling, TypeScript GridSpec patterns, server-side or tree data, and any PRO component (SmartSelect, PillManager, Menu, Dialog, TreeView, RowGroupCell). Also activate when the user describes grid problems without naming the package — e.g. "my rows won't group", "cells aren't editable", "add a loading overlay", "pin this column", "the filter isn't working", "how do I export this table", "select a range of cells", "copy cells to clipboard".
Design websites and applications that AI agents can consume, navigate, and interact with. Use when building any site, app, or product that agents will use as an end-user — not just crawl or index. Covers semantic structure, accessibility-as-agent-interface, machine-readable data, API-first patterns, and the emerging protocols (llms.txt, MCP, NLWeb, A2UI) that make sites agent-ready. Triggers on: agent-friendly, agent-readable, agent-accessible, AX, agent experience, agentic web, dual-interface, machine-readable, llms.txt, MCP integration, NLWeb, accessibility tree, ARIA for agents, structured data, JSON-LD, Schema.org, API-first design, build for agents, agent-ready.
Design system for AI agents that build UI. Automatically routes to the right quality checks based on the task. Triggers on ANY visual, frontend, UI, design, component, page, layout, or styling work. Includes: anti-pattern detection, state completeness checks, accessibility verification, typography/color/spacing guidance, and creative direction when needed. Install this one skill to get the full system — it orchestrates everything else.
Core pack — always active for visual work. Quality gate for UI, components, pages, layouts, or frontend work. Triggers on any visual/design task automatically. Use before presenting work, during builds, and for design QA.
| name | cocos2d-cli |
| description | 用户提供 UI 截图并要求生成白盒预制体时,使用此技能 |
Cocos Creator CLI 工具,支持通过 JSON 描述生成预制体/场景,以及截图预览。
JSON 描述 → screenshot 预览 → 迭代调整 → create-prefab 生成
# 预览 JSON 效果
npx cocos2d-cli screenshot panel.json
# 生成预制体
npx cocos2d-cli create-prefab panel.json assets/Panel.prefab
当用户输入一张图,并要求“生成白盒预制体”时,执行下面这个闭环流程,而不是直接一次性输出 prefab。
先分析 UI 截图
生成第一版 JSON
sprite 表示背景、卡片、按钮、图片占位、分组块label 或 richText 表示标题、正文、说明文字Root、Header、Panel、Title、Desc、BtnConfirm使用 CLI 对 JSON 截图
npx cocos2d-cli screenshot <json文件> ...对比截图与原图
如果有差异,修改 JSON
anchorX、width、horizontalAlign再次截图,继续对比
从最终 JSON 生成 prefab
npx cocos2d-cli create-prefab <json文件> <输出.prefab>screenshot 预览收到 UI 截图 + “生成白盒预制体”
→ 分析 UI 截图
→ 生成 first-pass JSON
→ 保存为 json 文件
→ 执行 screenshot
→ 对比截图与原图
→ 如果仍有明显差异,则修改 JSON 并再次 screenshot
→ 如果已无明显差异,则执行 create-prefab
{
"name": "节点名称",
"width": 400,
"height": 300,
"x": 0,
"y": 0,
"anchorX": 0.5,
"anchorY": 0.5,
"color": "#336699",
"opacity": 255,
"components": [
"sprite",
{ "type": "label", "string": "文本", "fontSize": 32, "horizontalAlign": "left" },
{ "type": "richText", "string": "普通<color=#ff0000>红色</color>文字", "fontSize": 28 }
],
"children": []
}
| 属性 | 类型 | 说明 |
|---|---|---|
| name | string | 节点名称,显示在编辑器层级中 |
| x, y | number | 相对于父节点中心的偏移(见坐标系说明) |
| width, height | number | 节点宽高 |
| anchorX, anchorY | number (0-1) | 锚点,默认 0.5 表示中心 |
| color | string (#RRGGBB) | 节点颜色,影响 Sprite 填充/Label 文字色 |
| opacity | number (0-255) | 透明度 |
| rotation | number | 旋转角度(度) |
| scaleX, scaleY | number | 缩放 |
| active | boolean | 是否激活 |
| components | array | 组件列表(见组件说明) |
| children | array | 子节点列表(递归) |
Cocos 默认锚点在节点中心(anchorX=0.5, anchorY=0.5),x/y 是相对父节点中心的偏移。
计算示例:父节点宽 660,子节点宽 150,要靠左留 30px 边距
x = -(660/2) + 30 + (150/2) = -225
靠左/靠右布局推荐写法(使用 anchorX + horizontalAlign):
// 靠左对齐文字:节点锚点设为左边,文字对齐设为 left
{
"anchorX": 0,
"x": -330,
"width": 300,
"components": [
{ "type": "label", "string": "打款人", "horizontalAlign": "left" }
]
}
// 靠右对齐文字:节点锚点设为右边,文字对齐设为 right
{
"anchorX": 1,
"x": 330,
"width": 300,
"components": [
{ "type": "label", "string": "¥40.00", "horizontalAlign": "right" }
]
}
这样做的好处:锚点控制节点定位基准,horizontalAlign 控制文字在节点内的排列,语义清晰,不需要心算偏移量。
精灵,显示为纯色方块(颜色由节点 color 控制)
"sprite"
// 或
{ "type": "sprite", "sizeMode": 0 }
文本组件
{
"type": "label",
"string": "文本内容",
"fontSize": 28,
"lineHeight": 40,
"horizontalAlign": "left", // left / center / right,默认 center
"verticalAlign": "center", // top / center / bottom,默认 center
"color": "#ffffff" // 兼容写法,效果等同于节点 color
}
注意:label 的文字颜色实际由节点 color 控制,组件内的 color 是兼容写法。
重要补充:
label 默认按内容自适应显示,不要把 width / height 当成稳定的文本排版手段anchorX / anchorY 锚定的是节点,不是文字笔画本身的视觉中心horizontalAlign / verticalAlign 主要控制文字在节点内的排列,不等于能自动解决跨多个文本节点的组合排版screenshot 的实际渲染结果为准,不要只凭 JSON 参数脑补最终效果富文本,支持 BBCode 局部样式
{
"type": "richText",
"string": "发起<color=#3cb034>准备40元打款</color>的申请<br/>请及时审批!",
"fontSize": 28,
"lineHeight": 40,
"maxWidth": 600,
"horizontalAlign": "left" // left / center / right
}
支持的 BBCode 标签:
<color=#RRGGBB>文字</color> — 局部变色<size=30>文字</size> — 局部字体大小<b>文字</b> — 加粗<i>文字</i> — 斜体<u>文字</u> — 下划线<br/> — 换行重要:richText 的节点 color 和 BBCode color 不要混用,运行时以 BBCode 为准。
对齐组件
{
"type": "widget",
"isAlignLeft": true,
"isAlignRight": true,
"isAlignTop": true,
"isAlignBottom": true,
"left": 0,
"right": 0,
"top": 0,
"bottom": 0
}
按钮组件(通常配合 sprite 使用)
"button"
# 预览 JSON 效果(截图)
npx cocos2d-cli screenshot <json文件> [选项]
-o, --output <目录> 输出目录,默认当前目录
--width <数值> 视口宽度,默认 750
--height <数值> 视口高度,默认 1334
--debug-bounds 叠加节点边界框和名称
# 生成预制体
npx cocos2d-cli create-prefab [JSON文件] <输出.prefab>
# 生成场景
npx cocos2d-cli create-scene [JSON文件] <输出.fire>
# 查看节点树
npx cocos2d-cli tree <场景或预制体文件>
# 获取节点属性
npx cocos2d-cli get <文件> <节点路径> [属性名|组件类型]
# 设置节点属性
npx cocos2d-cli set <文件> <节点路径> <属性名> <值>
# 添加组件
npx cocos2d-cli add-component <文件> <节点路径> <类型>
<color=#xxx> 设置局部颜色,不要依赖节点 coloranchorX=0(靠左)或 anchorX=1(靠右)配合 horizontalAlignlabel 分散硬摆;应先建立父节点,把这组文本作为一个组合块来组织布局,再分别放置子 labelscreenshot 回看实际效果并微调,不能假设一次参数设置就能直接得到正确视觉结果