src/agents/ defines built-in specialists plus custom agents and converts
configuration into OpenCode SDK registration data.
Responsibilities:
createAgents)getDisabledAgents():
config.disabled_agentsorchestrator, councillor never disabled)SUBAGENT_FACTORIES (SUBAGENT_NAMES).config.agents keys that are not built-ins
or aliases./^[a-z][a-z0-9_-]*$/i) and model presence:
skip with warning if model missing.<agent>.md replacement prompt<agent>_append.md append promptconfig.modelagent._modelArray and clear config.modeltemperature, variant, options, displayName.applyDefaultPermissions).fixer may inherit librarian model when not explicitly configured.council may inherit deprecated council.master.model when no explicit
council override and default remains unresolved.@displayName references into:
orchestrator prompt and all custom orchestratorPrompt snippets.[orchestrator, ...subagents]._modelArray is used as the ordered runtime failover chain when supplied.orchestrator may start unresolved (model undefined) to allow downstream
runtime resolution.subagent overrides preserve per-model variants inside _modelArray while
optionally keeping top-level variant as default fallback.getAgentConfigs(config) converts definitions to SDK configs and sets:
orchestrator → mode: primarymode: subagentcouncil → mode: allcouncillor → mode: subagent, hidden: truedisplayName is set:
Permission defaults:
question defaults to allow unless existing explicit deny.council_session defaults to allow only for council.skill permissions come from getSkillPermissionsForAgent and are
merged with existing permission maps.getAgentMcpList(name, config) from src/config/agent-mcps.tsagent-mcps defaults in src/config/agent-mcps.tsAGENT_ALIASES, SUBAGENT_NAMES, PROTECTED_AGENTSgetAgentOverride, getCustomAgentNames from src/config/utils.tscli/skills.tssrc/index.ts
└─> loadPluginConfig()
└─> createAgents(config) / getAgentConfigs(config)
└─> registration + runtime chat hooks
loadPluginConfig()
└─> prompt overrides + presets
└─> createAgents/create custom/orchestrator prompts
isSubagent(name) — type guard for subagent names.getDisabledAgents(config) and getEnabledAgentNames(config).resolvePrompt() in orchestrator.ts centralizes replacement vs append behavior.index.ts (agent registry, overrides, classification, custom agents)orchestrator.ts (base prompts, prompt resolution, model-array type)council.ts, councillor.ts (council tool orchestration + formatting)explorer.ts, librarian.ts, oracle.ts, designer.ts, fixer.ts,
observer.ts (specialist factory prompts/config)