---
title: "Agents Overview"
description: "Each OrchestKit agent is a specialist subagent for Claude Code. See how agents start from your prompt, which model each one uses, and which agent fits a task."
canonical: "https://orchestkit.dev/docs/agents/overview"
---

# Agents Overview

Each OrchestKit agent is a specialist subagent for Claude Code. See how agents start from your prompt, which model each one uses, and which agent fits a task.

import { LazyAgentSelector as AgentSelector } from '@/components/lazy';
import { Count } from '@/components/count';
import { AgentRoster } from '@/components/agent-roster';

# <Count k="agents" /> Specialist Agents, One Prompt Away

An OrchestKit **agent** is a specialized AI persona built from four components:

| Component | What it provides |
|-----------|-----------------|
| **Model** | The LLM powering the agent (`opus`, `sonnet`, or `inherit` from parent) |
| **Tools** | Which Claude Code tools the agent can use (Read, Write, Bash, Grep, etc.) |
| **Skills** | Knowledge modules auto-injected into the agent's context |
| **Directive** | The system prompt that defines the agent's role, boundaries, and output format |

Together these four pieces turn a general-purpose LLM into a focused specialist: a security auditor that only reads code and never modifies it, a backend architect that designs APIs but never touches the frontend, or a debug investigator that forms hypotheses and traces execution paths.

## What Is an Agent?

Every agent is defined in a single Markdown file at `src/agents/<name>.md`. The file has two parts:

1. **YAML frontmatter**: structured metadata (model, tools, skills, hooks, category, color)
2. **Markdown body**: the directive, task boundaries, output format, and integration notes

Here is a minimal example:

```yaml
---
name: my-agent
description: What this agent does. Activates for keyword1, keyword2
model: sonnet
tools:
  - Read
  - Write
  - Bash
skills:
  - relevant-skill-1
  - relevant-skill-2
metadata:
  category: "backend"
  taskTypes: "build"
  keywords: "keyword1, keyword2"
  examplePrompts: "First example prompt | Second example prompt"
---

## Directive
Clear instruction for what this agent does.

## Task Boundaries
**DO:** List what this agent should do
**DON'T:** List what other agents handle
```

## How Agents Activate

Agents activate through two mechanisms:

### 1. Keyword Auto-Activation

Each agent's `description` field contains activation keywords. When your prompt matches those keywords, OrchestKit's hooks suggest the most relevant agent. For example:

- Typing "design a REST API for user management" matches `backend-system-architect` keywords: *API design, REST, endpoint, route, authentication*
- Typing "scan for security vulnerabilities" matches `security-auditor` keywords: *security, vulnerability, CVE, audit, OWASP*
- Typing "this component is broken, help me debug" matches `debug-investigator` keywords: *bug, error, debug, crash, failure*

### 2. Explicit Spawning

You can spawn any agent directly using the `Task` tool with a `subagent_type` parameter:

```python
Task(
  description="Design the user API",
  subagent_type="backend-system-architect",
  prompt="Design RESTful endpoints for user management...",
  run_in_background=True
)
```

Workflow skills like `/ork:implement` and `/ork:review-pr` spawn multiple agents in parallel automatically.

## Find Your Agent

Use the interactive selector to find the right specialist for your task.

<AgentSelector />

## Frontmatter Fields Explained

| Field | Required | Values | Purpose |
|-------|----------|--------|---------|
| `name` | Yes | kebab-case string | Unique identifier used in `subagent_type` |
| `description` | Yes | String with keywords | Agent summary and auto-activation keywords |
| `model` | Yes | `opus`, `sonnet`, `inherit` | LLM model assignment |
| `tools` | Yes | Array of tool names | Which Claude Code tools the agent can access |
| `skills` | Yes | Array of skill names | Knowledge modules auto-injected at spawn |
| `metadata` | Yes | One-level string map | Ork house keys: `category` (`backend`, `frontend`, `security`, etc.), `taskTypes`, `keywords`, `examplePrompts` |
| `color` | No | CSS color name | Visual indicator in task display |
| `memory` | No | `project`, `local` | Memory persistence scope |
| `hooks` | No | Object with hook definitions | Agent-scoped hooks (e.g., block writes for read-only agents) |

