---
title: "Implementer"
description: "TDD implementation - writes tests first, minimal implementation, verifies, leaves runnable checks."
canonical_url: "https://mubaidr.github.io/gem-team/agents/implementer"
---

> Index of every page on this site: [llms.txt](https://mubaidr.github.io/gem-team/llms.txt)

## Role

Implements features, fixes, refactors using TDD. Bug fixes require Debugger diagnosis first. Writes the shortest correct diff that passes all acceptance criteria.

## When to Delegate

| Scenario                               | Delegate Implementer? | Why                                      |
| -------------------------------------- | --------------------- | ---------------------------------------- |
| New feature implementation             | ✅                     | TDD: Red → Green → Refactor              |
| Bug fix (after Debugger diagnosis)     | ✅                     | Receives root cause + fix recommendation |
| Refactor (simple, behavior-preserving) | ✅                     | Minimal diff, tests pass                 |
| Root cause diagnosis                   | ❌                     | Out of scope; use Debugger first         |
| Architecture redesign                  | ❌                     | Out of scope; use Planner + Implementer  |

## TDD Workflow (Mandatory)

1. **Red**: Write failing tests for all acceptance criteria + edge cases
2. **Green**: Shortest correct diff to pass
3. **Refactor**: Clean up, all tests pass
4. **Verify**: Runnable checks for non-trivial changes

## Input Handoff

```yaml
task_definition:
  objective: "Implement GET /api/users/search"
  acceptance_criteria: ["filter", "pagination", "sorting", "OpenAPI"]
  handoff:
    constraints: ["Follow conventions", "Use Prisma"]
    relevant_context: ["research-api-patterns: patterns=REST"]
    plan_context:
      architectural_boundaries: ["api layer"]
      risk_decisions: ["stateless search"]
```

## Output

```yaml
status: "completed"
handoff:
  implemented_files: ["src/api/users/search.ts"]
  test_files: ["tests/api/users/search.test.ts"]
  api_contract_path: "..."
  test_results_path: "..."
```

## Key Rules

- TDD always - no implementation without failing test
- Bug fixes: Debugger first, then Implementer
- Shortest correct diff
- One-line reason per decision
- Evidence by reference (artifact paths, not content)

## Definition

[`.apm/agents/gem-implementer.agent.md`](https://mubaidr.github.io/.apm/agents/gem-implementer.agent.md)

## Related

- [Debugger](https://mubaidr.github.io/agents/debugger) - Bug diagnosis before implementation
- [Code Simplifier](https://mubaidr.github.io/agents/code-simplifier) - Complex refactoring
- [Workflow: Execute](https://mubaidr.github.io/guide/workflow-execute)

## Sitemap

See the full [sitemap](https://mubaidr.github.io/gem-team/sitemap.md) for all pages.
