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 TOML configuration files stored in a specific folder: .codex/agents/. Each role is registered in your .codex/config.toml, then its detailed settings live in a separate .toml file. By creating these files, you are giving Codex a set of specialized "employees" it can hire to perform specific tasks with high precision.

The Anatomy Of A Specialist

In Unit 1 you already registered an agent role in .codex/config.toml and configured it with a role-specific TOML file. Every specialized agent follows that same three-part structure: Identity (the registration entry and model settings), Role (the developer_instructions system prompt that defines what the agent does), and Completion Criteria (a Standards section inside those instructions that lists what must be true before the agent reports "done"). We will apply this pattern directly to two new specialists below.

The Task Executor: Our Primary Builder

The Task Executor is your primary worker. Its job is to take a single task from your tasks.md file and turn it into working, tested code. You already saw its basic structure in Unit 1. What makes it effective in practice is the Process section of developer_instructions, which enforces a Test-First workflow—writing the test before the code to ensure we build exactly what is needed:

After the process, we define the Standards. These are the "laws" the agent must follow, such as requiring 90% code coverage. This ensures that even if you aren't watching, the agent maintains high quality.

This agent can be summoned by asking Codex to: Spawn a task-executor agent: "Execute T001: Add priority field to Task model".

The Test Enhancer: The Quality Auditor

Sometimes, a developer moves too fast and misses edge cases. That is why we build a Test Enhancer. This agent doesn't write new features; it only looks at existing code and tries to break it with better tests.

We start by registering the role in .codex/config.toml and creating .codex/agents/test-enhancer.toml:

.codex/config.toml:

.codex/agents/test-enhancer.toml:

Next, we define its Role and Process inside the developer_instructions. The core of this agent is its ability to check code coverage—a measurement of how much of your code is actually exercised by your tests.

In a production environment, you might run the task-executor first to build a feature, then immediately follow up with the test-enhancer to ensure no bugs are hiding in the "uncovered" lines of code. You would summon this agent by asking Codex to: .

Completion Reporting & Orchestration

Once an agent finishes its work, it provides a Structured Report—the same format you saw in Unit 1—so the Main Agent and you can quickly verify the work.

To manage these reports across a large project, we use an Orchestration Template. This is a guide for the Main Agent on how to handle a feature with multiple tasks. It follows a simple loop:

  1. Delegate: Spawn the specialized agent (e.g., Spawn a task-executor agent).
  2. Receive Report: Look at the validation results.
  3. Wait for Approval: Ask the human if the work is acceptable.
  4. Track Progress: Update the tasks.md file with a checkmark.

This "Delegate → Receive → Approve" flow is the secret to building massive APIs without the AI getting confused.

Summary And Practice Preview

In this lesson, we moved from the idea of orchestration to the actual construction of specialized agents.

  • We saw that agents share the same three-part anatomy (Identity, Role, Standards) introduced in Unit 1.
  • We examined the Task Executor's test-first Process and Standards that enforce quality.
  • We designed a Test Enhancer to act as a quality auditor and push code coverage to 95%+.
  • We explored the Orchestration Template, which defines how the Main Agent manages these specialists.

In the upcoming practice exercises, you will get hands-on experience building these .toml files in the CodeSignal IDE. You will then use your new team of agents to implement a Task Tags feature consisting of 6 different tasks, moving through the entire orchestration workflow from start to finish!

Sign up
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal