| name | ra-architecture |
| description | Use when starting work on the ra codebase, navigating the source, or understanding how components connect. |
ra Architecture โ Quick Orientation
Every src/ subdirectory has its own CLAUDE.md with detailed docs. This skill gets you oriented fast.
Where Things Live
| I want to... | Go to |
|---|
| Understand the agent loop | src/agent/CLAUDE.md โ loop.ts |
| Add or modify a tool | src/tools/CLAUDE.md โ tool file โ index.ts |
| Add or modify a provider | src/providers/CLAUDE.md โ provider file โ registry.ts |
| Change config behavior | src/config/CLAUDE.md โ types.ts, defaults.ts, index.ts |
| Work on CLI/REPL/HTTP | src/interfaces/CLAUDE.md โ interface file |
| Write middleware | src/middleware/CLAUDE.md + src/agent/types.ts for context shapes |
| Work on MCP | src/mcp/CLAUDE.md โ client.ts or server.ts |
| Work on memory | src/memory/CLAUDE.md โ store.ts, tools.ts, middleware.ts |
| Work on skills system | src/skills/CLAUDE.md โ loader.ts, runner.ts |
| Work on context discovery | src/context/CLAUDE.md โ index.ts |
| Work on session storage | src/storage/CLAUDE.md โ sessions.ts |
| Find tests | tests/CLAUDE.md โ tests/<module>/ mirrors src/<module>/ |
Core Data Flow
Config โ Provider + ToolRegistry + Middleware โ AgentLoop โ Interface (CLI/REPL/HTTP/MCP)
The 5 Key Interfaces
| Type | Location | What |
|---|
IProvider | src/providers/types.ts | LLM adapter: chat() + stream() |
IMessage | src/providers/types.ts | Unified message format across all providers |
ITool | src/providers/types.ts | Tool: name + description + inputSchema + execute() |
StreamChunk | src/providers/types.ts | Streaming response: `text |
MiddlewareConfig | src/agent/types.ts | 9 hook arrays with typed contexts |
First Steps for Any Task
- Read the relevant
CLAUDE.md in the target directory
- Read the existing code you'll modify
- Check
tests/<module>/ for test patterns
- When done:
bun tsc โ bun test โ git diff (use the verify skill)