danghuangshang: a Ming-dynasty bureaucracy for OpenClaw multi-agent teams
Open-source multi-agent collaboration system inspired by Chinese governance — deploy and coordinate specialized AI agents with OpenClaw.
At a glance
- What is it?
- The project maps Chinese imperial offices onto named AI agents and ships three ready-made org charts, with a one-command installer and a Docker image. It is opinionated, Discord-first, and its own README spends as much space on bot-loop safety as on features.
- Who is it for?
- Adopt danghuangshang if you already run OpenClaw and want a named, role-separated agent roster without designing the prompts yourself. Do not adopt it if you need a framework you can reason about module by module, or if you cannot put a Discord bot and an LLM API key on a server.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 132 days ago.
- What is it written in?
- Mainly TypeScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 30, 2026, and from our analysis. They are not legal advice.
Editorial analysis
What problem the imperial court metaphor actually solves
Most multi-agent demos stall at the same place. You have an LLM, you have a task, and you have no agreed answer to who receives the request, who rewrites it, and who checks the result. danghuangshang answers that by handing you a fixed org chart instead of a blank canvas.
The README describes the default as a Ming cabinet system: an emperor (you), a Directorate of Ceremonial Affairs that receives the order, a Grand Secretariat that enhances the prompt and produces a plan, six ministries that execute, and a Censorate that reviews code when something is pushed to GitHub. The repository states it ships 18 agents in that configuration, 14 in a Tang three-department variant, and 14 in a modern corporate variant with CEO, CTO and CFO roles.
That is the real product. Not another orchestration library, but a pre-written set of role prompts and routing rules you can install in minutes. If you have ever spent an afternoon writing system prompts for a planner agent and a reviewer agent, this is the shortcut. If you enjoy writing those prompts, the value proposition shrinks considerably.
How orders flow from a mention to a merged commit
The README gives two dispatch paths. In the default path, your message goes to the Directorate of Ceremonial Affairs, which forwards the request to the Grand Secretariat. The Secretariat rewrites the prompt, may ask clarifying questions, and returns a plan. The Directorate then dispatches to the ministries named in that plan. Separately, the Censorate watches for pushes to GitHub and either passes or rejects the change.
The second path skips all of that. In Discord multi-bot mode each ministry is its own bot, so you can mention the Ministry of War directly for a login API and get an answer without the cabinet round trip. The README recommends the Directorate path for complex tasks and direct mentions for simple ones, which is an honest admission that the extra hop costs latency and tokens.
Alongside the routing there is a task store and a context compressor exposed as binaries in package.json, plus a skills directory. The repository does not explain in the README how the compressor decides what to drop, so treat that as something to read in the source before you depend on it for long-running sessions.
Installing danghuangshang and issuing your first order
The README recommends a cloud server rather than a personal machine, and it offers four install paths. The local clone is the one it labels as recommended, because it works offline, lets you edit the installer, and includes what the README calls full persona injection.
git clone https://github.com/wanikua/danghuangshang.git
cd danghuangshang
bash scripts/full-install.shThere is also a remote one-liner for Linux and macOS that avoids git entirely, and a PowerShell equivalent for Windows. If OpenClaw is already installed, install-lite.sh only lays down configuration. A fourth script, install-hermes.sh, targets the Hermes Agent runtime instead of OpenClaw, and the README says the two runtimes can coexist.
After the script finishes, the README's three-step flow is: fill in your LLM API key and Discord bot token when prompted, then mention your bot in Discord. That is the whole first use. You should see the bot reply in character as the office you addressed.
Switching org charts later is a single script call:
bash scripts/switch-regime.sh tang-sansheng
bash scripts/switch-regime.sh modern-ceo
bash scripts/switch-regime.sh ming-neigeOne warning from the README deserves repeating: the older install.sh does not support remote execution and fails with a /dev/fd path error. Use scripts/full-install.sh or clone first. If you prefer containers, docker-compose.yml builds a service named court from the Dockerfile, binds the gateway dashboard to 127.0.0.1:18789 and the GUI to 127.0.0.1:18795, and caps the container at 4G memory and 2 CPUs.
The bot-to-bot loop is the failure mode to plan for
A court full of bots that can all hear each other is a message storm waiting to happen, and the README treats this as the headline safety issue rather than a footnote. New installers set allowBots to mentions, meaning a bot only reacts to another bot when explicitly mentioned. The README states plainly that allowBots should never be set to true, and links a safety guide and issue #107.
If you are running an older configuration, the documented fix is to edit the Discord block in your config:
"discord": {
"allowBots": "mentions"
}There is a second constraint worth naming. The README says the system automatically backs up ~/.openclaw/openclaw.json, but workspace files such as MEMORY.md need manual backup. That asymmetry is easy to miss and expensive to discover after a bad update. A safe-update script exists that the README describes as adding automatic backup and checks, and the manual path is git stash, git pull, git stash pop, with conflicts resolved by hand.
Finally, the project is not for you if you want a library to embed. This is a deployment: a server, a Discord bot, an API key, and a fixed cast of characters. Teams that need per-request control over agent composition will find the org chart getting in the way rather than helping.
How this differs from CrewAI and AutoGPT-style setups
CrewAI and similar frameworks give you primitives: agents, tasks, tools, and a process object you assemble in code. You decide how many agents exist and what each one does, and the framework executes your graph. The result is flexible and verbose, and the quality of the outcome tracks the quality of the prompts you wrote.
danghuangshang inverts that. The agents already exist, named after Ming and Tang offices, and the routing between them is defined by the regime you picked at install time. You configure rather than compose. The trade is obvious: less freedom, far less setup, and a mental model that a non-engineer on your team can hold in their head because the roles have names.
The README itself frames the comparison against ChatGPT, AutoGPT and CrewAI, which is a reasonable axis. The more useful distinction for an evaluator is that this project is bound to a runtime. It is built on OpenClaw, with a parallel path for Hermes Agent, and the Docker image installs openclaw globally from npm. Choosing danghuangshang means choosing that runtime too.
Licence, maintenance and the cost of upgrading
The repository is MIT licensed and the README explicitly invites pull requests and forks while asking that attribution and the licence file be kept. That is a permissive arrangement: you can ship modified versions commercially, provided you retain the notice. The README also contains an originality notice claiming the three-departments-times-six-ministries architecture as this project's own work and naming another project as an unattributed copy. That dispute is between the maintainers and does not change your MIT rights, but read docs/originality.md if provenance matters to your legal review. Nothing here is legal advice.
On maintenance, the last push to the default branch was on 2026-05-22, and the most recent release listed is v3.0 from 2026-03-12, described as a documentation rebuild plus a Docker image and broader platform coverage. package.json reports version 3.7.1, so the release tags trail the package version. The repository is not archived. The gap between the March release and the May push means you should check the issue tracker yourself rather than assume a cadence.
Upgrade cost is mostly configuration drift. Regime switches overwrite the active org chart, so any hand-edited agent personas will not survive a switch unless you keep them outside the managed directories. Docker users have it easier: the compose file uses named volumes for config, workspace and OpenViking data, so an image pull leaves your state in place. The container runs as a non-privileged court user with no-new-privileges set, which limits what a compromised agent can do to the host.
Editorial conclusion
Adopt danghuangshang if you already run OpenClaw and want a named, role-separated agent roster without designing the prompts yourself. Do not adopt it if you need a framework you can reason about module by module, or if you cannot put a Discord bot and an LLM API key on a server. Before installing, read docs/discord-safety.md and confirm your workspace files are backed up, because the README states the update script only backs up ~/.openclaw/openclaw.json and leaves MEMORY.md to you.
Frequently asked questions
What is danghuangshang and who is it for?
It is an open-source multi-agent collaboration system built on OpenClaw that maps Ming-dynasty government offices onto named AI agents. It suits people who already run OpenClaw and want a ready-made agent roster instead of writing role prompts from scratch.
How do I install danghuangshang?
The README recommends cloning the repository and running bash scripts/full-install.sh, which it says takes about five minutes and includes full persona injection. There is also a remote one-liner, a PowerShell script for Windows, and a lite installer for machines that already have OpenClaw.
Can I run danghuangshang with Docker?
Yes. The repository ships a Dockerfile and a docker-compose.yml that builds a service named court, exposes the gateway dashboard on 127.0.0.1:18789 and the GUI on 127.0.0.1:18795, and persists configuration through named volumes.
Why do the bots in danghuangshang keep replying to each other?
The README states that setting allowBots to true causes bots to trigger one another and produce a message storm. New installers set it to mentions so a bot only responds to another bot when explicitly mentioned, and the README tells older setups to adopt the same value.
Does danghuangshang work with runtimes other than OpenClaw?
The README documents install-hermes.sh for the Nous Research Hermes Agent runtime and says the two runtimes can run side by side. The default install paths and the Docker image target OpenClaw.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/wanikua-danghuangshang)