Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 32 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,15 @@ The plugin works perfectly with defaults. Aside from the recommended `google_aut

### Agents: Your Teammates

- **omo** (`anthropic/claude-sonnet-4-5`): The orchestration-focused primary agent. Actively delegates to specialized agents (explore, librarian, oracle, etc.) for complex tasks. Uses Sonnet 4.5 for its balanced speed and intelligence. **Enabled by default as your main agent.**
- **oracle** (`openai/gpt-5.2`): Architecture, code review, strategy. Uses GPT-5.2 for its stellar logical reasoning and deep analysis. Inspired by AmpCode.
- **librarian** (`anthropic/claude-sonnet-4-5`): Multi-repo analysis, doc lookup, implementation examples. Claude Sonnet 4 is fast, smart, great at tool calls, and excellent for documentation research. Inspired by AmpCode.
- **explore** (`opencode/grok-code`): Fast codebase exploration and pattern matching. Claude Code uses Haiku; we use Grok—it's free, blazing fast, and plenty smart for file traversal. Inspired by Claude Code.
- **frontend-ui-ux-engineer** (`google/gemini-3-pro-preview`): A designer turned developer. Builds gorgeous UIs. Gemini excels at creative, beautiful UI code.
- **document-writer** (`google/gemini-3-pro-preview`): Technical writing expert. Gemini is a wordsmith—writes prose that flows.
- **multimodal-looker** (`google/gemini-2.5-flash`): Visual content specialist. Analyzes PDFs, images, diagrams to extract information.

The main agent invokes these automatically, but you can call them explicitly:
The OmO agent automatically delegates to these specialists, but you can also call them explicitly:

```
Ask @oracle to review this design and propose an architecture
Expand Down Expand Up @@ -456,6 +457,35 @@ Enable built-in Antigravity OAuth for Google Gemini models:

When enabled, `opencode auth login` shows "OAuth with Google (Antigravity)" for the Google provider.

### OmO Agent

The OmO (Oh My OpenCode) agent is an orchestration-focused primary agent that actively delegates to specialized agents. It's enabled by default and set as your main agent.

Configure OmO agent behavior:

```json
{
"omo_agent": {
"enabled": true,
"default": true
}
}
```

| Option | Description | Default |
|--------|-------------|---------|
| `enabled` | Enable/disable the OmO agent entirely | `true` |
| `default` | Set OmO as the primary agent (Tab key shows OmO first). When `false`, OmO becomes a subagent. | `true` |

To use the default build agent instead of OmO:
```json
{
"omo_agent": {
"default": false
}
}
```

### Agents

Override built-in agent settings:
Expand Down Expand Up @@ -484,7 +514,7 @@ Or disable via `disabled_agents` in `~/.config/opencode/oh-my-opencode.json` or
}
```

Available agents: `oracle`, `librarian`, `explore`, `frontend-ui-ux-engineer`, `document-writer`
Available agents: `omo`, `oracle`, `librarian`, `explore`, `frontend-ui-ux-engineer`, `document-writer`, `multimodal-looker`

### MCPs

Expand Down
22 changes: 20 additions & 2 deletions assets/oh-my-opencode.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"explore",
"frontend-ui-ux-engineer",
"document-writer",
"multimodal-looker"
"multimodal-looker",
"omo"
]
}
},
Expand Down Expand Up @@ -65,7 +66,8 @@
"explore",
"frontend-ui-ux-engineer",
"document-writer",
"multimodal-looker"
"multimodal-looker",
"omo"
]
},
"additionalProperties": {
Expand Down Expand Up @@ -246,6 +248,22 @@
"description": "Execute hooks from ~/.claude/settings.json, ./.claude/settings.json, ./.claude/settings.local.json"
}
}
},
"omo_agent": {
"type": "object",
"description": "Configure the OmO (Oh My OpenCode) orchestration agent. OmO actively delegates to specialized agents for complex tasks.",
"properties": {
"enabled": {
"type": "boolean",
"description": "Enable the OmO agent. When true, OmO agent is available for use.",
"default": true
},
"default": {
"type": "boolean",
"description": "Set OmO as the default primary agent, replacing the build agent. When true, Tab key shows OmO agent first.",
"default": true
}
}
}
}
}
2 changes: 2 additions & 0 deletions src/agents/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { exploreAgent } from "./explore"
import { frontendUiUxEngineerAgent } from "./frontend-ui-ux-engineer"
import { documentWriterAgent } from "./document-writer"
import { multimodalLookerAgent } from "./multimodal-looker"
import { omoAgent } from "./omo"

export const builtinAgents: Record<string, AgentConfig> = {
oracle: oracleAgent,
Expand All @@ -13,6 +14,7 @@ export const builtinAgents: Record<string, AgentConfig> = {
"frontend-ui-ux-engineer": frontendUiUxEngineerAgent,
"document-writer": documentWriterAgent,
"multimodal-looker": multimodalLookerAgent,
omo: omoAgent,
}

export * from "./types"
Expand Down
140 changes: 140 additions & 0 deletions src/agents/omo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
import type { AgentConfig } from "@opencode-ai/sdk"

export const omoAgent: AgentConfig = {
description:
"OhMyOpenCode's Orchestration-focused agent that actively delegates to specialized agents. Rather than doing everything yourself, delegate to the appropriate agent.",
mode: "primary",
model: "anthropic/claude-sonnet-4-5",
color: "#00D9B4",
tools: {
task: true,
call_omo_agent: true,
background_task: true,
background_output: true,
background_cancel: true,
todowrite: true,
todoread: true,
read: true,
write: true,
edit: true,
bash: true,
glob: true,
grep: true,
list: true,
webfetch: true,
look_at: true,
lsp_hover: true,
lsp_goto_definition: true,
lsp_find_references: true,
lsp_document_symbols: true,
lsp_workspace_symbols: true,
lsp_diagnostics: true,
lsp_servers: true,
lsp_prepare_rename: true,
lsp_rename: true,
lsp_code_actions: true,
lsp_code_action_resolve: true,
ast_grep_search: true,
ast_grep_replace: true,
slashcommand: true,
skill: true,
},
prompt: `You are the OmO (Oh My OpenCode) Agent - an orchestration-focused AI that excels at delegating work to specialized agents.

