Configuration files and instructions for AI coding assistants like opencode, claude-code, and similar tools.
SECURITY NOTICE: This repository contains example configuration files with placeholder API keys. Never commit real API keys to git. Use environment variables ({env:VAR_NAME}) or the /connect command in opencode instead. See Security Warning below.
AGENTS.md- General instructions for AI coding agents to follow when working on tasksopencode/- Configuration for opencode TUIopencode.json- Main configuration file with providers, MCP servers, permissions, and agentscommands/- Slash commands for common workflows (standup, mail, orchestration, review)prompts/- Agent system prompts (boss, altboss, worker, coworker, reviewer, thinker, vision, covision, build)skills/- Reusable instruction modules for common tasks (git-checkpoint, mac-mail, standup-coordination, task-execution, frontend-design)
-
Clone this repo to a location of your choice (replace
<REPO_CLONE_PATH>with your preferred directory):git clone <repo-url> <REPO_CLONE_PATH>/agents # Example: git clone <repo-url> ~/repos/agents
-
Install opencode config files to the proper location (
~/.config/opencode/):Option A: Copy files (simplest)
mkdir -p ~/.config/opencode/commands cp <REPO_CLONE_PATH>/agents/opencode/opencode.json ~/.config/opencode/ cp <REPO_CLONE_PATH>/agents/opencode/commands/*.md ~/.config/opencode/commands/ mkdir -p ~/.config/opencode/prompts cp <REPO_CLONE_PATH>/agents/opencode/prompts/*.md ~/.config/opencode/prompts/ cp -r <REPO_CLONE_PATH>/agents/opencode/skills/* ~/.config/opencode/skills/
Option B: Create symlinks (keeps files in sync with repo)
mkdir -p ~/.config/opencode/commands ln -sf <REPO_CLONE_PATH>/agents/opencode/opencode.json ~/.config/opencode/opencode.json for f in <REPO_CLONE_PATH>/agents/opencode/commands/*.md; do ln -sf "$f" ~/.config/opencode/commands/ done mkdir -p ~/.config/opencode/prompts for f in <REPO_CLONE_PATH>/agents/opencode/prompts/*.md; do ln -sf "$f" ~/.config/opencode/prompts/ done mkdir -p ~/.config/opencode/skills for d in <REPO_CLONE_PATH>/agents/opencode/skills/*/; do skill_name=$(basename "$d") ln -sf "$d" ~/.config/opencode/skills/"$skill_name" done
-
Configure placeholder values in
~/.config/opencode/opencode.json:- Replace
<YOUR_*_MODEL>placeholders with your preferred models - Replace
<YOUR_WORKING_DIR>with your projects directory - API keys - See Security Warning below
- Replace
DO NOT paste API keys directly into opencode.json if this file is in a git repository or shared location.
Use environment variables instead:
{
"provider": {
"google": {
"options": { "apiKey": "{env:GOOGLE_GEMINI_API_KEY}" }
}
}
}Then set in your shell profile:
export GOOGLE_GEMINI_API_KEY="your-key-here"The boss orchestration system uses a Plan → Delegate → Validate → Re-delegate cycle with specialized subagents for different tasks. All coordination happens through standup.md with timestamped [boss HH:MM] markers.
flowchart TB
subgraph BOSS["Boss (Orchestrator)"]
direction TB
P["Plan<br/>(read standup.md)"] --> D[Delegate]
D --> V["Validate<br/>(spawn reviewer)"]
V --> R{Reviewer<br/>verdict?}
R -->|PASS| DONE[Task Complete]
R -->|FAIL| LIMIT{Round<br/>over 10?}
LIMIT -->|Yes| USER["ESCALATE<br/>to user"]
LIMIT -->|No| R3{Round 3?}
R3 -->|Yes| TK["Consult Thinker<br/>(diagnose, new strategy)"]
TK --> RD
R3 -->|No| CAP{Capacity<br/>failure?}
CAP -->|Yes| ESC["Switch to<br/>Coworker"]
ESC --> RD
CAP -->|No| RD["Re-delegate<br/>(worker or coworker)"]
RD --> V
end
subgraph SUBAGENTS["Subagents"]
direction LR
W["Worker<br/>128k / 32k"]
CW["Coworker<br/>400k / 128k"]
RV["Reviewer<br/>Fresh Context"]
T["Thinker<br/>Read-only"]
VV["Vision<br/>128k / 64k"]
CV["Covision<br/>256k / 96k"]
end
subgraph TASKS["Task Routing"]
direction LR
CODE[Code / Writing / Config]
VISUAL[Visual / PDFs / Screenshots]
end
CODE --> W
VISUAL --> VV
VV -.->|overflow| CV
D -->|spawn| W
D -->|spawn| VV
D -->|spawn| CW
W -->|done| V
CW -->|done| V
VV -->|done| V
CV -->|done| V
V -->|spawn| RV
RV -->|verdict| R
P -.->|"5+ tasks or<br/>complex session"| T
TK -.->|spawn| T
style BOSS fill:#e1f5fe,stroke:#01579b
style SUBAGENTS fill:#f3e5f5,stroke:#4a148c
style TASKS fill:#e8f5e9,stroke:#1b5e20
style USER fill:#ffcdd2,stroke:#b71c1c
style TK fill:#fff9c4,stroke:#f57f17
style ESC fill:#fff9c4,stroke:#f57f17
- Plan: Boss reads standup.md and creates an execution plan. For 5+ tasks, unfamiliar codebases, or unclear dependencies, boss consults
thinker(read-only strategic planner) for a structured plan. - Delegate: Boss spawns subagents in parallel for independent tasks. Tasks sharing files or with dependencies are grouped into the same subagent instance.
- Code/config/writing tasks →
worker(cost-effective, 128k context) - Visual tasks (PDFs, DevTools, screenshots) →
vision(128k context);covisionfor heavy payloads (256k context)
- Code/config/writing tasks →
- Validate: Boss always delegates verification to
reviewer(never reviews itself). Reviewer gets fresh context, the original acceptance criteria, and file paths changed. Multiple reviewers can run in parallel for independent tasks. - Re-delegate (max 10 rounds per task): If reviewer returns FAIL, boss spawns worker again with all prior reviewer findings accumulated (not just the latest) to prevent regressions.
- Round 3 trigger: On the 3rd failure, boss consults
thinkerbefore round 4. Thinker diagnoses the stuck approach and suggests a new strategy. Boss writes[boss HH:MM] THINKER CONSULTED:marker. - Coworker escalation: If worker hits context/output limits (truncated output, HANDOFF, "context limit"), boss escalates to
coworker(400k context, 128k output) and continues the loop with coworker in place of worker. Boss writes[boss HH:MM] ESCALATED TO COWORKER:marker.
- Round 3 trigger: On the 3rd failure, boss consults
- Escalate: If a task still fails after 10 rounds, boss marks
[boss HH:MM] ESCALATE:for user attention.
| Agent | Context | Output | Purpose |
|---|---|---|---|
| worker | 128k | 32k | Cost-effective task execution |
| coworker | 400k | 128k | Fallback for complex/large tasks (3x context, 4x output) |
| reviewer | 128k | 32k | Independent quality verification |
| vision | 128k | 64k | Visual tasks, screenshots, PDFs |
| covision | 256k | 96k | Heavy visual payloads, large PDFs |
| thinker | varies | varies | Read-only strategic planning |
/go-boss # Start boss orchestration (recommended)
/go-altboss # Alternative boss with different model
/review-loop # Fresh-eyes review: N workers sequentially review/fix| Agent | Mode | Model | Purpose |
|---|---|---|---|
task |
primary | <YOUR_PREFERRED_TASK_MODEL> |
Default task execution |
build |
primary | <YOUR_STRONGER_MODEL> |
Code implementation and writing |
plan |
primary | <YOUR_STRONGER_MODEL> |
Planning and architecture |
boss |
primary | <YOUR_STRONGER_MODEL> |
Orchestration with Plan/Delegate/Validate/Re-delegate |
altboss |
primary | <YOUR_STRONGER_MODEL> |
Alternative boss with different model |
simple |
primary | <YOUR_LIGHTWEIGHT_MODEL> |
Simple tasks with minimal overhead |
worker |
subagent | <YOUR_WORKER_MODEL> |
Cost-effective task execution |
coworker |
subagent | <YOUR_FALLBACK_MODEL> |
Fallback for complex tasks |
reviewer |
subagent | <YOUR_WORKER_MODEL> |
Independent quality verification |
thinker |
subagent | <YOUR_STRONGER_MODEL> |
Read-only strategic planning |
vision |
subagent | <YOUR_VISION_MODEL> |
Visual tasks and PDF analysis |
covision |
subagent | <YOUR_HEAVY_VISION_MODEL> |
Heavy-duty visual fallback |
| Command | Description |
|---|---|
/go-boss |
Start boss orchestration with Plan/Delegate/Validate/Re-delegate cycle |
/go-altboss |
Start altboss orchestration (alternative model) |
/review-loop |
Fresh-eyes review loop: N workers sequentially review/fix subtasks |
/add-todo |
Create GitHub issues from DETAILED-TODO items (today/tomorrow) |
/add-done |
Add DONE items from closed issues/PRs (today/tomorrow) |
/standup-create |
Convert DETAILED-TODOs to standup TODO bullets |
/standup-update |
Update standup.md after completing tasks |
/open-standup |
Open Safari with project boards and issue/PR links |
/post-standup |
Post standup to Discord (test/prod/dry-run modes) |
| Command | Description |
|---|---|
/mail-search |
Search Apple Mail for emails and correspondence |
The configuration uses placeholders that you must customize:
<YOUR_WORKING_DIR>→ Your projects directory (e.g.,~/repos/)<MAIL_SCRIPT_PATH>→ Path to scripts directory<NOTES_PATH>→ Path to your notes directory
<YOUR_STRONGER_MODEL>→ Stronger model for orchestration<YOUR_WORKER_MODEL>→ Worker model for cost-effective execution<YOUR_FALLBACK_MODEL>→ Fallback model (400k context)<YOUR_VISION_MODEL>→ Vision model for visual tasks<YOUR_HEAVY_VISION_MODEL>→ Heavy vision model (256k context)
# If using symlinks, changes are automatic after restart
# If using copies:
cp <REPO_CLONE_PATH>/agents/opencode/opencode.json ~/.config/opencode/
cp <REPO_CLONE_PATH>/agents/opencode/commands/*.md ~/.config/opencode/commands/
cp <REPO_CLONE_PATH>/agents/opencode/prompts/*.md ~/.config/opencode/prompts/Config not loading:
- Verify files are in
~/.config/opencode/ - Check JSON syntax:
python -m json.tool ~/.config/opencode/opencode.json
Commands not appearing:
- Ensure command files are in
~/.config/opencode/commands/ - Check files have
.mdextension and proper frontmatter
Agent not found:
- Verify agent names match what you're invoking
- Check
modeis set correctly (primaryorsubagent)
MIT