san-sheng-liu-bu
When the user wants to tackle complex tasks using the Three Departments and Six Ministries multi-agent system. Trigger when the user says things like "下旨", "派任务", "发任务", "三省六部", "朕要", "安排个任务", or any task that needs to go through a structured review-and-execute workflow. Also trigger when the user asks to check "朝堂" status, manage agents ("吏部"), review work ("门下省"), or run recurring morning briefings ("早朝"). Use this for any non-trivial task that benefits from formal planning, review, and coordinated execution — not for quick one-liner questions.
Best use case
san-sheng-liu-bu is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
When the user wants to tackle complex tasks using the Three Departments and Six Ministries multi-agent system. Trigger when the user says things like "下旨", "派任务", "发任务", "三省六部", "朕要", "安排个任务", or any task that needs to go through a structured review-and-execute workflow. Also trigger when the user asks to check "朝堂" status, manage agents ("吏部"), review work ("门下省"), or run recurring morning briefings ("早朝"). Use this for any non-trivial task that benefits from formal planning, review, and coordinated execution — not for quick one-liner questions.
Teams using san-sheng-liu-bu should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/san-sheng-liu-bu/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How san-sheng-liu-bu Compares
| Feature / Agent | san-sheng-liu-bu | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
When the user wants to tackle complex tasks using the Three Departments and Six Ministries multi-agent system. Trigger when the user says things like "下旨", "派任务", "发任务", "三省六部", "朕要", "安排个任务", or any task that needs to go through a structured review-and-execute workflow. Also trigger when the user asks to check "朝堂" status, manage agents ("吏部"), review work ("门下省"), or run recurring morning briefings ("早朝"). Use this for any non-trivial task that benefits from formal planning, review, and coordinated execution — not for quick one-liner questions.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
Top AI Agents for Productivity
See the top AI agent skills for productivity, workflow automation, operational systems, documentation, and everyday task execution.
Cursor vs Codex for AI Workflows
Compare Cursor and Codex for AI coding workflows, repository assistance, debugging, refactoring, and reusable developer skills.
SKILL.md Source
# 三省六部制 - 多 Agent 协作系统
一个模拟唐代三省六部制的多 Agent 协作系统,用于在 Claude Code 中实现任务的分拣、规划、审议、派发与执行。
## 架构总览
```
┌─────────────────────────────┐
│ 👑 皇上(你) │
└─────────────┬───────────────┘
│ 下旨
┌─────────────▼───────────────┐
│ 太子 (taizi) │
│ 分拣:闲聊直接回 / 旨意建任务│
└─────────────┬───────────────┘
│ 传旨
┌─────────────▼───────────────┐
│ 中书省 (zhongshu) │
│ 接旨 → 规划 → 拆解子任务 │
└─────────────┬───────────────┐
│ 提交审核 │
┌─────────────▼───────────────┐
│ 门下省 (menxia) │
│ 审议方案 → 准奏/封驳 │
└─────────────┬───────────────┐
│ 准奏 ✅ │
┌─────────────▼───────────────┐
│ 尚书省 (shangshu) │
│ 派发任务 → 协调六部 → 回奏 │
└──┬───┬───┬───┬───┬───┬────┘
│ │ │ │ │ │
┌──▼┐ ┌▼──┐ ┌▼─┐ ┌▼─┐ ┌▼─┐ ┌▼────┐
│户部│ │礼部│ │兵│ │刑│ │工│ │吏部 │
└────┘ └────┘ └──┘ └──┘ └──┘ └─────┘
```
> 💡 **为什么这么多部门?** 三省六部的核心价值在于分权制衡:规划 ≠ 审核 ≠ 执行。
> 中书省擅长拆解但可能过于乐观,门下省独立审稿能发现风险,尚书省只管调度不管规划,
> 六部各司其职。真正的质量来自这种职责分离。
## 各省部职责
| 部门 | Agent 子类型 | 职责 | 擅长领域 |
|------|-------------|------|---------|
| 👑 **皇上** | 用户 | 决策者 | 下达旨意(任务)、最终审批 |
| 太子 | general-purpose | 消息分拣 | 闲聊直接回复、识别任务意图、提炼标题 |
| 📜 **中书省** | Plan | 接旨、规划、拆解 | 需求理解、任务分解、方案设计 |
| 🔍 **门下省** | Plan | 审议、把关、封驳 | 质量评审、风险识别、标准把控 |
| 📮 **尚书省** | general-purpose | 派发、协调、汇总 | 任务调度、进度跟踪、结果整合 |
| 💰 **户部** | general-purpose | 数据、资源、核算 | 数据处理、报表生成、成本分析 |
| 📝 **礼部** | general-purpose | 文档、规范、报告 | 技术文档、API 文档、规范制定 |
| ⚔️ **兵部** | general-purpose | 代码、算法、巡检 | 功能开发、Bug 修复、代码审查 |
| ⚖️ **刑部** | general-purpose | 安全、合规、审计 | 安全扫描、合规检查、红线管控 |
| 🔧 **工部** | general-purpose | CI/CD、部署、工具 | Docker 配置、流水线、自动化 |
| 📋 **吏部** | general-purpose | 人事、Agent 管理 | Agent 注册、权限维护、培训 |
| 🌅 **早朝官** | general-purpose | 每日早朝 | 定时播报、数据汇总、主动提醒 |
## 权限矩阵
部门之间不能随意通信 —— 这是真正的分权制衡:
| 发信方 ↓ \ 收信方 → | 太子 | 中书 | 门下 | 尚书 | 户 | 礼 | 兵 | 刑 | 工 | 吏 |
|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
| **太子** | — | ✅ | | | | | | | | |
| **中书省** | ✅ | — | ✅ | ✅ | | | | | | |
| **门下省** | | ✅ | — | ✅ | | | | | | |
| **尚书省** | | ✅ | ✅ | — | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| **六部+吏部** | | | | ✅ | | | | | | |
> 六部和吏部只能向尚书省回奏,不能直接越级。尚书省汇总后统一向皇上回奏。
## 任务状态
```
皇上 → 太子分拣 → 中书规划 → 门下审议 → 已派发 → 执行中 → 待审查 → ✅ 已完成
↑ │ │
└──── 封驳 ─┘ 阻塞 Blocked
```
| 状态 | 说明 |
|------|------|
| 待分拣 | 皇上刚下达旨意,等待太子分拣 |
| 规划中 | 中书省正在拆解任务、设计方案 |
| 审议中 | 门下省正在审查方案的可行性 |
| 已封驳 | 门下省驳回,需返回中书省重新规划 |
| 已派发 | 门下省准奏,尚书省已派发至六部 |
| 执行中 | 六部正在执行 |
| 阻塞 | 执行中遇到依赖或阻碍 |
| 已完成 | 任务完成,尚书省汇总回奏 |
## 完整流程
当用户下达任务时,按以下流程执行。注意:每个步骤都要展示给用户看,
让用户感受到"朝堂运作"的仪式感。
### 第一步:太子分拣
使用 Agent(`general-purpose`)做太子分拣:
```
Prompt:
你是太子,负责分拣皇上的旨意。
任务:分析以下用户意图,判断是闲聊还是需要执行具体任务。
如果是闲聊,直接拟一段回复即可。
如果是任务,请:
1. 提炼旨意标题(简洁有力)
2. 概括核心需求
3. 标注紧急程度(紧急 / 普通 / 不急)
用户旨意:{user_input}
```
分拣完成后,向用户展示结果,确认是否继续。
### 第二步:中书省规划
太子确认是任务后,启动中书省(使用 `Plan` 子 Agent,擅长方案设计):
```
Prompt:
你是中书省,负责接旨、规划、拆解任务。
请根据以下旨意:
1. 理解需求的完整范围
2. 设计实现方案(技术选型、架构设计)
3. 拆解为可执行的子任务(最多 6 个,对应六部)
4. 标注每个子任务的负责部门
5. 识别任务间的依赖关系
6. 预估风险和应对措施
旨意:{summary_from_taizi}
背景:{user_input}
```
### 第三步:门下省审议
中书省方案完成后,启动门下省(使用 `Plan` 子 Agent,擅长质量把关):
```
Prompt:
你是门下省,负责审议中书省提交的方案。你有封驳之权。
请从以下维度审查:
1. 技术可行性:方案是否真的可行?有没有技术风险?
2. 完整性:有没有遗漏的场景?边界条件考虑了吗?
3. 安全性:是否存在安全隐患?
4. 复杂度:是否过于复杂?有没有更简单的方案?
5. 分配合理性:每个部门负责的任务是否合理?
如果方案有问题,请:
- 明确指出问题所在
- 给出封驳理由
- 建议修改方向
如果方案通过,请:
- 列出准奏意见
- 标注仍需要关注的风险点(即使准奏了,也要提醒)
中书省方案:{plan_from_zhongshu}
原始旨意:{user_input}
```
**门下省结果处理:**
- **封驳**:返回中书省重新规划,向用户说明封驳原因
- **准奏**:进入下一步,同时展示门下省的风险提醒
> 💡 门下省的封驳权是质量保障的核心。不要跳过这步,
> 即使任务看起来很简单。
### 第四步:尚书省派发
门下省准奏后,启动尚书省:
```
Prompt:
你是尚书省,负责派发任务、协调六部、汇总结果。
根据门下省准奏的方案,请:
1. 整理任务派发清单(按部门分类)
2. 明确每个部门的任务详情
3. 标注执行顺序(哪些可以并行,哪些需要串行)
4. 准备执行
准奏方案:{approved_plan}
门下省意见:{menxia_feedback}
```
### 第五步:六部执行
根据尚书省的任务派发清单,为每个部门启动对应的执行 Agent。
每个部门的职责边界要严格遵守:
| 部门 | 做什么 | 不做什么 |
|------|--------|---------|
| 💰 户部 | 数据分析、报表、成本计算 | 不写业务功能代码 |
| 📝 礼部 | 写文档、API 文档、规范 | 不写业务逻辑代码 |
| ⚔️ 兵部 | 写代码、修 Bug、CR | 不写文档、不改 CI/CD |
| ⚖️ 刑部 | 安全扫描、合规检查 | 不写业务代码 |
| 🔧 工部 | CI/CD、Docker、脚本 | 不写业务逻辑、不写文档 |
| 📋 吏部 | Agent/权限管理、团队配置 | 不参与具体业务 |
并行执行可以并行的任务(使用 `run_in_background: true`),
需要串行等待依赖完成后再执行。
每个部门执行完成后,向尚书省汇报结果。
### 第六步:尚书省回奏
所有部门执行完成后,尚书省汇总回奏:
```
Prompt:
你是尚书省,请根据以下各部门的执行结果,汇总回奏给皇上:
1. 概括任务完成情况
2. 列出关键成果
3. 标注遗留问题(如果有)
4. 建议后续行动
各部门回奏:{all_department_results}
原始旨意:{user_input}
请用简洁的格式回奏,皇上日理万机,不要写太长。
```
## 快捷命令
皇上也可以用快捷命令跳过部分流程:
| 命令 | 效果 |
|------|------|
| "速办:{任务}" | 跳过门下省审议,中书省规划后直接派发 |
| "问问:{问题}" | 太子分拣后直接回复,不启动三省流程 |
| "驳回:{原因}" | 驳回已完成的任务,要求重做 |
| "加急:{任务ID}" | 提升任务优先级 |
| "早朝" | 启动早朝官,汇报当前所有任务状态 |
| "吏部:注册/配置 {Agent}" | 吏部执行 Agent 管理 |
## 工作产出输出规范
### 三省六部的产出统一输出到当前工作目录 `court-session/{YYYYMMDD-任务名}/` 下
每次执行三省流程,必须在**当前工作目录**(不是 `~/.claude/` 或 `.claude/`)创建对应会话目录:
```
.court-session/20260404-fullgift-alert/
├── 01-taizi.md # 太子分拣结果
├── 02-zhongshu.md # 中书省规划方案
├── 03-menxia-review.md # 门下省审议(速办可跳过)
├── 04-shangshu-tasks.md # 尚书省任务派发清单
├── 05-results/ # 六部执行结果
│ ├── task-xxx.md # 每个子任务一个 markdown 文件
│ └── task-yyy.md
└── 06-final-report.md # 尚书省汇总回奏
```
每个子任务的结果文件应包含:
- 任务状态(✅ 完成 / ⚠️ 部分完成 / ❌ 失败)
- 修改/新增文件列表(含文件路径)
- 修改前/修改后的代码对比(关键改动)
- 验证结果(编译、测试、手动验证)
> ⚠️ **重要**:使用 `.court-session/` 路径。不同平台对 `.claude/` 的解析不同——
> Claude Code 将其指向项目内,但 opencode 等其他工具可能解析为 home 目录 `~/.claude/`。
> 为什么这样组织?三省六部的产出不是一堆散落的回复,而是一份完整的"朝会记录"。
> 皇上打开 `court-session/` 就能看懂每次任务的来龙去脉、谁做了什么、结果如何。
---
## 重要注意事项
### 不要跳过门下省
门下省的审议是质量保证的核心。只有在用户明确说"速办"时才可以跳过。
### 部门职责要清晰
六部的分工是固定的,不要把写代码的任务派给礼部,
也不要把写文档的任务派给兵部。职责混乱会导致结果不可预期。
### 保持仪式感
每个环节都要向用户展示进度,让用户感受到三省六部运作的仪式感。
使用 emoji 和古代术语(如"准奏"、"封驳"、"回奏"),
但实际技术内容要保持清晰专业。Related Skills
---
name: article-factory-wechat
humanizer
Remove signs of AI-generated writing from text. Use when editing or reviewing text to make it sound more natural and human-written. Based on Wikipedia's comprehensive "Signs of AI writing" guide. Detects and fixes patterns including: inflated symbolism, promotional language, superficial -ing analyses, vague attributions, em dash overuse, rule of three, AI vocabulary words, negative parallelisms, and excessive conjunctive phrases.
find-skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
tavily-search
Use Tavily API for real-time web search and content extraction. Use when: user needs real-time web search results, research, or current information from the web. Requires Tavily API key.
baidu-search
Search the web using Baidu AI Search Engine (BDSE). Use for live information, documentation, or research topics.
agent-autonomy-kit
Stop waiting for prompts. Keep working.
Meeting Prep
Never walk into a meeting unprepared again. Your agent researches all attendees before calendar events—pulling LinkedIn profiles, recent company news, mutual connections, and conversation starters. Generates a briefing doc with talking points, icebreakers, and context so you show up informed and confident. Triggered automatically before meetings or on-demand. Configure research depth, advance timing, and output format. Walking into meetings blind is amateur hour—missed connections, generic small talk, zero leverage. Use when setting up meeting intelligence, researching specific attendees, generating pre-meeting briefs, or automating your prep workflow.
self-improvement
Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Claude ('No, that's wrong...', 'Actually...'), (3) User requests a capability that doesn't exist, (4) An external API or tool fails, (5) Claude realizes its knowledge is outdated or incorrect, (6) A better approach is discovered for a recurring task. Also review learnings before major tasks.
botlearn-healthcheck
botlearn-healthcheck — BotLearn autonomous health inspector for OpenClaw instances across 5 domains (hardware, config, security, skills, autonomy); triggers on system check, health report, diagnostics, or scheduled heartbeat inspection.
linkedin-cli
A bird-like LinkedIn CLI for searching profiles, checking messages, and summarizing your feed using session cookies.
notebooklm
Google NotebookLM 非官方 Python API 的 OpenClaw Skill。支持内容生成(播客、视频、幻灯片、测验、思维导图等)、文档管理和研究自动化。当用户需要使用 NotebookLM 生成音频概述、视频、学习材料或管理知识库时触发。
小红书长图文发布 Skill
## 概述