Skip to content
Agent Orchestration
Agent

codemap

Defines agent personalities (Orchestrator, Explorer, etc.) and manages their configuration lifecycle. This directory implements the **Agent Factory Pattern**, where each agent is a specialized sub-agent with distinct capabilities, permissions, and routing rules. The Orchestrator

From plugin
oh-my-opencode-slim
10k1 skill1 agent

Claude Code

$ npx -y skills add alvinunreal/oh-my-opencode-slim --agent claude-code

Agent definition

codemap.md

src/agents/

Responsibility

Defines agent personalities (Orchestrator, Explorer, etc.) and manages their configuration lifecycle. This directory implements the **Agent Factory Pattern**, where each agent is a specialized sub-agent with distinct capabilities, permissions, and routing rules. The Orchestrator agent (src/agents/index.ts) coordinates task delegation to these specialists. Note: Council and Councillor agents are included for multi-model consensus, with Councillors created dynamically per preset.

Design

Agent Types and Factories

Each agent is a **prompt-driven specialist** with a factory function that creates an `AgentDefinition`:

| Agent | Factory | Role | Permissions | Model Default | |-------|---------|------|-------------|---------------| | **orchestrator** | `createOrchestratorAgent()` | Workflow manager that delegates tasks to specialists | Primary agent with available guarded controls | Resolved from config or runtime preset | | **explorer** | `createExplorerAgent()` | Fast codebase search, pattern matching, and external docs/library/web research | Read-only defaults; tool descriptions own mechanics | DEFAULT_MODELS.explorer | | **oracle** | `createOracleAgent()` | Strategic technical advisor and code reviewer | Read-only defaults | DEFAULT_MODELS.oracle | | **designer** | `createDesignerAgent()` | UI/UX design, review, and implementation | Read/write defaults | DEFAULT_MODELS.designer | | **fixer** | `createFixerAgent()` | Fast implementation specialist for bounded tasks | Read/write defaults | DEFAULT_MODELS.fixer | | **observer** | `createObserverAgent()` | Visual analysis specialist (images, PDFs, diagrams) | Strict read-only defaults (no edit/write/shell/execute); requires a vision-capable model | DEFAULT_MODELS.observer | | **council** | `createCouncilAgent()` | Multi-model consensus synthesis (read-only, no tools) | Read-only (council permission) | DEFAULT_MODELS.council | | **councillor** | Created dynamically by `buildCouncillorAgents()` | Read-only council advisor; registered per preset seat as `councillor-<name>` | Read-only defaults | Inherited from council preset |

Configuration System

  • **Default prompts**: Role/workflow guidance without duplicating tool catalogs or call syntax; tool descriptions own usage
  • **User overrides**: From `~/.config/opencode/oh-my-opencode-slim.json` via `loadAgentPrompt()`
  • **Agent colors**: Optional per-agent hex or theme-color overrides; no defaults (colorless agents get the host TUI's distinct palette colors)
  • **Permission wildcards**: Applied via `applyDefaultPermissions()` in `index.ts`
  • **Model resolution**: Supports string models, explicit `inheritModelFrom` policies, and priority-ordered arrays (`_modelArray`) for runtime fallback
  • **Skill permissions**: Per-agent MCP and tool access controlled via `getSkillPermissionsForAgent()`
  • **Council synthesis**: Uses `createSynthesisOnlyPermission()` to block tool calls while allowing synthesis from councillor responses

Pass-local Resolution

SDK and registry projections derive merged agent overrides/model arrays once per pass. MCP consumers receive that same override view. Marketplace activation and agent construction arrive through `marketplace.implementation`, loaded by the asynchronous composition root only after its existing enabled gate; the registry remains synchronous. Permission policies and host precedence do not change. Shared capabilities/ID schemas do not load the full manifest graph.

Agent Lifecycle

1. **Agent creation**: `createAgents(config)` instantiates all agents with merged configuration 2. **Dynamic councillors**: `buildCouncillorAgents()` (`council-agents.ts`) creates one `councillor-<name>` subagent per council preset seat, attaching `_modelArray` fallback chains for multi-model councillors 3. **Permission application**: `applyDefaultPermissions()` emits generated `allow` grants only for tools this generation registers, while preserving generated denies (the v2 base allows unmatched names). `question`, task tools, and interview submission stay primary-scoped by default — a parked child question has no headless answerer (explicit per-agent config wins). `task_report` is available to subagents by default except for agents whose factory map already denies `'*'` (Observer and councillors); its runtime still requires a host-confirmed parent session. Marketplace/ACP/AST grants follow their registration gates, and `disabled_tools: ["acp_run"]` also removes the wrappers that could call it. It then adds skill grants on top of each agent's map, preserving key order 4. **Task-rejection instruction**: `appendTaskRejectionInstruction()` appends the "outside your role" instruction to specialist prompts (`task-rejection.ts`) 5. **Display name injection**: Orchestrator prompt rewrites `@agent` mentions to user-configured display names 6. **Configuration export**: `getAgentConfigs()` converts `AgentDefinition` to OpenCode SDK format with classification metadata

Flow

Agent Instantiation Sequence (src/agents/index.ts)

// 1. Gather sub-agent definitions with custom prompts
const protoSubAgents = Object.entries(SUBAGENT_FACTORIES)
  .filter(([name]) => !disabled.has(name))
  .map(([name, factory]) => {
    const customPrompts = loadAgentPrompt(name, config?.preset);
    return factory(getModelForAgent(name), customPrompts.prompt, customPrompts.appendPrompt);
  });

// 2. Apply overrides and default permissions
const builtInSubAgents = protoSubAgents.map((agent) => {
  const override = getOverrideFromAgents(config, agent.name);
  if (override) applyOverrides(agent, override);
  applyDefaultPermissions(agent, registeredTools, override?.skills, runtime, hostFlavor);
  return agent;
});

// 3. Create Orchestrator (with its own overrides and custom prompts)
const orchestrator = createOrchestratorAgent(
  orchestratorModel,
  orchestratorPrompts.prompt,
  orchestratorPrompts.appendPrompt,
);
applyDefaultPermissions(orchest
Read more
@alvinunreal
Ships withoh-my-opencode-slim

Lean, fine tuned Opencode multi agent suite · Mix any models · Auto delegate tasks

10k11 skills1 agent
Get the whole plugin

Stars on GitHub

Momentum

stars in total
10.3k
Star history of alvinunreal/oh-my-opencode-slim on GitHub, a chart by star-history.com

More agents from other plugins.

codemod-runner

codemod-runner

Agent

Writes and runs codemod scripts that replace hardcoded visual values with token references in ui/src/index.css. Use for Phase 2…

paperclip6d114k
@paperclipai@paperclipaiInstall Agent

Questions about codemap.

Which coding agents can use codemap?
codemap installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.