nim_duilib: Instructions file for Claude Code

CLAUDE.md

nim_duilib CLAUDE.md is an instructions file for Claude Code from rhett-lee/nim_duilib. It costs 1,475 tokens per session, scanned A, original, MIT.

Repository instructions for nim_duilib, a cross-platform C++ interface library that uses Skia to draw windows and controls. User interfaces are described in XML, while C++ handles their behavior.

In plain words
What is it for?
Use them when developing or modifying nim_duilib applications, XML interface layouts, C++ UI logic, themes, animations, images, or embedded web views.
Why use it?
They give coding agents the project's layout, supported systems, build tools, and development conventions. This reduces confusion when changing controls, layouts, rendering, or resources.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: reads .claude/ paths.

This is rhett-lee/nim_duilib's own configuration. It tells Claude Code 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/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/rhett-lee/nim_duilib

Made for: Claude Code.

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 CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/rhett-lee/nim_duilib/claude-md/github.svg)](https://agentmods.dev/instructions/rhett-lee/nim_duilib/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/rhett-lee/nim_duilib/claude-md"><img src="https://agentmods.dev/badge/instructions/rhett-lee/nim_duilib/claude-md/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 CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/rhett-lee/nim_duilib/claude-md"><img src="https://agentmods.dev/badge/instructions/rhett-lee/nim_duilib/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,475 This file is loaded in full into every session.
When invoked 1,475 The same file — it is already loaded in full.
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.01475 $0.01475
Opus 5.5 $0.00590 $0.00590
Sonnet 5.5 $0.00295 $0.00295
Haiku 4.5 $0.00147 $0.00147

Measured 1mo ago against content hash 2842e54b5b1e, 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 CLAUDE.md 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.

CLAUDE.md · 106 lines

How it starts

The opening of the file, as written. The whole thing — 106 lines — stays where its author put it; the contents beside it link to each section on GitHub.

nim_duilib - 跨平台 C++ UI 库

项目概述

nim_duilib 是基于 Skia 渲染引擎的跨平台 C++ UI 框架,采用 XML 描述界面布局 + C++ 控制逻辑的开发模式。

  • 支持平台: Windows (7/10/11+), Linux, macOS (12+), FreeBSD
  • 渲染引擎: Skia (CPU/OpenGL)
  • 构建工具: CMake + Visual Studio / GCC / Clang
  • C++ 标准: C++20(cmake/duilib_bin.cmake:6-7 强制 CMAKE_CXX_STANDARD 20,MSVC 工程为 stdcpp20,不要用低于 C++20 的语法假设)

项目结构

nim_duilib/
├── duilib/              # 核心库源码
│   ├── Core/            # 窗口、控件基类、事件、管理器
│   ├── Control/         # UI控件(Button, Label, RichEdit, TreeView...)
│   ├── Box/             # 容器控件(VBox, HBox, ListBox, TabBox...)
│   ├── Layout/          # 布局引擎(HLayout, VLayout, GridLayout...)
│   ├── Animation/       # 动画系统
│   ├── Image/           # 图片处理(PNG/SVG/GIF/WEBP/APNG/Lottie/PAG)
│   ├── Render/          # 渲染接口
│   ├── RenderSkia/      # Skia渲染实现
│   ├── Utils/           # 工具类(WinImplBase.h→WindowImplBase 类, FilePath...)
│   ├── CEFControl/      # CEF浏览器集成
│   └── WebView2/        # WebView2控件
├── examples/            # 示例程序
├── docs/                # 完整文档
├── bin/resources/       # 主题资源(XML布局、图片、字体)
├── build/               # 构建脚本和解决方案
└── cmake/               # CMake配置

开发模式(XML + C++)

XML 布局文件

  • 位置: bin/resources/themes/default/<skin_folder>/<skin_file>.xml
  • 全局资源: bin/resources/themes/default/global.xml(字体、颜色、通用样式)
  • 编码: UTF-8

C++ 代码三件套

每个窗口通常需要三个文件:

  1. MainThread - 继承 ui::FrameworkThread,负责初始化和创建窗口
  2. MainForm.h/cpp - 继承 ui::WindowImplBase,实现窗口逻辑
  3. XML布局文件 - 描述界面结构和样式

关键代码模式

初始化全局资源:

// 推荐写法:自动处理平台差异(Windows 取 exe 同目录的 resources/,
// macOS 取 .app bundle 内的 Resources/),不要手工拼 "\\"
ui::FilePath resourcePath = ui::GlobalManager::GetResourceRootPath(false);
ui::GlobalManager::Instance().Startup(ui::LocalFilesResParam(resourcePath));

发布时切换到 ZIP / 嵌入 EXE 资源,详见 .claude/skills/nim-duilib-resource-pack.md。

创建窗口:

MainForm* window = new MainForm();
window->CreateWnd(nullptr, ui::WindowCreateParam(_T("WindowTitle"), true));
window->PostQuitMsgWhenClosed(true);
window->ShowWindow(ui::kSW_SHOW_NORMAL);

Read the full file on GitHub · 106 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 · +10 tokens per session 2842e54b5b1e
  2. 1mo ago Changed · +8 lines · +304 tokens per session e8afefa8861f
  3. 2mo ago First seen · 98 lines · 1,161 tokens per session scan A 6045ec2c0e21

Subscribe to this mod's changes

nim_duilib CLAUDE.md is an instructions file published in the GitHub repository rhett-lee/nim_duilib (337 stars, last pushed yesterday), licensed MIT. It adds 1,475 tokens to every session, about $0.0059 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-30.

Related

nim_duilib CLAUDE.md compared with instructions from other repositories

nim_duilib CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
nim_duilib CLAUDE.mdrhett-lee/nim_duilibInstructions file337yesterdayMITA1,475Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode