Skip to main content

Agent SDK

The Agent SDK lets you customize and extend the RBS coding agent with project-specific capabilities. Define custom tools, system prompts, teammate roles, subagents, and slash commands — all in your WORKSPACE.rbs or BUILD.rbs files using the RBS DSL.

Overview

Loading built-in tools

Load the built-in agent tools (Git status, Git log, file analysis, etc.) in your workspace:

Custom tools

Basic tool with a shell command

Tool with parameters

Tool with implementation function

For complex logic, use an implementation function with full ctx access:

The ctx object for tools

When using implementation, your function receives a ctx object with these modules:

ctx.attr — Access parameters

ctx.file — File operations

ctx.dir — Directory operations

ctx.shell — Execute commands

ctx.path — Path manipulation

ctx.json — JSON operations

ctx.output — Return results

Custom prompts

Create specialized system prompts with linked tools:

Custom subagents

Create subagent types for one-shot, isolated specialist tasks:

Custom teammate roles

Create reusable roles for multi-agent teams:
Custom roles are automatically available when spawning teammates:

Custom skills (slash commands)

Create slash commands for common workflows:

Long-term memory

The coding agent has a persistent memory system that remembers things across sessions — design patterns, user corrections, file-specific notes, and architectural decisions. Memory is stored as human-editable markdown in .rbs/memory/.

How memory works

Memory file format

Memory files are plain markdown, stored alongside your code:
Each entry uses ## [m-xxxxxxxx] headers:

Memory tools

Editing memory directly

Memory files are just markdown. You can read, edit, add, and delete entries directly in your editor — the agent respects your changes.

Complete example

Attribute types reference

All attribute types support:
  • doc (string) — Description shown to the AI model.
  • mandatory (bool) — Whether the parameter is required.
  • default (any) — Default value.

Best practices

  1. Clear descriptions — Write descriptions that help the AI model understand when to use the tool.
  2. Document parameters — Use doc for all attributes.
  3. Handle errors — Always check for errors and return meaningful messages.
  4. Keep tools focused — Each tool should do one thing well.
  5. Define roles for your team — Create custom teammate roles matching your project needs.
  6. Use subagents for isolation — Use read-only subagents for analysis tasks.
  7. Create skills for workflows — Turn common multi-step workflows into slash commands.