Skip to main content

Core Design Principles

Writing Instructions as SOPs

Writing agent instructions is like creating a Standard Operating Procedure (SOP) for an employee. Just as SOPs provide clear, repeatable instructions for human workers, agent instructions should be precise, actionable, and comprehensive.
When crafting agent instructions, think of yourself as a manager writing detailed procedures that any employee could follow:
  • Be specific: Like an SOP, leave no room for ambiguity
  • Include all context: Provide all necessary information upfront
  • Define success criteria: Clearly state what “done” looks like
  • Handle edge cases: Anticipate and document how to handle exceptions

1. Non-Interactive by Design

AgentUse agents run without interactive prompts, making them perfect for automation, CI/CD pipelines, and cron jobs.
Agents are designed to:
  • Run autonomously from start to finish
  • Complete tasks without user intervention
  • Work in headless environments
  • Integrate into automated workflows
Because nobody is watching the run, the rehearsal has to happen beforehand: agentuse test exercises the whole SOP, including approval branches, with side effects fabricated.

2. Agent as Delegated Employee

Think of agents as specialized employees you delegate work to. Once you hand off a task with clear instructions, they work autonomously until completion, just like delegating to a trusted team member.
This delegation model means:
  • Set and forget: Give clear instructions and let the agent work independently
  • No micromanagement: The agent handles the task from start to finish
  • Clear handoff: Define input requirements and expected outputs
  • Trust the process: Like a well-trained employee, the agent follows your SOPs

3. Communication Through Tools

Just as employees communicate and hand off work through tools like Slack and Notion, agents should use MCP servers and external integrations to report progress and deliver results.
Agents communicate through:
  • Status updates: Use Slack MCP to send progress notifications
  • Documentation: Update Notion databases with results
  • Handoffs: Save artifacts to shared filesystems for other agents
  • Reporting: Post summaries to webhooks or APIs
This approach mirrors how remote teams collaborate, asynchronously through shared tools rather than constant direct interaction.

4. Separation of Concerns

Use sub-agents to separate different responsibilities, keeping each agent focused on a single task.
Each agent should:
  • Have a single, clear purpose
  • Delegate complex subtasks to sub-agents
  • Use appropriate models for the task (Haiku for simple tasks, Sonnet for complex reasoning)
  • Maintain clear boundaries between concerns

Implementation Patterns

Multi-Agent Workflow Pattern

Complex tasks can be decomposed into specialized agents that work together through sub-agent composition. This mirrors how organizations structure teams, each specialist handles their domain, communicating through established channels.

Example: Content Pipeline

1

Research Agent

Gathers information using web search or MCP tools
research.agentuse
2

Writer Agent

Creates content based on research
writer.agentuse
3

Orchestrator Agent

Coordinates the workflow
orchestrator.agentuse

State Management with External Systems

Since AgentUse agents are stateless between runs, use MCP servers to manage state:

Error Handling

Build resilient agents with proper error handling:
robust-agent.agentuse

Chain of Responsibility

Process data through a sequential pipeline where each agent handles a specific transformation step:
chain-pipeline.agentuse

Conditional Routing

Route requests to different handlers based on complexity or type:
conditional-router.agentuse

Retry with Fallback

Implement resilient processing with automatic fallback on failures:
retry-fallback.agentuse