Definition

Agents are specialized AI subagents that live in .claude/agents/. Each Agent has a focused role, a defined set of tools it can access, and specific instructions for its domain of expertise.

Unlike Skills which are workflows, Agents are workers. They're spawned by Claude to handle specific tasks in parallel, returning their results to the parent conversation. Think of them as specialized farmhands, each expert in their particular area.

Philosophy

Core Principle

Agents embody the principle of separation of concerns. By giving each Agent a focused role with limited tools, you get better results than asking a single context to juggle multiple complex tasks.

The agricultural metaphor continues: a farm operates efficiently not because one person does everything, but because different workers specialize. The shepherd tends sheep while the farmer works the fields. Agents work the same way.

Why Specialized Agents

  • Focused context produces higher quality analysis
  • Parallel execution dramatically speeds up multi-faceted tasks
  • Tool restrictions prevent accidental side effects
  • Each agent can be tuned for its specific domain
  • Results are composable and can be reviewed independently

Structure

Each Agent is defined in a single markdown file with YAML frontmatter:

markdown
---
name: security-auditor
description: Scan codebase for OWASP vulnerabilities and
  security issues. Updates _AUDIT/SECURITY.md.
tools: Read, Grep, Glob, Edit
model: opus
---

# Security Auditor Agent

## Purpose
Identify security vulnerabilities following OWASP guidelines...

## Workflow
1. Scan for common vulnerability patterns
2. Check authentication and authorization code
3. Review input validation and sanitization
4. Update SECURITY.md with findings
...

Frontmatter Fields

Field Required Description
name Yes Unique identifier for the agent
description Yes What the agent does and when to use it
tools Yes Comma-separated list of allowed tools
model No Model to use (opus, sonnet, haiku)

Orchestration

Agents are orchestrated by Skills or by Claude directly. The "count the herd" skill, for example, spawns multiple audit agents in parallel:

1
Skill activates
2
Spawn agents
3
Parallel work
4
Collect results
5
Report

Parallel Execution

When multiple agents have no dependencies between them, they execute in parallel. This dramatically speeds up comprehensive audits where code-quality, security, performance, and accessibility can all run simultaneously.

Built-in Agents

Farmwork installs 13 specialized agents during initialization:

Audit Agents

  • the-farmer — FARMHOUSE.md metrics and framework health
  • code-quality — Code review, DRY violations, complexity analysis
  • security-auditor — OWASP vulnerability scanning
  • performance-auditor — Memory leaks, re-renders, anti-patterns
  • accessibility-auditor — WCAG 2.1 compliance checking

Workflow Agents

  • code-cleaner — Remove dead code, comments, console.logs
  • i18n-locale-translator — Translate UI text to target locales
  • idea-gardener — Manage GARDEN.md and COMPOST.md
  • researcher — Systematic research before planning

Strategy Agents

  • strategy-agent — GREENFIELD vision and strategy alignment
  • brownfield-agent — Track implemented features in BROWNFIELD.md
  • onboarding-agent — Tours, tooltips, modals documentation
  • user-guide-agent — Feature documentation for help systems

Creating Custom Agents

You can create project-specific agents. A well-designed agent should:

  • Have a single, clearly defined responsibility
  • Request only the tools it actually needs
  • Specify its output format clearly
  • Update relevant audit documents with findings
  • Return structured results the parent can use

Tool Restrictions

Be conservative with tool access. An agent that only needs to read code shouldn't have Write or Bash access. Minimal permissions reduce risk and focus the agent on its core task.