DEV Community

Cristian Sifuentes
Cristian Sifuentes

Posted on

Conversational Development With Claude Code — Part 9: Building Specialized Sub‑Agents for Parallel Delivery

Conversational Development With Claude Code — Part 9: Building Specialized Sub‑Agents for Parallel Delivery<br>

Conversational Development With Claude Code — Part 9: Building Specialized Sub‑Agents for Parallel Delivery

TL;DR — Real productivity does not come from asking Claude Code to do more. It comes from asking it to divide responsibilities like a disciplined engineering team. In this chapter, we design and orchestrate specialized frontend and backend sub‑agents to plan the Platiflix ratings system in parallel — no code generation, only structured, executable phases.

This is not about automation.

This is about architecture through delegation.


Why specialization is the difference between speed and noise

A single agent, no matter how capable, eventually becomes cognitively overloaded.

When planning a feature like a 1–5 star rating system, the mental space fragments into:

  • database modeling,
  • API contracts,
  • migration strategies,
  • UI state design,
  • component integration,
  • validation logic,
  • rollback guarantees.

If one agent tries to hold all of this at once, the reasoning blurs.

Specialized sub‑agents restore clarity by narrowing scope:

  • Backend agent: owns persistence, migrations, integrity.
  • Frontend agent: owns interaction, state, UI contract alignment.
  • Architect agent (from Part 7): defines boundaries and sequencing.

The objective is not parallel typing.

The objective is parallel thinking.


Where sub‑agents live (and why structure matters)

Claude Code agents live inside:

.cloud/agents/
Enter fullscreen mode Exit fullscreen mode

Each agent is defined by a Markdown file containing:

  1. YAML front matter (identity + metadata)
  2. System prompt (behavioral contract)

We will create two files:

.cloud/agents/backend.md
.cloud/agents/frontend.md
Enter fullscreen mode Exit fullscreen mode

The file system becomes your organizational chart.


Designing the Frontend Sub‑Agent

The frontend agent must reflect the project stack:

  • Next.js
  • React
  • TypeScript
  • Existing component architecture

Its prompt should move from general stack awareness to precise responsibilities.

Example Frontend Agent Definition

---
name: frontend
description: Specialist in frontend architecture and UI integration for Next.js + React + TypeScript.
model: inherit
color: blue
---
Enter fullscreen mode Exit fullscreen mode

System prompt (excerpt):

You are a frontend architecture specialist.

Stack:
- Next.js
- React
- TypeScript

Responsibilities:
- Analyze existing component structure
- Identify current development patterns
- Define interfaces and types required for new features
- Propose incremental implementation phases
- Do NOT generate code — produce structured plans only

Always:
- Start by analyzing current frontend architecture
- Identify compatibility considerations
- Deliver phased, testable steps
Enter fullscreen mode Exit fullscreen mode

Notice the structure:

From stack → patterns → tasks → constraints.

This ensures the agent does not improvise outside the system’s design language.


Designing the Backend Sub‑Agent

The backend agent mirrors the server stack:

  • FastAPI
  • Python
  • SQLAlchemy
  • PostgreSQL

But its emphasis is foundational integrity.

Backend Agent Definition

---
name: backend
description: Specialist in backend architecture and database design for FastAPI + SQLAlchemy.
model: inherit
color: green
---
Enter fullscreen mode Exit fullscreen mode

System prompt (excerpt):

You are a backend architecture specialist.

Stack:
- FastAPI
- Python
- SQLAlchemy
- PostgreSQL

Responsibilities:
- Begin with database design
- Define migration strategy
- Include downgrade (rollback) procedures
- Define API contract phases
- Maintain incremental, verifiable implementation steps
- Do NOT generate code — produce structured specifications only
Enter fullscreen mode Exit fullscreen mode

The backend agent must always start from the database layer.

Architecture is gravity. Everything falls downward first.


Explicit vs Implicit Invocation

Claude Code allows two orchestration strategies.

Explicit Invocation

You directly select the agent:

