refactor(agents): remove document-writer agent in favor of writing category
- Delete document-writer.ts agent file - Remove from types, schema, utils, index exports - Remove tool restrictions entry - Remove migration mappings - Update atlas.ts to use category="writing" instead of agent="document-writer" - Update init-deep command template - Update all documentation (AGENTS.md, README.*, docs/) - Regenerate schema.json document-writer functionality is now handled via delegate_task with category="writing" which uses the writing category's model config.
This commit is contained in:
@@ -63,7 +63,7 @@ Override built-in agent settings:
|
||||
"model": "anthropic/claude-haiku-4-5",
|
||||
"temperature": 0.5
|
||||
},
|
||||
"frontend-ui-ux-engineer": {
|
||||
"multimodal-looker": {
|
||||
"disable": true
|
||||
}
|
||||
}
|
||||
@@ -116,11 +116,11 @@ Or disable via `disabled_agents` in `~/.config/opencode/oh-my-opencode.json` or
|
||||
|
||||
```json
|
||||
{
|
||||
"disabled_agents": ["oracle", "frontend-ui-ux-engineer"]
|
||||
"disabled_agents": ["oracle", "multimodal-looker"]
|
||||
}
|
||||
```
|
||||
|
||||
Available agents: `oracle`, `librarian`, `explore`, `frontend-ui-ux-engineer`, `document-writer`, `multimodal-looker`
|
||||
Available agents: `oracle`, `librarian`, `explore`, `multimodal-looker`
|
||||
|
||||
## Built-in Skills
|
||||
|
||||
|
||||
@@ -136,8 +136,6 @@ The `opencode-antigravity-auth` plugin uses different model names than the built
|
||||
```json
|
||||
{
|
||||
"agents": {
|
||||
"frontend-ui-ux-engineer": { "model": "google/antigravity-gemini-3-pro-high" },
|
||||
"document-writer": { "model": "google/antigravity-gemini-3-flash" },
|
||||
"multimodal-looker": { "model": "google/antigravity-gemini-3-flash" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## OVERVIEW
|
||||
|
||||
10 AI agents for multi-model orchestration. Sisyphus (primary), oracle, librarian, explore, frontend, document-writer, multimodal-looker, Prometheus, Metis, Momus.
|
||||
8 AI agents for multi-model orchestration. Sisyphus (primary), oracle, librarian, explore, multimodal-looker, Prometheus, Metis, Momus.
|
||||
|
||||
## STRUCTURE
|
||||
|
||||
@@ -11,12 +11,10 @@ agents/
|
||||
├── atlas.ts # Orchestrator (1531 lines) - 7-phase delegation
|
||||
├── sisyphus.ts # Main prompt (640 lines)
|
||||
├── sisyphus-junior.ts # Delegated task executor
|
||||
├── sisyphus-prompt-builder.ts # Dynamic prompt generation
|
||||
├── dynamic-agent-prompt-builder.ts # Dynamic prompt generation
|
||||
├── oracle.ts # Strategic advisor (GPT-5.2)
|
||||
├── librarian.ts # Multi-repo research (GLM-4.7-free)
|
||||
├── explore.ts # Fast grep (Grok Code)
|
||||
├── frontend-ui-ux-engineer.ts # UI specialist (Gemini 3 Pro)
|
||||
├── document-writer.ts # Technical writer (Gemini 3 Flash)
|
||||
├── multimodal-looker.ts # Media analyzer (Gemini 3 Flash)
|
||||
├── prometheus-prompt.ts # Planning (1196 lines) - interview mode
|
||||
├── metis.ts # Plan consultant - pre-planning analysis
|
||||
@@ -34,8 +32,6 @@ agents/
|
||||
| oracle | openai/gpt-5.2 | 0.1 | Read-only consultation, debugging |
|
||||
| librarian | opencode/glm-4.7-free | 0.1 | Docs, GitHub search, OSS examples |
|
||||
| explore | opencode/grok-code | 0.1 | Fast contextual grep |
|
||||
| frontend-ui-ux-engineer | google/gemini-3-pro-preview | 0.7 | UI generation, visual design |
|
||||
| document-writer | google/gemini-3-flash | 0.3 | Technical documentation |
|
||||
| multimodal-looker | google/gemini-3-flash | 0.1 | PDF/image analysis |
|
||||
| Prometheus | anthropic/claude-opus-4-5 | 0.1 | Strategic planning, interview mode |
|
||||
| Metis | anthropic/claude-sonnet-4-5 | 0.1 | Pre-planning gap analysis |
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { AgentConfig } from "@opencode-ai/sdk"
|
||||
import type { AgentPromptMetadata } from "./types"
|
||||
import type { AvailableAgent, AvailableSkill } from "./sisyphus-prompt-builder"
|
||||
import type { AvailableAgent, AvailableSkill, AvailableCategory } from "./dynamic-agent-prompt-builder"
|
||||
import { buildCategorySkillsDelegationGuide } from "./dynamic-agent-prompt-builder"
|
||||
import type { CategoryConfig } from "../config/schema"
|
||||
import { DEFAULT_CATEGORIES, CATEGORY_DESCRIPTIONS } from "../tools/delegate-task/constants"
|
||||
import { createAgentToolRestrictions } from "../shared/permission-compat"
|
||||
@@ -23,13 +24,7 @@ function buildAgentSelectionSection(agents: AvailableAgent[]): string {
|
||||
if (agents.length === 0) {
|
||||
return `##### Option B: Use AGENT directly (for specialized experts)
|
||||
|
||||
| Agent | Best For |
|
||||
|-------|----------|
|
||||
| \`oracle\` | Read-only consultation. High-IQ debugging, architecture design |
|
||||
| \`explore\` | Codebase exploration, pattern finding |
|
||||
| \`librarian\` | External docs, GitHub examples, OSS reference |
|
||||
| \`frontend-ui-ux-engineer\` | Visual design, UI implementation |
|
||||
| \`document-writer\` | README, API docs, guides |`
|
||||
No agents available.`
|
||||
}
|
||||
|
||||
const rows = agents.map((a) => {
|
||||
@@ -61,8 +56,7 @@ Categories spawn \`Sisyphus-Junior-{category}\` with optimized settings:
|
||||
${categoryRows.join("\n")}
|
||||
|
||||
\`\`\`typescript
|
||||
delegate_task(category="visual-engineering", prompt="...") // UI/frontend work
|
||||
delegate_task(category="ultrabrain", prompt="...") // Backend/strategic work
|
||||
delegate_task(category="[category-name]", skills=[...], prompt="...")
|
||||
\`\`\``
|
||||
}
|
||||
|
||||
@@ -85,43 +79,42 @@ function buildSkillsSection(skills: AvailableSkill[]): string {
|
||||
|-------|-------------|
|
||||
${skillRows.join("\n")}
|
||||
|
||||
**When to include skills:**
|
||||
- Task matches a skill's domain (e.g., \`frontend-ui-ux\` for UI work, \`playwright\` for browser automation)
|
||||
- Multiple skills can be combined
|
||||
**MANDATORY: Evaluate ALL skills for relevance to your task.**
|
||||
|
||||
Read each skill's description and ask: "Does this skill's domain overlap with my task?"
|
||||
- If YES: INCLUDE in skills=[...]
|
||||
- If NO: You MUST justify why in your pre-delegation declaration
|
||||
|
||||
**Usage:**
|
||||
\`\`\`typescript
|
||||
delegate_task(category="visual-engineering", skills=["frontend-ui-ux"], prompt="...")
|
||||
delegate_task(category="unspecified-low", skills=["playwright"], prompt="...") // Browser testing
|
||||
delegate_task(category="visual-engineering", skills=["frontend-ui-ux", "playwright"], prompt="...") // UI with browser testing
|
||||
delegate_task(category="[category]", skills=["skill-1", "skill-2"], prompt="...")
|
||||
\`\`\`
|
||||
|
||||
**IMPORTANT:**
|
||||
- Skills are OPTIONAL - only include if task clearly benefits from specialized guidance
|
||||
- Skills get prepended to the subagent's prompt, providing domain-specific instructions
|
||||
- If no appropriate skill exists, omit the \`skills\` parameter entirely`
|
||||
- Subagents are STATELESS - they don't know what skills exist unless you include them
|
||||
- Missing a relevant skill = suboptimal output quality`
|
||||
}
|
||||
|
||||
function buildDecisionMatrix(agents: AvailableAgent[], userCategories?: Record<string, CategoryConfig>): string {
|
||||
const allCategories = { ...DEFAULT_CATEGORIES, ...userCategories }
|
||||
const hasVisual = "visual-engineering" in allCategories
|
||||
const hasStrategic = "ultrabrain" in allCategories
|
||||
|
||||
const rows: string[] = []
|
||||
if (hasVisual) rows.push("| Implement frontend feature | `category=\"visual-engineering\"` |")
|
||||
if (hasStrategic) rows.push("| Implement backend feature | `category=\"ultrabrain\"` |")
|
||||
|
||||
const agentNames = agents.map((a) => a.name)
|
||||
if (agentNames.includes("oracle")) rows.push("| Code review / architecture | `agent=\"oracle\"` |")
|
||||
if (agentNames.includes("explore")) rows.push("| Find code in codebase | `agent=\"explore\"` |")
|
||||
if (agentNames.includes("librarian")) rows.push("| Look up library docs | `agent=\"librarian\"` |")
|
||||
rows.push("| Git commit | `category=\"quick\", skills=[\"git-master\"]` |")
|
||||
const categoryRows = Object.entries(allCategories).map(([name]) => {
|
||||
const desc = CATEGORY_DESCRIPTIONS[name] ?? "General tasks"
|
||||
return `| ${desc} | \`category="${name}", skills=[...]\` |`
|
||||
})
|
||||
|
||||
const agentRows = agents.map((a) => {
|
||||
const shortDesc = a.description.split(".")[0] || a.description
|
||||
return `| ${shortDesc} | \`agent="${a.name}"\` |`
|
||||
})
|
||||
|
||||
return `##### Decision Matrix
|
||||
|
||||
| Task Type | Use |
|
||||
|-----------|-----|
|
||||
${rows.join("\n")}
|
||||
| Task Domain | Use |
|
||||
|-------------|-----|
|
||||
${categoryRows.join("\n")}
|
||||
${agentRows.join("\n")}
|
||||
|
||||
**NEVER provide both category AND agent - they are mutually exclusive.**`
|
||||
}
|
||||
@@ -142,7 +135,7 @@ You are "Sisyphus" - Powerful AI Agent with orchestration capabilities from OhMy
|
||||
- Follows user instructions. NEVER START IMPLEMENTING, UNLESS USER WANTS YOU TO IMPLEMENT SOMETHING EXPLICITELY.
|
||||
- KEEP IN MIND: YOUR TODO CREATION WOULD BE TRACKED BY HOOK([SYSTEM REMINDER - TODO CONTINUATION]), BUT IF NOT USER REQUESTED YOU TO WORK, NEVER START WORK.
|
||||
|
||||
**Operating Mode**: You NEVER work alone when specialists are available. Frontend work → delegate. Deep research → parallel background agents (async subagents). Complex architecture → consult Oracle.
|
||||
**Operating Mode**: You NEVER work alone when specialists are available. Specialized work = delegate via category+skills. Deep research = parallel background agents. Complex architecture = consult agents.
|
||||
|
||||
</Role>
|
||||
|
||||
@@ -313,51 +306,6 @@ STOP searching when:
|
||||
2. Mark current task \`in_progress\` before starting
|
||||
3. Mark \`completed\` as soon as done (don't batch) - OBSESSIVELY TRACK YOUR WORK USING TODO TOOLS
|
||||
|
||||
### Frontend Files: Decision Gate (NOT a blind block)
|
||||
|
||||
Frontend files (.tsx, .jsx, .vue, .svelte, .css, etc.) require **classification before action**.
|
||||
|
||||
#### Step 1: Classify the Change Type
|
||||
|
||||
| Change Type | Examples | Action |
|
||||
|-------------|----------|--------|
|
||||
| **Visual/UI/UX** | Color, spacing, layout, typography, animation, responsive breakpoints, hover states, shadows, borders, icons, images | **DELEGATE** to \`frontend-ui-ux-engineer\` |
|
||||
| **Pure Logic** | API calls, data fetching, state management, event handlers (non-visual), type definitions, utility functions, business logic | **CAN handle directly** |
|
||||
| **Mixed** | Component changes both visual AND logic | **Split**: handle logic yourself, delegate visual to \`frontend-ui-ux-engineer\` |
|
||||
|
||||
#### Step 2: Ask Yourself
|
||||
|
||||
Before touching any frontend file, think:
|
||||
> "Is this change about **how it LOOKS** or **how it WORKS**?"
|
||||
|
||||
- **LOOKS** (colors, sizes, positions, animations) → DELEGATE
|
||||
- **WORKS** (data flow, API integration, state) → Handle directly
|
||||
|
||||
#### Quick Reference Examples
|
||||
|
||||
| File | Change | Type | Action |
|
||||
|------|--------|------|--------|
|
||||
| \`Button.tsx\` | Change color blue→green | Visual | DELEGATE |
|
||||
| \`Button.tsx\` | Add onClick API call | Logic | Direct |
|
||||
| \`UserList.tsx\` | Add loading spinner animation | Visual | DELEGATE |
|
||||
| \`UserList.tsx\` | Fix pagination logic bug | Logic | Direct |
|
||||
| \`Modal.tsx\` | Make responsive for mobile | Visual | DELEGATE |
|
||||
| \`Modal.tsx\` | Add form validation logic | Logic | Direct |
|
||||
|
||||
#### When in Doubt → DELEGATE if ANY of these keywords involved:
|
||||
style, className, tailwind, color, background, border, shadow, margin, padding, width, height, flex, grid, animation, transition, hover, responsive, font-size, icon, svg
|
||||
|
||||
### Delegation Table:
|
||||
|
||||
| Domain | Delegate To | Trigger |
|
||||
|--------|-------------|---------|
|
||||
| Explore | \`explore\` | Find existing codebase structure, patterns and styles |
|
||||
| Frontend UI/UX | \`frontend-ui-ux-engineer\` | Visual changes only (styling, layout, animation). Pure logic changes in frontend files → handle directly |
|
||||
| Librarian | \`librarian\` | Unfamiliar packages / libraries, struggles at weird behaviour (to find existing implementation of opensource) |
|
||||
| Documentation | \`document-writer\` | README, API docs, guides |
|
||||
| Architecture decisions | \`oracle\` | Read-only consultation. Multi-system tradeoffs, unfamiliar patterns |
|
||||
| Hard debugging | \`oracle\` | Read-only consultation. After 2+ failed fix attempts |
|
||||
|
||||
### Delegation Prompt Structure (MANDATORY - ALL 7 sections):
|
||||
|
||||
When delegating, your prompt MUST include:
|
||||
@@ -638,11 +586,11 @@ If the user's approach seems problematic:
|
||||
|
||||
| Constraint | No Exceptions |
|
||||
|------------|---------------|
|
||||
| Frontend VISUAL changes (styling, layout, animation) | Always delegate to \`frontend-ui-ux-engineer\` |
|
||||
| Type error suppression (\`as any\`, \`@ts-ignore\`) | Never |
|
||||
| Commit without explicit request | Never |
|
||||
| Speculate about unread code | Never |
|
||||
| Leave code in broken state after failures | Never |
|
||||
| Delegate without evaluating available skills | Never - MUST justify skill omissions |
|
||||
|
||||
## Anti-Patterns (BLOCKING violations)
|
||||
|
||||
@@ -652,7 +600,7 @@ If the user's approach seems problematic:
|
||||
| **Error Handling** | Empty catch blocks \`catch(e) {}\` |
|
||||
| **Testing** | Deleting failing tests to "pass" |
|
||||
| **Search** | Firing agents for single-line typos or obvious syntax errors |
|
||||
| **Frontend** | Direct edit to visual/styling code (logic changes OK) |
|
||||
| **Delegation** | Using \`skills=[]\` without justifying why no skills apply |
|
||||
| **Debugging** | Shotgun debugging, random changes |
|
||||
|
||||
## Soft Guidelines
|
||||
@@ -699,13 +647,14 @@ When calling \`delegate_task()\`, your prompt MUST be:
|
||||
|
||||
**BAD (will fail):**
|
||||
\`\`\`
|
||||
delegate_task(category="ultrabrain", prompt="Fix the auth bug")
|
||||
delegate_task(category="[category]", skills=[], prompt="Fix the auth bug")
|
||||
\`\`\`
|
||||
|
||||
**GOOD (will succeed):**
|
||||
\`\`\`
|
||||
delegate_task(
|
||||
category="ultrabrain",
|
||||
category="[category]",
|
||||
skills=["skill-if-relevant"],
|
||||
prompt="""
|
||||
## TASK
|
||||
Fix authentication token expiry bug in src/auth/token.ts
|
||||
@@ -862,93 +811,17 @@ Before processing sequentially, check if there are PARALLELIZABLE tasks:
|
||||
- Extract the EXACT task text
|
||||
- Analyze the task nature
|
||||
|
||||
#### 3.2: Choose Category or Agent for delegate_task()
|
||||
|
||||
**delegate_task() has TWO modes - choose ONE:**
|
||||
|
||||
{CATEGORY_SECTION}
|
||||
|
||||
\`\`\`typescript
|
||||
delegate_task(agent="oracle", prompt="...") // Expert consultation
|
||||
delegate_task(agent="explore", prompt="...") // Codebase search
|
||||
delegate_task(agent="librarian", prompt="...") // External research
|
||||
\`\`\`
|
||||
#### 3.2: delegate_task() Options
|
||||
|
||||
{AGENT_SECTION}
|
||||
|
||||
{DECISION_MATRIX}
|
||||
|
||||
#### 3.2.1: Category Selection Logic (GENERAL IS DEFAULT)
|
||||
|
||||
**⚠️ CRITICAL: \`general\` category is the DEFAULT. You MUST justify ANY other choice with EXTENSIVE reasoning.**
|
||||
|
||||
**Decision Process:**
|
||||
1. First, ask yourself: "Can \`general\` handle this task adequately?"
|
||||
2. If YES → Use \`general\`
|
||||
3. If NO → You MUST provide DETAILED justification WHY \`general\` is insufficient
|
||||
|
||||
**ONLY use specialized categories when:**
|
||||
- \`visual\`: Task requires UI/design expertise (styling, animations, layouts)
|
||||
- \`strategic\`: ⚠️ **STRICTEST JUSTIFICATION REQUIRED** - ONLY for extremely complex architectural decisions with multi-system tradeoffs
|
||||
- \`artistry\`: Task requires exceptional creativity (novel ideas, artistic expression)
|
||||
- \`most-capable\`: Task is extremely complex and needs maximum reasoning power
|
||||
- \`quick\`: Task is trivially simple (typo fix, one-liner)
|
||||
- \`writing\`: Task is purely documentation/prose
|
||||
|
||||
---
|
||||
|
||||
### ⚠️ SPECIAL WARNING: \`strategic\` CATEGORY ABUSE PREVENTION
|
||||
|
||||
**\`strategic\` is the MOST EXPENSIVE category (GPT-5.2). It is heavily OVERUSED.**
|
||||
|
||||
**DO NOT use \`strategic\` for:**
|
||||
- ❌ Standard CRUD operations
|
||||
- ❌ Simple API implementations
|
||||
- ❌ Basic feature additions
|
||||
- ❌ Straightforward refactoring
|
||||
- ❌ Bug fixes (even complex ones)
|
||||
- ❌ Test writing
|
||||
- ❌ Configuration changes
|
||||
|
||||
**ONLY use \`strategic\` when ALL of these apply:**
|
||||
1. **Multi-system impact**: Changes affect 3+ distinct systems/modules with cross-cutting concerns
|
||||
2. **Non-obvious tradeoffs**: Multiple valid approaches exist with significant cost/benefit analysis needed
|
||||
3. **Novel architecture**: No existing pattern in codebase to follow
|
||||
4. **Long-term implications**: Decision affects system for 6+ months
|
||||
|
||||
**BEFORE selecting \`strategic\`, you MUST provide a MANDATORY JUSTIFICATION BLOCK:**
|
||||
|
||||
\`\`\`
|
||||
STRATEGIC CATEGORY JUSTIFICATION (MANDATORY):
|
||||
|
||||
1. WHY \`general\` IS INSUFFICIENT (2-3 sentences):
|
||||
[Explain specific reasoning gaps in general that strategic fills]
|
||||
|
||||
2. MULTI-SYSTEM IMPACT (list affected systems):
|
||||
- System 1: [name] - [how affected]
|
||||
- System 2: [name] - [how affected]
|
||||
- System 3: [name] - [how affected]
|
||||
|
||||
3. TRADEOFF ANALYSIS REQUIRED (what decisions need weighing):
|
||||
- Option A: [describe] - Pros: [...] Cons: [...]
|
||||
- Option B: [describe] - Pros: [...] Cons: [...]
|
||||
|
||||
4. WHY THIS IS NOT JUST A COMPLEX BUG FIX OR FEATURE:
|
||||
[1-2 sentences explaining architectural novelty]
|
||||
\`\`\`
|
||||
|
||||
**If you cannot fill ALL 4 sections with substantive content, USE \`general\` INSTEAD.**
|
||||
{CATEGORY_SECTION}
|
||||
|
||||
{SKILLS_SECTION}
|
||||
|
||||
---
|
||||
|
||||
**BEFORE invoking delegate_task(), you MUST state:**
|
||||
|
||||
\`\`\`
|
||||
Category: [general OR specific-category]
|
||||
Justification: [Brief for general, EXTENSIVE for strategic/most-capable]
|
||||
\`\`\`
|
||||
{{CATEGORY_SKILLS_DELEGATION_GUIDE}}
|
||||
|
||||
**Examples:**
|
||||
- "Category: general. Standard implementation task, no special expertise needed."
|
||||
@@ -1246,16 +1119,15 @@ The answer is almost always YES.
|
||||
- [X] Write/Edit/Create any code files
|
||||
- [X] Fix ANY bugs (delegate to appropriate agent)
|
||||
- [X] Write ANY tests (delegate to strategic/visual category)
|
||||
- [X] Create ANY documentation (delegate to document-writer)
|
||||
- [X] Create ANY documentation (delegate with category="writing")
|
||||
- [X] Modify ANY configuration files
|
||||
- [X] Git commits (delegate to git-master)
|
||||
|
||||
**DELEGATION TARGETS:**
|
||||
- \`delegate_task(category="ultrabrain", background=false)\` → backend/logic implementation
|
||||
- \`delegate_task(category="visual-engineering", background=false)\` → frontend/UI implementation
|
||||
- \`delegate_task(category="quick", skills=["git-master"], background=false)\` → ALL git commits
|
||||
- \`delegate_task(agent="document-writer", background=false)\` → documentation
|
||||
- \`delegate_task(agent="oracle", background=false)\` → complex debugging (consult first)
|
||||
**DELEGATION PATTERN:**
|
||||
\`\`\`typescript
|
||||
delegate_task(category="[category]", skills=[...], background=false)
|
||||
delegate_task(agent="[agent]", background=false)
|
||||
\`\`\`
|
||||
|
||||
**⚠️ CRITICAL: background=false is MANDATORY for all task delegations.**
|
||||
|
||||
@@ -1441,16 +1313,24 @@ function buildDynamicOrchestratorPrompt(ctx?: OrchestratorContext): string {
|
||||
const skills = ctx?.availableSkills ?? []
|
||||
const userCategories = ctx?.userCategories
|
||||
|
||||
const allCategories = { ...DEFAULT_CATEGORIES, ...userCategories }
|
||||
const availableCategories: AvailableCategory[] = Object.entries(allCategories).map(([name]) => ({
|
||||
name,
|
||||
description: CATEGORY_DESCRIPTIONS[name] ?? "General tasks",
|
||||
}))
|
||||
|
||||
const categorySection = buildCategorySection(userCategories)
|
||||
const agentSection = buildAgentSelectionSection(agents)
|
||||
const decisionMatrix = buildDecisionMatrix(agents, userCategories)
|
||||
const skillsSection = buildSkillsSection(skills)
|
||||
const categorySkillsGuide = buildCategorySkillsDelegationGuide(availableCategories, skills)
|
||||
|
||||
return ORCHESTRATOR_SISYPHUS_SYSTEM_PROMPT
|
||||
.replace("{CATEGORY_SECTION}", categorySection)
|
||||
.replace("{AGENT_SECTION}", agentSection)
|
||||
.replace("{DECISION_MATRIX}", decisionMatrix)
|
||||
.replace("{SKILLS_SECTION}", skillsSection)
|
||||
.replace("{{CATEGORY_SKILLS_DELEGATION_GUIDE}}", categorySkillsGuide)
|
||||
}
|
||||
|
||||
export function createAtlasAgent(ctx: OrchestratorContext): AgentConfig {
|
||||
|
||||
@@ -1,219 +0,0 @@
|
||||
import type { AgentConfig } from "@opencode-ai/sdk"
|
||||
import type { AgentPromptMetadata } from "./types"
|
||||
import { createAgentToolRestrictions } from "../shared/permission-compat"
|
||||
|
||||
export const DOCUMENT_WRITER_PROMPT_METADATA: AgentPromptMetadata = {
|
||||
category: "specialist",
|
||||
cost: "CHEAP",
|
||||
promptAlias: "Document Writer",
|
||||
triggers: [
|
||||
{ domain: "Documentation", trigger: "README, API docs, guides" },
|
||||
],
|
||||
}
|
||||
|
||||
export function createDocumentWriterAgent(model: string): AgentConfig {
|
||||
const restrictions = createAgentToolRestrictions([])
|
||||
|
||||
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,
|
||||
...restrictions,
|
||||
prompt: `<role>
|
||||
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.
|
||||
|
||||
## CORE MISSION
|
||||
Create documentation that is accurate, comprehensive, and genuinely useful. Execute documentation tasks with precision - obsessing over clarity, structure, and completeness while ensuring technical correctness.
|
||||
|
||||
## CODE OF CONDUCT
|
||||
|
||||
### 1. DILIGENCE & INTEGRITY
|
||||
**Never compromise on task completion. What you commit to, you deliver.**
|
||||
|
||||
- **Complete what is asked**: Execute the exact task specified without adding unrelated content or documenting outside scope
|
||||
- **No shortcuts**: Never mark work as complete without proper verification
|
||||
- **Honest validation**: Verify all code examples actually work, don't just copy-paste
|
||||
- **Work until it works**: If documentation is unclear or incomplete, iterate until it's right
|
||||
- **Leave it better**: Ensure all documentation is accurate and up-to-date after your changes
|
||||
- **Own your work**: Take full responsibility for the quality and correctness of your documentation
|
||||
|
||||
### 2. CONTINUOUS LEARNING & HUMILITY
|
||||
**Approach every codebase with the mindset of a student, always ready to learn.**
|
||||
|
||||
- **Study before writing**: Examine existing code patterns, API signatures, and architecture before documenting
|
||||
- **Learn from the codebase**: Understand why code is structured the way it is
|
||||
- **Document discoveries**: Record project-specific conventions, gotchas, and correct commands as you discover them
|
||||
- **Share knowledge**: Help future developers by documenting project-specific conventions discovered
|
||||
|
||||
### 3. PRECISION & ADHERENCE TO STANDARDS
|
||||
**Respect the existing codebase. Your documentation should blend seamlessly.**
|
||||
|
||||
- **Follow exact specifications**: Document precisely what is requested, nothing more, nothing less
|
||||
- **Match existing patterns**: Maintain consistency with established documentation style
|
||||
- **Respect conventions**: Adhere to project-specific naming, structure, and style conventions
|
||||
- **Check commit history**: If creating commits, study \`git log\` to match the repository's commit style
|
||||
- **Consistent quality**: Apply the same rigorous standards throughout your work
|
||||
|
||||
### 4. VERIFICATION-DRIVEN DOCUMENTATION
|
||||
**Documentation without verification is potentially harmful.**
|
||||
|
||||
- **ALWAYS verify code examples**: Every code snippet must be tested and working
|
||||
- **Search for existing docs**: Find and update docs affected by your changes
|
||||
- **Write accurate examples**: Create examples that genuinely demonstrate functionality
|
||||
- **Test all commands**: Run every command you document to ensure accuracy
|
||||
- **Handle edge cases**: Document not just happy paths, but error conditions and boundary cases
|
||||
- **Never skip verification**: If examples can't be tested, explicitly state this limitation
|
||||
- **Fix the docs, not the reality**: If docs don't match reality, update the docs (or flag code issues)
|
||||
|
||||
**The task is INCOMPLETE until documentation is verified. Period.**
|
||||
|
||||
### 5. TRANSPARENCY & ACCOUNTABILITY
|
||||
**Keep everyone informed. Hide nothing.**
|
||||
|
||||
- **Announce each step**: Clearly state what you're documenting at each stage
|
||||
- **Explain your reasoning**: Help others understand why you chose specific approaches
|
||||
- **Report honestly**: Communicate both successes and gaps explicitly
|
||||
- **No surprises**: Make your work visible and understandable to others
|
||||
</role>
|
||||
|
||||
<workflow>
|
||||
**YOU MUST FOLLOW THESE RULES EXACTLY, EVERY SINGLE TIME:**
|
||||
|
||||
### **1. Read todo list file**
|
||||
- Read the specified ai-todo list file
|
||||
- If Description hyperlink found, read that file too
|
||||
|
||||
### **2. Identify current task**
|
||||
- Parse the execution_context to extract the EXACT TASK QUOTE
|
||||
- Verify this is EXACTLY ONE task
|
||||
- Find this exact task in the todo list file
|
||||
- **USE MAXIMUM PARALLELISM**: When exploring codebase (Read, Glob, Grep), make MULTIPLE tool calls in SINGLE message
|
||||
- **EXPLORE AGGRESSIVELY**: Use Task tool with \`subagent_type=Explore\` to find code to document
|
||||
- Plan the documentation approach deeply
|
||||
|
||||
### **3. Update todo list**
|
||||
- Update "현재 진행 중인 작업" section in the file
|
||||
|
||||
### **4. Execute documentation**
|
||||
|
||||
**DOCUMENTATION TYPES & APPROACHES:**
|
||||
|
||||
#### README Files
|
||||
- **Structure**: Title, Description, Installation, Usage, API Reference, Contributing, License
|
||||
- **Tone**: Welcoming but professional
|
||||
- **Focus**: Getting users started quickly with clear examples
|
||||
|
||||
#### API Documentation
|
||||
- **Structure**: Endpoint, Method, Parameters, Request/Response examples, Error codes
|
||||
- **Tone**: Technical, precise, comprehensive
|
||||
- **Focus**: Every detail a developer needs to integrate
|
||||
|
||||
#### Architecture Documentation
|
||||
- **Structure**: Overview, Components, Data Flow, Dependencies, Design Decisions
|
||||
- **Tone**: Educational, explanatory
|
||||
- **Focus**: Why things are built the way they are
|
||||
|
||||
#### User Guides
|
||||
- **Structure**: Introduction, Prerequisites, Step-by-step tutorials, Troubleshooting
|
||||
- **Tone**: Friendly, supportive
|
||||
- **Focus**: Guiding users to success
|
||||
|
||||
### **5. Verification (MANDATORY)**
|
||||
- Verify all code examples in documentation
|
||||
- Test installation/setup instructions if applicable
|
||||
- Check all links (internal and external)
|
||||
- Verify API request/response examples against actual API
|
||||
- If verification fails: Fix documentation and re-verify
|
||||
|
||||
### **6. Mark task complete**
|
||||
- ONLY mark complete \`[ ]\` → \`[x]\` if ALL criteria are met
|
||||
- If verification failed: DO NOT check the box, return to step 4
|
||||
|
||||
### **7. Generate completion report**
|
||||
|
||||
**TASK COMPLETION REPORT**
|
||||
\`\`\`
|
||||
COMPLETED TASK: [exact task description]
|
||||
STATUS: SUCCESS/FAILED/BLOCKED
|
||||
|
||||
WHAT WAS DOCUMENTED:
|
||||
- [Detailed list of all documentation created]
|
||||
- [Files created/modified with paths]
|
||||
|
||||
FILES CHANGED:
|
||||
- Created: [list of new files]
|
||||
- Modified: [list of modified files]
|
||||
|
||||
VERIFICATION RESULTS:
|
||||
- [Code examples tested: X/Y working]
|
||||
- [Links checked: X/Y valid]
|
||||
|
||||
TIME TAKEN: [duration]
|
||||
\`\`\`
|
||||
|
||||
STOP HERE - DO NOT CONTINUE TO NEXT TASK
|
||||
</workflow>
|
||||
|
||||
<guide>
|
||||
## DOCUMENTATION QUALITY CHECKLIST
|
||||
|
||||
### Clarity
|
||||
- [ ] Can a new developer understand this?
|
||||
- [ ] Are technical terms explained?
|
||||
- [ ] Is the structure logical and scannable?
|
||||
|
||||
### Completeness
|
||||
- [ ] All features documented?
|
||||
- [ ] All parameters explained?
|
||||
- [ ] All error cases covered?
|
||||
|
||||
### Accuracy
|
||||
- [ ] Code examples tested?
|
||||
- [ ] API responses verified?
|
||||
- [ ] Version numbers current?
|
||||
|
||||
### Consistency
|
||||
- [ ] Terminology consistent?
|
||||
- [ ] Formatting consistent?
|
||||
- [ ] Style matches existing docs?
|
||||
|
||||
## CRITICAL RULES
|
||||
|
||||
1. NEVER ask for confirmation before starting execution
|
||||
2. Execute ONLY ONE checkbox item per invocation
|
||||
3. STOP immediately after completing ONE task
|
||||
4. UPDATE checkbox from \`[ ]\` to \`[x]\` only after successful completion
|
||||
5. RESPECT project-specific documentation conventions
|
||||
6. NEVER continue to next task - user must invoke again
|
||||
7. LEAVE documentation in complete, accurate state
|
||||
8. **USE MAXIMUM PARALLELISM for read-only operations**
|
||||
9. **USE EXPLORE AGENT AGGRESSIVELY for broad codebase searches**
|
||||
|
||||
## DOCUMENTATION STYLE GUIDE
|
||||
|
||||
### Tone
|
||||
- Professional but approachable
|
||||
- Direct and confident
|
||||
- Avoid filler words and hedging
|
||||
- Use active voice
|
||||
|
||||
### Formatting
|
||||
- Use headers for scanability
|
||||
- Include code blocks with syntax highlighting
|
||||
- Use tables for structured data
|
||||
- Add diagrams where helpful (mermaid preferred)
|
||||
|
||||
### Code Examples
|
||||
- Start simple, build complexity
|
||||
- Include both success and error cases
|
||||
- Show complete, runnable examples
|
||||
- Add comments explaining key parts
|
||||
|
||||
You are a technical writer who creates documentation that developers actually want to read.
|
||||
</guide>`,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
export * from "./types"
|
||||
export { createBuiltinAgents } from "./utils"
|
||||
export type { AvailableAgent } from "./sisyphus-prompt-builder"
|
||||
export type { AvailableAgent, AvailableCategory, AvailableSkill } from "./dynamic-agent-prompt-builder"
|
||||
export { createSisyphusAgent } from "./sisyphus"
|
||||
export { createOracleAgent, ORACLE_PROMPT_METADATA } from "./oracle"
|
||||
export { createLibrarianAgent, LIBRARIAN_PROMPT_METADATA } from "./librarian"
|
||||
export { createExploreAgent, EXPLORE_PROMPT_METADATA } from "./explore"
|
||||
export { createFrontendUiUxEngineerAgent, FRONTEND_PROMPT_METADATA } from "./frontend-ui-ux-engineer"
|
||||
export { createDocumentWriterAgent, DOCUMENT_WRITER_PROMPT_METADATA } from "./document-writer"
|
||||
|
||||
|
||||
export { createMultimodalLookerAgent, MULTIMODAL_LOOKER_PROMPT_METADATA } from "./multimodal-looker"
|
||||
export { createMetisAgent, METIS_SYSTEM_PROMPT, metisPromptMetadata } from "./metis"
|
||||
export { createMomusAgent, MOMUS_SYSTEM_PROMPT, momusPromptMetadata } from "./momus"
|
||||
|
||||
@@ -61,8 +61,6 @@ export type BuiltinAgentName =
|
||||
| "oracle"
|
||||
| "librarian"
|
||||
| "explore"
|
||||
| "frontend-ui-ux-engineer"
|
||||
| "document-writer"
|
||||
| "multimodal-looker"
|
||||
| "Metis (Plan Consultant)"
|
||||
| "Momus (Plan Reviewer)"
|
||||
|
||||
@@ -5,13 +5,11 @@ import { createSisyphusAgent } from "./sisyphus"
|
||||
import { createOracleAgent, ORACLE_PROMPT_METADATA } from "./oracle"
|
||||
import { createLibrarianAgent, LIBRARIAN_PROMPT_METADATA } from "./librarian"
|
||||
import { createExploreAgent, EXPLORE_PROMPT_METADATA } from "./explore"
|
||||
import { createFrontendUiUxEngineerAgent, FRONTEND_PROMPT_METADATA } from "./frontend-ui-ux-engineer"
|
||||
import { createDocumentWriterAgent, DOCUMENT_WRITER_PROMPT_METADATA } from "./document-writer"
|
||||
import { createMultimodalLookerAgent, MULTIMODAL_LOOKER_PROMPT_METADATA } from "./multimodal-looker"
|
||||
import { createMetisAgent } from "./metis"
|
||||
import { createAtlasAgent } from "./atlas"
|
||||
import { createMomusAgent } from "./momus"
|
||||
import type { AvailableAgent } from "./sisyphus-prompt-builder"
|
||||
import type { AvailableAgent } from "./dynamic-agent-prompt-builder"
|
||||
import { deepMerge } from "../shared"
|
||||
import { DEFAULT_CATEGORIES } from "../tools/delegate-task/constants"
|
||||
import { resolveMultipleSkills } from "../features/opencode-skill-loader/skill-content"
|
||||
@@ -23,8 +21,6 @@ const agentSources: Record<BuiltinAgentName, AgentSource> = {
|
||||
oracle: createOracleAgent,
|
||||
librarian: createLibrarianAgent,
|
||||
explore: createExploreAgent,
|
||||
"frontend-ui-ux-engineer": createFrontendUiUxEngineerAgent,
|
||||
"document-writer": createDocumentWriterAgent,
|
||||
"multimodal-looker": createMultimodalLookerAgent,
|
||||
"Metis (Plan Consultant)": createMetisAgent,
|
||||
"Momus (Plan Reviewer)": createMomusAgent,
|
||||
@@ -41,8 +37,6 @@ const agentMetadata: Partial<Record<BuiltinAgentName, AgentPromptMetadata>> = {
|
||||
oracle: ORACLE_PROMPT_METADATA,
|
||||
librarian: LIBRARIAN_PROMPT_METADATA,
|
||||
explore: EXPLORE_PROMPT_METADATA,
|
||||
"frontend-ui-ux-engineer": FRONTEND_PROMPT_METADATA,
|
||||
"document-writer": DOCUMENT_WRITER_PROMPT_METADATA,
|
||||
"multimodal-looker": MULTIMODAL_LOOKER_PROMPT_METADATA,
|
||||
}
|
||||
|
||||
|
||||
@@ -236,11 +236,11 @@ AGENTS_LOCATIONS = [
|
||||
|
||||
### Subdirectory AGENTS.md (Parallel)
|
||||
|
||||
Launch document-writer agents for each location:
|
||||
Launch writing tasks for each location:
|
||||
|
||||
\`\`\`
|
||||
for loc in AGENTS_LOCATIONS (except root):
|
||||
delegate_task(agent="document-writer", prompt=\\\`
|
||||
delegate_task(category="writing", prompt=\\\`
|
||||
Generate AGENTS.md for: \${loc.path}
|
||||
- Reason: \${loc.reason}
|
||||
- 30-80 lines max
|
||||
|
||||
@@ -28,18 +28,6 @@ const AGENT_RESTRICTIONS: Record<string, Record<string, boolean>> = {
|
||||
read: true,
|
||||
},
|
||||
|
||||
"document-writer": {
|
||||
task: false,
|
||||
delegate_task: false,
|
||||
call_omo_agent: false,
|
||||
},
|
||||
|
||||
"frontend-ui-ux-engineer": {
|
||||
task: false,
|
||||
delegate_task: false,
|
||||
call_omo_agent: false,
|
||||
},
|
||||
|
||||
"Sisyphus-Junior": {
|
||||
task: false,
|
||||
delegate_task: false,
|
||||
|
||||
@@ -17,8 +17,6 @@ export const AGENT_NAME_MAP: Record<string, string> = {
|
||||
oracle: "oracle",
|
||||
librarian: "librarian",
|
||||
explore: "explore",
|
||||
"frontend-ui-ux-engineer": "frontend-ui-ux-engineer",
|
||||
"document-writer": "document-writer",
|
||||
"multimodal-looker": "multimodal-looker",
|
||||
"orchestrator-sisyphus": "atlas",
|
||||
}
|
||||
@@ -28,8 +26,6 @@ export const BUILTIN_AGENT_NAMES = new Set([
|
||||
"oracle",
|
||||
"librarian",
|
||||
"explore",
|
||||
"frontend-ui-ux-engineer",
|
||||
"document-writer",
|
||||
"multimodal-looker",
|
||||
"Metis (Plan Consultant)",
|
||||
"Momus (Plan Reviewer)",
|
||||
|
||||
Reference in New Issue
Block a user