Recipes
Common patterns and pre-built agent configurations.
Pre-built recipes
ra ships with ready-to-use agent configurations in the recipes/ directory. These are complete ra.config.yaml files that compose skills, middleware, and settings into purpose-built agents.
Coding Agent
A general-purpose coding agent with file editing, shell execution, codebase navigation, extended thinking, and smart context compaction. Uses 200 max iterations and high thinking budget.
ra --config recipes/coding-agent/ra.config.yamlCode Review Agent
Reviews diffs for correctness, style, and performance. Connects to GitHub via MCP, includes a diff-gathering script and style guide, and enforces a token budget via middleware.
ra --config recipes/code-review-agent/ra.config.yaml --file diff.patch "Review this"Common patterns
Project-specific agent
Drop a ra.config.yml in your repo:
provider: anthropic
model: claude-sonnet-4-6
systemPrompt: |
You are an expert on this codebase. You know TypeScript, Bun, and the project structure.
When asked to make changes, write the code directly — don't describe what to do.
skillDirs:
- .ra/skillsNow ra in that directory becomes a project-aware agent.
CI code reviewer
# .github/workflows/review.yml
- name: Review PR
run: git diff origin/main | ra --skill code-review "Review this PR diff"Pipe and chain
# Summarize a log file
cat server.log | ra "Summarize errors in the last 100 lines"
# Review a diff
git diff | ra --skill code-review "Review this diff"
# Chain: extract → summarize
ra "List all TODO comments" | ra "Group by priority and format as a table"Rate limit fallback
# Primary provider fails? Flip and keep going
RA_PROVIDER=openai ra "Continue where we left off"MCP tool in Claude Desktop
{
"mcpServers": {
"project-agent": {
"command": "ra",
"args": ["--mcp-stdio"],
"cwd": "/path/to/your/project"
}
}
}Middleware for audit logging
// middleware/audit.ts
export default async (ctx) => {
const entry = {
ts: new Date().toISOString(),
messages: ctx.messages.length,
}
await Bun.file('audit.log').writer().write(JSON.stringify(entry) + '\n')
}# ra.config.yml
middleware:
afterLoopComplete:
- "./middleware/audit.ts"Scripting with --exec
Use --exec to run a TypeScript or JavaScript file that imports ra's internals programmatically:
ra --exec ./scripts/batch-review.tsSee also
- Dynamic Prompts — advanced middleware patterns for context injection
- Skills — creating and using skills
- Middleware — hooks for custom behavior
- Configuration — all config fields