Borrowing it
Nothing to install: this file belongs to rhett-lee/nim_duilib. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/rhett-lee/nim_duilib/main/.trae/skills/nim-duilib/SKILL.mdgit clone --depth 1 https://github.com/rhett-lee/nim_duilibWrote 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/rhett-lee/nim_duilib/nim-duilib)<a href="https://agentmods.dev/skills/rhett-lee/nim_duilib/nim-duilib"><img src="https://agentmods.dev/badge/skills/rhett-lee/nim_duilib/nim-duilib/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/rhett-lee/nim_duilib/nim-duilib"><img src="https://agentmods.dev/badge/skills/rhett-lee/nim_duilib/nim-duilib.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.00043 | $0.02178 |
| Opus 5.5 | $0.00017 | $0.00871 |
| Sonnet 5.5 | $0.00009 | $0.00436 |
| Haiku 4.5 | $0.00004 | $0.00218 |
Grade A, and why
nim-duilib 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 — 131 lines — stays where its author put it; the contents beside it link to each section on GitHub.
nim_duilib 开发助手
nim_duilib 是一个 XML 驱动皮肤 + C++ 逻辑的跨平台桌面 UI 框架(C++20)。窗口外观由 XML 布局描述,
行为由继承 ui::WindowImplBase 的 C++ 类实现,二者通过控件 name 关联。
定位源码根目录
动手前先确认 nim_duilib 仓库根目录(含 duilib/、examples/、bin/resources/ 的那个目录)。
下文所有相对路径均相对于它。若当前工作目录就在其中,直接使用相对路径即可。
按任务载入参考文档
按需读取,不要一次全读——只有当前任务相关的才载入上下文。
| 任务 | 载入 |
|---|---|
| 新建窗口 / 窗体 / 对话框 | references/create-window.md |
| 弹模态消息框 / 确认框(MessageBoxWnd) | references/api-reference.md 的「模态消息框 MessageBoxWnd」小节 |
| 弹非模态通知 / Toast 提示(ToastWnd) | references/api-reference.md 的「非模态通知框 ToastWnd」小节 + references/pitfalls.md 第 19 条 |
| 设计或修改 XML 布局、选容器、写尺寸 | references/xml-layout.md |
| 添加控件、写控件属性、动态加数据 | references/add-control.md |
| 给框架已有控件扩展新 XML 属性 / 改 duilib 头文件 | references/framework-extend.md |
| 事件绑定(XML 内联或 C++ Attach)、查事件名 | references/event-handler.md |
| 主题、颜色、字体、global.xml 的 Class | references/theme.md |
| 资源打包、发布、ZIP、单文件 EXE | references/resource-pack.md |
| 查某个 API / 属性 / 容器的完整定义 | references/api-reference.md |
| 排查诡异问题、确认某个坑是否还存在 | references/pitfalls.md |
references/api-reference.md 是最大的一份(约 600 行完整速查表),只在确实需要查表时才读,
其余场景优先读对应的专题文档。
六条必守约束
违反这些不会报错,只会静默出问题,排查成本极高。
-
class属性必须写在所有属性最前面。 写在后面则整个 class 的样式被忽略。<Button class="btn_global_blue_80x30" name="ok" text="确定"/>正确;反过来则控件无任何样式。 -
标题栏与按钮必须用新名。 容器
window_title_bar,按钮btn_window_min/btn_window_max/btn_window_restore/btn_window_close/btn_window_fullscreen。 旧名(window_caption_bar、minbtn、closebtn…)只是兼容 fallback,新代码不要用。 依据duilib/duilib_defs.h:145-152与duilib/Utils/WinImplBase.cpp:9-14。 -
颜色一律写语义色名,不要写死色值。 语义色的真实色值定义在
bin/resources/themes/color_light/global.xml与color_dark/global.xml,themes/default/global.xml里只剩旧名→新名的<Alias>映射。写死色值会导致深色主题失效。 -
取事件发送者用
args.GetSender(),不是args.pSender。pSender是 private 成员,直接访问编译不过。GetSender()返回nullptr表示控件已销毁,应提前返回。 -
FrameworkThread::OnInit()返回bool,不是void。 末尾要return true;。
What ships with it
15 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- assets/templates/CMakeLists.txt 657 B
- assets/templates/my_form.xml 1.9 KB
- assets/templates/MyForm.cpp 774 B
- assets/templates/MyForm.h 846 B
- references/add-control.md 8.2 KB
- references/api-reference.md 89 KB
- references/create-window.md 4.6 KB
- references/event-handler.md 10 KB
- references/framework-extend.md 7.3 KB
- references/pitfalls.md 17 KB
- references/resource-pack.md 7.8 KB
- references/theme.md 13 KB
- references/xml-layout.md 7.9 KB
- scripts/verify_allowlist.txt 3.3 KB
- scripts/verify_docs.py 13 KB runs code
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 Changed · +1 lines 5ec9eb23408c
- 1mo ago Changed · +2 lines 2c3a232beb56
- 1mo ago Changed · -1 lines · -99 tokens per session f3c04b406bd6
- 1mo ago First seen · 129 lines · 142 tokens per session scan A a28302d1d237
nim-duilib is a skill published in the GitHub repository rhett-lee/nim_duilib (337 stars, last pushed yesterday), licensed MIT. It adds 43 tokens to every session and 2,178 once invoked, about $0.0002 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-09-26.
nim-duilib compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| nim-duilibrhett-lee/nim_duilib | Skill | 337 | yesterday | MIT | A | 43 | Claude Code, Codex |
| qt-cpp-docsTheQtCompanyRnD/agent-skills | Skill | 523 | 17d ago | none | A | 155 | Claude Code |
| qt-cpp-reviewTheQtCompanyRnD/agent-skills | Skill | 523 | 17d ago | none | A | 92 | Claude Code |
| compiler-portreact/react | Skill | 252k | yesterday | MIT | A | 35 | Claude Code |
| zoom-meeting-sdk-unrealanthropics/knowledge-work-plugins | Skill | 35k | 2d ago | Apache-2.0 | A | 41 | Claude Code |
| doca-argpNVIDIA/skills | Skill | 3.9k | yesterday | Apache-2.0 | A | 277 | Claude Code, Codex |
| cpu-kernelshuggingface/kernels | Skill | 783 | yesterday | Apache-2.0 | A | 89 | Claude Code |