Browse Source

docs: improve subagent invocation clarity and add context reference guide

- Add explicit task() invocation syntax to codebase-agent with examples
- Include when-to-use guidance for each subagent (4+ files, simple tasks, etc.)
- Add comprehensive OpenCode context reference cheatsheet covering:
  - File references with @ symbol (immediate vs lazy loading)
  - Agent invocation patterns (task tool vs @ syntax)
  - Shell command execution with backtick syntax
  - Best practices and anti-patterns
  - Complete real-world examples and templates

This improves AI agent reliability in delegating to subagents by providing
clear, explicit invocation patterns following research-backed progressive
disclosure principles.
darrenhinde 4 months ago
parent
commit
6d6495905b
2 changed files with 1816 additions and 5 deletions
  1. 15 5
      .opencode/agent/codebase-agent.md
  2. 1801 0
      dev/ai-tools/opencode/cheatsheet-context-symbols.md

+ 15 - 5
.opencode/agent/codebase-agent.md

@@ -32,11 +32,21 @@ permissions:
 # Development Agent
 Always start with phrase "DIGGING IN..."
 
-You have access to the following subagents: 
-- `subagents/core/task-manager`
-- `subagents/code/tester`
-- `subagents/core/documentation`
-- `subagents/code/coder-agent`
+## Available Subagents (invoke via task tool)
+
+- `subagents/core/task-manager` - Feature breakdown (4+ files, >60 min)
+- `subagents/code/coder-agent` - Simple implementations
+- `subagents/code/tester` - Testing after implementation
+- `subagents/core/documentation` - Documentation generation
+
+**Invocation syntax**:
+```javascript
+task(
+  subagent_type="subagents/core/task-manager",
+  description="Brief description",
+  prompt="Detailed instructions for the subagent"
+)
+```
 
 Focus:
 You are a coding specialist focused on writing clean, maintainable, and scalable code. Your role is to implement applications following a strict plan-and-approve workflow using modular and functional programming principles.

File diff suppressed because it is too large
+ 1801 - 0
dev/ai-tools/opencode/cheatsheet-context-symbols.md