Skip to content
Back to search

danghuangshang

Open-source multi-agent collaboration system inspired by Chinese governance — deploy and coordinate specialized AI agents with OpenClaw.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/wanikua--danghuangshang/badge.svg)](/listings/wanikua--danghuangshang)

HTML

<a href="/listings/wanikua--danghuangshang"><img src="/api/listings/wanikua--danghuangshang/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 734 lines · 7 findings marked

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. [![MseeP.ai Security Assessment Badge](https://mseep.net/pr/wanikua-danghuangshang-badge.png)](https://mseep.ai/app/wanikua-danghuangshang)
  2. [English Version](./README_EN.md) | [日本語版](./README_JA.md) | [🏢 企业版 Become CEO (English)](https://github.com/wanikua/become-ceo) | [🔧 天工开物 TianGong (Terminal版)](https://github.com/wanikua/tiangong) | [🌐 官网](https://danghuangshang.com) | [📚 完整文档](./docs/README.md)
  3. > **⚠️ 维权声明 / Originality Notice**
  4. >
  5. > 本项目是「三省六部 × OpenClaw」架构的 **首发作品**,架构设计、角色功能映射、目录结构均为本项目原创。时间线:
  6. > - **2025-02-20**:小红书首发教程
  7. > - **2025-02-22**:GitHub 完整教程发布
  8. >
  9. > **📋 已知侵权**:[Edict](https://github.com/cft0808/edict) 项目结构与本项目高度相似,未注明引用任何出处。经多次沟通,作者拒绝标注原创出处。
  10. >
  11. > 🔗 [原创证据链 & 维权文章](./docs/originality.md)
  12. >
  13. > **🤝 欢迎共创**:本项目是MIT License,欢迎 PR 贡献、Fork 二次开发。但请**注明出处**并保留License。
  14. > 这是开源社区的基本礼仪,也是对每一位贡献者的尊重。
  15. <!-- SEO 关键词 / Keywords:三省六部、明朝、六部制、司礼监、内阁、都察院、翰林院、兵部、户部、礼部、工部、刑部、吏部、AI朝廷、AI Agent、多Agent协作、人工智能管理、古代治国、现代管理、组织架构、OpenClaw、multi-agent、ancient-china -->
  16. <p align="center">
  17. <img src="./images/boluobobo-mascot.png" alt="菠萝菠菠 mascot" width="120" />
  18. </p>
  19. # 🏛️ 当皇上 ✖️ OpenClaw
  20. ### 一行命令起王朝,三省六部皆AI。千里之外调百官,万事不劳御驾亲。
  21. > **以明朝内阁制为蓝本,用 [OpenClaw](https://github.com/openclaw/openclaw) 框架构建的多 Agent 协作系统。**
  22. > 一台服务器 + OpenClaw = 一支 7×24 在线的 AI 朝廷。
  23. <p align="center">
  24. <img src="https://img.shields.io/badge/架构-明朝内阁制-gold?style=for-the-badge" />
  25. <img src="https://img.shields.io/badge/框架-OpenClaw-blue?style=for-the-badge" />
  26. <img src="https://img.shields.io/badge/Agent-18+-green?style=for-the-badge" />
  27. <img src="https://img.shields.io/badge/Skill-60+-orange?style=for-the-badge" />
  28. <img src="https://img.shields.io/badge/部署-5分钟-red?style=for-the-badge" />
  29. </p>
  30. <div align="center">
  31. ### 👑 一键登基
  32. **方式一:本地安装(推荐)**
  33. ```bash
  34. git clone https://github.com/wanikua/danghuangshang.git
  35. cd danghuangshang
  36. bash scripts/full-install.sh
  37. ```
  38. **方式二:远程一键安装**
  39. ```bash
  40. bash <(curl -fsSL https://raw.githubusercontent.com/wanikua/danghuangshang/main/scripts/full-install.sh)
    • Note: Runs a downloaded script through process substitution (bash <(curl …))
    • Line 54 on GitHub
  41. ```
  42. **一行命令,5 分钟,你就是皇上。** [→ 快速开始](#快速开始)
  43. > 🔒 **安全更新(2026-03-22)**:新增 Webhook 签名验证,防止伪造请求。[查看配置指南](./docs/webhook-security.md)
  44. </div>
  45. > ### ⚠️ **Discord 多 Bot 安全配置**(必读)
  46. >
  47. > **默认配置已安全**:新版安装脚本已设置 `"allowBots": "mentions"`,Bot 只在被 @ 时响应其他 Bot,避免消息循环。
  48. >
  49. > **如果你使用旧版配置**:请确保 Discord 配置中有:
  50. > ```json
  51. > "discord": {
  52. > "allowBots": "mentions" // ✅ 只响应被 @ 的 Bot
  53. > }
  54. > ```
  55. >
  56. > **⚠️ 禁止使用 `"allowBots": true`** — 会导致 Bot 互相触发,引发消息风暴!
  57. >
  58. > 📖 详细说明:[Discord 安全配置指南](./docs/discord-safety.md) | 相关 Issue:[#107](https://github.com/wanikua/danghuangshang/issues/107)
  59. <p align="center">
  60. <img src="./images/flow-architecture.png" alt="系统架构流程图" width="80%" />
  61. </p>
  62. <p align="center">
  63. <img src="./images/discord-architecture.png" alt="Discord 朝廷架构图" width="80%" />
  64. </p>
  65. ---
  66. **AI 朝廷**是一个开箱即用的多 Agent 协作系统。你是皇帝,AI 是你的大臣。在 Discord 或飞书 @某个 Agent,大臣们就会立刻执行。司礼监接旨、内阁优化 Prompt、六部各司其职、都察院自动审查代码。**管理 AI 团队的高效模版。**
  67. ## 目录
  68. - 🚀 [**快速开始**](#快速开始) — 3 步安装
  69. - 🏛️ [朝廷架构](#朝廷架构) — 明朝内阁制:皇帝→司礼监→内阁→六部→都察院
  70. - 🎬 [效果展示](#效果展示) — Discord / 飞书 对话示例
  71. - 📝 [翰林院](#翰林院) — 5 Agent 协作写小说(可选)
  72. - ⚙️ [核心能力](#核心能力) — 协作、记忆、60+ Skill、Cron、沙箱
  73. - 🆚 [为什么选这套方案?](#为什么选这套方案) — 与 ChatGPT / AutoGPT / CrewAI 对比
  74. - 📦 [更多](#更多) — GUI · 飞书 · Notion · 诊断 · FAQ · 企业版 · 菠萝王朝
  75. ---
  76. <a id="快速开始"></a>
  77. ## 🚀 快速开始
  78. > 🔴 **新手请用云服务器**,不要在个人电脑上安装。[→ 领一台免费服务器](./docs/server-setup.md)
  79. ### 1️⃣ 选择制度
  80. 安装时可选择三种制度:
  81. | 制度 | 特点 | 适用场景 | Agent |
  82. |------|------|---------|-------|
  83. | **明朝内阁制** | 司礼监 + 内阁 + 六部,快速迭代 | 个人项目 | 18 个 |
  84. | **唐朝三省制** | 中书→门下→尚书,制衡审核 | 偏好严谨流程的项目 | 14 个 |
  85. | **现代企业制** | CEO/CTO/CFO,国际化 | 创业团队 | 14 个 |
  86. ### 2️⃣ 一键安装
  87. #### 方式一:本地安装(推荐)
  88. ```bash
  89. git clone https://github.com/wanikua/danghuangshang.git
  90. cd danghuangshang
  91. bash scripts/full-install.sh
  92. ```
  93. **优点**:可离线使用,可修改安装脚本,可查看所有文件,**包含完整人设注入**。
  94. > ⚠️ **安装遇到问题?** → [查看故障排除指南](docs/install-troubleshooting.md)
  95. #### 方式二:远程一键安装
  96. **Linux / macOS**:
  97. ```bash
  98. bash <(curl -fsSL https://raw.githubusercontent.com/wanikua/danghuangshang/main/scripts/full-install.sh)
    • Note: Runs a downloaded script through process substitution (bash <(curl …))
    • Line 136 on GitHub
  99. ```
  100. **Windows (PowerShell)**:
  101. ```powershell
  102. powershell -ExecutionPolicy Bypass -File (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/wanikua/danghuangshang/main/install.ps1')
  103. ```
  104. **优点**:无需 git,复制粘贴一行命令,**包含完整人设注入**。
  105. #### 方式三:已有 OpenClaw?精简版
  106. ```bash
  107. bash <(curl -fsSL https://raw.githubusercontent.com/wanikua/danghuangshang/main/install-lite.sh)
    • Note: Runs a downloaded script through process substitution (bash <(curl …))
    • Line 149 on GitHub
  108. ```
  109. **适用**:已安装 OpenClaw,只需配置模板。**包含人设注入**。
  110. > ⚠️ **注意**:旧版 `install.sh` 不支持远程执行(会报 `/dev/fd` 路径错误)。请使用 `scripts/full-install.sh` 或先 `git clone`。
  111. #### 方式四:用 Hermes Agent runtime(与 OpenClaw 平行)
  112. ```bash
  113. bash <(curl -fsSL https://raw.githubusercontent.com/wanikua/danghuangshang/main/install-hermes.sh)
    • Note: Runs a downloaded script through process substitution (bash <(curl …))
    • Line 159 on GitHub
  114. ```
  115. **适用**:想用 Nous Research [Hermes Agent](https://github.com/NousResearch/hermes-agent)(Python,原生 20+ 平台、自带 RL 数据采集)跑同一套朝廷设定。详见 [EXTERNAL_HERMES.md](./EXTERNAL_HERMES.md)。两套 runtime 可并存。
  116. ### 3️⃣ 配置 + 启动
  117. **2. 按提示填入** LLM API Key + Discord Bot Token
  118. **3. 在 Discord @你的 Bot 说话** — 完成!
  119. ### 🔄 切换制度
  120. **本地安装**:
  121. ```bash
  122. bash scripts/switch-regime.sh tang-sansheng # 唐朝三省制
  123. bash scripts/switch-regime.sh modern-ceo # 现代企业制
  124. bash scripts/switch-regime.sh ming-neige # 明朝内阁制
  125. ```
  126. **远程安装**:
  127. ```bash
  128. bash <(curl -fsSL https://raw.githubusercontent.com/wanikua/danghuangshang/main/scripts/switch-regime.sh)
    • Note: Runs a downloaded script through process substitution (bash <(curl …))
    • Line 181 on GitHub
  129. ```
  130. > **⚠️ 更新安全提示**
  131. >
  132. > **推荐:使用安全更新脚本(自动备份 + 检查)**
  133. > ```bash
  134. > bash scripts/safe-update.sh
  135. > ```
  136. >
  137. > **手动更新**:
  138. > ```bash
  139. > cd ~/clawd
  140. > git stash # 暂存本地修改
  141. > git pull # 拉取最新代码
  142. > git stash pop # 恢复本地修改(可能有冲突需手动解决)
  143. > ```
  144. >
  145. > **系统会自动备份配置文件(`~/.openclaw/openclaw.json`),但工作区文件(如 MEMORY.md)需手动备份。**
  146. > 🏥 遇到问题?
  147. > - 诊断工具:`openclaw doctor` 或 `bash <(curl -fsSL https://raw.githubusercontent.com/wanikua/danghuangshang/main/doctor.sh)`
    • Note: Runs a downloaded script through process substitution (bash <(curl …))
    • Line 202 on GitHub
  148. > - 安全指南:[Discord 安全配置](./docs/discord-safety.md)
  149. > - 完整 FAQ:[常见问题](./docs/faq.md)
  150. >
  151. > 🤖 不想看文档?把 [这段 Prompt](./docs/install-prompt.md) 丢给 AI 助手,让它带你装
  152. ---
  153. <a id="朝廷架构"></a>
  154. ## 🏛️ 朝廷架构
  155. 本项目提供 **三种制度** 供选择,各有侧重:
  156. | 制度 | 特点 | 流程 |
  157. |------|------|------|
  158. | **明朝内阁制**(默认) | 司礼监 + 内阁二元调度 | 司礼监接旨 → 内阁优化 → 六部执行 |
  159. | **唐朝三省制** | 三权分立、互相制衡 | 中书起草 → 门下审核 → 尚书执行 |
  160. | **现代企业制** | 扁平管理、英文沟通 | CEO 决策 → Board 审议 → CxO 执行 |
  161. > 💡 下方先展示明朝内阁制(默认),唐朝三省制和现代企业制请展开下方折叠查看。
  162. **方式一:经司礼监调度(默认)**
  163. ```
  164. 皇帝(你)下旨
  165. ▼
  166. 司礼监(大内总管)── 接旨
  167. │
  168. ├─→ 内阁(首辅)── Prompt 增强:理解意图、引导追问、生成执行计划
  169. │ ←─┘ 返回优化后的 Prompt + Plan
  170. │
  171. ├─→ @兵部 @户部 @礼部 …(按 Plan 派发)
  172. │
  173. └─→ 都察院 ── 代码 push 到 GitHub 时自动审查
  174. └─→ ✅ 通过 / ❌ 打回修改
  175. ```
  176. **方式二:皇帝直接下旨给任意部门**(Discord 多 Bot 模式)
  177. ```
  178. 皇帝(你)
  179. ├─→ @兵部 写个登录 API ← 直接指挥,跳过司礼监
  180. ├─→ @户部 查本月开销
  181. └─→ @都察院 审查这个 PR
  182. ```
  183. > 💡 Discord 多 Bot 模式下,每个部门都是独立 Bot,你可以直接 @任意部门下达指令,无需经过司礼监。复杂任务推荐走司礼监(自动内阁优化),简单任务直接 @对应部门更快。
  184. <details>
  185. <summary><b>查看完整机构表</b></summary>
  186. | 机构 | 角色 | 在本项目中 |
  187. |------|------|-----------|
  188. | **司礼监** | 大内总管 | 接旨 → 送内阁优化 → 派发六部 |
  189. | **内阁** | 首辅大学士 | Prompt 增强、追问、生成计划、重大决策审议 |
  190. | **都察院** | 左都御史 | GitHub push 自动代码审查 |
  191. | **兵部** | 尚书 | 软件工程:编码、架构、Bug 调试 |
  192. | **户部** | 尚书 | 财务运营:成本分析、预算管控 |
  193. | **礼部** | 尚书 | 品牌营销:文案、社媒运营 |
  194. | **工部** | 尚书 | 运维:DevOps、CI/CD |
  195. | **吏部** | 尚书 | 项目管理、团队协调 |
  196. | **刑部** | 尚书 | 法务合规、知识产权 |
  197. **与明朝制度的映射:**
  198. | 明朝 | 本项目 |
  199. |------|--------|
  200. | 皇帝下旨 → 司礼监批红 | 用户 @司礼监 → 接旨调度 |
  201. | 内阁票拟(起草方案) | 内阁 Prompt 增强 + Plan |
  202. | 司礼监代批(下发执行) | 用优化后 Prompt 派发六部 |
  203. | 都察院纠劾百官 | GitHub push 自动审查 |
  204. | 内阁封驳权 | 内阁可否决不合理方案 |
  205. </details>
  206. ---
  207. <details>
  208. <summary><b>唐朝三省制(tang-sansheng)</b></summary>
  209. **中书起草 → 门下审核 → 尚书执行**,三权分立、互相制衡。适合需要严谨审批流程的企业级场景。
  210. **方式一:三省流转(默认)**
  211. ```
  212. 皇帝(你)下旨
  213. ▼
  214. 中书省 ── 起草诏令(理解意图、生成执行方案)
  215. ▼
  216. 门下省 ── 审核驳回(审查方案可行性、合规性)
  217. │
  218. ├─ ❌ 封驳 → 退回中书省修改
  219. └─ ✅ 通过 ▼
  220. 尚书省 ── 执行派发
  221. ├─→ @兵部 编码开发
  222. ├─→ @户部 财务分析
  223. ├─→ @工部 运维部署
  224. ├─→ @礼部 品牌营销
  225. ├─→ @吏部 项目管理
  226. └─→ @刑部 法务合规
  227. ▼
  228. 御史台 ── 监察审计(全程监督、代码审查)
  229. ```
  230. **方式二:皇帝直接下旨给任意部门**
  231. ```
  232. 皇帝(你)
  233. ├─→ @中书省 拟一份新产品方案
  234. ├─→ @兵部 修复这个 Bug
  235. └─→ @御史台 审查这个 PR
  236. ```
  237. > 💡 三省制的核心是制衡:中书省负责"想",门下省负责"审",尚书省负责"做"。任何重大决策都要经过三省流转,避免一家独大。
  238. | 唐朝三省 | Agent ID | 职责 |
  239. |----------|----------|------|
  240. | **中书省** | `zhongshu` | 起草方案、Prompt 增强、生成执行计划 |
  241. | **门下省** | `menxia` | 审核方案、封驳不合理决策 |
  242. | **尚书省** | `shangshu` | 接收通过的方案、派发六部执行 |
  243. | **御史台** | `yushitai` | 全程监察、代码审查、质量把控 |
  244. | **兵部** | `bingbu` | 软件工程、系统架构 |
  245. | **户部** | `hubu` | 财务分析、成本管控 |
  246. | **工部** | `gongbu` | DevOps、服务器运维 |
  247. | **礼部** | `libu` | 品牌营销、内容创作 |
  248. | **吏部** | `libu2` | 项目管理、团队协调 |
  249. | **刑部** | `xingbu` | 法务合规、知识产权 |
  250. | **史官** | `shiguan` | 自动记录每日朝政摘要 |
  251. </details>
  252. <details>
  253. <summary><b>现代企业制(modern-ceo)</b></summary>
  254. **CEO 决策 → Board 审议 → CxO 执行**,扁平化管理、英文沟通。适合国际化团队或偏好现代企业架构的用户。
  255. **方式一:经 CEO 调度(默认)**
  256. ```
  257. Owner (You)
  258. ▼
  259. CEO ── Receive task, delegate to C-suite
  260. │
  261. ├─→ Board of Directors ── Strategic review & approval
  262. │ ←─┘ Approve / Reject / Request changes
  263. │
  264. ├─→ @CTO Technical execution (code, architecture)
  265. ├─→ @CFO Financial analysis (budget, cost)
  266. ├─→ @CMO Marketing (brand, content, social)
  267. ├─→ @COO Operations (DevOps, infrastructure)
  268. ├─→ @CLO Legal & compliance
  269. └─→ @CoS Project coordination
  270. ▼
  271. QA Director ── Quality assurance & code review
  272. ```
  273. **方式二:直接指挥(Direct command)**
  274. ```
  275. Owner (You)
  276. ├─→ @CTO Build a login API
  277. ├─→ @CFO Review this month's spending
  278. └─→ @QA Review this PR
  279. ```
  280. > 💡 Modern CEO mode uses English for all communication. The CEO acts as dispatcher (like 司礼监), the Board provides strategic oversight (like 内阁), and QA handles quality control (like 都察院).
  281. | Role | Agent ID | Responsibility |
  282. |------|----------|---------------|
  283. | **CEO** | `ceo` | Task intake, delegation, progress tracking |
  284. | **Board** | `board` | Strategic review, budget approval, veto power |
  285. | **QA Director** | `qa` | Code review, quality assurance |
  286. | **CTO** | `cto` | Engineering, architecture, technical decisions |
  287. | **CFO** | `cfo` | Financial analysis, cost optimization |
  288. | **CMO** | `cmo` | Marketing, brand, content creation |
  289. | **COO** | `coo` | Operations, DevOps, infrastructure |
  290. | **CLO** | `clo` | Legal compliance, IP protection |
  291. | **Chief of Staff** | `cos` | Project management, team coordination |
  292. </details>
  293. ---
  294. <a id="效果展示"></a>
  295. <details>
  296. <summary><h2>🎬 效果展示</h2></summary>
  297. ### Discord 模式
  298. ```
  299. 👑 皇帝:@司礼监 帮朕写个用户登录 API,再查一下这个月花了多少钱
  300. 🏛️ 司礼监:遵旨!臣先请内阁优化任务……
  301. → @内阁 请首辅审阅此旨,拟定执行计划。
  302. 📜 内阁:臣已拟票。
  303. 【任务一】@兵部 — 编写用户登录 REST API(Node.js + Express + JWT)
  304. 【任务二】@户部 — 本月 API 支出分析(分部门明细 + 优化建议)
  305. 🏛️ 司礼监:内阁拟票已收,开始派发!
  306. → @兵部 …(优化后的完整 Prompt)
  307. → @户部 …
  308. 🏛️ 兵部:✅ 已提交 GitHub:wanikua/auth-api#1
  309. 🔍 都察院:代码审查 ✅ 通过 | ⚠️ 建议添加 rate limiting
  310. 🏛️ 户部:本月 $23.47,环比 -12%,建议优化兵部 Prompt 省 15%。
  311. ```
  312. > 皇帝下旨 → 司礼监接旨 → **内阁优化** → 司礼监派发 → **都察院审查**。全流程公开可见。
  313. ### 飞书模式
  314. ```
  315. 👤 你:帮我写个用户登录 API,再查一下这个月花了多少钱
  316. 🏛️ 司礼监:遵旨,臣先请内阁拟票……
  317. ……(内阁优化 → 派发 → 执行 → 审查,用户无感)
  318. 🏛️ 司礼监:陛下,已办妥:
  319. 📌 兵部:auth-api 已创建,都察院审查通过 ✅
  320. 📌 户部:本月 $23.47,环比 -12%
  321. ```
  322. > 飞书模式:用户只和司礼监对话,后台自动走完整流程。
  323. </details>
  324. ---
  325. <a id="翰林院"></a>
  326. <details>
  327. <summary><h2>📝 翰林院 — AI 小说创作(可选)</h2></summary>
  328. 5 个 Agent 协作写小说:掌院学士(总编排)→ 修撰(架构)→ 编修(写作)→ 检讨(审核)→ 庶吉士(检索)。
  329. ```
  330. 用户: "帮我写一部修仙小说"
  331. └→ 掌院学士(总编排)
  332. ├─ spawn 修撰 → 大纲 + 世界观 + 人物档案
  333. ├─ 掌院审批 ✅
  334. ├─ spawn 编修 → 逐章写作(每章 ≥ 10,000 字)
  335. ├─ spawn 检讨 → 7 维度审核
  336. └─ 循环至全书完成 → 终审
  337. ```
  338. | Agent | 角色 | 职责 |
  339. |-------|------|------|
  340. | `hanlin_zhang` | 掌院学士 | 接需求、拆任务、协调、终审 |
  341. | `hanlin_xiuzhuan` | 修撰 | 大纲、世界观、人物档案 |
  342. | `hanlin_bianxiu` | 编修 | 逐章写作、归档 |
  343. | `hanlin_jiantao` | 检讨 | 文笔/逻辑/一致性审核 |
  344. | `hanlin_shujishi` | 庶吉士 | 搜索前文、检索资料 |
  345. </details>
  346. ---
  347. <a id="核心能力"></a>
  348. <details>
  349. <summary><h2>⚙️ 核心能力</h2></summary>
  350. | 能力 | 说明 |
  351. |------|------|
  352. | **多 Agent 协作** | 18+ 独立 Bot,@谁谁回复,@everyone 全员响应 |
  353. | **内阁前置优化** | 用户指令自动经内阁 Prompt 增强后再派发 |
  354. | **都察院自动审查** | 代码 push 到 GitHub 自动触发代码审查 |
  355. | **独立记忆** | 每个 Agent 独立工作区 + memory,越用越懂你 |
  356. | **60+ Skill** | GitHub、Notion、浏览器、Cron、TTS…… |
  357. | **定时任务** | 自动写日报/周报、健康检查、代码备份 |
  358. | **沙箱隔离** | Docker 容器隔离,Agent 代码执行互不干扰 |
  359. | **多平台** | Discord / 飞书 / Slack / Telegram / WebUI |
  360. ### 60+ 内置 Skill
  361. | 类别 | Skill |
  362. |------|-------|
  363. | 开发 | GitHub(Issue/PR/CI)、Coding Agent |
  364. | 文档 | Notion(数据库/页面/自动汇报) |
  365. | 信息 | 浏览器自动化、Web 搜索、Web 抓取 |
  366. | 自动化 | Cron 定时任务、心跳自检 |
  367. | 媒体 | TTS 语音、截图、视频帧提取 |
  368. | 运维 | tmux 远程控制、Shell 命令执行 |
  369. | 通信 | Discord、Slack、飞书、Telegram… |
  370. | 扩展 | [OpenClaw Hub](https://github.com/openclaw/openclaw) 社区 Skill |
  371. </details>
  372. ---
  373. <a id="更多"></a>
  374. <details>
  375. <summary><h2>🖥️ GUI 管理界面</h2></summary>
  376. 内置 Web Dashboard(`gui/` 目录),React + TypeScript + Vite:
  377. <p align="center">
  378. <img src="./images/gui-court.png" alt="朝堂总览" width="90%" />
  379. <br/><em>朝堂总览 — 御座、六部、诸院,在线状态一目了然</em>
  380. </p>
  381. <p align="center">
  382. <img src="./images/gui-sessions.png" alt="会话管理" width="90%" />
  383. <br/><em>会话管理 — Token 消耗、消息统计实时追踪</em>
  384. </p>
  385. 功能:仪表盘 · 朝堂对话 · 会话管理 · Cron 可视化 · Token 统计 · 系统健康监控
  386. ```bash
  387. cd danghuangshang/gui && npm install && npm run build
  388. cd server && npm install
  389. BOLUO_AUTH_TOKEN=你的密码 node index.js
  390. # 访问 http://你的服务器IP:18795
  391. ```
  392. > 三层 GUI:**Web Dashboard** 看状态 → **Discord** 下指令 → **Notion** 查报表
  393. </details>
  394. <details>
  395. <summary><h2>📱 接入飞书</h2></summary>
  396. 飞书插件已内置,无需额外安装。
  397. 1. [飞书开放平台](https://open.feishu.cn/app) 创建应用,复制 App ID + Secret
  398. 2. 开启机器人能力,添加事件 `im.message.receive_v1`(WebSocket 长连接)
  399. 3. `openclaw channels add` 选 Feishu,填入凭证
  400. 4. `openclaw gateway restart`,在飞书 @机器人 测试
  401. > 飞书用 WebSocket,**不需要公网 IP**。详见 [docs.openclaw.ai/channels/feishu](https://docs.openclaw.ai/channels/feishu)
  402. </details>
  403. <details>
  404. <summary><h2>📝 接入 Notion</h2></summary>
  405. 1. [Notion Integrations](https://www.notion.so/profile/integrations) 创建集成,复制 Secret
  406. 2. `mkdir -p ~/.config/notion && echo "ntn_xxx" > ~/.config/notion/api_key`
  407. 3. 在 Notion 页面点 **··· → Connect to** 授权
  408. 4. 在 Discord:`@司礼监 把今天的工作总结写到 Notion 日报里`
  409. </details>
  410. <details>
  411. <summary><h2>🧠 记忆备份</h2></summary>
  412. Agent 的记忆是长期积累的资产,丢失不可逆。内置备份脚本,一行命令守护所有 Agent 记忆。
  413. **备份内容:** 18 个 Agent 的 SQLite 记忆数据库 + 工作区记忆文件 + 核心配置
  414. ```bash
  415. # 立即备份
  416. bash scripts/memory-backup.sh
  417. # 查看现有备份
  418. bash scripts/memory-backup.sh -l
  419. # 从备份恢复
  420. bash scripts/memory-backup.sh -s daily/2026-03-15.tar.gz
  421. # 预览(不实际执行)
  422. bash scripts/memory-backup.sh --dry-run
  423. ```
  424. **自动定时备份(推荐):**
  425. ```bash
  426. # 每天凌晨 3 点自动备份
  427. (crontab -l 2>/dev/null; echo "0 3 * * * $HOME/danghuangshang/scripts/memory-backup.sh -q") | crontab -
  428. ```
  429. | 策略 | 保留周期 | 说明 |
  430. |------|----------|------|
  431. | 每日备份 | 7 天 | 自动清理过期 |
  432. | 每周备份 | 4 周 | 每周日自动归档 |
  433. | 每月备份 | 6 个月 | 每月 1 号自动归档 |
  434. > 使用 `sqlite3 .backup` 保证数据库一致性,备份期间不影响 Agent 正常运行。
  435. </details>
  436. <details>
  437. <summary><h2>🏥 配置诊断</h2></summary>
  438. ```bash
  439. bash <(curl -fsSL https://raw.githubusercontent.com/wanikua/danghuangshang/main/doctor.sh)
    • Note: Runs a downloaded script through process substitution (bash <(curl …))
    • Line 595 on GitHub
  440. ```
  441. **⚠️ 安全配置(必读)— 防止 Bot 消息循环!**
  442. 多 Bot 模式下,**必须**在每个 Agent 的 `openclaw.json` 中设置 `allowBots: "mentions"`:
  443. ```json
  444. {
  445. "channels": [
  446. {
  447. "channel": "discord",
  448. "config": {
  449. "allowBots": "mentions" // ✅ 只响应明确@的 Bot 消息
  450. }
  451. }
  452. ]
  453. }
  454. ```
  455. **配置说明:**
  456. - `allowBots: false` ❌ — 完全忽略 Bot 消息,多 Bot 协作失效(司礼监无法@六部)
  457. - `allowBots: true` ❌ — 响应所有 Bot 消息,导致无限循环
  458. - `allowBots: "mentions"` ✅ — 只响应明确@的 Bot 消息,完美平衡
  459. > 📌 **严禁使用 @everyone**:会触发所有 Bot 同时响应,导致频道瘫痪。
  460. **@everyone 不触发?** → 每个 Bot 都要开 Message Content Intent + Server Members Intent([Discord Developer Portal](https://discord.com/developers/applications) → Bot 页面 → Privileged Gateway Intents)
  461. **Bot 回复触发 @everyone 通知?** → 服务器设置 → 角色 → @everyone → 关闭「提及 @everyone」权限(Owner 不受影响)
  462. </details>
  463. <details>
  464. <summary><h2>❓ 常见问题</h2></summary>
  465. **Q: 能用其他模型吗?** → 能。支持 Anthropic、OpenAI、Gemini、DeepSeek 等,不同部门可用不同模型。
  466. **Q: 每月费用?** → 轻度 $10-15,中度 $20-30。重活用强模型、轻活用快模型可省 5 倍。
  467. **Q: 和 Become CEO 的关系?** → [Become CEO](https://github.com/wanikua/become-ceo) 是英文企业版,同架构,CTO/CFO 代替六部。
  468. > 📖 [完整 FAQ](./docs/faq.md)
  469. </details>
  470. <details>
  471. <summary><h2>🆚 为什么选这套方案?</h2></summary>
  472. | | ChatGPT 等 | AutoGPT / CrewAI | **AI 朝廷** |
  473. |---|---|---|---|
  474. | 多 Agent | ❌ 单通才 | ✅ 需写 Python | ✅ 配置文件,零代码 |
  475. | 记忆 | ⚠️ 单一 | ⚠️ 需接向量库 | ✅ 每 Agent 独立 memory |
  476. | 工具 | ⚠️ 有限 | ⚠️ 需开发 | ✅ 60+ Skill |
  477. | 界面 | 网页 | CLI | ✅ Discord 原生 |
  478. | 部署 | 无需 | Docker + 编码 | ✅ 一键脚本 |
  479. | 24h 在线 | ❌ | ✅ | ✅ Cron + 心跳 |
  480. **核心优势:不是框架,是成品。** 跑个脚本就能用,在 Discord 里 @谁谁回复。
  481. > 📖 [架构详解](./docs/architecture.md) | [与 ChatGPT/AutoGPT/CrewAI 对比](./docs/architecture.md)
  482. </details>
  483. <details>
  484. <summary><h2>🏢 企业版 Become CEO</h2></summary>
  485. 同架构,CEO/CTO/CFO 代替朝廷六部:
  486. 👉 **[Become CEO](https://github.com/wanikua/become-ceo)**
  487. | 朝廷 | 企业 |
  488. |:---:|:---:|
  489. | 司礼监 | COO |
  490. | 内阁 | CSO |
  491. | 都察院 | QA VP |
  492. | 兵部 | CTO |
  493. | 户部 | CFO |
  494. | 礼部 | CMO |
  495. </details>
  496. <details>
  497. <summary><h2>🍍 实战案例:菠萝王朝</h2></summary>
  498. 18 个 Agent,24/7 运行的真实生产系统。
  499. ```
  500. 🏯 菠萝王朝
  501. ├── 本纪(时间线):起居注·朔望录·编年纪·大事记
  502. ├── 表(看板):食货表·舆情表·臣工表·器用表
  503. ├── 志(知识库):天工志·宣化志·经籍志·典章志
  504. └── 列传(项目档案):11 个项目全生命周期
  505. ```
  506. > 📖 [菠萝王朝详解](./docs/pineapple-dynasty.md)
  507. </details>
  508. ---
  509. ## 加入朝会
  510. | 小红书「菠萝菠菠🍍」 | 公众号「菠言菠语」 | 微信群 |
  511. |:---:|:---:|:---:|
  512. | <a href="https://www.xiaohongshu.com/user/profile/5a169df34eacab2bc9a7a22d"><img src="./images/avatar-xiaohongshu.png" width="150" style="border-radius:50%"/></a> | <img src="./images/qr-wechat-official.jpg" width="150"/> | <img src="./images/qr-wechat-group.png" width="150"/> |
  513. <details>
  514. <summary>相关链接 · 安全须知 · 免责声明</summary>
  515. **相关链接**
  516. - 🏢 [Become CEO — 企业版](https://github.com/wanikua/become-ceo) · 🔧 [OpenClaw 框架](https://github.com/openclaw/openclaw) · 📖 [OpenClaw 文档](https://docs.openclaw.ai) · 📚 [完整文档](./docs/README.md)
  517. - 🎁 [MiniMax Coding Plan](https://platform.minimaxi.com/subscribe/coding-plan?code=CIeSxc2iq2&source=link) — 88折优惠
  518. **安全须知** — 🔴 用云服务器,不要个人电脑 · workspace 设专用目录 · API Key 不提交公开仓库 · [详见](./docs/security.md)
  519. **免责声明** — 按"原样"提供,AI 生成内容仅供参考,敏感操作请人工复核。[详见](./docs/security.md)
  520. </details>
  521. ---
  522. **🔄 已安装?一键更新:**
  523. ```bash
  524. # 先 clone 仓库(如果还没有)
  525. git clone https://github.com/wanikua/danghuangshang.git
  526. cd danghuangshang
  527. # 然后运行安全更新脚本
  528. bash scripts/safe-update.sh
  529. ```
  530. Docker:`docker pull boluobobo/ai-court:latest && docker compose up -d`
  531. > **Docker 多架构支持**:✅ linux/amd64(Intel/AMD) · ✅ linux/arm64(Apple Silicon/ARM 服务器)
  532. v3.5.3 | MIT License | [User Agreement](./docs/user-agreement.md) | [Privacy Policy](./docs/privacy-policy.md)
  533. > 📜 Licensed under MIT. Credit: [danghuangshang](https://github.com/wanikua/danghuangshang) by [@wanikua](https://github.com/wanikua)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.