## CORE IDENTITY

You are NOT a solo worker. You are a **team lead** who coordinates specialized agents to achieve complex goals efficiently.

Your superpower is knowing WHEN and HOW to delegate. You have access to powerful specialized agents:
- **explore**: Fast codebase exploration, file patterns, code search
- **librarian**: Documentation lookup, API references, implementation examples
- **oracle**: Architecture decisions, code review, strategic planning
- **frontend-ui-ux-engineer**: UI/UX design and implementation
- **document-writer**: Technical documentation writing
- **multimodal-looker**: Visual content analysis (PDFs, images, diagrams)
- **plan**: Work breakdown and task planning

## DELEGATION PRINCIPLES

### ALWAYS Delegate When:
1. **Exploring codebase** → Spawn \`explore\` agent in background
2. **Looking up docs/examples** → Spawn \`librarian\` agent in background
3. **Need architecture advice** → Call \`oracle\` agent
4. **Building UI components** → Delegate to \`frontend-ui-ux-engineer\`
5. **Writing documentation** → Delegate to \`document-writer\`
6. **Analyzing images/PDFs** → Use \`look_at\` tool or \`multimodal-looker\` agent
7. **Planning complex work** → Spawn \`plan\` agent first

### Parallel Execution (CRITICAL)
- **NEVER wait sequentially** when tasks are independent
- Launch 3+ background agents simultaneously via \`background_task\`
- While agents work, continue with tasks you CAN do yourself
- Collect results when needed using \`background_output\`

### When to Work Yourself
- Simple file edits that don't require exploration
- Responding to user questions with known information
- Running bash commands and interpreting results
- Tasks where delegation overhead exceeds benefit

## EXECUTION WORKFLOW

### For Every Non-Trivial Task:
1. **Analyze** - Identify what specialized capabilities are needed
2. **Delegate** - Spawn appropriate agents via \`background_task\` (3+ in parallel)
3. **Work** - Do your part while agents work
4. **Collect** - Gather results from background agents
5. **Synthesize** - Combine results into cohesive solution
6. **Verify** - Re-read original request, ensure ALL requirements met

### TODO Management (MANDATORY)
- **CREATE todos** before starting any multi-step task
- **UPDATE status** immediately when starting each task (in_progress)
- **MARK complete** immediately when finished (never batch)
- **ONLY ONE** task should be in_progress at a time

## COMMUNICATION STYLE

- Be concise but informative
- Tell the user WHICH agents you're delegating to and WHY
- Provide progress updates during long operations
- Use markdown formatting for clarity
- No emojis unless user explicitly requests

## QUALITY STANDARDS

- **Never rush** - Take time to delegate properly
- **Never skip verification** - Always re-read requirements before reporting done
- **Never work alone** when delegation would help
- **Never leave TODOs incomplete** - Finish all tasks before stopping

## EXAMPLE DELEGATION PATTERNS

### Complex Feature Implementation:
\`\`\`
1. Spawn explore agent → understand current codebase patterns (background)
2. Spawn librarian agent → find relevant API docs (background)
3. Spawn plan agent → create work breakdown
4. Collect exploration results
5. Implement following gathered context
6. Spawn oracle agent → review implementation
\`\`\`

### Debugging Session:
\`\`\`
1. Spawn explore agent → find related code (background)
2. Read error logs yourself
3. Collect exploration results
4. Analyze with context
5. If stuck → spawn oracle for advice
\`\`\`

### Documentation Task:
\`\`\`
1. Spawn explore agent → find all relevant files
2. Delegate to document-writer → create documentation
3. Review and refine
\`\`\`

Remember: Your value is in ORCHESTRATION, not in doing everything yourself.`,
}
1 change: 1 addition & 0 deletions src/agents/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type AgentName =
| "frontend-ui-ux-engineer"
| "document-writer"
| "multimodal-looker"
| "omo"

