home / skills / fusengine / agents / agent-design

This skill helps you design high-performance AI agents using 2025 patterns and clear architecture templates for scalable, flexible automation.

npx playbooks add skill fusengine/agents --skill agent-design

Review the files below or copy the command above to add this skill to your agents.

Files (3)
SKILL.md
4.2 KB
---
name: agent-design
description: Design AI agents with recommended patterns and architectures
allowed-tools: Read, Write
---

# Agent Design

Skill for designing high-performance AI agents following 2025 patterns.

## Documentation

- [patterns.md](docs/patterns.md) - Multi-agent architecture patterns
- [workflows.md](docs/workflows.md) - Recommended workflows

## Fundamental Distinction

### Workflows vs Agents

| Type | Control | When to use |
|------|---------|-------------|
| **Workflow** | Code orchestrates LLM | Predictable tasks, need for control |
| **Agent** | LLM directs its actions | Flexibility, adaptive decisions |

**Golden rule:** Start simple, add complexity if necessary.

## Agent Architecture

### Minimal Structure

```yaml
Agent:
  identity: Who am I?
  capabilities: What can I do?
  tools: What tools do I have?
  constraints: What are my limits?
  workflow: How should I proceed?
```

### Complete Structure (Production)

```markdown
---
name: my-agent
description: Short description
model: sonnet|opus
tools: [list of tools]
skills: [associated skills]
---

# Identity
[Who the agent is]

# Capabilities
[What it can do]

# Workflow
[Steps to follow]

# Tools
[How to use each tool]

# Constraints
[Limits and rules]

# Examples
[Use cases]

# Forbidden
[What it must NEVER do]
```

## Agent Patterns

### 1. Single Agent (Simple)

```
User → Agent → Response
```

**Usage:** Simple tasks, rapid prototyping.

### 2. Agent + Tools

```
User → Agent ↔ Tools → Response
                ↑
            Tool Results
```

**Usage:** Tasks requiring external access (API, files, DB).

### 3. Orchestrator + Subagents

```
User → Orchestrator → Subagent 1 (specialized)
                   → Subagent 2 (specialized)
                   → Subagent 3 (specialized)
                   ↓
              Synthesis → Response
```

**Usage:** Complex tasks, separation of responsibilities.

### 4. Sequential Pipeline

```
User → Agent 1 → Agent 2 → Agent 3 → Response
       (Analyze)  (Plan)    (Execute)
```

**Usage:** Linear processes (e.g., Analyst → Architect → Developer).

## Fresh Eyes Principle

**Key 2025 concept:** Each sub-agent must have a "fresh" context.

```
❌ Bad: Pass entire history to each sub-agent
✅ Good: Give only necessary information

Orchestrator:
  - Keeps complete history
  - Extracts relevant context for each sub-agent
  - Synthesizes results
```

## Design Checklist

### Before creating an agent

- [ ] Is the objective clear?
- [ ] Would a simple workflow suffice?
- [ ] What tools are needed?
- [ ] What guardrails are required?

### During design

- [ ] Is identity well defined?
- [ ] Is workflow explicit?
- [ ] Are error cases handled?
- [ ] Are examples relevant?

### After creation

- [ ] Standard case tests?
- [ ] Edge case tests?
- [ ] Security tests (jailbreak)?
- [ ] Acceptable performance?

## Claude Code Agent Template

```markdown
---
name: [kebab-case-name]
description: [1-2 lines max]
model: sonnet
color: blue
tools: Read, Edit, Write, Bash, Grep, Glob
skills: [associated-skills]
---

# [Agent Name]

[Purpose description]

## Core Principles

1. **[Principle 1]**: [Short explanation]
2. **[Principle 2]**: [Short explanation]

## Workflow (MANDATORY)

### Phase 1: [Name]
```
[Numbered actions]
```

### Phase 2: [Name]
```
[Numbered actions]
```

## Output Format

[Response structure]

## Forbidden

- [Prohibition 1]
- [Prohibition 2]
```

## Anti-Patterns to Avoid

### ❌ Omniscient agent
```
You know everything and can do anything.
```

### ✅ Specialized agent
```
You are an expert in [specific domain].
For topics outside your domain, redirect to the appropriate agent.
```

### ❌ Implicit instructions
```
Do what's logical.
```

### ✅ Explicit instructions
```
Step 1: Analyze the problem
Step 2: Propose 3 solutions
Step 3: Recommend the best with justification
```

### ❌ No error handling
```
Execute the task.
```

### ✅ Explicit error handling
```
IF the task fails:
  1. Identify the cause
  2. Propose an alternative
  3. Ask for confirmation before retrying
```

## Forbidden

- Never create an agent without explicit workflow
- Never give access to all tools without necessity
- Never ignore the principle of least privilege
- Never forget security guardrails

Overview

This skill designs high-performance AI agents using modern 2025 patterns and recommended architectures. It provides templates, clear distinctions between workflows and agents, and modular patterns for single agents, tool-augmented agents, orchestrators, and pipelines. The goal is predictable, secure, and maintainable agent behavior for production use.

How this skill works

The skill inspects agent requirements and maps them to proven architecture patterns: single-agent, agent+tools, orchestrator+subagents, and sequential pipelines. It enforces a minimal agent structure (identity, capabilities, tools, constraints, workflow) and offers a production-ready template with sections for identity, workflow, tools, constraints, examples, and forbidden actions. It also applies the Fresh Eyes principle by limiting context passed to subagents and defines explicit guardrails, error handling, and testing checklists.

When to use it

  • Prototyping a single-task assistant or simple automation
  • When external data or services are required (agent + tools)
  • Coordinating specialized skills across multiple subagents for complex tasks
  • Implementing linear multi-step processes (analysis → plan → execute)
  • When clear identity, constraints, and explicit workflows are required for safety and predictability

Best practices

  • Start simple; prefer workflows when orchestration and control are needed
  • Define agent identity, capabilities, and explicit workflow up front
  • Give each subagent only the minimal context it needs (Fresh Eyes)
  • Apply least-privilege to tool access and declare forbidden actions
  • Include explicit error handling and retry strategies in workflows
  • Run standard, edge-case, and security (jailbreak) tests before production

Example use cases

  • A documentation writer agent that reads files, drafts sections, and submits PRs using read/edit/write tools
  • An orchestrator that assigns research, design, and implementation to specialized subagents and synthesizes results
  • A sequential pipeline for product development: analyst → architect → developer agents
  • A data-enrichment agent that queries APIs or databases via dedicated tool access
  • A governance agent that enforces policies and checks outputs against safety constraints

FAQ

When should I use an orchestrator versus a single agent?

Use a single agent for simple, self-contained tasks. Use an orchestrator when tasks benefit from specialized subagents, separation of responsibilities, or result synthesis across domains.

How much history should I pass to subagents?

Pass only the minimal relevant context. The orchestrator keeps full history and extracts concise, task-specific inputs for each subagent to avoid bias and unnecessary complexity.