all factors
IIIfoundation

Focused Agents

One agent, one job. Compose from simple parts.

5 min read

III. Focused Agents

III
One agent, one job

Each agent does one thing well. Complex workflows compose specialized agents.


The Problem

Monolithic Agents

When agents try to do everything:

  • Become unmaintainable quickly
  • Fail unpredictably
  • Can't be reused across contexts
  • Violate context budgets
  • Have unclear failure modes

Focused Agents

Single responsibility enables:

  • Clear, maintainable capabilities
  • Isolated, testable components
  • Reuse across many workflows
  • Efficient context usage
  • Obvious debugging path

The Solution

God Agent

Super Agent: 8000 tokens

Expert in everything:

  • Research
  • Design
  • Implementation
  • Testing
  • Deployment
  • Monitoring
  • ...and more

Result: 40% success rate, 0 reuse

Composed Agents

Workflow composition: research → plan → implement → validate

Each agent: 300-800 tokens

  • research-agent — 500 tokens
  • plan-agent — 600 tokens
  • implement-agent — 400 tokens
  • validate-agent — 300 tokens

Result: 95% success rate, 8.3x reuse


Unix Philosophy for AI

The Unix philosophy (1978) still applies:

Do One Thing

Single, clear purpose

Work Together

Compose into workflows

Standard Interfaces

Markdown, JSON, YAML

Reusable

Shareable patterns


Why It Works

::: info Single Responsibility Principle From software engineering (Robert C. Martin):

"An agent should have only one reason to execute"

Examples:

  • validate-yaml: One responsibility (validation)
  • do-everything-kubernetes: Multiple responsibilities :::

The Composition Model

LayerSizeExample
Skills100-300 tokensread-file, validate-yaml
Agents300-800 tokensresearch-agent, plan-agent
Workflows2-7 agentsresearch → plan → implement
Profiles10-50 workflowskubernetes-ops domain

::: code-group

research-best-practices:
  purpose: Gather information from docs
  single_responsibility: true

validate-yaml:
  purpose: Check YAML syntax and schema
  single_responsibility: true

generate-tests:
  purpose: Create test cases from specs
  single_responsibility: true
do-kubernetes-stuff:
  purpose: Everything Kubernetes
  single_responsibility: false  # Too vague

research-and-implement:
  purpose: Research then implement
  single_responsibility: false  # Two jobs

everything-for-statefulsets:
  purpose: All StatefulSet operations
  single_responsibility: false  # Not focused

:::


Real-World Evidence

Before: Monolithic Agent

MetricResult
Agent Size8000 tokens
Success Rate40%
Time per Task2 hours
Reuse Count0 workflows
Context Usage75%

After: Composed Agents

MetricResult
Agent Size300-600 tokens each
Success Rate95%
Time per Task20 minutes
Reuse Count8.3x average
Context Usage20-30% per agent

Improvement: 6x faster, 2.4x more reliable, infinitely more reusable


Agent Composition Pattern

::: code-group

workflow: create-kubernetes-application
  phases:
    - research:
        agent: research-k8s-patterns
        output: research-bundle.md

    - plan:
        agent: plan-statefulset
        inputs: [research-bundle.md]
        output: design-spec.md

    - implement:
        agents:
          - generate-manifest
          - create-tests
        inputs: [design-spec.md]
        outputs: [manifest.yaml, tests/]
        execution: parallel

    - validate:
        agents:
          - validate-yaml
          - run-tests
        inputs: [manifest.yaml, tests/]
        execution: sequential
# manifest-generator agent

## Responsibilities
Generate Kubernetes manifests

## Skills Used
- yaml-processing (structure output)
- file-operations (write manifests)
- git-operations (commit results)

## Does NOT Handle
- Research (use research-agent)
- Validation (use validate-agent)
- Deployment (use deploy-agent)

## Input Contract
required:
  - design-spec: markdown file
  - namespace: string

## Output Contract
- manifest.yaml: K8s manifest
- metadata.json: generation details

:::


The 52-Agent Validation

52 Agents

Production system

2-7 Per Workflow

Composed capabilities

8.3x Reuse

Average per agent

Isolated Fixes

One agent, not system

Top reused agents:

  • validate-yaml: 47 workflows
  • generate-tests: 23 workflows
  • commit-with-context: 52 workflows (universal)

Implementation Checklist

  • Define clear, single responsibility per agent
  • Agents answer "What is the ONE thing this does?"
  • Standard input/output contracts defined
  • Agents compose into documented workflows
  • Track reuse metrics (target 3+ workflows)

Anti-Patterns

The God Agent

Wrong: Single agent handles all tasks (12,000 tokens)

You are an expert in research, design, implementation,
testing, deployment, monitoring, documentation...

Right: Specialized agents for each responsibility

Overlapping Responsibilities

Wrong:

  • research-and-plan (two jobs)
  • implement-and-test (two jobs)

Right:

  • research (one job)
  • plan (one job)
  • implement (one job)
  • test (one job)

Hyper-Specialization

Wrong: Agent per line of code

- generate-yaml-line-1
- generate-yaml-line-2
- generate-yaml-line-3

Right: Agent per cohesive task

- generate-kubernetes-manifest

FactorRelationship
II. Context LoadingSmaller agents delegate to sub-agents
IV. Continuous ValidationValidation agents check implementation
VII. Smart RoutingRouter selects best-fit agent
XII. Package PatternsAgents packaged into profiles