← Back to Tutorials

Vibe Engineering as an Expert

Multi-Agent Architectures

Expert-level vibe engineering uses swarms of sub-agents, each with specialized roles, orchestrated by hooks and custom commands.

Multi-agent swarm architecture

Sub-Agents & Hooks

// Claude swarm configuration
{
  "agents": {
    "frontend": {
      "role": "Frontend Developer",
      "context": ["/frontend/**", "tailwind.config.js"],
      "hooks": {
        "pre-commit": "lint:check",
        "post-deploy": "e2e:test"
      }
    },
    "backend": {
      "role": "Backend Developer",
      "context": ["/backend/**", "requirements.txt"],
      "hooks": {
        "pre-commit": "pytest",
        "post-merge": "migrate:db"
      }
    }
  }
}

Controlled Chaos: Swarms

Swaroms are groups of agents that work in parallel on different aspects of a problem. An orchestrator coordinates their outputs.

# Swarm orchestrator pattern
class SwarmOrchestrator:
    def __init__(self):
        self.agents = {
            "planner": Agent("plan"),
            "coder": Agent("code"),
            "tester": Agent("test"),
            "reviewer": Agent("review")
        }

    async def run(self, task):
        plan = await self.agents["planner"].run(task)
        code = await self.agents["coder"].run(plan)
        test_report = await self.agents["tester"].run(code)
        review = await self.agents["reviewer"].run(code, test_report)
        return review

Cloud Sandboxes

Execute agents remotely in cloud sandboxes (Sprites.dev, Modal) for secure, scalable execution.

claude --sandbox sprites  # Run in cloud sandbox

Scale & SDKs

The Claude Agent SDK enables programmatic agent creation and orchestration for large codebases.

pip install claude-agent-sdk

from claude_agent import Agent, Swarm

agent = Agent(
    name="CodeReviewer",
    model="claude-sonnet-4-20250514",
    instructions="Review code for bugs, security, and style."
)

swarm = Swarm(agents=[agent], orchestrator="sequential")
result = swarm.run("Review the PR #42 changes")

Advanced Swarms & Capstone

The Gastown orchestration pattern enables parallel agent execution with dynamic task assignment.

Capstone: Trader Workstation

Build a complete trading platform using multi-agent swarms:

✏️ Exercise: Build a multi-agent swarm for a trading platform. Configure sub-agents for data, analysis, risk, and execution. Use hooks for pre-trade checks and post-trade logging. Deploy the orchestrator to a cloud sandbox. The final system should be able to: fetch real-time data, analyze trends, assess risk, and execute paper trades autonomously.