--- name: art-of-war-agents description: Apply Sun Tzu's Art of War to AI agent orchestration. Use for: task assessment (ไบ”ไบ‹ไธƒ่ฎก), deployment decisions, multi-agent strategy, token cost optimization, risk management, and agent collaboration patterns. Maps all 13 chapters to practical agent workflows with decision trees and troubleshooting. --- # ๐Ÿ“œ Art of War Agents > ๅ…ต่€…๏ผŒๅ›ฝไน‹ๅคงไบ‹๏ผŒๆญป็”Ÿไน‹ๅœฐ๏ผŒๅญ˜ไบกไน‹้“๏ผŒไธๅฏไธๅฏŸไนŸ > > "War is vital โ€” the province of life or death. It must be thoroughly studied." **Sun Tzu's 13 chapters โ†’ AI agent orchestration patterns.** This skill provides a complete framework for strategic agent deployment: when to use agents, which ones, how to organize them, and how to avoid wasting tokens on unwinnable battles. --- ## โšก Quick Reference Card ``` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ ART OF WAR AGENT DECISION FLOW โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ โ”‚ โ”‚ 1. ๅง‹่ฎก โ†’ ๅ€ผๅพ—ๅšๅ—๏ผŸ(ไบ”ไบ‹ไธƒ่ฎก่ฏ„ไผฐ) โ”‚ โ”‚ โ”œโ”€ Score โ‰ฅ70% โ†’ ้ƒจ็ฝฒ โ”‚ โ”‚ โ”œโ”€ Score 50-70% โ†’ ๅ…ˆ่กฅๅผฑ็‚น โ”‚ โ”‚ โ””โ”€ Score <50% โ†’ ไธๅš๏ผŒ้‡ๆ–ฐ่ง„ๅˆ’ โ”‚ โ”‚ โ”‚ โ”‚ 2. ่ฐ‹ๆ”ป โ†’ ่ƒฝไธๅšๅ—๏ผŸ(ไธŠๅ…ตไผ่ฐ‹) โ”‚ โ”‚ โ”œโ”€ ๅฏ่‡ชๅŠจๅŒ–/ๆถˆ้™ค โ†’ ไธๅš โ”‚ โ”‚ โ”œโ”€ ๅ• agent ๅฏ่งฃ โ†’ ๅ• agent โ”‚ โ”‚ โ””โ”€ ๅฟ…้กปๅคš agent โ†’ ็ปง็ปญ โ”‚ โ”‚ โ”‚ โ”‚ 3. ไฝœๆˆ˜ โ†’ ้ข„็ฎ—ๅคšๅฐ‘๏ผŸ(้€Ÿๆˆ˜้€Ÿๅ†ณ) โ”‚ โ”‚ โ”œโ”€ <10k tokens โ†’ ๅ• agent๏ผŒๅฟซ้€Ÿ่ฟญไปฃ โ”‚ โ”‚ โ””โ”€ >10k tokens โ†’ ๅคš agent๏ผŒ่ฎพๆฃ€ๆŸฅ็‚น โ”‚ โ”‚ โ”‚ โ”‚ 4. ๅ†›ๅฝข โ†’ ๆœ‰้ฃŽ้™ฉๅ—๏ผŸ(ๅ…ˆ่ƒœๅŽๆˆ˜) โ”‚ โ”‚ โ”œโ”€ ้ซ˜้ฃŽ้™ฉ โ†’ ้˜ฒๅพกไผ˜ๅ…ˆ๏ผŒๅคš้‡้ชŒ่ฏ โ”‚ โ”‚ โ””โ”€ ไฝŽ้ฃŽ้™ฉ โ†’ ้€Ÿๅบฆไผ˜ๅ…ˆ โ”‚ โ”‚ โ”‚ โ”‚ 5. ้ƒจ็ฝฒ โ†’ ็›‘ๆŽงไฟกๅท (่กŒๅ†›็ฏ‡) โ”‚ โ”‚ โ”œโ”€ ้‡ๅคๆ้—ฎ โ†’ ่กฅๅ……ไธŠไธ‹ๆ–‡ โ”‚ โ”‚ โ”œโ”€ ่พ“ๅ‡บๅ˜้•ฟไฝ†่ดจ้‡้™ โ†’ ๅผบๅˆถ็ฎ€ๆด โ”‚ โ”‚ โ”œโ”€ ่ฟ‡ๅบฆ่‡ชไฟก โ†’ ่ฆๆฑ‚ๆฅๆบ โ”‚ โ”‚ โ””โ”€ ๅพช็Žฏ่ฎบ่ฏ โ†’ ไป‹ๅ…ฅ้‡ๅฎšๅ‘ โ”‚ โ”‚ โ”‚ โ”‚ 6. ้ชŒ่ฏ โ†’ ไธ‰ๅๅŽŸๅˆ™ (็”จ้—ด็ฏ‡) โ”‚ โ”‚ โ””โ”€ ่‡ณๅฐ‘ 3 ไธช็‹ฌ็ซ‹ๆฅๆบไบคๅ‰้ชŒ่ฏ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ``` --- ## ๐ŸŽฏ 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 --- ## 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? 2. **ๅคฉ (Timing)**: Is now the right time? Dependencies ready? 3. **ๅœฐ (Environment)**: Do we have the right context/data/tools? 4. **ๅฐ† (Capability)**: Which agent(s) have the right skills? 5. **ๆณ• (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) 2. **ไธญ็ญ–**: Single focused agent with clear instructions 3. **ไธ‹็ญ–**: 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) 2. Excessive caution (never completes) 3. Quick temper (argues with user) 4. Over-optimization (loses the goal) 5. 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):** - **ไบ”็ง็ซ (Five fires)**: 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 ``` Task arrives โ†“ Can I do this myself in <5 min? โ”œโ”€ Yes โ†’ Do it (don't deploy agent) โ””โ”€ No โ†’ Continue โ†“ Is the task clearly defined? โ”œโ”€ No โ†’ Plan first (ๅง‹่ฎก็ฏ‡) โ””โ”€ Yes โ†’ Continue โ†“ What's the token budget? โ”œโ”€ Low (<10k) โ†’ Single focused agent (่ฐ‹ๆ”ป็ฏ‡) โ””โ”€ High โ†’ Multi-agent OK (ๅ…ตๅŠฟ็ฏ‡) โ†“ What's the risk if wrong? โ”œโ”€ High โ†’ Defense first (ๅ†›ๅฝข็ฏ‡), multiple validation โ””โ”€ Low โ†’ Speedไผ˜ๅ…ˆ (ไฝœๆˆ˜็ฏ‡) โ†“ Deploy with clear success criteria โ†“ Monitor for drift (่กŒๅ†›็ฏ‡) โ†“ Validate output (็”จ้—ด็ฏ‡ - cross-check) ``` --- ## ๐Ÿ“‹ Usage Examples ### Example 1: Task Assessment (ๅง‹่ฎก็ฏ‡) **User**: "Should I use an agent for competitor research?" **Agent applies ไบ”ไบ‹ไธƒ่ฎก**: | ไบ”ไบ‹ | ่ฏ„ไผฐ | ๅพ—ๅˆ† | |------|------|------| | ้“ (Wisdom) | Aligns with product launch goals | โœ“ 1 | | ๅคฉ (Timing) | Launch in 3 weeks, timing good | โœ“ 1 | | ๅœฐ (Environment) | Need market data, competitor info | โœ“ 1 | | ๅฐ† (Capability) | Research + synthesis agents available | โœ“ 1 | | ๆณ• (Process) | Clear workflow: researchโ†’synthesizeโ†’present | โœ“ 1 | **ไธƒ่ฎก Score**: 6/7 (task clarity could be better) **Overall**: 85% โ†’ **DEPLOY** **Recommendation**: Start with existing reports (ๅ› ้—ด) before new searches (ๆญป้—ด). Budget: ~5k tokens. --- ### Example 2: Agent Stuck (่กŒๅ†›็ฏ‡) **User**: "The agent keeps asking me the same questions over and over" **Diagnosis**: ๆŒ‚ๅฝข (entangling ground) โ€” agent is stuck in a loop **Signal Reading**: - โš ๏ธ Repeated questions = unclear instructions OR missing context - โš ๏ธ Likely on iteration 4+ = ่ƒœไน…ๅˆ™้’ (prolonged = degraded) **Action**: ``` "Stopping current run. Here's what was missing: [provide missing context] New instructions: 1. Use the context above 2. Complete in max 2 iterations 3. If blocked, make reasonable assumptions and note them 4. Output format: [specify] Proceed." ``` --- ### Example 3: Multi-Agent Orchestration (ๅ…ตๅŠฟ็ฏ‡) **User**: "I need a complete market analysis report" **Apply ๅ…ตๅŠฟ็ฏ‡ โ€” Create Momentum**: ``` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ ๅŠฟ (SHI) โ€” MOMENTUM CONFIGURATION โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ โ”‚ โ”‚ Research Agent โ†’ Synthesis Agent โ”‚ โ”‚ (collect raw data) (find patterns, insights) โ”‚ โ”‚ โ†“ โ†“ โ”‚ โ”‚ Critique Agent โ†’ Writing Agent โ”‚ โ”‚ (find gaps, flaws) (draft report) โ”‚ โ”‚ โ†“ โ†“ โ”‚ โ”‚ Validation Agent โ†’ FINAL OUTPUT โ”‚ โ”‚ (cross-verify facts) โ”‚ โ”‚ โ”‚ โ”‚ Each output โ†’ next input. No parallel chaos. โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ``` **ๅฅ‡ๆญฃ Combination**: - **ๆญฃ**: Research โ†’ Synthesis โ†’ Write (standard flow) - **ๅฅ‡**: Critique agent challenges assumptions mid-flow --- ### Example 4: Risk Management (ๅ†›ๅฝข็ฏ‡) **User**: "I want an agent to refactor our production codebase" **Apply ๅ†›ๅฝข็ฏ‡ โ€” Defense First**: **ๅ…ˆไธบไธๅฏ่ƒœ (Make Undefeatable)**: - [โœ“] Git branch created, current state saved - [โœ“] Automated tests in place - [โœ“] Rollback procedure documented - [โœ“] Changes will be reviewed before merge - [โœ“] Agent cannot push directly **ไปฅๅพ…ๆ•Œไน‹ๅฏ่ƒœ (Wait for Opportunity)**: - Start with non-critical module first - Validate approach before scaling - Set strict boundaries: "No changes to X, Y, Z" **Deployment**: ``` "Refactor the authentication module ONLY. Constraints: - No changes to public API signatures - All existing tests must pass - Max 3 iterations, then we review - Document all changes If uncertain about anything, ask before changing." ``` --- ### Example 5: Tool Usage (็ซๆ”ป็ฏ‡) **User**: "Should I let the agent execute code to analyze this dataset?" **Apply ็ซๆ”ป็ฏ‡ โ€” Five Fires Analysis**: | Fire Type | Available? | Use? | |-----------|-----------|------| | ไบบ็ซ (User data) | โœ“ Dataset provided | Use first | | ็งฏ็ซ (Cached) | โœ“ Previous analysis exists | Reuse | | ่พŽ็ซ (API/Search) | โœ“ Has access | Use if needed | | ๅบ“็ซ (Code exec) | โœ“ Sandbox available | **Use with caution** | | ้˜Ÿ็ซ (Multi-agent) | โœ“ Available | Not needed yet | **Decision**: Start with ไบบ็ซ + ็งฏ็ซ (existing data). Only use ๅบ“็ซ (code execution) if initial analysis shows it's necessary. **Guardrails**: - Code runs in sandbox - No network access - Output reviewed before trusting - Rollback: re-run original analysis if needed --- ### Example 6: Before/After Comparison **โŒ Before (No Art of War)**: ``` User: "Research our competitors and write a report" Agent: *starts searching immediately* *finds 50 sources* *writes 20 page report* *user: "this isn't what I needed"* *starts over* Token waste: ~50k Result: Wrong direction, redo needed ``` **โœ… After (Art of War Applied)**: ``` User: "Research our competitors and write a report" Agent [ๅง‹่ฎก็ฏ‡]: "Before I start: 1. Which competitors? (top 3? all in category?) 2. What aspects? (pricing? features? marketing?) 3. Who's the audience? (exec team? product team?) 4. What format? (slides? doc? spreadsheet?) 5. Deadline? (hours? days?)" User: "Top 3 competitors, features + pricing, for product team, spreadsheet, tomorrow" Agent [่ฐ‹ๆ”ป็ฏ‡]: "Single agent can handle this. Budget: ~8k tokens. Will use existing data first (ๅ› ้—ด), then search for gaps (ๆญป้—ด). Checkpoint after data collection. Proceed?" User: "Proceed" Agent [ๅ…ตๅŠฟ็ฏ‡]: *Research โ†’ Synthesis โ†’ Format* *Checkpoint: "Found data for 2/3 competitors, X missing. Use estimates?"* User: "Use estimates, note as assumptions" Agent [็”จ้—ด็ฏ‡]: *Cross-verified pricing with 2 sources* *Delivered: 8k tokens, correct direction* Token waste: ~8k (84% savings) Result: Right direction, one iteration ``` --- **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 2. Provide missing context 3. Set iteration limit: "Answer in 2 iterations max" 4. 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 (ๆ”ถ้›†ๆƒ…ๆŠฅ) 2. Analysis agent (ๅˆ†ๆžๆ•ฐๆฎ) 3. Critique agent (ๆ‰พๅ‡บๆผๆดž) 4. Writing agent (็”ŸๆˆๆŠฅๅ‘Š) 5. Validation agent (ไบคๅ‰้ชŒ่ฏ) Each output feeds the next, creating ๅŠฟ (momentum). --- ## ๐Ÿ› Troubleshooting Common Agent Problems | Problem | Sun Tzu Diagnosis | Solution | |---------|------------------|----------| | Agent stuck in loops | ่กŒๅ†›็ฏ‡ โ€” ๆŒ‚ๅฝข (entangling ground) | Intervene early, provide missing context, set iteration limit | | Output quality degrades | ไฝœๆˆ˜็ฏ‡ โ€” ่ƒœไน…ๅˆ™้’ (prolonged = dull) | Force conclusion, start fresh with clearer instructions | | Hallucinations | ็”จ้—ด็ฏ‡ โ€” ไฟกๆฏไธ่ถณ | Require sources, cross-verify with 3+ independent sources | | Agent argues with user | ไนๅ˜็ฏ‡ โ€” ๅฟฟ้€Ÿ (quick temper fault) | Calmly restate goal, remind "complete > perfect" | | Never completes task | ไนๅ˜็ฏ‡ โ€” ๅฟ…็”Ÿ (cowardly fault) | Set deadline, force output, accept "good enough" | | Wastes tokens on details | ่™šๅฎž็ฏ‡ โ€” ๆœช้ฟๅฎžๅ‡ป่™š | Redirect: you handle nuance, agent handles bulk | | Multi-agent chaos | ๅ…ตๅŠฟ็ฏ‡ โ€” ๆ— ๅŠฟ (no momentum) | Restructure: each agent output โ†’ next agent input | | Wrong direction | ๅง‹่ฎก็ฏ‡ โ€” ๆœชๅ…ˆ็Ÿฅ (didn't know first) | Stop, reassess with ไบ”ไบ‹ไธƒ่ฎก๏ผŒthen restart | --- ## ๐Ÿ“Š Visual Decision Tree ```mermaid flowchart TD A[Task Arrives] --> B{Can I do this
in <5 min?} B -->|Yes| C[Do It Yourself] B -->|No| D{Task Clearly
Defined?} D -->|No| E[ๅง‹่ฎก็ฏ‡: Plan First] D -->|Yes| F{Token Budget?} F -->|Low <10k| G[่ฐ‹ๆ”ป็ฏ‡: Single Agent] F -->|High| H[ๅ…ตๅŠฟ็ฏ‡: Multi-Agent] G --> I{Risk if Wrong?} H --> I I -->|High| J[ๅ†›ๅฝข็ฏ‡: Defense + Validation] I -->|Low| K[ไฝœๆˆ˜็ฏ‡: Speed Priority] J --> L[Deploy with Success Criteria] K --> L L --> M{Monitor:่กŒๅ†›็ฏ‡} M -->|Drift Detected| N[Intervene/Redirect] M -->|On Track| O[Complete] N --> M O --> P[็”จ้—ด็ฏ‡: Cross-Verify] P --> Q[Done] ``` --- ## ๐ŸŽ“ Remember > ็Ÿฅๅฝผ็Ÿฅๅทฑ๏ผŒ็™พๆˆ˜ไธๆฎ† > > "Know the enemy and know yourself; in a hundred battles you will never be defeated." **็Ÿฅๅฝผ** = Understand the task deeply **็Ÿฅๅทฑ** = Know your agents' capabilities and limits Agent deployment is war by other means. Treat it seriously. Plan thoroughly. Execute decisively. Review honestly. --- ## ๐Ÿ“š Files | File | Purpose | |------|---------| | `SKILL.md` | This file โ€” core principles and quick reference | | `references/thirteen-chapters.md` | Deep dive: each chapter's full agent mapping | | `scripts/assess-task.py` | Interactive ไบ”ไบ‹ไธƒ่ฎก assessment tool | --- ## ๐Ÿ”— Related - [thinking-skills](https://github.com/wanikua/thinking-skills) โ€” 20 thinking framework commands for Claude Code - [awesome-claude-skills](https://github.com/ComposioHQ/awesome-claude-skills) โ€” Curated skill collection