Borrowing it
Nothing to install: this file belongs to dawangcoding/ClawUI. 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/dawangcoding/ClawUI/master/AGENTS.mdgit clone --depth 1 https://github.com/dawangcoding/ClawUIWrote 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/instructions/dawangcoding/clawui/agents-md)<a href="https://agentmods.dev/instructions/dawangcoding/clawui/agents-md"><img src="https://agentmods.dev/badge/instructions/dawangcoding/clawui/agents-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.
<a href="https://agentmods.dev/instructions/dawangcoding/clawui/agents-md"><img src="https://agentmods.dev/badge/instructions/dawangcoding/clawui/agents-md.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.06103 | $0.06103 |
| Opus 5.5 | $0.02441 | $0.02441 |
| Sonnet 5.5 | $0.01221 | $0.01221 |
| Haiku 4.5 | $0.00610 | $0.00610 |
Grade A, and why
ClawUI AGENTS.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 2mo 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 — 410 lines — stays where its author put it; the contents beside it link to each section on GitHub.
ClawUI 开发基本指南
本文档为 ClawUI 项目开发提供基本的规范指南。
项目概述
ClawUI 是一个为 OpenClaw 开发的跨平台桌面应用,基于 Electron、React、TypeScript、Antd、AgentScope Spark Design 和 Vite 构建。
技术栈
| 分类 | 技术 | 版本 |
|---|---|---|
| 桌面运行时 | Electron | 40.x |
| 前端框架 | React | 19.x |
| 开发语言 | TypeScript | 5.9.x |
| 构建工具 | Vite | 7.x |
| 包管理器 | pnpm | 10.30.x |
| UI 组件 | @agentscope-ai/chat, @agentscope-ai/design, antd | - |
| WebSocket | ws | 8.x |
编码规范
代码格式化 (Prettier)
printWidth: 100 # 行宽 100
tabWidth: 3 # 缩进宽度 3 空格
TypeScript 配置
- 目标:ESNext
- 模块:ESNext (bundler 解析)
- 严格模式:启用
- JSX:react-jsx (自动转换)
资产放置
- 所需要的资产都放到:src/renderer/assets/目录下
注意事项
- 错误处理:所有异步操作需要 try-catch 包裹
- 日志格式:使用
[ModuleName]前缀,如[GatewayClient] - 中文支持:用户界面文本使用中文
- 类型安全:避免使用
any,优先使用unknown+ 类型守卫 - 清理监听器:组件卸载时清理事件监听器,避免内存泄漏
- 不准修改 OpenClaw 代码:ClawUI 是 OpenClaw 的下游应用,所有功能变更都应在 ClawUI 端实现。如果 OpenClaw 行为不符合预期,优先通过纯 ClawUI 端方案解决(如 hook、包装层、事件拦截等),而不是直接修改 OpenClaw 源码
最佳实践
替换第三方包中的远程图标
@agentscope-ai/chat 的 Attachments 组件内部使用 alicdn 远程 URL 作为文件类型图标。Electron 离线环境下这些 URL 不可用,需要替换为本地 SVG。
实现方式: 通过 Vite 插件 src/renderer/plugins/replace-file-icons.ts 在构建时完成替换:
- 本地图标位置:
src/renderer/assets/icons/目录下的 SVG 文件 - dev 模式:通过
optimizeDeps.esbuildOptions.plugins注入 esbuild 插件,在依赖预打包阶段将 alicdn URL 替换为内联data:image/svg+xmldata URL - production 构建:通过 Rollup
transform钩子做同样替换
注意事项:
- 不要使用
optimizeDeps.exclude排除@agentscope-ai/chat,其内部依赖(如rc-util)有 CJS/ESM 兼容问题,会导致白屏 - 新增文件类型图标时,需同时在
ICON_MAP中添加 alicdn URL 映射和对应的本地 SVG 文件 - 如果上游包更新了图标 URL,插件会在控制台输出警告,需同步更新
ICON_MAP
参考文档
- 如果想知道 OpenClaw Gateway 协议怎么定义的,参考:../openclaw/src/gateway/protocol(或 OpenClaw 仓库的 src/gateway/protocol 目录)
- 如果想知道怎么连接到 OpenClaw gateway 的,参考 OpenClaw UI 的实现:../openclaw/ui(或 OpenClaw 仓库的 ui 目录)
- 如果要了解 agentscope-ai 的使用,先参考内容大纲:docs/agentscope-ai/index,然后再参考详细内容:docs/agentscope-ai/all
- 如果想参考 agentscope-ai 怎么实现的,参考源码:../agentscope-spark-design(需本地克隆该仓库)
- OpenClaw 项目 github :https://github.com/openclaw/openclaw
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.
- 2mo ago First seen · 410 lines · 6,103 tokens per session scan A 4e42214f905c
ClawUI AGENTS.md is an instructions file published in the GitHub repository dawangcoding/ClawUI (20 stars, last pushed 7mo ago), licensed MIT. It adds 6,103 tokens to every session, about $0.0244 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.
ClawUI AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| ClawUI AGENTS.mddawangcoding/ClawUI | Instructions file | 20 | 7mo ago | MIT | A | 6,103 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | yesterday | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |