
Agent Architect
- 261 installs
- 125 repo stars
- Updated February 4, 2026
- igorwarzocha/opencode-workflows
Design agent topology, tool boundaries, memory flows, and orchestration patterns before coding so multi-step AI systems stay maintainable and testable.
About
agent-architect from igorwarzocha/opencode-workflows helps Claude Code plan multi-agent systems: roles, tools, memory, and control flow. It targets validate-stage prototyping when teams need a coherent blueprint before investing in agent-tooling implementation.
- Agent topology planning
- Tool and memory boundary design
- Orchestration pattern guidance
- OpenCode workflows integration
- Reduces agent refactor risk
Agent Architect by the numbers
- 261 all-time installs (skills.sh)
- +9 installs in the week ending Aug 2, 2026 (Skillselion tracking)
- Ranked #2,472 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 2, 2026 (Skillselion catalog sync)
npx skills add https://github.com/igorwarzocha/opencode-workflows --skill agent-architectAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 261 |
|---|---|
| repo stars | ★ 125 |
| Last updated | February 4, 2026 |
| Repository | igorwarzocha/opencode-workflows ↗ |
What it does
Design agent topology, tool boundaries, memory flows, and orchestration patterns before coding so multi-step AI systems stay maintainable and testable.
Files
Agent Architect
Create and refine opencode agents through a guided Q&A process.
<core_approach>
Agent creation is conversational, not transactional.
- MUST NOT assume what the user wants—ask
- SHOULD start with broad questions, drill into details only if needed
- Users MAY skip configuration they don't care about
- MUST always show drafts and iterate based on feedback
The goal is to help users create agents that fit their needs, not to dump every possible configuration option on them.
</core_approach>
<question_tool>
Batching: Use the question tool for 2+ related questions. Single questions → plain text.
Syntax: header ≤12 chars, label 1-5 words, add "(Recommended)" to default.
CRITICAL Permission Logic:
- You MUST ask the user about permissions explicitly.
- If user selects "Standard/Default" or "No extra", do NOT list
bash,read,write,editpermissions. Rely on system defaults. - Only add explicit permission blocks for tools when the user requests NON-STANDARD access (e.g., restrictive, or specific allows).
- EXCEPTION: Skills MUST ALWAYS be configured with
"*": "deny"and explicit allows, regardless of tool permissions.
</question_tool>
<reference>
Agent Locations
| Scope | Path |
|---|---|
| Project | .opencode/agent/<name>.md |
| Global | ~/.config/opencode/agent/<name>.md |
Agent File Format
---
description: When to use this agent. Include trigger examples.
model: anthropic/claude-sonnet-4-20250514 # Optional
mode: subagent # Optional (defaults to undefined/standard)
permission:
skill: { "*": "deny", "my-skill": "allow" }
bash: { "*": "ask", "git *": "allow" }
---
System prompt in markdown body (second person).Full schema: See references/opencode-config.md
Agent Modes
| Mode | Description |
|---|---|
(undefined) | Standard agent, visible to user and tools (Default) |
subagent | specialized task tool agent, hidden from main list |
</reference>
<workflow>
Phase 1: Core Purpose (Required)
Ask these first—they shape everything else:
1. "What should this agent do?"
- Get the core task/domain
- Examples: "review code", "help with deployments", "research topics"
2. "What should trigger this agent?"
- Specific phrases, contexts, file types
- Becomes the
descriptionfield
3. "What expertise/persona should it have?"
- Tone, boundaries, specialization
- Shapes the system prompt
Phase 1.5: Research the Domain
MUST NOT assume knowledge is current. After understanding the broad strokes:
- Search for current best practices in the domain
- Check for updates to frameworks, tools, or APIs the agent will work with
- Look up documentation for any unfamiliar technologies mentioned
- Find examples of how experts approach similar tasks
This research informs better questions in Phase 2 and produces a more capable agent.
Example: User wants an agent for "Next.js deployments" → Research current Next.js deployment patterns, Vercel vs self-hosted, App Router vs Pages Router, common pitfalls, etc.
Phase 2: Capabilities (Ask broadly, then drill down)
4. "What permissions does this agent need?" (Use Question Tool)
- Options: "Standard (Recommended)", "Read-Only", "Full Access", "Custom"
- Standard: Do NOT add
bash,read,write,editto config. Rely on defaults. - Read-Only: Explicitly deny write/edit/bash.
- Full Access: Allow bash
*if needed. - Custom: Ask specific follow-ups.
5. "Should this agent use any skills?"
- If yes: "Which ones?"
- ALWAYS configure
permission.skillwith"*": "deny"and explicit allows. - This applies even if other permissions are standard.
6. "Is this a subagent?"
- If yes: set
mode: subagent - If no: leave
modeundefined (standard)
Phase 3: Details (Optional—user MAY skip)
7. "Any specific model preference?" (most users skip) 8. "Custom temperature/sampling?" (most users skip) 9. "Maximum steps before stopping?" (most users skip)
Phase 4: Review & Refine
10. Show the draft config and prompt, ask for feedback
- "Here's what I've created. Anything you'd like to change?"
- Iterate until user is satisfied
Key principle: Start broad, get specific only where the user shows interest. MUST NOT overwhelm with options like top_p unless asked.
Be flexible: If the user provides lots of info upfront, adapt—MUST NOT rigidly follow the phases. If they say "I want a code review agent that can't run shell commands", you already have answers to multiple questions.
</workflow>
<system_prompt_structure>
Recommended Structure
# Role and Objective
[Agent purpose and scope]
# Instructions
- Core behavioral rules
- What to always/never do
## Sub-instructions (optional)
More detailed guidance for specific areas.
# Workflow
1. First, [step]
2. Then, [step]
3. Finally, [step]
# Output Format
Specify exact format expected.
# Examples (optional)
<examples>
<example>
<input>User request</input>
<output>Expected response</output>
</example>
</examples>XML Tags (Recommended)
XML tags improve clarity and parseability across all models:
| Tag | Purpose |
|---|---|
<instructions> | Core behavioral rules |
<context> | Background information |
<examples> | Few-shot demonstrations |
<thinking> | Chain-of-thought reasoning |
<output> | Final response format |
Best practices:
- Be consistent with tag names throughout
- Nest tags for hierarchy:
<outer><inner></inner></outer> - Reference tags in instructions: "Using the data in
<context>tags..."
Example:
<instructions>
1. Analyze the code in <code> tags
2. List issues in <findings> tags
3. Suggest fixes in <recommendations> tags
</instructions>Description Field (Critical)
The description determines when the agent triggers.
Primary Agents: Keep it extremely concise (PRECISELY 3 words). The user selects these manually or via very clear intent. Any Other Agents: Must be specific and exhaustive to ensure correct routing by the task tool. Template (Any Other Agents): [Role/Action]. Use when [triggers]. Examples: - user: "trigger" -> action
Good (Primary):
Code review expert.Good (Any Other Agents):
Code review specialist. Use when user says "review this PR", "check my code",
"find bugs".
Examples:
- user: "review" -> check code
- user: "scan" -> check codePrompt Altitude
Find the balance between too rigid and too vague:
| ❌ Too Rigid | ✅ Right Altitude | ❌ Too Vague |
|---|---|---|
| Hardcoded if-else logic | Clear heuristics + flexibility | "Be helpful" |
| "If X then always Y" | "Generally prefer X, but use judgment" | No guidance |
</system_prompt_structure>
<agentic_components>
For agents that use tools in a loop, SHOULD include these reminders:
# Persistence
Keep working until the user's request is fully resolved. Only yield
control when you're confident the task is complete.
# Tool Usage
If unsure about something, use tools to gather information.
Do NOT guess or make up answers.
# Planning (optional)
Think step-by-step before each action. Reflect on results before
proceeding.</agentic_components>
<permissions>
Control what agents can access.
CRITICAL: Avoid Overengineering
- Do NOT list permissions for standard tools (
read,write,edit,bash) unless the user explicitly asks for restrictions or non-standard access. - Rely on system defaults for most agents.
- Skills are the exception: You MUST always configure
permission.skillto whitelist specific skills and deny others.
# Standard Agent (minimal config)
permission:
skill:
"*": "deny"
"my-skill": "allow"
# Restricted Agent (explicit config)
permission:
edit: "ask"
bash:
"*": "deny"
skill:
"*": "deny"Full reference: See references/opencode-config.md
Legacy Configuration
Agents may occasionally work on legacy projects using outdated frontmatter (e.g., tools:, maxSteps:). You MUST correct these to the modern permission: and steps: fields when encountered.
</permissions>
<enhancement_workflow>
When improving an agent, diagnose through questions:
1. "What's not working well?" — Get specific symptoms 2. "Can you show me an example where it failed?" — Understand the gap 3. "What should it have done instead?" — Define success
Then propose targeted fixes:
| Symptom | Likely Cause | Fix |
|---|---|---|
| Triggers too often | Description too broad | Add specific contexts |
| Misses triggers | Description too narrow | Add trigger phrases |
| Wrong outputs | Prompt ambiguous | Add explicit instructions |
| Executes dangerous commands | Loose bash permissions | Restrict with patterns |
| Uses wrong skills | No skill restrictions | Configure permission.skill |
MUST show proposed changes and ask for confirmation before applying.
</enhancement_workflow>
<examples>
Restricted Code Review Agent
---
description: Safe code reviewer.
mode: primary
permission:
edit: "ask"
bash: "deny"
write: "deny"
external_directory: "deny"
---
You are a code review specialist. Analyze code for bugs, security issues,
and improvements. Never modify files directly.Deployment Agent (Any Other Agents)
---
description: |-
Deployment helper. Use when user says "deploy to staging", "push to prod",
"release version".
Examples:
- user: "deploy" -> run deployment
- user: "release" -> run deployment
mode: subagent
permission:
bash:
"*": "deny"
"git *": "allow"
"npm run build": "allow"
"npm run deploy:*": "ask"
skill:
"*": "deny"
"deploy-checklist": "allow"
---
You are a deployment specialist...</examples>
<quality_checklist>
Before showing the final agent to the user:
- [ ] Asked about core purpose and triggers
- [ ] Researched the domain (MUST NOT assume knowledge is current)
- [ ]
descriptionhas concrete trigger examples - [ ]
modediscussed and set appropriately - [ ] System prompt uses second person
- [ ] Asked about tool/permission needs (MUST NOT assume)
- [ ] Output format is specified if relevant
- [ ] Showed draft to user and got feedback
- [ ] User confirmed they're happy with result
</quality_checklist>
References
references/agent-patterns.md- Design patterns and prompt engineeringreferences/opencode-config.md- Full frontmatter schema, tools, permissions
Agent Design Patterns
<single_agent_patterns>
| Pattern | How it works | Best for |
|---|---|---|
| ReAct | Reason → Act → Observe → Repeat | Tool use with reasoning |
| Self-Refine | Generate → Critique → Refine | Quality-focused (writing, review) |
| Reflexion | Reflect on failures → Improve | Adaptive/learning tasks |
</single_agent_patterns>
<multi_agent_patterns>
| Pattern | How it works | Best for |
|---|---|---|
| Lead Agent | Orchestrator delegates to specialists | Multiple expertise domains |
| Router | Analyze request → Route to right agent | Diverse request types |
| Subagents/Other | Main agent spawns focused sub-agents | Long-horizon tasks, parallel exploration |
</multi_agent_patterns>
<agentic_behavior_levels>
1. Output - Agent decides what to output 2. Task - Agent decides how (tool selection, ordering) 3. Process - Agent decides overall approach and strategy
</agentic_behavior_levels>
<prompt_structure>
From OpenAI/Anthropic research, this structure works well:
# Role and Objective
# Instructions
## Sub-categories for detailed guidance
# Workflow / Reasoning Steps
# Output Format
# Examples
# Context
# Final reminders</prompt_structure>
<xml_tags>
XML outperforms JSON for long context and complex prompts:
<role>Expert code reviewer</role>
<instructions>
1. Analyze code for bugs
2. Check for security issues
3. Suggest improvements
</instructions>
<examples>
<example type="bug">
<input>for i in range(len(lst)): lst.pop(i)</input>
<output>Bug: Modifying list while iterating</output>
</example>
</examples>
<output_format>
Return findings as JSON: {"bugs": [], "security": [], "suggestions": []}
</output_format></xml_tags>
<agentic_reminders>
For tool-using agents, SHOULD include these:
| Reminder | Purpose | Example |
|---|---|---|
| Persistence | Keep going until done | "Only yield when task is fully resolved" |
| Tool-calling | Use tools, don't guess | "If unsure, use tools to verify" |
| Planning | Think between actions | "Plan before each tool call, reflect after" |
</agentic_reminders>
<context_engineering>
| Principle | Bad | Good |
|---|---|---|
| Be specific | "Review the code" | "Review for null pointer errors in auth module" |
| Right altitude | Hardcoded if-else | Clear heuristics with flexibility |
| Minimal context | Dump everything | Only what's needed for the task |
| Clear structure | Wall of text | XML tags or markdown sections |
</context_engineering>
<prompt_techniques>
| Technique | When to use |
|---|---|
| Few-shot examples | When format/style matters |
| Chain-of-thought | Complex reasoning tasks |
| XML structure | Multi-part prompts, long context |
| Step-by-step workflow | Procedural tasks |
| Self-verification | High-stakes outputs |
| Output format spec | Structured responses needed |
</prompt_techniques>
<failure_modes>
| Problem | Cause | Fix |
|---|---|---|
| Hallucinated tool inputs | Forced to call tool without info | Add "ask user if unsure" |
| Repetitive phrasing | Sample phrases used verbatim | "Vary phrases naturally" |
| Over-explaining | No brevity instruction | "Be concise, no prose" |
| Wrong format | Format not specified | Add explicit format section |
| Premature completion | No persistence reminder | Add "keep going until done" |
</failure_modes>
OpenCode Agent Configuration Reference
<file_locations>
Agent definitions are markdown files in:
.opencode/agent/<name>.md(project)~/.config/opencode/agent/<name>.md(global)
</file_locations>
<frontmatter_schema>
---
# Core Configuration
model: "provider/model-id" # Model override
temperature: 0.7 # Sampling temperature
top_p: 0.9 # Nucleus sampling
prompt: "Custom system prompt" # Or use markdown body
description: "Agent description" # Shown in listings, triggers agent
mode: "subagent" | "primary" | "all" # Agent availability
color: "#FF5733" # UI color
maxSteps: 25 # Max tool call steps
disable: false # Disable agent
# Tool Access Control
tools:
edit: true
write: true
bash: true
read: true
glob: true
grep: true
webfetch: true
task: true
skill: true
# Permissions
permission:
edit: "ask" | "allow" | "deny"
bash:
"*": "allow"
"git *": "deny"
skill:
"*": "allow"
"my-skill": "deny"
webfetch: "ask" | "allow" | "deny"
doom_loop: "ask" | "allow" | "deny"
external_directory: "ask" | "allow" | "deny"
---</frontmatter_schema>
<agent_modes>
| Mode | Description |
|---|---|
primary | User-selectable, can be default, spawns subagents |
subagent | Only callable via task tool by other agents |
all | Both primary and subagent (default) |
</agent_modes>
<permissions>
Permission Values
| Value | Behavior |
|---|---|
"allow" | Automatically permit |
"ask" | Prompt user for approval |
"deny" | Automatically reject |
Permission Categories
edit
Controls edit and write tools.
bash
Controls command execution. Supports wildcard patterns:
bash:
"*": "ask" # Ask for everything by default
"git *": "allow" # Allow all git commands
"npm *": "allow" # Allow npm commands
"rm *": "deny" # Block deletionskill
Controls skill access:
skill:
"*": "deny" # Deny all by default
"my-skill": "allow" # Allow specific skillwebfetch
Controls web fetching. "ask" prompts for each URL.
doom_loop
Controls doom loop detection (agent stuck in repetitive patterns).
external_directory
Controls access to files outside working directory. Affects:
- bash commands referencing external paths
- read/edit/write for external files
Default Permissions
If not specified, agents inherit from global config:
permission:
edit: "allow"
bash: { "*": "allow" }
skill: { "*": "allow" }
webfetch: "allow"
doom_loop: "ask"
external_directory: "ask"</permissions>
<available_tools>
File Operations
| Tool | Purpose | Key Parameters |
|---|---|---|
read | Read file contents | filePath, offset, limit |
edit | String replacement in files | filePath, oldString, newString, replaceAll |
write | Create/overwrite files | filePath, content |
Search & Navigation
| Tool | Purpose | Key Parameters |
|---|---|---|
glob | Find files by pattern | pattern, path |
grep | Search file contents (regex) | pattern, path, include |
list | List directory contents | path |
Command Execution
| Tool | Purpose | Key Parameters |
|---|---|---|
bash | Execute shell commands | command, timeout, workdir, description |
Default timeout: 120000ms. Permissions: bash, external_directory.
Web & External
| Tool | Purpose | Key Parameters |
|---|---|---|
webfetch | Fetch web content | url, format (text/markdown/html), timeout |
websearch | Web search via Exa AI | query, numResults |
codesearch | Code/SDK documentation search | query, tokensNum |
Task Management
| Tool | Purpose | Key Parameters |
|---|---|---|
task | Launch subagents | description, prompt, subagent_type, session_id |
todowrite | Update todo list | todos array |
todoread | Read todo list | (none) |
Other Tools
| Tool | Purpose | Notes |
|---|---|---|
skill | Load skill instructions | Parameter: name |
batch | Parallel tool execution | Experimental: config.experimental.batch_tool |
lsp | Language Server Protocol | Experimental: OPENCODE_EXPERIMENTAL_LSP_TOOL |
</available_tools>
<tool_access_control>
Disable specific tools for an agent:
tools:
bash: false # No shell access
webfetch: false # No web access
task: false # Cannot spawn subagentsAll tools inherit from global config.tools by default.
</tool_access_control>
<examples>
Restricted Code Review Agent (Primary)
---
description: Safe code reviewer.
mode: primary
permission:
edit: "ask"
bash: "deny"
write: "deny"
external_directory: "deny"
---
You are a code review specialist...Research Agent (Subagent)
---
description: |-
Web research agent. Use when user says "research topic", "find info".
Examples:
- user: "research" -> search web
mode: subagent
permission:
skill:
"*": "deny"
"web-research": "allow"
---
You are a research specialist...Deployment Agent (Standard/Undefined)
---
description: Deployment helper.
permission:
skill:
"*": "deny"
"deploy-checklist": "allow"
---
You are a deployment specialist...</examples>