Skip to main content

Coding agent

The RBS platform includes a built-in AI coding agent — similar to Cursor or Claude Code, but deeply integrated with the build system. It understands your project structure, can build and test targets, modify code, and even spawn teams of specialized AI teammates for complex tasks. The coding agent runs on your branch server and is accessible from your code editor or the integrated terminal.

Quick start

# Start interactive mode
rbs agent

# Run with a prompt
rbs agent "Add a hello world endpoint to the API"

# Use a specific model
rbs agent --model "claude-sonnet-4" "Explain this codebase"

What makes it different

Build system aware

Natively understands your BUILD.rbs files, targets, dependencies, and toolchains.

Multi-agent teams

Spawn teams of specialized AI teammates (frontend, backend, tester, etc.) for large tasks.

Deep code tools

Read, write, search, and precisely edit files. Run terminal commands. Build and test targets.

Fully extensible

Define custom tools, prompts, teammate roles, and skills using the RBS DSL.
RBS AgentCursorClaude CodeCodex CLI
Build integration✅ Native (9 tools)
Multi-agent teams
DAG workflows
Custom tool SDK✅ RBS DSL
Session persistencePartialPartial
Server + Web API✅ REST + WebSocket
Multi-LLM providers✅ 4 providers❌ (Claude only)❌ (OpenAI only)

Features

Code understanding and editing

The agent can read, search, and precisely edit your source files:
rbs agent "Refactor the database logic into a separate repository class"
The agent will:
  1. Scan your project structure and understand the build graph.
  2. Read the relevant source files.
  3. Make targeted edits using precise string replacement (not full file rewrites).
  4. Run tests to verify the changes.

Build system integration

Unlike standalone coding assistants, the RBS agent has native build tools:
rbs agent "Build the API server and fix any compilation errors"
The agent can:
  • Build targets: rbs_build — compile and package code.
  • Run tests: rbs_test — execute test targets and report results.
  • Run applications: rbs_run — start and interact with running targets.
  • Scan the project: rbs_scan — discover all packages, targets, and dependencies.
  • Query the build graph: rbs_query — analyze dependency relationships.
  • Manage processes: rbs_start / rbs_stop — run servers in the background.

Interactive commands

CommandDescription
/help, ?Show help message.
/clear, /cClear conversation history.
/exit, /qExit the agent.
/modelShow current model.
/toolsList available tools.
/statusShow session status.
/sessionShow current session ID.
/historyList recent chat sessions.

Extended thinking

For complex reasoning tasks, the agent supports extended thinking:
rbs agent "Analyze the architecture and suggest improvements for scalability"
When enabled, you’ll see the agent’s reasoning process:
  * Reasoning in the OS...
  The user wants me to analyze the architecture. Let me start by
  scanning the workspace to understand the project structure,
  then analyze the dependency graph for bottlenecks...

Multi-agent teams

For large, multi-faceted tasks, the agent can spawn teams of specialized AI teammates that work in parallel.
rbs agent "Create a team to build a REST API with frontend, backend, and tests"
Team 'api-team' created!
Standards Enforcer auto-spawned
Teammate 'backend-dev' spawned (role: backend)
Teammate 'frontend-dev' spawned (role: frontend)
Teammate 'test-writer' spawned (role: tester)
Tasks assigned...

How teams work

Main Agent (Orchestrator)

    ├── Standards Enforcer (auto-spawned, monitors quality)
    ├── Teammate "backend-dev" (role: backend)
    ├── Teammate "frontend-dev" (role: frontend)
    └── Teammate "test-writer" (role: tester)
Each teammate:
  • Has its own runtime with full access to all tools.
  • Receives a role-specific system prompt.
  • Communicates via a shared message bus.
  • Reports progress and results back to the orchestrator.

Coordination models

  • Hierarchical (default): You direct all teammates. Best for structured tasks.
  • Collaborative: Teammates coordinate with each other. Best for exploratory tasks.

Built-in roles

