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 agentmods add instructions/dawangcoding/clawui/agents-mdgit clone --depth 1 https://github.com/dawangcoding/ClawUIWhat 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 | $0.06103 | $0.06103 |
| Opus 5 | $0.03052 | $0.03052 |
| Sonnet 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 2d 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.
- 2d 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 5mo ago), licensed MIT. It adds 6,103 tokens to every session, about $0.0305 per session on Opus 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.
Other instructions, from other repositories
code-by-wire CLAUDE.md
Instructions for luojiahai/code-by-wire, covering claude.md, development, website, architecture and code style.
clawsuite AGENTS.md
Instructions for outsourc-e/clawsuite, covering clawsuite agent roster, how aurora uses this file, routing table, aurora-coder — frontend specialist and aurora-daemon — backend specialist.
code-by-wire AGENTS.md
Instructions for luojiahai/code-by-wire, a project described as: Pilot coding agents (Claude Code, Codex) and monitor their telemetry from one cockpit.
swob AGENTS.md
Instructions for IvyYang1999/swob, covering swob 研发协作唯一规范, 不可越过的边界, 角色与职责, 生命周期 and 分支、worktree 与提交.
cc-mascot CLAUDE.md
Instructions for kazakago/cc-mascot, covering cc mascot - 技術ドキュメント, プロジェクト概要, コンセプト, 技術スタック and アーキテクチャ概要.
plano CLAUDE.md
Instructions for zqkra/plano, covering claude.md, what plano is, commands, environment gotchas (windows — hit these during setup) and environment gotchas (linux / fedora kde — port-specific).