[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EAD7SAR4ATTADXP49076AK":3,"skill-same:01M6EAD7SAR4ATTADXP49076AK":88},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":30,"linkOnly":31,"markdownContent":32,"markdownBody":33,"frontMatter":34,"refName":35,"commitSha":36,"skillDirectory":37,"forksCount":38,"repositoryHtmlUrl":39,"repositoryHomepageUrl":40,"ownerHtmlUrl":41,"ownerBlogUrl":6,"ownerDescription":42,"updatedAt":43,"install":44,"resources":57},"01M6EAD7SAR4ATTADXP49076AK","deep-agents-orchestration",null,"INVOKE THIS SKILL when using subagents, task planning, or human approval in Deep Agents. Covers SubAgentMiddleware, TodoList for planning, and HITL interrupts.","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FHarmeet10000\u002Fskills\u002Fdeep-agents-orchestration\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29],"orchestration","deep agents orchestration","deep agents","deep","planning","task planning","approval","subagents","task","hitl","human","2026-11-10 10:12:30",false,"---\nname: deep-agents-orchestration\ndescription: \"INVOKE THIS SKILL when using subagents, task planning, or human approval in Deep Agents. Covers SubAgentMiddleware, TodoList for planning, and HITL interrupts.\"\n---\n\n\u003Coverview>\nDeep Agents include three orchestration capabilities:\n\n1. **SubAgentMiddleware**: Delegate work via `task` tool to specialized agents\n2. **TodoListMiddleware**: Plan and track tasks via `write_todos` tool\n3. **HumanInTheLoopMiddleware**: Require approval before sensitive operations\n\nAll three are automatically included in `create_deep_agent()`.\n\u003C\u002Foverview>\n\n---\n\n## Subagents (Task Delegation)\n\n\u003Cwhen-to-use-subagents>\n\n| Use Subagents When | Use Main Agent When |\n|-------------------|-------------------|\n| Task needs specialized tools | General-purpose tools sufficient |\n| Want to isolate complex work | Single-step operation |\n| Need clean context for main agent | Context bloat acceptable |\n\n\u003C\u002Fwhen-to-use-subagents>\n\n\u003Chow-subagents-work>\nMain agent has `task` tool -> creates fresh subagent -> subagent executes autonomously -> returns final report.\n\n**Default subagent**: \"general-purpose\" - automatically available with same tools\u002Fconfig as main agent.\n\u003C\u002Fhow-subagents-work>\n\n\u003Cex-custom-subagents>\n\u003Cpython>\nCreate a custom \"researcher\" subagent with specialized tools for academic paper search.\n```python\nfrom deepagents import create_deep_agent\nfrom langchain.tools import tool\n\n@tool\ndef search_papers(query: str) -> str:\n    \"\"\"Search academic papers.\"\"\"\n    return f\"Found 10 papers about {query}\"\n\nagent = create_deep_agent(\n    subagents=[\n        {\n            \"name\": \"researcher\",\n            \"description\": \"Conduct web research and compile findings\",\n            \"system_prompt\": \"Search thoroughly, return concise summary\",\n            \"tools\": [search_papers],\n        }\n    ]\n)\n\n# Main agent delegates: task(agent=\"researcher\", instruction=\"Research AI trends\")\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nCreate a custom \"researcher\" subagent with specialized tools for academic paper search.\n```typescript\nimport { createDeepAgent } from \"deepagents\";\nimport { tool } from \"@langchain\u002Fcore\u002Ftools\";\nimport { z } from \"zod\";\n\nconst searchPapers = tool(\n  async ({ query }) => `Found 10 papers about ${query}`,\n  { name: \"search_papers\", description: \"Search papers\", schema: z.object({ query: z.string() }) }\n);\n\nconst agent = await createDeepAgent({\n  subagents: [\n    {\n      name: \"researcher\",\n      description: \"Conduct web research and compile findings\",\n      systemPrompt: \"Search thoroughly, return concise summary\",\n      tools: [searchPapers],\n    }\n  ]\n});\n\n\u002F\u002F Main agent delegates: task(agent=\"researcher\", instruction=\"Research AI trends\")\n```\n\u003C\u002Ftypescript>\n\u003C\u002Fex-custom-subagents>\n\n\u003Cex-subagent-with-hitl>\n\u003Cpython>\nConfigure a subagent with HITL approval for sensitive operations.\n```python\nfrom deepagents import create_deep_agent\nfrom langgraph.checkpoint.memory import MemorySaver\n\nagent = create_deep_agent(\n    subagents=[\n        {\n            \"name\": \"code-deployer\",\n            \"description\": \"Deploy code to production\",\n            \"system_prompt\": \"You deploy code after tests pass.\",\n            \"tools\": [run_tests, deploy_to_prod],\n            \"interrupt_on\": {\"deploy_to_prod\": True},  # Require approval\n        }\n    ],\n    checkpointer=MemorySaver()  # Required for interrupts\n)\n```\n\u003C\u002Fpython>\n\u003C\u002Fex-subagent-with-hitl>\n\n\u003Cfix-subagents-are-stateless>\n\u003Cpython>\nSubagents are stateless - provide complete instructions in a single call.\n```python\n# WRONG: Subagents don't remember previous calls\n# task(agent='research', instruction='Find data')\n# task(agent='research', instruction='What did you find?')  # Starts fresh!\n\n# CORRECT: Complete instructions upfront\n# task(agent='research', instruction='Find data on AI, save to \u002Fresearch\u002F, return summary')\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nSubagents are stateless - provide complete instructions in a single call.\n```typescript\n\u002F\u002F WRONG: Subagents don't remember previous calls\n\u002F\u002F task research: Find data\n\u002F\u002F task research: What did you find?  \u002F\u002F Starts fresh!\n\n\u002F\u002F CORRECT: Complete instructions upfront\n\u002F\u002F task research: Find data on AI, save to \u002Fresearch\u002F, return summary\n```\n\u003C\u002Ftypescript>\n\u003C\u002Ffix-subagents-are-stateless>\n\n\u003Cfix-custom-subagents-dont-inherit-skills>\n\u003Cpython>\nCustom subagents don't inherit skills from the main agent.\n```python\n# WRONG: Custom subagent won't have main agent's skills\nagent = create_deep_agent(\n    skills=[\"\u002Fmain-skills\u002F\"],\n    subagents=[{\"name\": \"helper\", ...}]  # No skills inherited\n)\n\n# CORRECT: Provide skills explicitly (general-purpose subagent DOES inherit)\nagent = create_deep_agent(\n    skills=[\"\u002Fmain-skills\u002F\"],\n    subagents=[{\"name\": \"helper\", \"skills\": [\"\u002Fhelper-skills\u002F\"], ...}]\n)\n```\n\u003C\u002Fpython>\n\u003C\u002Ffix-custom-subagents-dont-inherit-skills>\n\n---\n\n## TodoList (Task Planning)\n\n\u003Cwhen-to-use-todolist>\n\n| Use TodoList When | Skip TodoList When |\n|------------------|-------------------|\n| Complex multi-step tasks | Simple single-action tasks |\n| Long-running operations | Quick operations (\u003C 3 steps) |\n\n\u003C\u002Fwhen-to-use-todolist>\n\n\u003Ctodolist-tool>\n```\nwrite_todos(todos: list[dict]) -> None\n```\n\nEach todo item has:\n- `content`: Description of the task\n- `status`: One of `\"pending\"`, `\"in_progress\"`, `\"completed\"`\n\u003C\u002Ftodolist-tool>\n\n\u003Cex-todolist-usage>\n\u003Cpython>\nInvoke an agent that automatically creates a todo list for a multi-step task.\n```python\nfrom deepagents import create_deep_agent\n\nagent = create_deep_agent()  # TodoListMiddleware included by default\n\nresult = agent.invoke({\n    \"messages\": [{\"role\": \"user\", \"content\": \"Create a REST API: design models, implement CRUD, add auth, write tests\"}]\n}, config={\"configurable\": {\"thread_id\": \"session-1\"}})\n\n# Agent's planning via write_todos:\n# [\n#   {\"content\": \"Design data models\", \"status\": \"in_progress\"},\n#   {\"content\": \"Implement CRUD endpoints\", \"status\": \"pending\"},\n#   {\"content\": \"Add authentication\", \"status\": \"pending\"},\n#   {\"content\": \"Write tests\", \"status\": \"pending\"}\n# ]\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nInvoke an agent that automatically creates a todo list for a multi-step task.\n```typescript\nimport { createDeepAgent } from \"deepagents\";\n\nconst agent = await createDeepAgent();  \u002F\u002F TodoListMiddleware included\n\nconst result = await agent.invoke({\n  messages: [{ role: \"user\", content: \"Create a REST API: design models, implement CRUD, add auth, write tests\" }]\n}, { configurable: { thread_id: \"session-1\" } });\n```\n\u003C\u002Ftypescript>\n\u003C\u002Fex-todolist-usage>\n\n\u003Cex-access-todo-state>\n\u003Cpython>\nAccess the todo list from the agent's final state after invocation.\n```python\nresult = agent.invoke({...}, config={\"configurable\": {\"thread_id\": \"session-1\"}})\n\n# Access todo list from final state\ntodos = result.get(\"todos\", [])\nfor todo in todos:\n    print(f\"[{todo['status']}] {todo['content']}\")\n```\n\u003C\u002Fpython>\n\u003C\u002Fex-access-todo-state>\n\n\u003Cfix-todolist-requires-thread-id>\n\u003Cpython>\nTodo list state requires a thread_id for persistence across invocations.\n```python\n# WRONG: Fresh state each time without thread_id\nagent.invoke({\"messages\": [...]})\n\n# CORRECT: Use thread_id\nconfig = {\"configurable\": {\"thread_id\": \"user-session\"}}\nagent.invoke({\"messages\": [...]}, config=config)  # Todos preserved\n```\n\u003C\u002Fpython>\n\u003C\u002Ffix-todolist-requires-thread-id>\n\n---\n\n## Human-in-the-Loop (Approval Workflows)\n\n\u003Cwhen-to-use-hitl>\n\n| Use HITL When | Skip HITL When |\n|--------------|---------------|\n| High-stakes operations (DB writes, deployments) | Read-only operations |\n| Compliance requires human oversight | Fully automated workflows |\n\n\u003C\u002Fwhen-to-use-hitl>\n\n\u003Cex-hitl-setup>\n\u003Cpython>\nConfigure which tools require human approval before execution.\n```python\nfrom deepagents import create_deep_agent\nfrom langgraph.checkpoint.memory import MemorySaver\n\nagent = create_deep_agent(\n    interrupt_on={\n        \"write_file\": True,  # All decisions allowed\n        \"execute_sql\": {\"allowed_decisions\": [\"approve\", \"reject\"]},\n        \"read_file\": False,  # No interrupts\n    },\n    checkpointer=MemorySaver()  # REQUIRED for interrupts\n)\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nConfigure which tools require human approval before execution.\n```typescript\nimport { createDeepAgent } from \"deepagents\";\nimport { MemorySaver } from \"@langchain\u002Flanggraph\";\n\nconst agent = await createDeepAgent({\n  interruptOn: {\n    write_file: true,\n    execute_sql: { allowedDecisions: [\"approve\", \"reject\"] },\n    read_file: false,\n  },\n  checkpointer: new MemorySaver()  \u002F\u002F REQUIRED\n});\n```\n\u003C\u002Ftypescript>\n\u003C\u002Fex-hitl-setup>\n\n\u003Cex-approval-workflow>\n\u003Cpython>\nComplete workflow: trigger an interrupt, check state, approve action, and resume execution.\n```python\nfrom deepagents import create_deep_agent\nfrom langgraph.checkpoint.memory import MemorySaver\nfrom langgraph.types import Command\n\nagent = create_deep_agent(\n    interrupt_on={\"write_file\": True},\n    checkpointer=MemorySaver()\n)\n\nconfig = {\"configurable\": {\"thread_id\": \"session-1\"}}\n\n# Step 1: Agent proposes write_file - execution pauses\nresult = agent.invoke({\n    \"messages\": [{\"role\": \"user\", \"content\": \"Write config to \u002Fprod.yaml\"}]\n}, config=config)\n\n# Step 2: Check for interrupts\nstate = agent.get_state(config)\nif state.next:\n    print(f\"Pending action\")\n\n# Step 3: Approve and resume\nresult = agent.invoke(Command(resume={\"decisions\": [{\"type\": \"approve\"}]}), config=config)\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nComplete workflow: trigger an interrupt, check state, approve action, and resume execution.\n```typescript\nimport { createDeepAgent } from \"deepagents\";\nimport { MemorySaver, Command } from \"@langchain\u002Flanggraph\";\n\nconst agent = await createDeepAgent({\n  interruptOn: { write_file: true },\n  checkpointer: new MemorySaver()\n});\n\nconst config = { configurable: { thread_id: \"session-1\" } };\n\n\u002F\u002F Step 1: Agent proposes write_file - execution pauses\nlet result = await agent.invoke({\n  messages: [{ role: \"user\", content: \"Write config to \u002Fprod.yaml\" }]\n}, config);\n\n\u002F\u002F Step 2: Check for interrupts\nconst state = await agent.getState(config);\nif (state.next) {\n  console.log(\"Pending action\");\n}\n\n\u002F\u002F Step 3: Approve and resume\nresult = await agent.invoke(\n  new Command({ resume: { decisions: [{ type: \"approve\" }] } }), config\n);\n```\n\u003C\u002Ftypescript>\n\u003C\u002Fex-approval-workflow>\n\n\u003Cex-reject-with-feedback>\n\u003Cpython>\nReject a pending action with feedback, prompting the agent to try a different approach.\n```python\nresult = agent.invoke(\n    Command(resume={\"decisions\": [{\"type\": \"reject\", \"message\": \"Run tests first\"}]}),\n    config=config,\n)\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nReject a pending action with feedback, prompting the agent to try a different approach.\n```typescript\nconst result = await agent.invoke(\n  new Command({ resume: { decisions: [{ type: \"reject\", message: \"Run tests first\" }] } }),\n  config,\n);\n```\n\u003C\u002Ftypescript>\n\u003C\u002Fex-reject-with-feedback>\n\n\u003Cex-edit-before-execution>\n\u003Cpython>\nEdit the proposed action arguments before allowing execution.\n```python\nresult = agent.invoke(\n    Command(resume={\"decisions\": [{\n        \"type\": \"edit\",\n        \"edited_action\": {\n            \"name\": \"execute_sql\",\n            \"args\": {\"query\": \"DELETE FROM users WHERE last_login \u003C '2020-01-01' LIMIT 100\"},\n        },\n    }]}),\n    config=config,\n)\n```\n\u003C\u002Fpython>\n\u003C\u002Fex-edit-before-execution>\n\n\u003Cboundaries>\n### What Agents CAN Configure\n\n- Subagent names, tools, models, system prompts\n- Which tools require approval\n- Allowed decision types per tool\n- TodoList content and structure\n\n### What Agents CANNOT Configure\n\n- Tool names (`task`, `write_todos`)\n- HITL protocol (approve\u002Fedit\u002Freject structure)\n- Skip checkpointer requirement for interrupts\n- Make subagents stateful (they're ephemeral)\n\u003C\u002Fboundaries>\n\n\u003Cfix-checkpointer-required>\n\u003Cpython>\nCheckpointer is required when using interrupt_on for HITL workflows.\n```python\n# WRONG\nagent = create_deep_agent(interrupt_on={\"write_file\": True})\n\n# CORRECT\nagent = create_deep_agent(interrupt_on={\"write_file\": True}, checkpointer=MemorySaver())\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nCheckpointer is required when using interruptOn for HITL workflows.\n```typescript\n\u002F\u002F WRONG\nconst agent = await createDeepAgent({ interruptOn: { write_file: true } });\n\n\u002F\u002F CORRECT\nconst agent = await createDeepAgent({ interruptOn: { write_file: true }, checkpointer: new MemorySaver() });\n```\n\u003C\u002Ftypescript>\n\u003C\u002Ffix-checkpointer-required>\n\n\u003Cfix-thread-id-required-for-resumption>\n\u003Cpython>\nA consistent thread_id is required to resume interrupted workflows.\n```python\n# WRONG: Can't resume without thread_id\nagent.invoke({\"messages\": [...]})\n\n# CORRECT\nconfig = {\"configurable\": {\"thread_id\": \"session-1\"}}\nagent.invoke({...}, config=config)\n# Resume with Command using same config\nagent.invoke(Command(resume={\"decisions\": [{\"type\": \"approve\"}]}), config=config)\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nA consistent thread_id is required to resume interrupted workflows.\n```typescript\n\u002F\u002F WRONG: Can't resume without thread_id\nawait agent.invoke({ messages: [...] });\n\n\u002F\u002F CORRECT\nconst config = { configurable: { thread_id: \"session-1\" } };\nawait agent.invoke({ messages: [...] }, config);\n\u002F\u002F Resume with Command using same config\nawait agent.invoke(new Command({ resume: { decisions: [{ type: \"approve\" }] } }), config);\n```\n\u003C\u002Ftypescript>\n\u003C\u002Ffix-thread-id-required-for-resumption>\n\n\u003Cfix-interrupt-checks-between-invocations>\n\u003Cpython>\nInterrupts happen BETWEEN invoke() calls, not mid-execution.\n```python\nresult = agent.invoke({...}, config=config)       # Step 1: triggers interrupt\nif \"__interrupt__\" in result:                      # Step 2: check for interrupt\n    result = agent.invoke(                         # Step 3: resume\n        Command(resume={\"decisions\": [{\"type\": \"approve\"}]}),\n        config=config,\n    )\n```\n\u003C\u002Fpython>\n\u003C\u002Ffix-interrupt-checks-between-invocations>\n","\u003Coverview>\nDeep Agents include three orchestration capabilities:\n\n1. **SubAgentMiddleware**: Delegate work via `task` tool to specialized agents\n2. **TodoListMiddleware**: Plan and track tasks via `write_todos` tool\n3. **HumanInTheLoopMiddleware**: Require approval before sensitive operations\n\nAll three are automatically included in `create_deep_agent()`.\n\u003C\u002Foverview>\n\n---\n\n## Subagents (Task Delegation)\n\n\u003Cwhen-to-use-subagents>\n\n| Use Subagents When | Use Main Agent When |\n|-------------------|-------------------|\n| Task needs specialized tools | General-purpose tools sufficient |\n| Want to isolate complex work | Single-step operation |\n| Need clean context for main agent | Context bloat acceptable |\n\n\u003C\u002Fwhen-to-use-subagents>\n\n\u003Chow-subagents-work>\nMain agent has `task` tool -> creates fresh subagent -> subagent executes autonomously -> returns final report.\n\n**Default subagent**: \"general-purpose\" - automatically available with same tools\u002Fconfig as main agent.\n\u003C\u002Fhow-subagents-work>\n\n\u003Cex-custom-subagents>\n\u003Cpython>\nCreate a custom \"researcher\" subagent with specialized tools for academic paper search.\n```python\nfrom deepagents import create_deep_agent\nfrom langchain.tools import tool\n\n@tool\ndef search_papers(query: str) -> str:\n    \"\"\"Search academic papers.\"\"\"\n    return f\"Found 10 papers about {query}\"\n\nagent = create_deep_agent(\n    subagents=[\n        {\n            \"name\": \"researcher\",\n            \"description\": \"Conduct web research and compile findings\",\n            \"system_prompt\": \"Search thoroughly, return concise summary\",\n            \"tools\": [search_papers],\n        }\n    ]\n)\n\n# Main agent delegates: task(agent=\"researcher\", instruction=\"Research AI trends\")\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nCreate a custom \"researcher\" subagent with specialized tools for academic paper search.\n```typescript\nimport { createDeepAgent } from \"deepagents\";\nimport { tool } from \"@langchain\u002Fcore\u002Ftools\";\nimport { z } from \"zod\";\n\nconst searchPapers = tool(\n  async ({ query }) => `Found 10 papers about ${query}`,\n  { name: \"search_papers\", description: \"Search papers\", schema: z.object({ query: z.string() }) }\n);\n\nconst agent = await createDeepAgent({\n  subagents: [\n    {\n      name: \"researcher\",\n      description: \"Conduct web research and compile findings\",\n      systemPrompt: \"Search thoroughly, return concise summary\",\n      tools: [searchPapers],\n    }\n  ]\n});\n\n\u002F\u002F Main agent delegates: task(agent=\"researcher\", instruction=\"Research AI trends\")\n```\n\u003C\u002Ftypescript>\n\u003C\u002Fex-custom-subagents>\n\n\u003Cex-subagent-with-hitl>\n\u003Cpython>\nConfigure a subagent with HITL approval for sensitive operations.\n```python\nfrom deepagents import create_deep_agent\nfrom langgraph.checkpoint.memory import MemorySaver\n\nagent = create_deep_agent(\n    subagents=[\n        {\n            \"name\": \"code-deployer\",\n            \"description\": \"Deploy code to production\",\n            \"system_prompt\": \"You deploy code after tests pass.\",\n            \"tools\": [run_tests, deploy_to_prod],\n            \"interrupt_on\": {\"deploy_to_prod\": True},  # Require approval\n        }\n    ],\n    checkpointer=MemorySaver()  # Required for interrupts\n)\n```\n\u003C\u002Fpython>\n\u003C\u002Fex-subagent-with-hitl>\n\n\u003Cfix-subagents-are-stateless>\n\u003Cpython>\nSubagents are stateless - provide complete instructions in a single call.\n```python\n# WRONG: Subagents don't remember previous calls\n# task(agent='research', instruction='Find data')\n# task(agent='research', instruction='What did you find?')  # Starts fresh!\n\n# CORRECT: Complete instructions upfront\n# task(agent='research', instruction='Find data on AI, save to \u002Fresearch\u002F, return summary')\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nSubagents are stateless - provide complete instructions in a single call.\n```typescript\n\u002F\u002F WRONG: Subagents don't remember previous calls\n\u002F\u002F task research: Find data\n\u002F\u002F task research: What did you find?  \u002F\u002F Starts fresh!\n\n\u002F\u002F CORRECT: Complete instructions upfront\n\u002F\u002F task research: Find data on AI, save to \u002Fresearch\u002F, return summary\n```\n\u003C\u002Ftypescript>\n\u003C\u002Ffix-subagents-are-stateless>\n\n\u003Cfix-custom-subagents-dont-inherit-skills>\n\u003Cpython>\nCustom subagents don't inherit skills from the main agent.\n```python\n# WRONG: Custom subagent won't have main agent's skills\nagent = create_deep_agent(\n    skills=[\"\u002Fmain-skills\u002F\"],\n    subagents=[{\"name\": \"helper\", ...}]  # No skills inherited\n)\n\n# CORRECT: Provide skills explicitly (general-purpose subagent DOES inherit)\nagent = create_deep_agent(\n    skills=[\"\u002Fmain-skills\u002F\"],\n    subagents=[{\"name\": \"helper\", \"skills\": [\"\u002Fhelper-skills\u002F\"], ...}]\n)\n```\n\u003C\u002Fpython>\n\u003C\u002Ffix-custom-subagents-dont-inherit-skills>\n\n---\n\n## TodoList (Task Planning)\n\n\u003Cwhen-to-use-todolist>\n\n| Use TodoList When | Skip TodoList When |\n|------------------|-------------------|\n| Complex multi-step tasks | Simple single-action tasks |\n| Long-running operations | Quick operations (\u003C 3 steps) |\n\n\u003C\u002Fwhen-to-use-todolist>\n\n\u003Ctodolist-tool>\n```\nwrite_todos(todos: list[dict]) -> None\n```\n\nEach todo item has:\n- `content`: Description of the task\n- `status`: One of `\"pending\"`, `\"in_progress\"`, `\"completed\"`\n\u003C\u002Ftodolist-tool>\n\n\u003Cex-todolist-usage>\n\u003Cpython>\nInvoke an agent that automatically creates a todo list for a multi-step task.\n```python\nfrom deepagents import create_deep_agent\n\nagent = create_deep_agent()  # TodoListMiddleware included by default\n\nresult = agent.invoke({\n    \"messages\": [{\"role\": \"user\", \"content\": \"Create a REST API: design models, implement CRUD, add auth, write tests\"}]\n}, config={\"configurable\": {\"thread_id\": \"session-1\"}})\n\n# Agent's planning via write_todos:\n# [\n#   {\"content\": \"Design data models\", \"status\": \"in_progress\"},\n#   {\"content\": \"Implement CRUD endpoints\", \"status\": \"pending\"},\n#   {\"content\": \"Add authentication\", \"status\": \"pending\"},\n#   {\"content\": \"Write tests\", \"status\": \"pending\"}\n# ]\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nInvoke an agent that automatically creates a todo list for a multi-step task.\n```typescript\nimport { createDeepAgent } from \"deepagents\";\n\nconst agent = await createDeepAgent();  \u002F\u002F TodoListMiddleware included\n\nconst result = await agent.invoke({\n  messages: [{ role: \"user\", content: \"Create a REST API: design models, implement CRUD, add auth, write tests\" }]\n}, { configurable: { thread_id: \"session-1\" } });\n```\n\u003C\u002Ftypescript>\n\u003C\u002Fex-todolist-usage>\n\n\u003Cex-access-todo-state>\n\u003Cpython>\nAccess the todo list from the agent's final state after invocation.\n```python\nresult = agent.invoke({...}, config={\"configurable\": {\"thread_id\": \"session-1\"}})\n\n# Access todo list from final state\ntodos = result.get(\"todos\", [])\nfor todo in todos:\n    print(f\"[{todo['status']}] {todo['content']}\")\n```\n\u003C\u002Fpython>\n\u003C\u002Fex-access-todo-state>\n\n\u003Cfix-todolist-requires-thread-id>\n\u003Cpython>\nTodo list state requires a thread_id for persistence across invocations.\n```python\n# WRONG: Fresh state each time without thread_id\nagent.invoke({\"messages\": [...]})\n\n# CORRECT: Use thread_id\nconfig = {\"configurable\": {\"thread_id\": \"user-session\"}}\nagent.invoke({\"messages\": [...]}, config=config)  # Todos preserved\n```\n\u003C\u002Fpython>\n\u003C\u002Ffix-todolist-requires-thread-id>\n\n---\n\n## Human-in-the-Loop (Approval Workflows)\n\n\u003Cwhen-to-use-hitl>\n\n| Use HITL When | Skip HITL When |\n|--------------|---------------|\n| High-stakes operations (DB writes, deployments) | Read-only operations |\n| Compliance requires human oversight | Fully automated workflows |\n\n\u003C\u002Fwhen-to-use-hitl>\n\n\u003Cex-hitl-setup>\n\u003Cpython>\nConfigure which tools require human approval before execution.\n```python\nfrom deepagents import create_deep_agent\nfrom langgraph.checkpoint.memory import MemorySaver\n\nagent = create_deep_agent(\n    interrupt_on={\n        \"write_file\": True,  # All decisions allowed\n        \"execute_sql\": {\"allowed_decisions\": [\"approve\", \"reject\"]},\n        \"read_file\": False,  # No interrupts\n    },\n    checkpointer=MemorySaver()  # REQUIRED for interrupts\n)\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nConfigure which tools require human approval before execution.\n```typescript\nimport { createDeepAgent } from \"deepagents\";\nimport { MemorySaver } from \"@langchain\u002Flanggraph\";\n\nconst agent = await createDeepAgent({\n  interruptOn: {\n    write_file: true,\n    execute_sql: { allowedDecisions: [\"approve\", \"reject\"] },\n    read_file: false,\n  },\n  checkpointer: new MemorySaver()  \u002F\u002F REQUIRED\n});\n```\n\u003C\u002Ftypescript>\n\u003C\u002Fex-hitl-setup>\n\n\u003Cex-approval-workflow>\n\u003Cpython>\nComplete workflow: trigger an interrupt, check state, approve action, and resume execution.\n```python\nfrom deepagents import create_deep_agent\nfrom langgraph.checkpoint.memory import MemorySaver\nfrom langgraph.types import Command\n\nagent = create_deep_agent(\n    interrupt_on={\"write_file\": True},\n    checkpointer=MemorySaver()\n)\n\nconfig = {\"configurable\": {\"thread_id\": \"session-1\"}}\n\n# Step 1: Agent proposes write_file - execution pauses\nresult = agent.invoke({\n    \"messages\": [{\"role\": \"user\", \"content\": \"Write config to \u002Fprod.yaml\"}]\n}, config=config)\n\n# Step 2: Check for interrupts\nstate = agent.get_state(config)\nif state.next:\n    print(f\"Pending action\")\n\n# Step 3: Approve and resume\nresult = agent.invoke(Command(resume={\"decisions\": [{\"type\": \"approve\"}]}), config=config)\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nComplete workflow: trigger an interrupt, check state, approve action, and resume execution.\n```typescript\nimport { createDeepAgent } from \"deepagents\";\nimport { MemorySaver, Command } from \"@langchain\u002Flanggraph\";\n\nconst agent = await createDeepAgent({\n  interruptOn: { write_file: true },\n  checkpointer: new MemorySaver()\n});\n\nconst config = { configurable: { thread_id: \"session-1\" } };\n\n\u002F\u002F Step 1: Agent proposes write_file - execution pauses\nlet result = await agent.invoke({\n  messages: [{ role: \"user\", content: \"Write config to \u002Fprod.yaml\" }]\n}, config);\n\n\u002F\u002F Step 2: Check for interrupts\nconst state = await agent.getState(config);\nif (state.next) {\n  console.log(\"Pending action\");\n}\n\n\u002F\u002F Step 3: Approve and resume\nresult = await agent.invoke(\n  new Command({ resume: { decisions: [{ type: \"approve\" }] } }), config\n);\n```\n\u003C\u002Ftypescript>\n\u003C\u002Fex-approval-workflow>\n\n\u003Cex-reject-with-feedback>\n\u003Cpython>\nReject a pending action with feedback, prompting the agent to try a different approach.\n```python\nresult = agent.invoke(\n    Command(resume={\"decisions\": [{\"type\": \"reject\", \"message\": \"Run tests first\"}]}),\n    config=config,\n)\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nReject a pending action with feedback, prompting the agent to try a different approach.\n```typescript\nconst result = await agent.invoke(\n  new Command({ resume: { decisions: [{ type: \"reject\", message: \"Run tests first\" }] } }),\n  config,\n);\n```\n\u003C\u002Ftypescript>\n\u003C\u002Fex-reject-with-feedback>\n\n\u003Cex-edit-before-execution>\n\u003Cpython>\nEdit the proposed action arguments before allowing execution.\n```python\nresult = agent.invoke(\n    Command(resume={\"decisions\": [{\n        \"type\": \"edit\",\n        \"edited_action\": {\n            \"name\": \"execute_sql\",\n            \"args\": {\"query\": \"DELETE FROM users WHERE last_login \u003C '2020-01-01' LIMIT 100\"},\n        },\n    }]}),\n    config=config,\n)\n```\n\u003C\u002Fpython>\n\u003C\u002Fex-edit-before-execution>\n\n\u003Cboundaries>\n### What Agents CAN Configure\n\n- Subagent names, tools, models, system prompts\n- Which tools require approval\n- Allowed decision types per tool\n- TodoList content and structure\n\n### What Agents CANNOT Configure\n\n- Tool names (`task`, `write_todos`)\n- HITL protocol (approve\u002Fedit\u002Freject structure)\n- Skip checkpointer requirement for interrupts\n- Make subagents stateful (they're ephemeral)\n\u003C\u002Fboundaries>\n\n\u003Cfix-checkpointer-required>\n\u003Cpython>\nCheckpointer is required when using interrupt_on for HITL workflows.\n```python\n# WRONG\nagent = create_deep_agent(interrupt_on={\"write_file\": True})\n\n# CORRECT\nagent = create_deep_agent(interrupt_on={\"write_file\": True}, checkpointer=MemorySaver())\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nCheckpointer is required when using interruptOn for HITL workflows.\n```typescript\n\u002F\u002F WRONG\nconst agent = await createDeepAgent({ interruptOn: { write_file: true } });\n\n\u002F\u002F CORRECT\nconst agent = await createDeepAgent({ interruptOn: { write_file: true }, checkpointer: new MemorySaver() });\n```\n\u003C\u002Ftypescript>\n\u003C\u002Ffix-checkpointer-required>\n\n\u003Cfix-thread-id-required-for-resumption>\n\u003Cpython>\nA consistent thread_id is required to resume interrupted workflows.\n```python\n# WRONG: Can't resume without thread_id\nagent.invoke({\"messages\": [...]})\n\n# CORRECT\nconfig = {\"configurable\": {\"thread_id\": \"session-1\"}}\nagent.invoke({...}, config=config)\n# Resume with Command using same config\nagent.invoke(Command(resume={\"decisions\": [{\"type\": \"approve\"}]}), config=config)\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nA consistent thread_id is required to resume interrupted workflows.\n```typescript\n\u002F\u002F WRONG: Can't resume without thread_id\nawait agent.invoke({ messages: [...] });\n\n\u002F\u002F CORRECT\nconst config = { configurable: { thread_id: \"session-1\" } };\nawait agent.invoke({ messages: [...] }, config);\n\u002F\u002F Resume with Command using same config\nawait agent.invoke(new Command({ resume: { decisions: [{ type: \"approve\" }] } }), config);\n```\n\u003C\u002Ftypescript>\n\u003C\u002Ffix-thread-id-required-for-resumption>\n\n\u003Cfix-interrupt-checks-between-invocations>\n\u003Cpython>\nInterrupts happen BETWEEN invoke() calls, not mid-execution.\n```python\nresult = agent.invoke({...}, config=config)       # Step 1: triggers interrupt\nif \"__interrupt__\" in result:                      # Step 2: check for interrupt\n    result = agent.invoke(                         # Step 3: resume\n        Command(resume={\"decisions\": [{\"type\": \"approve\"}]}),\n        config=config,\n    )\n```\n\u003C\u002Fpython>\n\u003C\u002Ffix-interrupt-checks-between-invocations>\n",{"name":5,"description":7},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FHarmeet10000\u002Fskills\u002Fdeep-agents-orchestration",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":45,"prompt":55,"zipAvailable":56},[46,49,52],{"tool":47,"command":48},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill deep-agents-orchestration",{"tool":50,"command":51},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill deep-agents-orchestration",{"tool":53,"command":54},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill deep-agents-orchestration","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FHarmeet10000\u002Fskills\u002Fdeep-agents-orchestration\u002FSKILL.md",true,[58,64,68,72,76,80,84],{"path":59,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":62,"sourceHtmlUrl":63},"agent.md","REFERENCE","参考文档",4271,"https:\u002F\u002Fgithub.com\u002FBoloBoloMe\u002Fskills\u002Fblob\u002Fmain\u002Fgeneral\u002Fuse-herdr\u002Fagent.md",{"path":65,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":66,"sourceHtmlUrl":67},"browser.md",784,"https:\u002F\u002Fgithub.com\u002FBoloBoloMe\u002Fskills\u002Fblob\u002Fmain\u002Fgeneral\u002Fuse-herdr\u002Fbrowser.md",{"path":69,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":70,"sourceHtmlUrl":71},"launch.md",2343,"https:\u002F\u002Fgithub.com\u002FBoloBoloMe\u002Fskills\u002Fblob\u002Fmain\u002Fgeneral\u002Fuse-herdr\u002Flaunch.md",{"path":73,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":74,"sourceHtmlUrl":75},"layout.md",2945,"https:\u002F\u002Fgithub.com\u002FBoloBoloMe\u002Fskills\u002Fblob\u002Fmain\u002Fgeneral\u002Fuse-herdr\u002Flayout.md",{"path":77,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":78,"sourceHtmlUrl":79},"machine.md",1976,"https:\u002F\u002Fgithub.com\u002FBoloBoloMe\u002Fskills\u002Fblob\u002Fmain\u002Fgeneral\u002Fuse-herdr\u002Fmachine.md",{"path":81,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":82,"sourceHtmlUrl":83},"pane.md",1832,"https:\u002F\u002Fgithub.com\u002FBoloBoloMe\u002Fskills\u002Fblob\u002Fmain\u002Fgeneral\u002Fuse-herdr\u002Fpane.md",{"path":85,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":86,"sourceHtmlUrl":87},"PI.md",3941,"https:\u002F\u002Fgithub.com\u002FBoloBoloMe\u002Fskills\u002Fblob\u002Fmain\u002Fgeneral\u002Fuse-herdr\u002FPI.md",[89,98,107,116,122,128],{"skillNo":90,"name":91,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":30},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[95,96,97],"model","model hierarchy","model hierarchy skill",{"skillNo":99,"name":100,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":30},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[104,105,106],"MCP","zoom","zoom mcp",{"skillNo":108,"name":109,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":30},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[113,114,115,105],"sdk","zoom apps sdk","apps",{"skillNo":117,"name":118,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":30},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[118],{"skillNo":123,"name":124,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":125,"categories":126,"keywords":127,"publishedAt":30},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[124],{"skillNo":129,"name":130,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":131,"categories":132,"keywords":133,"publishedAt":30},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[130]]