### Model Assignment Strategy

The `model` field controls which LLM powers the agent:

- **`opus`**: Used for complex reasoning and review: security auditing, AI safety, code quality review, system design review, workflow design. Agents on Opus: <Count k="agents.byModel.opus" />.
- **`sonnet`**: Used for focused production tasks: debugging, databases, CI/CD, LLM integration, performance, testing, design, research. Agents on Sonnet: <Count k="agents.byModel.sonnet" />, the default choice.
- **`haiku`**: Used for low-stakes, fast tasks: emulation, eval runs, release mechanics. Agents on Haiku: <Count k="agents.byModel.haiku" />.
- **`inherit`**: Uses whatever model the parent session is running. Agents that inherit: <Count k="agents.byModel.inherit" /> (the roster below names them). Use it where depth should follow the session, not as a blanket default.

### Why No `context` Field

Agents do not declare `context:`. It is a skill frontmatter key (`context: fork` runs a skill in a subagent), and nothing shows Claude Code reads it on a subagent definition, so it was dropped from every agent in m3. Every spawned agent already runs in its own context window.

## Agent Lifecycle

When an agent is spawned, it follows this lifecycle:

```
1. PROMPT           User types a request
                    |
2. KEYWORD MATCH    Hooks analyze prompt, suggest matching agent
                    |
3. AGENT SPAWNS     Claude Code creates a new task with:
                    - Model from frontmatter
                    - Tools from frontmatter
                    - Skills auto-injected from frontmatter
                    - Directive from markdown body
                    |
4. SKILL INJECTION  Skills listed in frontmatter are loaded
                    into the agent's context automatically
                    (CC 2.1.6+ auto-discovery)
                    |
5. HOOK EXECUTION   Agent-scoped hooks run (PreToolUse, PostToolUse)
                    Example: block-writes hook prevents read-only
                    agents from modifying code
                    |
6. EXECUTION        Agent performs its task using available tools
                    - Reads code, runs commands, analyzes patterns
                    - Follows its directive and task boundaries
                    |
7. RETURN           Agent produces structured output
                    - JSON report, review findings, or implementation
                    - Parent task receives the result
```

### Agent-Scoped Hooks

Some agents define their own hooks in the frontmatter. These run only when that specific agent is active:

```yaml
hooks:
  PreToolUse:
    - matcher: "Write|Edit"
      command: "${CLAUDE_PLUGIN_ROOT}/hooks/bin/run-hook.mjs agent/block-writes"
```

This pattern is used by read-only agents like `security-auditor`, `debug-investigator`, `code-quality-reviewer`, and `system-design-reviewer` to prevent them from modifying code. The `deployment-manager` uses a different hook (`deployment-safety-check`) to validate commands before execution.

## The <Count k="agents" /> Agents by Category

Categories collapse the raw `metadata.category` values from `src/agents/*.md` frontmatter into seven readable groups; singletons (data, git, research) fold into adjacent groups. The tables are rendered from the frontmatter at build time, so the model column is always the one the agent runs.

<AgentRoster />
## Skills Per Agent

Each agent carries a tailored set of skills. The `backend-system-architect`, for example, loads a broad set covering API design, database schemas, caching, auth patterns, and more, while the `debug-investigator` loads a short list focused on root cause analysis and observability. Each agent's reference page lists its skills, generated from its frontmatter.

Skills are auto-injected when the agent spawns, no manual loading required. The platform scales skill content to fit within 2% of the context window (CC 2.1.33+).

## What's Next

- [Choosing an Agent](/docs/agents/choosing-an-agent): Decision tree for picking the right agent for your task
- [Multi-Agent Patterns](/docs/agents/multi-agent-patterns): How `/ork:implement` and `/ork:review-pr` orchestrate agents in parallel
- [Writing Agents](/docs/agents/writing-agents): Create your own specialized agent