@frontend
@backend
@architect
Enter fullscreen mode Exit fullscreen mode

This is ideal when precision matters.

Implicit Invocation

You write a prompt that encourages Claude Code to activate appropriate sub‑agents automatically.

Example:

Analyze the architect’s ratings plan and produce backend and frontend implementation phases in parallel. Do not generate code.

Claude will delegate internally.

Explicit invocation gives you control.

Implicit invocation gives you fluidity.

Choose intentionally.


Parallel Planning for the Ratings System

We ask both sub‑agents to:

  • Analyze the architect’s output.
  • Produce independent but compatible phase plans.
  • Avoid generating code.
  • Focus only on execution phases.

This produces two specification artifacts.

Parallel planning does not mean chaos.

It means synchronized independence.


What the Frontend Plan Includes

The frontend agent typically produces:

1. Context Analysis

  • Current component hierarchy
  • State management patterns
  • Data fetching mechanisms
  • Existing type definitions

2. Rating Interfaces

  • New TypeScript interfaces
  • Props extensions
  • Rating entity representations

3. Implementation Phases

  • Phase 1: Interface definitions
  • Phase 2: Component creation
  • Phase 3: Integration with course pages
  • Phase 4: UI validation + compatibility checks

4. Compatibility Considerations

  • Backward compatibility
  • Empty rating state handling
  • Rendering performance

Each phase must be independently verifiable.

If a phase cannot be tested alone, it is too vague.


What the Backend Plan Includes

The backend agent begins at the root: persistence.

Phase 1 — Database Foundation

  • Ratings table definition
  • Constraints (1–5 enforcement)
  • Foreign keys
  • Index strategy
  • Migration creation

Phase 2 — Migration Execution

  • Command definitions
  • Application steps
  • Validation checks

Phase 3 — Rollback Strategy

  • Downgrade procedures
  • State consistency validation

Phase 4 — API Contract Layer

  • Endpoint definitions
  • Input validation
  • Response schema structure

The backend plan must always be sequentially executable.

No skipped gravity.


Orchestrating Execution and Monitoring Progress

Claude Code allows visibility into orchestration mechanics.

Task List

Use Ctrl + T to view active to‑dos.
Each completed phase is marked as done.

Context Isolation

Each sub‑agent operates with its own memory context.
They do not bleed into one another unless instructed.

Context Command

context
Enter fullscreen mode Exit fullscreen mode

Displays memory usage across:

  • System prompt
  • Tools
  • MCP integrations
  • Custom agents

Token Awareness

System prompt ≈ 2.2k tokens

Tooling + MCP = additional consumption

Each sub‑agent increases token footprint during execution.

Token awareness is architectural awareness.

Memory is not infinite. Discipline matters.


Specification Artifacts

Both agents generate spec documents inside:

spec/
Enter fullscreen mode Exit fullscreen mode

Example:

spec/00-ratings-backend.md
spec/01-ratings-frontend.md
Enter fullscreen mode Exit fullscreen mode

You can renumber to reflect sequencing.

These files become reviewable artifacts:

  • diffable
  • auditable
  • PR‑friendly
  • persistent beyond the conversation

Planning becomes version‑controlled thought.


The Invisible Architecture: Why This Matters

Sub‑agents are not a gimmick.

They introduce:

  • Role isolation
  • Responsibility clarity
  • Parallelizable reasoning
  • Controlled cognitive load
  • Structured output formats

This mirrors real teams.

You are not replacing engineers.

You are structuring intelligence.


Final Reflection

A mature engineering organization does not scale by working harder.

It scales by dividing responsibility with precision.

Claude Code sub‑agents allow you to simulate that structure inside a single interface.

Frontend thinks like frontend.

Backend thinks like backend.

Architect guards coherence.

And you remain the orchestrator.

In the next chapter, we will move from specification to controlled incremental implementation — phase by phase, without sacrificing architectural integrity.

— Written by Cristian Sifuentes

Full‑stack engineer · AI‑assisted systems thinker

Top comments (0)