feat(agents): register new agents in index and types
- Export Metis, Momus, orchestrator-sisyphus in builtinAgents - Add new agent names to BuiltinAgentName type - Update AGENTS.md documentation with new agents 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
parent
059aa87695
commit
c1fa8d5212
@ -2,20 +2,19 @@
|
|||||||
|
|
||||||
## OVERVIEW
|
## OVERVIEW
|
||||||
|
|
||||||
7 AI agents for multi-model orchestration. Sisyphus orchestrates, specialists handle domains.
|
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
|
## STRUCTURE
|
||||||
|
|
||||||
```
|
```
|
||||||
agents/
|
agents/
|
||||||
├── sisyphus.ts # Primary orchestrator (504 lines)
|
├── sisyphus.ts # Primary orchestrator (Claude Opus 4.5)
|
||||||
├── oracle.ts # Strategic advisor
|
├── oracle.ts # Strategic advisor (GPT-5.2)
|
||||||
├── librarian.ts # Multi-repo research
|
├── librarian.ts # Multi-repo research (Claude Sonnet 4.5)
|
||||||
├── explore.ts # Fast codebase grep
|
├── explore.ts # Fast codebase grep (Grok Code)
|
||||||
├── frontend-ui-ux-engineer.ts # UI generation
|
├── frontend-ui-ux-engineer.ts # UI generation (Gemini 3 Pro)
|
||||||
├── document-writer.ts # Technical docs
|
├── document-writer.ts # Technical docs (Gemini 3 Flash)
|
||||||
├── multimodal-looker.ts # PDF/image analysis
|
├── multimodal-looker.ts # PDF/image analysis (Gemini 3 Flash)
|
||||||
├── sisyphus-prompt-builder.ts # Sisyphus prompt construction
|
|
||||||
├── build-prompt.ts # Shared build agent prompt
|
├── build-prompt.ts # Shared build agent prompt
|
||||||
├── plan-prompt.ts # Shared plan agent prompt
|
├── plan-prompt.ts # Shared plan agent prompt
|
||||||
├── types.ts # AgentModelConfig interface
|
├── types.ts # AgentModelConfig interface
|
||||||
@ -25,40 +24,68 @@ agents/
|
|||||||
|
|
||||||
## AGENT MODELS
|
## AGENT MODELS
|
||||||
|
|
||||||
| Agent | Model | Fallback | Purpose |
|
| Agent | Default Model | Fallback | Purpose |
|
||||||
|-------|-------|----------|---------|
|
|-------|---------------|----------|---------|
|
||||||
| Sisyphus | anthropic/claude-opus-4-5 | - | Orchestrator with extended thinking |
|
| Sisyphus | anthropic/claude-opus-4-5 | - | Primary orchestrator with extended thinking |
|
||||||
| oracle | openai/gpt-5.2 | - | Architecture, debugging, review |
|
| oracle | openai/gpt-5.2 | - | Architecture, debugging, code review |
|
||||||
| librarian | anthropic/claude-sonnet-4-5 | google/gemini-3-flash | Docs, GitHub research |
|
| librarian | anthropic/claude-sonnet-4-5 | google/gemini-3-flash | Docs, OSS research, GitHub examples |
|
||||||
| explore | opencode/grok-code | gemini-3-flash, haiku-4-5 | Contextual grep |
|
| 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 | - | Beautiful UI code |
|
| frontend-ui-ux-engineer | google/gemini-3-pro-preview | - | UI/UX code generation |
|
||||||
| document-writer | google/gemini-3-pro-preview | - | Technical writing |
|
| document-writer | google/gemini-3-pro-preview | - | Technical writing |
|
||||||
| multimodal-looker | google/gemini-3-flash | - | Visual analysis |
|
| multimodal-looker | google/gemini-3-flash | - | PDF/image analysis |
|
||||||
|
|
||||||
## HOW TO ADD
|
## HOW TO ADD AN AGENT
|
||||||
|
|
||||||
1. Create `src/agents/my-agent.ts`:
|
1. Create `src/agents/my-agent.ts`:
|
||||||
```typescript
|
```typescript
|
||||||
|
import type { AgentConfig } from "@opencode-ai/sdk"
|
||||||
|
|
||||||
export const myAgent: AgentConfig = {
|
export const myAgent: AgentConfig = {
|
||||||
model: "provider/model-name",
|
model: "provider/model-name",
|
||||||
temperature: 0.1,
|
temperature: 0.1,
|
||||||
system: "...",
|
system: "Agent system prompt...",
|
||||||
tools: { include: ["tool1"] },
|
tools: { include: ["tool1", "tool2"] }, // or exclude: [...]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
2. Add to `builtinAgents` in index.ts
|
2. Add to `builtinAgents` in `src/agents/index.ts`
|
||||||
3. Update types.ts if new config options
|
3. Update `types.ts` if adding new config options
|
||||||
|
|
||||||
## MODEL FALLBACK
|
## AGENT CONFIG OPTIONS
|
||||||
|
|
||||||
`createBuiltinAgents()` handles fallback:
|
| Option | Type | Description |
|
||||||
1. User config override
|
|--------|------|-------------|
|
||||||
2. Installer settings (claude max20, gemini antigravity)
|
| model | string | Model identifier (provider/model-name) |
|
||||||
3. Default model
|
| 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 |
|
||||||
|
|
||||||
## ANTI-PATTERNS
|
## MODEL FALLBACK LOGIC
|
||||||
|
|
||||||
- High temperature (>0.3) for code agents
|
`createBuiltinAgents()` in utils.ts handles model fallback:
|
||||||
- Broad tool access (prefer explicit `include`)
|
|
||||||
- Monolithic prompts (delegate to specialists)
|
1. Check user config override (`agents.{name}.model`)
|
||||||
- Missing fallbacks for rate-limited models
|
2. Check installer settings (claude max20, gemini antigravity)
|
||||||
|
3. 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 `include` over 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 (legacy)
|
||||||
|
- **prometheus-prompt.ts**: System prompt for Prometheus (Planner) agent
|
||||||
|
- **metis.ts**: Metis (Plan Consultant) agent for pre-planning analysis
|
||||||
|
|
||||||
|
Used by `src/index.ts` when creating Builder-Sisyphus and Prometheus (Planner) variants.
|
||||||
|
|||||||
@ -6,6 +6,9 @@ import { exploreAgent } from "./explore"
|
|||||||
import { frontendUiUxEngineerAgent } from "./frontend-ui-ux-engineer"
|
import { frontendUiUxEngineerAgent } from "./frontend-ui-ux-engineer"
|
||||||
import { documentWriterAgent } from "./document-writer"
|
import { documentWriterAgent } from "./document-writer"
|
||||||
import { multimodalLookerAgent } from "./multimodal-looker"
|
import { multimodalLookerAgent } from "./multimodal-looker"
|
||||||
|
import { metisAgent } from "./metis"
|
||||||
|
import { orchestratorSisyphusAgent } from "./orchestrator-sisyphus"
|
||||||
|
import { momusAgent } from "./momus"
|
||||||
|
|
||||||
export const builtinAgents: Record<string, AgentConfig> = {
|
export const builtinAgents: Record<string, AgentConfig> = {
|
||||||
Sisyphus: sisyphusAgent,
|
Sisyphus: sisyphusAgent,
|
||||||
@ -15,6 +18,9 @@ export const builtinAgents: Record<string, AgentConfig> = {
|
|||||||
"frontend-ui-ux-engineer": frontendUiUxEngineerAgent,
|
"frontend-ui-ux-engineer": frontendUiUxEngineerAgent,
|
||||||
"document-writer": documentWriterAgent,
|
"document-writer": documentWriterAgent,
|
||||||
"multimodal-looker": multimodalLookerAgent,
|
"multimodal-looker": multimodalLookerAgent,
|
||||||
|
"Metis (Plan Consultant)": metisAgent,
|
||||||
|
"Momus (Plan Reviewer)": momusAgent,
|
||||||
|
"orchestrator-sisyphus": orchestratorSisyphusAgent,
|
||||||
}
|
}
|
||||||
|
|
||||||
export * from "./types"
|
export * from "./types"
|
||||||
|
|||||||
@ -64,6 +64,9 @@ export type BuiltinAgentName =
|
|||||||
| "frontend-ui-ux-engineer"
|
| "frontend-ui-ux-engineer"
|
||||||
| "document-writer"
|
| "document-writer"
|
||||||
| "multimodal-looker"
|
| "multimodal-looker"
|
||||||
|
| "Metis (Plan Consultant)"
|
||||||
|
| "Momus (Plan Reviewer)"
|
||||||
|
| "orchestrator-sisyphus"
|
||||||
|
|
||||||
export type OverridableAgentName =
|
export type OverridableAgentName =
|
||||||
| "build"
|
| "build"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user