Plugin Architecture
Understanding Ralph TUI's plugin system for agent and tracker integrations.
Plugin Architecture
Ralph TUI uses a plugin system to support multiple AI agents and task trackers. This modular design lets you choose the tools that best fit your workflow.
Plugins are independent - any agent can work with any tracker. Use Claude Code with Beads, or OpenCode with prd.json, or any combination.
Two Plugin Types
Ralph TUI has two categories of plugins:
Agent Plugins
Agent plugins connect to AI coding assistants that execute tasks. They handle:
- Detecting if the agent CLI is installed
- Building command-line arguments from prompts
- Streaming output in real-time
- Managing execution lifecycle (start, interrupt, timeout)
- Model selection and configuration
Built-in agents:
- Claude Code - Anthropic's Claude CLI with subagent tracing
- OpenCode - Open-source multi-provider agent with subagent tracing
- Factory Droid - Factory Droid CLI (no subagent tracing)
Tracker Plugins
Tracker plugins connect to task management systems. They handle:
- Fetching available tasks
- Selecting the next task (respecting priorities and dependencies)
- Updating task status (in progress, completed)
- Syncing with external systems
Built-in trackers:
- JSON - Simple prd.json file format (no dependencies)
- Beads - Git-backed issue tracker with hierarchy
- Beads-BV - Beads with graph analysis for smart task selection
How Plugins Work Together
The execution engine orchestrates plugins:
- Tracker provides the next task (highest priority, no blockers)
- Engine builds a prompt from task data + Handlebars template
- Agent executes the prompt and streams output
- Engine detects completion via
<promise>COMPLETE</promise> - Tracker marks the task as complete
- Repeat until no tasks remain
Plugin Comparison
Agents
| Feature | Claude Code | OpenCode | Factory Droid |
|---|---|---|---|
| Provider | Anthropic | Multi-provider | Factory |
| Models | sonnet, opus, haiku | Any via provider/model format | Factory model list |
| Subagent Tracing | Yes (Task tool) | Yes (Task tool) | No |
| File Context | Yes (--add-dir) | Yes (--file) | No (uses --cwd) |
| Streaming | Yes | Yes | Yes |
| Installation | npm i -g @anthropic-ai/claude-code | curl -fsSL https://opencode.ai/install | bash | Factory Droid CLI |
Trackers
| Feature | JSON | Beads | Beads-BV |
|---|---|---|---|
| External CLI | None | bd | bd + bv |
| Dependencies | Yes | Yes | Yes |
| Priority Ordering | Yes | Yes | Yes + PageRank |
| Hierarchy (Epics) | No | Yes | Yes |
| Graph Analysis | No | No | Yes |
| Git Sync | No | Yes | Yes |
| Setup Complexity | Lowest | Medium | Highest |
Choosing Plugins
Start with the JSON tracker and Claude Code agent:
No external dependencies needed - just create a prd.json file and go.
Configuration
Quick Setup
Set default plugins in your config file:
CLI Override
Override config with CLI flags:
Multiple Plugin Configs
Configure multiple instances for flexibility:
Plugin Interface
All plugins implement standard interfaces defined in the source:
- AgentPlugin:
src/plugins/agents/types.ts - TrackerPlugin:
src/plugins/trackers/types.ts
Key methods for agents:
detect()- Check if CLI is availableexecute(prompt, files, options)- Run the agentinterrupt(executionId)- Stop execution
Key methods for trackers:
getTasks(filter)- Get all matching tasksgetNextTask(filter)- Get highest priority ready taskcompleteTask(id, reason)- Mark task doneupdateTaskStatus(id, status)- Update task state
Next Steps
Learn about specific plugins:
- Agents: Claude Code | OpenCode | Factory Droid
- Trackers: JSON | Beads | Beads-BV