diff --git a/assets/oh-my-opencode.schema.json b/assets/oh-my-opencode.schema.json index 89d407c..2f15a1a 100644 --- a/assets/oh-my-opencode.schema.json +++ b/assets/oh-my-opencode.schema.json @@ -85,6 +85,9 @@ "prompt": { "type": "string" }, + "prompt_append": { + "type": "string" + }, "tools": { "type": "object", "propertyNames": { @@ -196,6 +199,9 @@ "prompt": { "type": "string" }, + "prompt_append": { + "type": "string" + }, "tools": { "type": "object", "propertyNames": { @@ -307,6 +313,9 @@ "prompt": { "type": "string" }, + "prompt_append": { + "type": "string" + }, "tools": { "type": "object", "propertyNames": { @@ -418,6 +427,9 @@ "prompt": { "type": "string" }, + "prompt_append": { + "type": "string" + }, "tools": { "type": "object", "propertyNames": { @@ -529,6 +541,9 @@ "prompt": { "type": "string" }, + "prompt_append": { + "type": "string" + }, "tools": { "type": "object", "propertyNames": { @@ -640,6 +655,9 @@ "prompt": { "type": "string" }, + "prompt_append": { + "type": "string" + }, "tools": { "type": "object", "propertyNames": { @@ -751,6 +769,9 @@ "prompt": { "type": "string" }, + "prompt_append": { + "type": "string" + }, "tools": { "type": "object", "propertyNames": { @@ -862,6 +883,9 @@ "prompt": { "type": "string" }, + "prompt_append": { + "type": "string" + }, "tools": { "type": "object", "propertyNames": { @@ -973,6 +997,9 @@ "prompt": { "type": "string" }, + "prompt_append": { + "type": "string" + }, "tools": { "type": "object", "propertyNames": { @@ -1084,6 +1111,9 @@ "prompt": { "type": "string" }, + "prompt_append": { + "type": "string" + }, "tools": { "type": "object", "propertyNames": { diff --git a/src/agents/document-writer.ts b/src/agents/document-writer.ts index 01c4b60..76e27e7 100644 --- a/src/agents/document-writer.ts +++ b/src/agents/document-writer.ts @@ -1,12 +1,17 @@ import type { AgentConfig } from "@opencode-ai/sdk" -export const documentWriterAgent: AgentConfig = { - description: - "A technical writer who crafts clear, comprehensive documentation. Specializes in README files, API docs, architecture docs, and user guides. MUST BE USED when executing documentation tasks from ai-todo list plans.", - mode: "subagent", - model: "google/gemini-3-flash-preview", - tools: { background_task: false }, - prompt: ` +const DEFAULT_MODEL = "google/gemini-3-flash-preview" + +export function createDocumentWriterAgent( + model: string = DEFAULT_MODEL +): AgentConfig { + return { + description: + "A technical writer who crafts clear, comprehensive documentation. Specializes in README files, API docs, architecture docs, and user guides. MUST BE USED when executing documentation tasks from ai-todo list plans.", + mode: "subagent" as const, + model, + tools: { background_task: false }, + prompt: ` You are a TECHNICAL WRITER with deep engineering background who transforms complex codebases into crystal-clear documentation. You have an innate ability to explain complex concepts simply while maintaining technical accuracy. You approach every documentation task with both a developer's understanding and a reader's empathy. Even without detailed specs, you can explore codebases and create documentation that developers actually want to read. @@ -200,4 +205,7 @@ STOP HERE - DO NOT CONTINUE TO NEXT TASK You are a technical writer who creates documentation that developers actually want to read. `, + } } + +export const documentWriterAgent = createDocumentWriterAgent() diff --git a/src/agents/explore.ts b/src/agents/explore.ts index 7b04d8c..ba6b704 100644 --- a/src/agents/explore.ts +++ b/src/agents/explore.ts @@ -1,13 +1,16 @@ import type { AgentConfig } from "@opencode-ai/sdk" -export const exploreAgent: AgentConfig = { - description: - 'Contextual grep for codebases. Answers "Where is X?", "Which file has Y?", "Find the code that does Z". Fire multiple in parallel for broad searches. Specify thoroughness: "quick" for basic, "medium" for moderate, "very thorough" for comprehensive analysis.', - mode: "subagent", - model: "opencode/grok-code", - temperature: 0.1, - tools: { write: false, edit: false, background_task: false }, - prompt: `You are a codebase search specialist. Your job: find files and code, return actionable results. +const DEFAULT_MODEL = "opencode/grok-code" + +export function createExploreAgent(model: string = DEFAULT_MODEL): AgentConfig { + return { + description: + 'Contextual grep for codebases. Answers "Where is X?", "Which file has Y?", "Find the code that does Z". Fire multiple in parallel for broad searches. Specify thoroughness: "quick" for basic, "medium" for moderate, "very thorough" for comprehensive analysis.', + mode: "subagent" as const, + model, + temperature: 0.1, + tools: { write: false, edit: false, background_task: false }, + prompt: `You are a codebase search specialist. Your job: find files and code, return actionable results. ## Your Mission @@ -96,4 +99,7 @@ grep_app searches millions of public GitHub repos instantly — use it for exter 3. **Cross-validate with local tools** (grep, ast_grep_search, LSP) before trusting results Flood with parallel calls. Trust only cross-validated results.`, + } } + +export const exploreAgent = createExploreAgent() diff --git a/src/agents/frontend-ui-ux-engineer.ts b/src/agents/frontend-ui-ux-engineer.ts index e893b7f..add5db7 100644 --- a/src/agents/frontend-ui-ux-engineer.ts +++ b/src/agents/frontend-ui-ux-engineer.ts @@ -1,12 +1,17 @@ import type { AgentConfig } from "@opencode-ai/sdk" -export const frontendUiUxEngineerAgent: AgentConfig = { - description: - "A designer-turned-developer who crafts stunning UI/UX even without design mockups. Code may be a bit messy, but the visual output is always fire.", - mode: "subagent", - model: "google/gemini-3-pro-preview", - tools: { background_task: false }, - prompt: `# Role: Designer-Turned-Developer +const DEFAULT_MODEL = "google/gemini-3-pro-preview" + +export function createFrontendUiUxEngineerAgent( + model: string = DEFAULT_MODEL +): AgentConfig { + return { + description: + "A designer-turned-developer who crafts stunning UI/UX even without design mockups. Code may be a bit messy, but the visual output is always fire.", + mode: "subagent" as const, + model, + tools: { background_task: false }, + prompt: `# Role: Designer-Turned-Developer You are a designer who learned to code. You see what pure developers miss—spacing, color harmony, micro-interactions, that indefinable "feel" that makes interfaces memorable. Even without mockups, you envision and create beautiful, cohesive interfaces. @@ -79,4 +84,7 @@ Match implementation complexity to aesthetic vision: - **Minimalist** → Restraint, precision, careful spacing and typography Interpret creatively and make unexpected choices that feel genuinely designed for the context. No design should be the same. Vary between light and dark themes, different fonts, different aesthetics. You are capable of extraordinary creative work—don't hold back.`, + } } + +export const frontendUiUxEngineerAgent = createFrontendUiUxEngineerAgent() diff --git a/src/agents/librarian.ts b/src/agents/librarian.ts index 8359ed9..c536e2a 100644 --- a/src/agents/librarian.ts +++ b/src/agents/librarian.ts @@ -1,13 +1,16 @@ import type { AgentConfig } from "@opencode-ai/sdk" -export const librarianAgent: AgentConfig = { - description: - "Specialized codebase understanding agent for multi-repository analysis, searching remote codebases, retrieving official documentation, and finding implementation examples using GitHub CLI, Context7, and Web Search. MUST BE USED when users ask to look up code in remote repositories, explain library internals, or find usage examples in open source.", - mode: "subagent", - model: "anthropic/claude-sonnet-4-5", - temperature: 0.1, - tools: { write: false, edit: false, background_task: false }, - prompt: `# THE LIBRARIAN +const DEFAULT_MODEL = "anthropic/claude-sonnet-4-5" + +export function createLibrarianAgent(model: string = DEFAULT_MODEL): AgentConfig { + return { + description: + "Specialized codebase understanding agent for multi-repository analysis, searching remote codebases, retrieving official documentation, and finding implementation examples using GitHub CLI, Context7, and Web Search. MUST BE USED when users ask to look up code in remote repositories, explain library internals, or find usage examples in open source.", + mode: "subagent" as const, + model, + temperature: 0.1, + tools: { write: false, edit: false, background_task: false }, + prompt: `# THE LIBRARIAN You are **THE LIBRARIAN**, a specialized open-source codebase understanding agent. @@ -237,4 +240,7 @@ grep_app_searchGitHub(query: "useQuery") 5. **BE CONCISE**: Facts > opinions, evidence > speculation `, + } } + +export const librarianAgent = createLibrarianAgent() diff --git a/src/agents/multimodal-looker.ts b/src/agents/multimodal-looker.ts index d7ecffe..1c8e44f 100644 --- a/src/agents/multimodal-looker.ts +++ b/src/agents/multimodal-looker.ts @@ -1,13 +1,18 @@ import type { AgentConfig } from "@opencode-ai/sdk" -export const multimodalLookerAgent: AgentConfig = { - description: - "Analyze media files (PDFs, images, diagrams) that require interpretation beyond raw text. Extracts specific information or summaries from documents, describes visual content. Use when you need analyzed/extracted data rather than literal file contents.", - mode: "subagent", - model: "google/gemini-3-flash", - temperature: 0.1, - tools: { write: false, edit: false, bash: false, background_task: false }, - prompt: `You interpret media files that cannot be read as plain text. +const DEFAULT_MODEL = "google/gemini-3-flash" + +export function createMultimodalLookerAgent( + model: string = DEFAULT_MODEL +): AgentConfig { + return { + description: + "Analyze media files (PDFs, images, diagrams) that require interpretation beyond raw text. Extracts specific information or summaries from documents, describes visual content. Use when you need analyzed/extracted data rather than literal file contents.", + mode: "subagent" as const, + model, + temperature: 0.1, + tools: { write: false, edit: false, bash: false, background_task: false }, + prompt: `You interpret media files that cannot be read as plain text. Your job: examine the attached file and extract ONLY what was requested. @@ -39,4 +44,7 @@ Response rules: - Be thorough on the goal, concise on everything else Your output goes straight to the main agent for continued work.`, + } } + +export const multimodalLookerAgent = createMultimodalLookerAgent() diff --git a/src/agents/utils.ts b/src/agents/utils.ts index 1f24238..78213a8 100644 --- a/src/agents/utils.ts +++ b/src/agents/utils.ts @@ -2,11 +2,11 @@ import type { AgentConfig } from "@opencode-ai/sdk" import type { BuiltinAgentName, AgentOverrideConfig, AgentOverrides, AgentFactory } from "./types" import { createSisyphusAgent } from "./sisyphus" import { createOracleAgent } from "./oracle" -import { librarianAgent } from "./librarian" -import { exploreAgent } from "./explore" -import { frontendUiUxEngineerAgent } from "./frontend-ui-ux-engineer" -import { documentWriterAgent } from "./document-writer" -import { multimodalLookerAgent } from "./multimodal-looker" +import { createLibrarianAgent } from "./librarian" +import { createExploreAgent } from "./explore" +import { createFrontendUiUxEngineerAgent } from "./frontend-ui-ux-engineer" +import { createDocumentWriterAgent } from "./document-writer" +import { createMultimodalLookerAgent } from "./multimodal-looker" import { deepMerge } from "../shared" type AgentSource = AgentFactory | AgentConfig @@ -14,11 +14,11 @@ type AgentSource = AgentFactory | AgentConfig const agentSources: Record = { Sisyphus: createSisyphusAgent, oracle: createOracleAgent, - librarian: librarianAgent, - explore: exploreAgent, - "frontend-ui-ux-engineer": frontendUiUxEngineerAgent, - "document-writer": documentWriterAgent, - "multimodal-looker": multimodalLookerAgent, + librarian: createLibrarianAgent, + explore: createExploreAgent, + "frontend-ui-ux-engineer": createFrontendUiUxEngineerAgent, + "document-writer": createDocumentWriterAgent, + "multimodal-looker": createMultimodalLookerAgent, } function isFactory(source: AgentSource): source is AgentFactory {