Specialized Agent Design
From Theory To Tools
In our previous lesson, we discussed the theory of agent orchestration. We learned that using one large AI for a long project often leads to context decay, where the AI starts making mistakes because it is trying to remember too much at once. The solution is to use a Main Agent that delegates work to specialized Subagents.
In this lesson, we move from theory to tools. We will learn how to actually build these specialized agents. On CodeSignal, these agents are defined as simple Markdown files stored in a specific folder: .claude/agents/. By creating these files, you are giving Claude a set of specialized "employees" it can hire to perform specific tasks with high precision.
The Anatomy Of A Specialist
Before we build a specific agent, we need to understand what goes inside an agent file. Every specialized agent has three main parts: the Identity, the Role, and the Completion Criteria.
First, we define the Identity using something called YAML frontmatter. This is a small block of text at the very top of the file that tells the system what the agent is named and what tools it can use.
name: How you will call this agent later.tools: The specific powers this agent has (like reading files or running terminal commands).model: The specific AI brain used for this agent (e.g.,Claude 3.5 Sonnet).
Next, we add the System Prompt. This is the instruction manual for the agent. It defines its Role and the Process it must follow.
Finally, we define Completion Criteria through a Standards section. This tells the agent exactly what it must do before it is allowed to say "I am finished." Standards typically include specific quality thresholds like code coverage percentages, test success requirements, and type-checking results.
These Standards act as the completion checklist—the agent cannot mark its work as done until all these criteria are satisfied. This usually involves running validation scripts or checking code coverage as part of the agent's process.
