How I Built an AI Dev Team in Claude Code: Tester, Developer, Reviewer and DevOps
AI coding tools are fast. You write one sentence, and a few minutes later you have a new feature. But if you use one AI agent for everything, you will soon see some problems. The same agent writes the code, writes the t
AI coding tools are fast. You write one sentence, and a few minutes later you have a new feature. But if you use one AI agent for everything, you will soon see some problems.
The same agent writes the code, writes the tests and then "reviews" its own work. Sometimes it even changes a test so that the test passes. π
So I tried something different. I built a small AI team in Claude Code. Every agent has one job and only the tools it really needs, a bit like a real development team.
π€ Why Not Just One Agent?
- It can't review its own code. It remembers why it wrote the code, so it trusts it. A reviewer with a fresh context sees only the changes.
- It can "fix" the test instead of the code. When one agent owns both, the easiest way to a green test is to change the test.
- It has too many permissions. A reviewer doesn't need to edit files. A tester doesn't need to deploy anything.
π₯ The Team
| Agent | What it does |
|---|---|
tester |
Writes failing tests first. They are the task for the developer. |
fe-dev |
Frontend: components, pages, forms, accessibility. |
be-dev |
Backend: API endpoints, migrations, commands, imports. |
reviewer |
Reviews the changes. Read only, never edits. |
devops |
Docker, CI/CD, Kubernetes. Joins only when infrastructure changes and never deploys. |
| team | Runs tester β dev β reviewer in rounds. Starts with "Implementβ¦", or "Reviewβ¦" for review only. |
On small projects, I use one fullstack-dev instead of fe-dev and be-dev.
π It's Just Files in Your Repository
.claude/
βββ agents/ tester.md, fe-dev.md, be-dev.md, reviewer.md, devops.md
βββ hooks/ block-test-edits.sh
βββ skills/team/ SKILL.md
βββ settings.json
CLAUDE.md
Each agent is a Markdown file with a short YAML header (name, description, tools, model) and instructions below it. You commit the folder, and your whole team gets the same AI colleagues.
π‘ The Trick: One Team for Every Stack
I work with WordPress, Laravel, Symfony, Node.js and Next.js. I didn't want five different teams.
So the agents are generic. They don't know how to run tests in your project. They read it from CLAUDE.md, which every agent loads:
## Commands
- Tests: npx vitest run <file>
- Types: npx tsc --noEmit
- Lint: npx eslint .
In WordPress, the same section has vendor/bin/phpunit and phpcs --standard=WordPress. In Laravel, php artisan test and pint. Only CLAUDE.md changes between projects.
π§ͺ Tester and Developers
The tester writes the smallest set of tests for the new behaviour and checks that they fail for the right reason. A failing test is a clear task: the developer knows exactly what "done" means.
---
name: tester
description: Writes failing tests as a task for the developers. Use before a new feature or bug fix.
tools: Read, Grep, Glob, Edit, Write, Bash
model: sonnet
---
You are a tester. Your output is tests, not production code.
Find the test commands in CLAUDE.md. Run the new tests and
check that they FAIL for the right reason. No skipped tests.
The developers have different rules. Backend runs migrations only locally, validates input and checks permissions. Frontend uses semantic HTML, keyboard navigation, and loading and error states. The most important rule for both: don't change the tests.
π‘οΈ Hooks: Rules Without Exceptions
A prompt is only a request. A hook is a rule. It's a small script that Claude Code runs automatically, for example before every file edit. Exit code 2 blocks the action:
#!/bin/bash
# Developers can't edit tests
FILE=$(jq -r '.tool_input.file_path // empty')
case "$FILE" in
*/tests/*|*Test.php|*.test.ts|*.test.tsx|*.spec.ts)
echo "Blocked: tests are the task. Don't change them." >&2
exit 2 ;;
esac
exit 0
π Reviewer: Read Only
---
name: reviewer
description: Reviews frontend and backend changes. Read only.
tools: Read, Grep, Glob, Bash
---
There is no Edit and no Write, and Claude Code itself enforces this. The reviewer returns two lists:
- BLOCKING: bugs, security problems, broken migrations.
- SUGGESTIONS: at most 5 small ideas.
Why two lists? An AI reviewer always finds something. If you fix every small idea, you get over-engineered code. Only blocking problems start a new round.
π The Team Leader
The main conversation leads the team. It follows a skill, a file with instructions that Claude loads when it needs them:
- Turn the task into 3β6 acceptance criteria.
- Tester writes failing tests.
-
be-devand/orfe-devimplement until the tests pass (backend first). - Reviewer checks the changes.
- Blocking findings β next round. Maximum 3 rounds, then stop and ask a human.
Skills deserve their own article, and I'll write one soon. π
π A Real Example
I wrote: "Implement a price filter for products."
The tester wrote tests for the API and the component. be-dev added minPrice and maxPrice, and fe-dev connected a price slider. It once tried to edit a test, and the hook stopped it. π The reviewer found a blocking problem: the slider sent a request on every move. In round 2, fe-dev added a debounce. Done.
I didn't write the code. I checked the criteria, read the diff and tested it in the browser.
πΈ When Is It Too Much?
The team is slower and more expensive than one conversation, because every agent starts with an empty context. I don't use it for small fixes, one-time scripts, questions about the code or purely visual changes.
To save money, I use cheaper models for simpler roles, set a turn limit for each agent and use one fullstack-dev on small projects.
π How to Start
- Write a good
CLAUDE.md: your stack, folders and the commands for tests, lint and types. - Add only a reviewer first. It's read-only, so it's safe to try. Ask it to review your changes before every pull request.
- When you trust it, add the tester, developers and the team skill.
Official docs: Claude Code subagents, Skills, Hooks
π¬ What About You?
Do you use AI agents in your development workflow?
Do you use one agent for everything, or do you also split the work into roles?
Share your setup in the comments! I'm especially interested in how you handle tests and code review with AI. π
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.