nim_duilib: Skill for Claude Code

.trae/skills/nim-duilib/SKILL.md

nim-duilib is a skill for Claude Code, Codex from rhett-lee/nim_duilib. It costs 43 tokens per session (2,178 once invoked), scanned A, original, MIT.

A coding guide for nim_duilib, a cross-platform desktop interface framework that uses XML for layout and C++ for behavior. It explains where to find the source, which reference notes to load, and rules that prevent silent UI mistakes.

In plain words
What is it for?
Use it to create or modify nim_duilib windows, XML layouts, controls, event handlers, themes, and resource packages, or to look up APIs and investigate problems.
Why use it?
It reduces guesswork when changing windows, controls, themes, events, or packaged resources. It also directs you to check the actual source and relevant documentation instead of relying on memory.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

This is rhett-lee/nim_duilib's own configuration. It tells Claude Code and Codex how to work on nim_duilib itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything nim_duilib configures →

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/rhett-lee/nim_duilib/main/.trae/skills/nim-duilib/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/rhett-lee/nim_duilib

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for nim-duilib

README.md
[![agentmods](https://agentmods.dev/badge/skills/rhett-lee/nim_duilib/nim-duilib/github.svg)](https://agentmods.dev/skills/rhett-lee/nim_duilib/nim-duilib)
Your own site
<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.

agentmods 80×15 button for nim-duilib

Your own site · 80×15
<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>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,178 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 1mo ago against content hash 5ec9eb23408c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/verify_docs.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

.trae/skills/nim-duilib/SKILL.md · 131 lines

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 行完整速查表),只在确实需要查表时才读, 其余场景优先读对应的专题文档。

六条必守约束

违反这些不会报错,只会静默出问题,排查成本极高。

  1. class 属性必须写在所有属性最前面。 写在后面则整个 class 的样式被忽略。 <Button class="btn_global_blue_80x30" name="ok" text="确定"/> 正确;反过来则控件无任何样式。

  2. 标题栏与按钮必须用新名。 容器 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。

  3. 颜色一律写语义色名,不要写死色值。 语义色的真实色值定义在 bin/resources/themes/color_light/global.xml 与 color_dark/global.xml, themes/default/global.xml 里只剩旧名→新名的 <Alias> 映射。写死色值会导致深色主题失效。

  4. 取事件发送者用 args.GetSender(),不是 args.pSender。 pSender 是 private 成员,直接访问编译不过。 GetSender() 返回 nullptr 表示控件已销毁,应提前返回。

  5. FrameworkThread::OnInit() 返回 bool,不是 void。 末尾要 return true;。

Read the full file on GitHub · 131 lines

Changes

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.

  1. 1mo ago Changed · +1 lines 5ec9eb23408c
  2. 1mo ago Changed · +2 lines 2c3a232beb56
  3. 1mo ago Changed · -1 lines · -99 tokens per session f3c04b406bd6
  4. 1mo ago First seen · 129 lines · 142 tokens per session scan A a28302d1d237

Subscribe to this mod's changes

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.

Related

nim-duilib compared with skills from other repositories

nim-duilib next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
nim-duilibrhett-lee/nim_duilibSkill337yesterdayMITA43Claude Code, Codex
qt-cpp-docsTheQtCompanyRnD/agent-skillsSkill52317d agononeA155Claude Code
qt-cpp-reviewTheQtCompanyRnD/agent-skillsSkill52317d agononeA92Claude Code
compiler-portreact/reactSkill252kyesterdayMITA35Claude Code
zoom-meeting-sdk-unrealanthropics/knowledge-work-pluginsSkill35k2d agoApache-2.0A41Claude Code
doca-argpNVIDIA/skillsSkill3.9kyesterdayApache-2.0A277Claude Code, Codex
cpu-kernelshuggingface/kernelsSkill783yesterdayApache-2.0A89Claude Code