oh-my-opencode-slim is a lightweight agent orchestration plugin for OpenCode - a slimmed-down fork of oh-my-opencode. It provides a multi-agent system that enables specialized AI agents to work together under an orchestrator to optimize coding tasks for quality, speed, cost, and reliability.
The plugin integrates with OpenCode to provide:
| File | Purpose | Key Exports |
|---|---|---|
package.json |
Project manifest, dependencies, and build scripts | oh-my-opencode-slim CLI, dist/index.js main entry |
src/index.ts |
Main plugin entry point | OhMyOpenCodeLite plugin, agent configs, tools, MCPs |
src/cli/index.ts |
CLI installer entry point | install command, configuration management |
tsconfig.json |
TypeScript compiler configuration | Build settings, type checking, declaration generation |
dist/index.js - Main plugin bundle (ESM)dist/index.d.ts - TypeScript declarationsdist/cli/index.js - CLI bundledist/cli/index.d.ts - CLI TypeScript declarationsdist/ - Built JavaScript and declarationssrc/skills/ - Skill definitions (included in npm package)README.md - DocumentationLICENSE - MIT license| Directory | Responsibility Summary | Detailed Map |
|---|---|---|
src/ |
Main plugin entrypoint plus all feature modules that compose agents, tools, hooks, background managers, and utils. | View Map |
src/agents/ |
Defines specialist agents and the orchestrator, with factories and override/permission helpers. | View Map |
src/background/ |
Background task/session managers and tmux pane orchestration for off-thread agent runs. | View Map |
src/cli/ |
Installer CLI flow, config edits, provider setup, and skill installation helpers. | View Map |
src/config/ |
Plugin configuration schemas, defaults, loaders, and MCP/agent override helpers. | View Map |
src/hooks/ |
Lifecycle hooks for message transforms, error recovery, and rate-limit fallbacks. | View Map |
src/hooks/auto-update-checker/ |
Startup update check hook with cache invalidation and optional auto-install. | View Map |
src/hooks/phase-reminder/ |
Orchestrator message transform hook that injects phase reminders. | View Map |
src/hooks/post-file-tool-nudge/ |
Read/Write tool after-hook that queues ephemeral delegation nudges. | View Map |
src/hooks/delegate-task-retry/ |
Error detection and retry guidance with pattern matching and assistance. | View Map |
src/hooks/foreground-fallback/ |
Rate-limit fallback manager for interactive sessions. | View Map |
src/hooks/json-error-recovery/ |
JSON parse error detection and recovery helpers. | View Map |
src/mcp/ |
Built-in MCP registry and config types for remote connectors. | View Map |
src/tools/ |
Tool registry plus LSP, AST-grep, and background task implementations. | View Map |
src/tools/ast-grep/ |
AST-grep CLI discovery, execution, and tool definitions. | View Map |
src/tools/lsp/ |
LSP client stack and tool surface for definitions, diagnostics, and rename. | View Map |
src/utils/ |
Shared helpers for tmux, environment variables, internal initiation, and config. | View Map |
OpenCode loads plugin
↓
src/index.ts: OhMyOpenCodeLite(ctx)
↓
Load plugin config (src/config)
↓
Initialize agent configs (src/agents)
↓
Initialize background manager (src/background)
↓
Initialize MCPs (src/mcp)
↓
Initialize hooks (src/hooks)
↓
Register tools (src/tools)
↓
Return plugin object with:
- agent: Agent configurations
- tool: Tool implementations
- mcp: MCP configurations
- config: Config merger
- event: Event handlers
- hooks: Message transforms
Agent System (src/agents/)
Background Tasks (src/background/)
Configuration (src/config/)
Tools (src/tools/)
MCP Integration (src/mcp/)
Hooks (src/hooks/)
apply_patch stale-patch rescue with strict parsing, bounded LCS fallback, stateful same-path helper updates, and safe canonical rewrites only inside root/worktree# Build the project
bun run build
# Type checking
bun run typecheck
# Run tests
bun test
# Linting
bun run lint
# Format code
bun run format
# Run all checks (lint + format + organize imports)
bun run check
# CI mode checks (no auto-fix)
bun run check:ci
# Build and run with OpenCode
bun run dev
| Dependency | Purpose |
|---|---|
@opencode-ai/plugin |
OpenCode plugin SDK |
@opencode-ai/sdk |
OpenCode AI SDK |
@modelcontextprotocol/sdk |
MCP protocol implementation |
@ast-grep/cli |
AST-aware code search |
vscode-jsonrpc |
JSON-RPC protocol |
vscode-languageserver-protocol |
LSP protocol |
zod |
Runtime validation |
src/agents/src/config/constants.tssrc/config/agent-mcps.tssrc/cli/skills/src/tools/src/tools/index.tssrc/index.ts)src/mcp/createBuiltinMcps registrysrc/config/agent-mcps.tssrc/hooks/src/hooks/index.tssrc/index.ts)interface PluginConfig {
agents?: {
[agentName: string]: AgentOverrideConfig;
};
tmux?: TmuxConfig;
disabled_mcps?: McpName[];
background?: BackgroundTaskConfig;
presets?: Record<string, Partial<PluginConfig>>;
}
MIT License - See LICENSE for details.