- Add src/agents/AGENTS.md with agent module documentation - Update root AGENTS.md with latest generation timestamp (2025-12-28T17:15:00+09:00, commit f5b74d5) - Update src/features/AGENTS.md with builtin-commands and claude-code-plugin-loader documentation - Update src/hooks/AGENTS.md with thinking-block-validator hook documentation 🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
3.7 KiB
3.7 KiB
AGENTS KNOWLEDGE BASE
OVERVIEW
AI agent definitions for multi-model orchestration. 7 specialized agents: Sisyphus (orchestrator), oracle (strategy), librarian (research), explore (grep), frontend-ui-ux-engineer, document-writer, multimodal-looker.
STRUCTURE
agents/
├── sisyphus.ts # Primary orchestrator (Claude Opus 4.5)
├── oracle.ts # Strategic advisor (GPT-5.2)
├── librarian.ts # Multi-repo research (Claude Sonnet 4.5)
├── explore.ts # Fast codebase grep (Grok Code)
├── frontend-ui-ux-engineer.ts # UI generation (Gemini 3 Pro)
├── document-writer.ts # Technical docs (Gemini 3 Flash)
├── multimodal-looker.ts # PDF/image analysis (Gemini 3 Flash)
├── build-prompt.ts # Shared build agent prompt
├── plan-prompt.ts # Shared plan agent prompt
├── types.ts # AgentModelConfig interface
├── utils.ts # createBuiltinAgents(), getAgentName()
└── index.ts # builtinAgents export
AGENT MODELS
| Agent | Default Model | Fallback | Purpose |
|---|---|---|---|
| Sisyphus | anthropic/claude-opus-4-5 | - | Primary orchestrator with extended thinking |
| oracle | openai/gpt-5.2 | - | Architecture, debugging, code review |
| librarian | anthropic/claude-sonnet-4-5 | google/gemini-3-flash | Docs, OSS research, GitHub examples |
| explore | opencode/grok-code | google/gemini-3-flash, anthropic/claude-haiku-4-5 | Fast contextual grep |
| frontend-ui-ux-engineer | google/gemini-3-pro-preview | - | UI/UX code generation |
| document-writer | google/gemini-3-pro-preview | - | Technical writing |
| multimodal-looker | google/gemini-3-flash | - | PDF/image analysis |
HOW TO ADD AN AGENT
- Create
src/agents/my-agent.ts:import type { AgentConfig } from "@opencode-ai/sdk" export const myAgent: AgentConfig = { model: "provider/model-name", temperature: 0.1, system: "Agent system prompt...", tools: { include: ["tool1", "tool2"] }, // or exclude: [...] } - Add to
builtinAgentsinsrc/agents/index.ts - Update
types.tsif adding new config options
AGENT CONFIG OPTIONS
| Option | Type | Description |
|---|---|---|
| model | string | Model identifier (provider/model-name) |
| temperature | number | 0.0-1.0, most use 0.1 for consistency |
| system | string | System prompt (can be multiline template literal) |
| tools | object | { include: [...] } or { exclude: [...] } |
| top_p | number | Optional nucleus sampling |
| maxTokens | number | Optional max output tokens |
MODEL FALLBACK LOGIC
createBuiltinAgents() in utils.ts handles model fallback:
- Check user config override (
agents.{name}.model) - Check installer settings (claude max20, gemini antigravity)
- Use default model
Fallback order for explore:
- If gemini antigravity enabled →
google/gemini-3-flash - If claude max20 enabled →
anthropic/claude-haiku-4-5 - Default →
opencode/grok-code(free)
ANTI-PATTERNS (AGENTS)
- High temperature: Don't use >0.3 for code-related agents
- Broad tool access: Prefer explicit
includeover unrestricted access - Monolithic prompts: Keep prompts focused; delegate to specialized agents
- Missing fallbacks: Consider free/cheap fallbacks for rate-limited models
SHARED PROMPTS
- build-prompt.ts: Base prompt for build agents (OpenCode default + Sisyphus variants)
- plan-prompt.ts: Base prompt for plan agents (Planner-Sisyphus)
Used by src/index.ts when creating Builder-Sisyphus and Planner-Sisyphus variants.