diff --git a/README.md b/README.md index 503726e..c896b37 100644 --- a/README.md +++ b/README.md @@ -229,6 +229,7 @@ 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. @@ -236,7 +237,7 @@ The plugin works perfectly with defaults. Aside from the recommended `google_aut - **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 @@ -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: @@ -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 diff --git a/assets/oh-my-opencode.schema.json b/assets/oh-my-opencode.schema.json index 2a8eba9..01e9189 100644 --- a/assets/oh-my-opencode.schema.json +++ b/assets/oh-my-opencode.schema.json @@ -28,7 +28,8 @@ "explore", "frontend-ui-ux-engineer", "document-writer", - "multimodal-looker" + "multimodal-looker", + "omo" ] } }, @@ -65,7 +66,8 @@ "explore", "frontend-ui-ux-engineer", "document-writer", - "multimodal-looker" + "multimodal-looker", + "omo" ] }, "additionalProperties": { @@ -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 + } + } } } } \ No newline at end of file diff --git a/src/agents/index.ts b/src/agents/index.ts index 8f2c3ed..2fb484e 100644 --- a/src/agents/index.ts +++ b/src/agents/index.ts @@ -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 = { oracle: oracleAgent, @@ -13,6 +14,7 @@ export const builtinAgents: Record = { "frontend-ui-ux-engineer": frontendUiUxEngineerAgent, "document-writer": documentWriterAgent, "multimodal-looker": multimodalLookerAgent, + omo: omoAgent, } export * from "./types" diff --git a/src/agents/omo.ts b/src/agents/omo.ts new file mode 100644 index 0000000..7dcd78b --- /dev/null +++ b/src/agents/omo.ts @@ -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.`, +} diff --git a/src/agents/types.ts b/src/agents/types.ts index e24d04d..f4f22e8 100644 --- a/src/agents/types.ts +++ b/src/agents/types.ts @@ -7,6 +7,7 @@ export type AgentName = | "frontend-ui-ux-engineer" | "document-writer" | "multimodal-looker" + | "omo" export type AgentOverrideConfig = Partial diff --git a/src/agents/utils.ts b/src/agents/utils.ts index 64eca40..85345dc 100644 --- a/src/agents/utils.ts +++ b/src/agents/utils.ts @@ -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 = { @@ -15,6 +16,7 @@ const allBuiltinAgents: Record = { "frontend-ui-ux-engineer": frontendUiUxEngineerAgent, "document-writer": documentWriterAgent, "multimodal-looker": multimodalLookerAgent, + omo: omoAgent, } function mergeAgentConfig( diff --git a/src/config/index.ts b/src/config/index.ts index 7fcd69e..158fd8f 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -5,6 +5,7 @@ export { McpNameSchema, AgentNameSchema, HookNameSchema, + OmoAgentConfigSchema, } from "./schema" export type { @@ -14,4 +15,5 @@ export type { McpName, AgentName, HookName, + OmoAgentConfig, } from "./schema" diff --git a/src/config/schema.ts b/src/config/schema.ts index d823181..4fd37dc 100644 --- a/src/config/schema.ts +++ b/src/config/schema.ts @@ -23,6 +23,7 @@ export const AgentNameSchema = z.enum([ "frontend-ui-ux-engineer", "document-writer", "multimodal-looker", + "omo", ]) export const HookNameSchema = z.enum([ @@ -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() @@ -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(), @@ -86,6 +93,7 @@ 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 @@ -93,5 +101,6 @@ export type AgentOverrideConfig = z.infer export type AgentOverrides = z.infer export type AgentName = z.infer export type HookName = z.infer +export type OmoAgentConfig = z.infer export { McpNameSchema, type McpName } from "../mcp/types" diff --git a/src/index.ts b/src/index.ts index 502e69e..abbccee 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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() : {}; @@ -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, }; @@ -461,4 +492,5 @@ export type { AgentOverrides, McpName, HookName, + OmoAgentConfig, } from "./config";