Deepagents harness

From mouadja02/skills · View interactive version

Deepagents harness is an AI agent skill from the GitHub repository mouadja02/skills. Use when designing long-horizon agents that need subagents, isolated context windows, filesystem-backed work, persistence, human approval, MCP tools, or production tracing.

How to use this skill

Skill file

Deep Agents Harness

Design long-running agents as a harness with explicit state, bounded delegation, durable artifacts, and reviewable tool calls. Use a higher-level harness when the work needs more than one ReAct loop.

Use When

Harness Design

  1. Define the persistent state object: task, plan, artifacts, decisions, approvals, and final output.
  2. Split capabilities into tools, subagents, filesystem, memory, shell, and human review.
  3. Give each subagent a narrow contract: inputs, allowed tools, expected artifacts, and stop condition.
  4. Store bulky observations as files and pass summaries plus paths through the state.
  5. Add approval gates for network calls, shell commands, writes outside workspace, credential access, deletes, and external side effects.
  6. Trace every step with state diffs, tool inputs, tool outputs, and handoff reasons.
  7. Evaluate the trajectory, not just the final answer.

Decision Table

| Need | Pattern |

| --- | --- |

| Short single-step assistant | Plain tool-calling agent |

| Stateful workflow with branches | LangGraph-style graph |

| Long-horizon work with files and subagents | Deep agent harness |

| Tool execution can affect users or infrastructure | Human-in-the-loop gate |

| Agent needs learned project practices | Durable memory plus context evolution |

Handoff Contract

Every subagent handoff should include:

See harness-contracts.md for reusable templates.

Common Mistakes

| Mistake | Fix |

| --- | --- |

| Letting subagents explore the whole repo | Give exact files, commands, and output contracts |

| Passing huge tool outputs through chat | Store them as artifacts and pass summaries |

| Treating checkpoints as logs only | Resume from checkpoints and test recovery |

| Adding memory without invalidation | Version memory and attach evidence |

| Evaluating only pass/fail | Inspect trajectory quality, retries, dead ends, and repair behavior |

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.