export type AgentOverrideConfig = Partial<AgentConfig>

Expand Down
2 changes: 2 additions & 0 deletions src/agents/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { exploreAgent } from "./explore"
import { frontendUiUxEngineerAgent } from "./frontend-ui-ux-engineer"
import { documentWriterAgent } from "./document-writer"
import { multimodalLookerAgent } from "./multimodal-looker"
import { omoAgent } from "./omo"
import { deepMerge } from "../shared"

const allBuiltinAgents: Record<AgentName, AgentConfig> = {
Expand All @@ -15,6 +16,7 @@ const allBuiltinAgents: Record<AgentName, AgentConfig> = {
"frontend-ui-ux-engineer": frontendUiUxEngineerAgent,
"document-writer": documentWriterAgent,
"multimodal-looker": multimodalLookerAgent,
omo: omoAgent,
}

function mergeAgentConfig(
Expand Down
2 changes: 2 additions & 0 deletions src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export {
McpNameSchema,
AgentNameSchema,
HookNameSchema,
OmoAgentConfigSchema,
} from "./schema"

export type {
Expand All @@ -14,4 +15,5 @@ export type {
McpName,
AgentName,
HookName,
OmoAgentConfig,
} from "./schema"
9 changes: 9 additions & 0 deletions src/config/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const AgentNameSchema = z.enum([
"frontend-ui-ux-engineer",
"document-writer",
"multimodal-looker",
"omo",
])

export const HookNameSchema = z.enum([
Expand Down Expand Up @@ -67,6 +68,7 @@ export const AgentOverridesSchema = z
"frontend-ui-ux-engineer": AgentOverrideConfigSchema.optional(),
"document-writer": AgentOverrideConfigSchema.optional(),
"multimodal-looker": AgentOverrideConfigSchema.optional(),
omo: AgentOverrideConfigSchema.optional(),
})
.partial()

Expand All @@ -78,6 +80,11 @@ export const ClaudeCodeConfigSchema = z.object({
hooks: z.boolean().optional(),
})

export const OmoAgentConfigSchema = z.object({
enabled: z.boolean().optional(),
default: z.boolean().optional(),
})

export const OhMyOpenCodeConfigSchema = z.object({
$schema: z.string().optional(),
disabled_mcps: z.array(McpNameSchema).optional(),
Expand All @@ -86,12 +93,14 @@ export const OhMyOpenCodeConfigSchema = z.object({
agents: AgentOverridesSchema.optional(),
claude_code: ClaudeCodeConfigSchema.optional(),
google_auth: z.boolean().optional(),
omo_agent: OmoAgentConfigSchema.optional(),
})

export type OhMyOpenCodeConfig = z.infer<typeof OhMyOpenCodeConfigSchema>
export type AgentOverrideConfig = z.infer<typeof AgentOverrideConfigSchema>
export type AgentOverrides = z.infer<typeof AgentOverridesSchema>
export type AgentName = z.infer<typeof AgentNameSchema>
export type HookName = z.infer<typeof HookNameSchema>
export type OmoAgentConfig = z.infer<typeof OmoAgentConfigSchema>

export { McpNameSchema, type McpName } from "../mcp/types"
36 changes: 34 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,24 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
},

config: async (config) => {
const omoAgentConfig = pluginConfig.omo_agent ?? { enabled: true, default: true };
const disabledAgents = [...(pluginConfig.disabled_agents ?? [])];
const agentOverrides = { ...pluginConfig.agents };

const omoDisabled = omoAgentConfig.enabled === false;
const omoNotDefault = omoAgentConfig.enabled !== false && omoAgentConfig.default === false;

if (omoDisabled && !disabledAgents.includes("omo")) {
disabledAgents.push("omo");
}

if (omoNotDefault) {
agentOverrides.omo = { ...agentOverrides.omo, mode: "subagent" };
}

const builtinAgents = createBuiltinAgents(
pluginConfig.disabled_agents,
pluginConfig.agents,
disabledAgents,
agentOverrides,
);

const userAgents = (pluginConfig.claude_code?.agents ?? true) ? loadUserAgents() : {};
Expand All @@ -254,6 +269,22 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
...projectAgents,
...config.agent,
};

const omoEnabled = !omoDisabled;
const omoIsDefault = !omoNotDefault;
const omoModelNotOverridden = !agentOverrides.omo?.model;
const buildModelNotSet = !config.agent?.build?.model;
const shouldEnhanceBuildAgent = omoEnabled && omoIsDefault && omoModelNotOverridden && buildModelNotSet;

if (shouldEnhanceBuildAgent) {
config.agent.build = {
...config.agent.build,
model: "anthropic/claude-opus-4-5-high",
thinking: { type: "enabled", budgetTokens: 64000 },
maxTokens: 128000,
};
}

config.tools = {
...config.tools,
};
Expand Down Expand Up @@ -461,4 +492,5 @@ export type {
AgentOverrides,
McpName,
HookName,
OmoAgentConfig,
} from "./config";