Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add Wade-DevCode/awesome-coding-skills-cn --skill cocos-creator-ui-listgit clone --depth 1 https://github.com/Wade-DevCode/awesome-coding-skills-cnWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/wade-devcode/awesome-coding-skills-cn/cocos-creator-ui-list)<a href="https://agentmods.dev/skills/wade-devcode/awesome-coding-skills-cn/cocos-creator-ui-list"><img src="https://agentmods.dev/badge/skills/wade-devcode/awesome-coding-skills-cn/cocos-creator-ui-list/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/wade-devcode/awesome-coding-skills-cn/cocos-creator-ui-list"><img src="https://agentmods.dev/badge/skills/wade-devcode/awesome-coding-skills-cn/cocos-creator-ui-list.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00027 | $0.04110 |
| Opus 5.5 | $0.00011 | $0.01644 |
| Sonnet 5.5 | $0.00005 | $0.00822 |
| Haiku 4.5 | $0.00003 | $0.00411 |
Grade A, and why
cocos-creator-ui-list scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 251 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Cocos Creator 长列表优化
何时用
- 排行榜、好友列表、背包物品、聊天记录等条目数量超过 50 条时。
- ScrollView 滑动时帧率下降,Profiler 显示大量
Layout或Sprite更新耗时时。 - 启动时一次性
instantiate了几百个 item 节点导致进入场景卡顿时。 - 列表数据频繁刷新(如实时排行榜推送)但整体 CPU 占用居高不下时。
- 图片异步加载导致列表滚动时出现闪烁或短暂空白占位时。
核心规则
1. 虚拟列表:只实例化可视区 + 缓冲节点,滚动时复用
规则: 不论列表数据有多少条,同时存在于场景节点树中的 item 节点数量 = 可视区可容纳数量 + 固定缓冲量(通常 4~6 个);滚动时将移出可视区的节点重新定位到新进入可视区的位置并更新数据,不增减节点数量。
为什么: 这是长列表性能的根本问题。AI 生成列表代码时的惯用写法是循环 cc.instantiate(itemPrefab) 并 addChild 全部数据——500 条排行榜就创建 500 个节点,每个节点含 Sprite、Label、Button,光是节点树渲染遍历就够卡的。实测在中端安卓机上,一次性创建 200 个含图片的列表节点耗时超过 1 秒,直接导致进入场景的白屏卡顿。更致命的是:ScrollView 的 content 节点拖 Layout 组件后,每次 addChild 都会触发整个 Layout 的重排,200 次 addChild = 200 次全量重排,复杂度是 O(n²)。
怎么做:
- 计算可视区高度 / 单个 item 高度,得到可见数量
visibleCount,加缓冲visibleCount + 6作为实际节点池大小。 onLoad里只创建这么多节点放入节点池,content节点不挂 Layout 组件(手动控制y坐标)。content节点高度设为总条目数 × itemHeight,让 ScrollView 滚动条正确反映总量。- 监听 ScrollView 的
SCROLL_EV或在update里用节流检测滚动偏移,计算当前第一个可见索引firstIndex,遍历节点池把每个节点的y = -(firstIndex + i) * itemHeight,并调用refreshItem(node, data[firstIndex + i])更新数据。
2. 节点复用池:对象池管理 item 节点,避免滚动时频繁创建销毁
规则: item 节点用 NodePool(或简单数组)管理复用,不在滚动回调里 instantiate/destroy;归还节点时在 unuse 钩子里重置所有可视状态(图片、文字、选中态),避免残留数据。
为什么: 即使实现了虚拟列表,如果每次 item 滑出可视区就 destroy、滑入就 instantiate,性能依然很差。instantiate 一个含多个子节点的 prefab 在移动端耗时 5~20 ms,60fps 的帧预算只有 16ms,几个 item 同时进入视野就直接掉帧。更隐蔽的问题:归还节点时不重置状态,下次从池里取出的节点仍然显示上一个位置的数据(旧头像、旧分数),等异步加载完成后才刷新,用户会看到数据"闪变"。
怎么做:
- 定义
ItemController组件,实现unuse()方法清空头像 Sprite(this.avatar.spriteFrame = null)、重置文字、隐藏选中态。 - 对象池声明:
private _itemPool: NodePool = new NodePool('ItemController');。 - 取节点:
const node = this._itemPool.size() > 0 ? this._itemPool.get()! : instantiate(this.itemPrefab); - 还节点:
this._itemPool.put(node);(内部自动调用ItemController.unuse())。 onDestroy里:this._itemPool.clear();,防止场景卸载后池内节点仍挂载于内存。
3. 数据视图分离:滚动只更新可见 item 的数据绑定,不重建节点
规则: 列表的「数据模型」和「节点视图」严格分离;滚动时只调用 itemNode.getComponent(ItemController).refresh(data) 更新绑定数据,绝不销毁重建节点,也不对不可见节点做任何数据操作。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 251 lines · 27 tokens per session scan A 405faaba13a8
cocos-creator-ui-list is a skill published in the GitHub repository Wade-DevCode/awesome-coding-skills-cn (7 stars, last pushed 4mo ago), licensed MIT. It adds 27 tokens to every session and 4,110 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
executing-plans
A procedure for carrying out a written software implementation plan in a separate session, including reviewing the plan, completing its tasks, and checking the results at defined review points.
chinese-git-workflow
A reference for configuring Git with Chinese code-hosting services such as Gitee, Coding.net, GitLab China, and CNB, including SSH, HTTPS, credentials, CI, and repository mirroring.
chinese-code-review
A Chinese-language code-review communication guide with templates and severity levels for review comments.
chinese-commit-conventions
A Chinese-language guide to Conventional Commits, a format for writing consistent Git commit messages, plus related changelog, commit-checking, and commit-helper configuration.
chinese-documentation
A Chinese technical-documentation style guide covering spacing, punctuation, numbers, terminology, and links when Chinese and English appear together.
systematic-debugging
A step-by-step method for finding the underlying cause of technical problems before changing code. It covers reading errors, reproducing failures, checking recent changes, and tracing data across system components.