Art of War
Apply Sun Tzu's 13 chapters to AI agent organization and orchestration. This skill provides a framework for strategic decision-making about when, how, and which agents to deploy for maximum effectiveness with minimum waste.
Core Principles
知彼知己 (Know Enemy, Know Yourself)
- - 知彼: Understand the task deeply — requirements, constraints, success criteria
- 知己: Know your agents' capabilities, limitations, and costs
- 百战不殆: With both, every agent deployment is calculated, not hopeful
上兵伐谋 (Best Strategy Attacks Plans)
- - Planning > Execution. Invest in task analysis before spawning agents
- A well-planned single agent beats three confused agents
- "Win before fighting" — structure the problem so the solution is obvious
奇正相生 (Orthodox + Unorthodox)
- - 正: Standard workflows, proven patterns, reliable agents
- 奇: Creative approaches, novel combinations, experimental agents
- Use 正 for reliability, 奇 for breakthrough. Never rely on 奇 alone.
速战速决 (Speed is Essential)
- - Prolonged agent runs waste tokens and drift from intent
- Set clear termination conditions upfront
- If an agent isn't making progress in 2-3 iterations, reassess
先胜后战 (Victory Before Battle)
- - Ensure conditions favor success before deploying agents
- If you can't articulate what "winning" looks like, don't start
- Retreat is better than wasting resources on unwinnable tasks
开工前自检(必用)
每次部署 agent 前,填这个表。填不完别发。
CODEBLOCK0
三反验证(输出事实前必做)
CODEBLOCK1
信号监控(迭代中盯这些)
CODEBLOCK2
迭代限制(写死)
CODEBLOCK3
The Thirteen Chapters → Agent Patterns
1. 始计篇 (Laying Plans) — Task Assessment
Before deploying any agent, run the Five Constants + Seven Metrics:
五事 (Five Constants):
- 1. 道 (Wisdom): Does this task align with overall goals?
- 天 (Timing): Is now the right time? Dependencies ready?
- 地 (Environment): Do we have the right context/data/tools?
- 将 (Capability): Which agent(s) have the right skills?
- 法 (Process): What's the workflow? Success criteria?
七计 (Seven Metrics):
- - Which side has better task clarity?
- Which side has more capable agents?
- Which side has better context/data?
- Which side has clearer success criteria?
- Which side has better tool access?
- Which side has more disciplined execution?
- Which side will waste fewer resources?
Decision: If you can't answer these, don't deploy. Plan first.
2. 作战篇 (Waging War) — Cost Awareness
Agent runs cost tokens. Treat them like war costs:
- - 速战速决: Set iteration limits. Force conclusions.
- 因粮于敌: Use existing outputs/data; don't regenerate what exists
- 胜久则钝: Long-running agents lose focus and waste tokens
- 预算先行: Estimate token cost before starting; track as you go
Rule: If a task can be done in 1 agent iteration, don't use 3.
3. 谋攻篇 (Attack by Stratagem) — Planning Over Force
Hierarchy of agent deployment:
- 1. 上策: Restructure the problem so it solves itself (no agent needed)
- 中策: Single focused agent with clear instructions
- 下策: Multiple agents in complex orchestration
Avoid siege warfare: Don't throw more agents at a poorly-defined problem.
全胜思维: The best outcome is winning without fighting — automate or eliminate the task entirely.
4. 军形篇 (Tactical Dispositions) — Defense First
Before offense, ensure defense:
- - What can go wrong? (Hallucination, outdated info, tool failures)
- What's the rollback plan if the agent makes things worse?
- What guardrails prevent catastrophic outputs?
先为不可胜: Make yourself undefeatable first — have validation, version control, and undo capability.
以待敌之可胜: Then wait for the opportunity — deploy when conditions are favorable.
5. 兵势篇 (Energy/Impetus) — Momentum & Combination
Create unstoppable momentum:
- - 势 (Shi): Build configurations where each agent output naturally triggers the next
- 奇正: Combine standard agents (正) with creative approaches (奇)
- 节 (Timing): Release agents in waves, not all at once
Example pattern: Research agent → Synthesis agent → Critique agent → Final polish
Each builds on the previous, creating momentum.
6. 虚实篇 (Weak Points & Strong) — Strategic Targeting
Avoid strength, attack weakness:
- - Identify the critical bottleneck in the task
- Don't waste agent capacity on parts you can handle yourself
- Deploy agents where they have comparative advantage
避实击虚: If an agent struggles with nuance, handle the nuance yourself; let it handle the bulk work.
致人而不致于人: Control where the agent focuses; don't let it drift.
7. 军争篇 (Maneuvering) — Indirect Approaches
The longest path may be fastest:
- - Sometimes 2-3 focused agents beat 1 generalist agent
- Sometimes doing background research first saves 10 iterations later
- "Appear weak when strong" — let the agent explore naive approaches first, then guide
以迂为直: A seeming detour (extra planning, extra validation) often reaches the goal faster.
8. 九变篇 (Nine Variations) — Adaptability
Agents must adapt to changing conditions:
- - Have contingency plans: If agent A fails, what's plan B?
- 将在外,君命有所不受: Give agents autonomy within boundaries
- Recognize when to change strategy mid-execution
Five dangerous agent faults:
- 1. Reckless iteration (burns tokens)
- Excessive caution (never completes)
- Quick temper (argues with user)
- Over-optimization (loses the goal)
- Blind compliance (no pushback on bad instructions)
Watch for these; intervene early.
9. 行军篇 (Marching) — Environmental Awareness
Read the signals:
- - 相敌 (Observing the enemy): Watch agent outputs for drift, hallucination, confusion
- 信号 (Signals): Repeated questions = unclear instructions; circular reasoning = stuck
- 地形 (Terrain): Some tasks are "difficult ground" — high uncertainty, need more oversight
When to intervene:
- - Agent asks the same question twice
- Output quality degrades over iterations
- Agent is confident but wrong
10. 地形篇 (Terrain) — Task Classification
Six terrain types → Six task types:
| 地形 | 任务类型 | Agent 策略 |
|---|
| 通形 (Accessible) | 清晰定义的任务 | 直接部署,标准流程 |
| 挂形 (Entangling) |
容易陷入细节的任务 | 设时间限制,强制输出 |
| 支形 (Stalemate) | 信息不足的任务 | 先收集信息,再决策 |
| 隘形 (Narrow) | 高约束任务 | 精确指令,严格验证 |
| 险形 (Dangerous) | 高风险任务 | 多重验证,保守策略 |
| 远形 (Distant) | 长链条任务 | 分阶段,设检查点 |
11. 九地篇 (Nine Grounds) — Commitment Levels
Match resource commitment to task importance:
| 地 | 任务重要性 | Agent 投入 |
|---|
| 散地 (Home ground) | 日常任务 | 轻量 agent,快速迭代 |
| 轻地 (Light ground) |
低价值任务 | 最小可用方案 |
| 争地 (Contentious) | 竞争/时间敏感 | 优先资源,快速部署 |
| 交地 (Open ground) | 多方协作 | 明确接口,文档先行 |
| 衢地 (Intersecting) | 多目标 | 平衡资源,避免偏废 |
| 重地 (Serious) | 高价值任务 | 多 agent 协作,充分验证 |
| 圮地 (Difficult) | 信息不足 | 先探索,后投入 |
| 围地 (Desperate) | 受约束 | 创造性方案,突破限制 |
| 死地 (Death) | 背水一战 | 全力以赴,不留退路 |
Most tasks are 散地 or 轻地 — don't over-invest.
12. 火攻篇 (Fire Attack) — Tool Usage
Fire = powerful tools (code execution, API calls, external data):
1. 人火 (Human fire): User-provided data/context
2. 积火 (Accumulated fire): Cached/prepared resources
3. 辎火 (Supply fire): Tool/API access
4. 库火 (Arsenal fire): Code execution
5. 队火 (Unit fire): Multi-agent collaboration
用火的时机 (When to use fire):
- - 行必有备 (Always prepared): Have fallback if tool fails
- 发火有时 (Right timing): Don't use tools prematurely
- 发火在早 (Early): Use tools early to validate direction
Warning: Fire can burn you. Validate tool outputs; don't trust blindly.
13. 用间篇 (Spies) — Information Gathering
Five types of intelligence sources:
| 间 | Agent 应用 |
|---|
| 因间 (Local spies) | 利用现有文档/代码库 |
| 内间 (Inside spies) |
访问内部系统/数据库 |
| 反间 (Double agents) | 交叉验证多个信息源 |
| 死间 (Doomed spies) | 一次性查询(搜索、API) |
| 生间 (Living spies) | 持续监控(RSS、警报) |
关键原则:
- - 三反: Cross-verify with 3+ independent sources
- 不可偏信: Never trust a single source
- 先知: Gather intelligence before making decisions
Quick Decision Tree
CODEBLOCK4
Usage Examples
Example 1: Should I use an agent for this?
User: "I need to research competitors for our new product launch"
Apply 始计篇:
- - 道: Aligns with business goals ✓
- 天: Launch is in 3 weeks, timing is good ✓
- 地: Need market data, competitor websites, reviews ✓
- 将: Research agent + synthesis agent ✓
- 法: Research → Synthesize → Present findings ✓
Decision: Deploy, but start with 因间 (existing reports) before 死间 (new searches).
Example 2: Agent is stuck in loops
User: "The agent keeps asking me the same questions"
Apply 行军篇: This is a signal (信号). The agent is on 挂形 (entangling ground).
Action:
- 1. Intervene early
- Provide missing context
- Set iteration limit: "Answer in 2 iterations max"
- If still stuck, switch strategy (九变篇)
Example 3: Multi-agent orchestration
User: "I need to build a complete market analysis report"
Apply 兵势篇 (create momentum):
- 1. Research agent (收集情报)
- Analysis agent (分析数据)
- Critique agent (找出漏洞)
- Writing agent (生成报告)
- Validation agent (交叉验证)
Each output feeds the next, creating 势 (momentum).
Remember
兵者,国之大事,死生之地,存亡之道,不可不察也
"War is a matter of vital importance to the State; the province of life or death; the road to survival or ruin. It is mandatory that it be thoroughly studied."
Agent deployment is the same. Treat it seriously. Plan thoroughly. Execute decisively. Review honestly.
兵法
将孙子兵法十三篇应用于AI智能体组织与编排。该技能提供了一个战略决策框架,用于决定何时、如何以及部署哪些智能体,以最小消耗实现最大效能。
核心原则
知彼知己
- - 知彼: 深入理解任务——需求、约束、成功标准
- 知己: 了解智能体的能力、局限和成本
- 百战不殆: 两者兼备,每次智能体部署都是经过计算的,而非心存侥幸
上兵伐谋
- - 规划 > 执行。在启动智能体之前,先投入任务分析
- 一个规划良好的单一智能体胜过三个混乱的智能体
- 先胜后战——结构化问题,使解决方案显而易见
奇正相生
- - 正: 标准工作流、经过验证的模式、可靠的智能体
- 奇: 创造性方法、新颖组合、实验性智能体
- 用正确保可靠性,用奇实现突破。切勿仅依赖奇。
速战速决
- - 长时间的智能体运行会浪费令牌并偏离目标
- 提前设定明确的终止条件
- 如果智能体在2-3次迭代中没有进展,重新评估
先胜后战
- - 确保条件有利于成功,再部署智能体
- 如果你说不清胜利是什么样子,就不要开始
- 撤退比在无法完成的任务上浪费资源要好
开工前自检(必用)
每次部署 agent 前,填这个表。填不完别发。
┌────────────────────────────────────────────────────┐
│ 五事自检 FIVE CONSTANTS │
├────────────────────────────────────────────────────┤
│ 道:这任务值得做吗?对齐目标吗? │
│ □ 是 □ 否 □ 不确定 │
│ │
│ 天:现在是时候吗?依赖准备好了吗? │
│ □ 是 □ 否 □ 不确定 │
│ │
│ 地:数据/上下文/工具齐了吗? │
│ □ 是 □ 否 □ 不确定 │
│ │
│ 将:有合适的 agent 吗?能力匹配吗? │
│ □ 是 □ 否 □ 不确定 │
│ │
│ 法:流程清楚吗?什么叫做完? │
│ □ 是 □ 否 □ 不确定 │
│ │
│ 得分:_/5 │
│ ≥4: 可以发 | 3: 先补弱点 | <3: 别发 │
└────────────────────────────────────────────────────┘
三反验证(输出事实前必做)
要验证的事实:
□ 来源 1(Agent 内部知识):
□ 来源 2(外部搜索/API):
□ 来源 3(用户上下文/文档):
一致 → 信 | 不一致 → 查
信号监控(迭代中盯这些)
⚠ 问同样的问题第二次 → 缺上下文,补
⚠ 输出越来越长 → 在填充,停
⚠ 过度自信 → 要来源,验
⚠ 回避问题 → 不会,直说
⚠ 循环论证 → 卡住,重定向
看到任一信号 → 立刻干预,别等第 5 次
迭代限制(写死)
最大迭代次数:3 次(默认)
Token 预算:_
超时:_ 分钟
到限不出结果 → 强制结论,停
十三篇 → 智能体模式
1. 始计篇 — 任务评估
在部署任何智能体之前,运行五事七计:
五事:
- 1. 道: 此任务是否与整体目标一致?
- 天: 时机是否合适?依赖项是否就绪?
- 地: 我们是否有正确的上下文/数据/工具?
- 将: 哪个智能体拥有合适的技能?
- 法: 工作流是什么?成功标准是什么?
七计:
- - 哪一方任务清晰度更高?
- 哪一方智能体能力更强?
- 哪一方上下文/数据更优?
- 哪一方成功标准更明确?
- 哪一方工具访问权限更好?
- 哪一方执行更规范?
- 哪一方资源浪费更少?
决策: 如果无法回答这些问题,不要部署。先规划。
2. 作战篇 — 成本意识
智能体运行消耗令牌。将其视为战争成本:
- - 速战速决: 设定迭代限制。强制得出结论。
- 因粮于敌: 利用已有的输出/数据;不要重新生成已有的内容
- 胜久则钝: 长时间运行的智能体会失去焦点并浪费令牌
- 预算先行: 开始前估算令牌成本;过程中持续追踪
规则: 如果一个任务可以在1次智能体迭代中完成,不要使用3次。
3. 谋攻篇 — 规划胜于蛮力
智能体部署的层次结构:
- 1. 上策: 重构问题使其自行解决(无需智能体)
- 中策: 单一专注的智能体,配有清晰指令
- 下策: 多个智能体进行复杂编排
避免攻城战: 不要向定义不清的问题投入更多智能体。
全胜思维: 最好的结果是不战而屈人之兵——完全自动化或消除该任务。
4. 军形篇 — 防御为先
在进攻之前,确保防御:
- - 可能出现什么问题?(幻觉、过时信息、工具故障)
- 如果智能体把事情搞得更糟,回滚计划是什么?
- 有哪些防护措施可以防止灾难性输出?
先为不可胜: 首先使自己立于不败之地——拥有验证、版本控制和撤销能力。
以待敌之可胜: 然后等待机会——在条件有利时部署。
5. 兵势篇 — 动量与组合
创造不可阻挡的动量:
- - 势: 构建配置,使每个智能体的输出自然触发下一个
- 奇正: 将标准智能体(正)与创造性方法(奇)相结合
- 节: 分批释放智能体,而非一次性全部释放
示例模式: 研究智能体 → 综合智能体 → 批判智能体 → 最终润色
每个步骤都建立在前一个步骤之上,形成动量。
6. 虚实篇 — 战略目标定位
避实击虚:
- - 识别任务中的关键瓶颈
- 不要将智能体能力浪费在你自己可以处理的部分
- 在智能体具有比较优势的地方部署它们
避实击虚: 如果智能体在细微之处挣扎,你自己处理细微之处;让它处理主体工作。
致人而不致于人: 控制智能体的关注点;不要让它偏离方向。
7. 军争篇 — 间接方法
最长的路可能是最快的:
- - 有时2-3个专注的智能体胜过1个通才智能体
- 有时先做背景研究可以节省后续10次迭代
- 能而示之不能——让智能体先探索天真的方法,然后引导
以迂为直: 看似绕路(额外的规划、额外的验证)往往能更快达到目标。
8. 九变篇 — 适应性
智能体必须适应不断变化的条件:
- - 制定应急预案:如果智能体A失败,B计划是什么?
- 将在外,君命有所不受: 在边界内给予智能体自主权
- 识别何时在执行过程中改变策略
五种危险的智能体缺陷:
- 1. 鲁莽迭代(消耗令牌)
- 过度谨慎(永远无法完成)
- 脾气暴躁(与用户争论)
- 过度优化(偏离目标)
- 盲目服从(对错误指令没有抵制)
注意这些;及早干预。
9. 行军篇 — 环境感知
读取信号:
- - 相敌: 观察智能体输出是否存在偏离、幻觉、混乱
- 信号: 重复提问 = 指令不清晰;循环论证 = 卡住
- 地形: 有些任务是难行之地——高度不确定性,需要更多监督
何时干预:
- - 智能体两次问同一个问题
- 输出质量随迭代次数下降
- 智能体自信但错误
10. 地形篇 — 任务分类
六种地形 → 六种任务类型:
| 地形 | 任务类型 | 智能体策略 |
|---|
| 通形 | 清晰定义的任务 | 直接部署,标准流程 |
| 挂形 |
容易陷入细节的任务 | 设时间限制,强制输出 |
| 支形 | 信息不足的任务 | 先收集信息,再决策 |
| 隘形 | 高约束任务 | 精确指令,严格验证 |
| 险