RoleSpecialty
frontendReact, TypeScript, CSS, UI/UX
backendAPIs, databases, server logic
architectSystem design, patterns, scalability
reviewerCode quality, best practices, security
testerTesting strategies, coverage, QA
devopsCI/CD, containers, infrastructure
researcherInvestigation, analysis, documentation
doc_writerTechnical writing, API docs, tutorials
debuggerBug investigation, root cause analysis
refactorerCode improvement, tech debt reduction
You can also define custom teammate roles using the Agent SDK.

DAG workflows

For multi-step tasks with dependencies, the agent can define and execute DAG workflows where each step is a subagent:
[explore] → [analyze] → [implement] → [test]
                │                        ↑
                └───→ [document] ────────┘
Each node runs as an independent subagent, receives context from upstream nodes, and passes results downstream.
rbs agent "Run a workflow: explore the codebase, plan the auth feature, implement it, then write tests"

Rules enforcement

The agent automatically loads project rules and coding standards from your repository:
SourcePriorityDescription
.agent-rules/HighestProject-specific agent rules
.cursorrulesHighCursor IDE rules
.cursor/rules/HighCursor rules directory
CLAUDE.mdMediumClaude Code project file
CONTRIBUTING.mdLowProject conventions
Rules are injected into the agent’s system prompt and periodically re-reminded during long sessions.

Example .agent-rules/coding-standards.md

# Coding Standards

- All new functions must have unit tests.
- Use dependency injection for database access.
- API endpoints must return JSON with status codes.
- Never commit secrets or API keys.

Session persistence

All agent sessions are automatically saved on the branch server:
.rbs/ai/chats/
├── 2026-02-17_10-30-45.json   # Full data (messages, tool calls, thinking)
└── 2026-02-17_10-30-45.md     # Human-readable markdown
You can resume past sessions and review what the agent did:
rbs agent
> /history

Recent sessions:
  1. 2026-02-17 10:30 - "Add health endpoint" (23 messages)
  2. 2026-02-16 15:45 - "Refactor auth module" (47 messages)
  3. 2026-02-16 09:00 - "Fix database tests" (12 messages)

Server API

The coding agent is accessible via REST and WebSocket APIs, enabling integration with any editor or tool:

REST endpoints

EndpointMethodDescription
/api/agent/sessionsPOSTCreate new agent session.
/api/agent/sessionsGETList all sessions.
/api/agent/sessions/:idGETGet session details.
/api/agent/sessions/:id/runPOSTRun agent with a prompt.
/api/agent/toolsGETList available tools.
/api/agent/configGETGet agent configuration.
/api/agent/historyGETList saved chat sessions.
/api/agent/history/:id/resumePOSTResume a past session.

WebSocket streaming

WS /ws/agent/:session_id
Responses stream in real-time over WebSocket, including:
  • Text deltas (agent’s response).
  • Tool call events (what the agent is doing).
  • Thinking events (extended reasoning).
  • Team events (teammate progress).

CLI flags

rbs agent [flags] [prompt]

Flags:
  -m, --model string     Model to use (auto-detects provider)
  -f, --files string     Comma-separated list of context files
  -s, --system string    Custom system prompt
  -n, --non-interactive  Run once without interactive mode
      --full-docs        Enable full documentation access
  -h, --help             Help for agent

Examples

Basic usage

# Interactive mode
rbs agent

# Single prompt
rbs agent "What does this project do?"

# With context files
rbs agent --files "main.go,config.go" "Explain the entry point"

Code changes

# Add a feature
rbs agent "Add a /health endpoint that returns JSON status"

# Fix a bug
rbs agent "Fix the null pointer exception in UserService.java"

# Refactor
rbs agent "Extract the database logic into a separate repository class"

Build and test

# Scan the project
rbs agent "Scan the workspace and tell me what targets are available"

# Build and fix
rbs agent "Build //services/api:server and fix any errors"

# Run tests and improve coverage
rbs agent "Run all tests and add missing test coverage for the auth module"

Team-based tasks

# Full feature with team
rbs agent "Create a team to implement user auth with frontend, backend, and tests"

# Documentation project
rbs agent "Create a doc_writer team to generate API docs for this project"

Next steps