From fc669c1b7433a442bb68fb7345ac907412a8ad92 Mon Sep 17 00:00:00 2001 From: Victor Kzam Date: Mon, 9 Mar 2026 13:13:56 +0000 Subject: [PATCH 1/4] fix(opencode): use plural agents/ directory per current conventions OpenCode docs now specify agents/ (plural) as the standard directory name; agent/ (singular) is legacy backwards-compat. Update the converter output path, installer source/dest paths, and .gitignore entry accordingly. --- .gitignore | 2 +- scripts/convert.sh | 4 ++-- scripts/install.sh | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index dc5cb89..6eb5135 100644 --- a/.gitignore +++ b/.gitignore @@ -69,7 +69,7 @@ NOTES.md integrations/antigravity/agency-*/ integrations/gemini-cli/skills/ integrations/gemini-cli/gemini-extension.json -integrations/opencode/agent/ +integrations/opencode/agents/ integrations/cursor/rules/ integrations/aider/CONVENTIONS.md integrations/windsurf/.windsurfrules diff --git a/scripts/convert.sh b/scripts/convert.sh index fb426a5..27e80db 100755 --- a/scripts/convert.sh +++ b/scripts/convert.sh @@ -137,8 +137,8 @@ convert_opencode() { slug="$(slugify "$name")" body="$(get_body "$file")" - outfile="$OUT_DIR/opencode/agent/${slug}.md" - mkdir -p "$OUT_DIR/opencode/agent" + outfile="$OUT_DIR/opencode/agents/${slug}.md" + mkdir -p "$OUT_DIR/opencode/agents" # OpenCode agent format: same as the source format (.md with frontmatter). # color field is supported. No conversion needed beyond directory placement. diff --git a/scripts/install.sh b/scripts/install.sh index b7c1939..3f701e7 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -306,8 +306,8 @@ install_gemini_cli() { } install_opencode() { - local src="$INTEGRATIONS/opencode/agent" - local dest="${PWD}/.opencode/agent" + local src="$INTEGRATIONS/opencode/agents" + local dest="${PWD}/.opencode/agents" local count=0 [[ -d "$src" ]] || { err "integrations/opencode missing. Run convert.sh first."; return 1; } mkdir -p "$dest" From d339b43763b06c1ab8631bcf0cbe707ad8bc68c5 Mon Sep 17 00:00:00 2001 From: Victor Kzam Date: Mon, 9 Mar 2026 13:14:23 +0000 Subject: [PATCH 2/4] fix(opencode): add color name-to-hex mapping for agent files OpenCode only accepts hex color codes (e.g. #00FFFF), not named colors (e.g. cyan). Add resolve_opencode_color() with a 14-entry lookup table and wire it into convert_opencode(). Colors already in hex pass through. --- scripts/convert.sh | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/scripts/convert.sh b/scripts/convert.sh index 27e80db..35ae9d4 100755 --- a/scripts/convert.sh +++ b/scripts/convert.sh @@ -127,21 +127,44 @@ ${body} HEREDOC } +# Map named colors to hex codes for OpenCode (which only accepts hex values). +# Colors already starting with '#' pass through unchanged. +resolve_opencode_color() { + local c="$1" + case "$c" in + cyan) echo "#00FFFF" ;; + blue) echo "#3498DB" ;; + green) echo "#2ECC71" ;; + red) echo "#E74C3C" ;; + purple) echo "#9B59B6" ;; + orange) echo "#F39C12" ;; + teal) echo "#008080" ;; + indigo) echo "#6366F1" ;; + pink) echo "#E84393" ;; + gold) echo "#EAB308" ;; + amber) echo "#F59E0B" ;; + neon-green) echo "#10B981" ;; + neon-cyan) echo "#06B6D4" ;; + metallic-blue) echo "#3B82F6" ;; + *) echo "$c" ;; # already hex or unknown — pass through + esac +} + convert_opencode() { local file="$1" local name description color slug outfile body name="$(get_field "name" "$file")" description="$(get_field "description" "$file")" - color="$(get_field "color" "$file")" + color="$(resolve_opencode_color "$(get_field "color" "$file")")" slug="$(slugify "$name")" body="$(get_body "$file")" outfile="$OUT_DIR/opencode/agents/${slug}.md" mkdir -p "$OUT_DIR/opencode/agents" - # OpenCode agent format: same as the source format (.md with frontmatter). - # color field is supported. No conversion needed beyond directory placement. + # OpenCode agent format: .md with YAML frontmatter in .opencode/agents/. + # Named colors are resolved to hex via resolve_opencode_color(). cat > "$outfile" < Date: Mon, 9 Mar 2026 13:14:40 +0000 Subject: [PATCH 3/4] fix(opencode): add mode: subagent to generated agent frontmatter Without mode: subagent, all 68 agents default to mode: all and appear as primary agents the user Tab-cycles through, making the UX unusable. With mode: subagent they are invoked on-demand via @agent-name. --- scripts/convert.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/convert.sh b/scripts/convert.sh index 35ae9d4..ae6e0bc 100755 --- a/scripts/convert.sh +++ b/scripts/convert.sh @@ -169,6 +169,7 @@ convert_opencode() { --- name: ${name} description: ${description} +mode: subagent color: ${color} --- ${body} From 43c66a7b89ca1b8997b64eb11061fb3007a4a95d Mon Sep 17 00:00:00 2001 From: Victor Kzam Date: Mon, 9 Mar 2026 13:15:11 +0000 Subject: [PATCH 4/4] docs(opencode): update integration docs for plural dirs and new frontmatter Reflect the switch to agents/ (plural), hex color codes, mode: subagent, and @agent-name invocation in both the OpenCode integration README and the main README's OpenCode section. --- README.md | 10 +++++----- integrations/opencode/README.md | 30 +++++++++++++++++------------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index b6cad18..5d6450e 100644 --- a/README.md +++ b/README.md @@ -341,7 +341,7 @@ The Agency works natively with Claude Code, and ships conversion + install scrip - **[Claude Code](https://claude.ai/code)** — native `.md` agents, no conversion needed → `~/.claude/agents/` - **[Antigravity](https://github.com/google-gemini/antigravity)** — `SKILL.md` per agent → `~/.gemini/antigravity/skills/` - **[Gemini CLI](https://github.com/google-gemini/gemini-cli)** — extension + `SKILL.md` files → `~/.gemini/extensions/agency-agents/` -- **[OpenCode](https://opencode.ai)** — `.md` agent files → `.opencode/agent/` +- **[OpenCode](https://opencode.ai)** — `.md` agent files → `.opencode/agents/` - **[Cursor](https://cursor.sh)** — `.mdc` rule files → `.cursor/rules/` - **[Aider](https://aider.chat)** — single `CONVENTIONS.md` → `./CONVENTIONS.md` - **[Windsurf](https://codeium.com/windsurf)** — single `.windsurfrules` → `./.windsurfrules` @@ -446,7 +446,7 @@ See [integrations/gemini-cli/README.md](integrations/gemini-cli/README.md) for d
OpenCode -Agents are placed in `.opencode/agent/` in your project root (project-scoped). +Agents are placed in `.opencode/agents/` in your project root (project-scoped). ```bash cd /your/project @@ -455,13 +455,13 @@ cd /your/project Or install globally: ```bash -mkdir -p ~/.config/opencode/agent -cp integrations/opencode/agent/*.md ~/.config/opencode/agent/ +mkdir -p ~/.config/opencode/agents +cp integrations/opencode/agents/*.md ~/.config/opencode/agents/ ``` Activate in OpenCode: ``` -Use the Backend Architect agent to design this API. +@backend-architect design this API. ``` See [integrations/opencode/README.md](integrations/opencode/README.md) for details. diff --git a/integrations/opencode/README.md b/integrations/opencode/README.md index a4a5db3..9d4f916 100644 --- a/integrations/opencode/README.md +++ b/integrations/opencode/README.md @@ -1,9 +1,9 @@ # OpenCode Integration -OpenCode uses the same agent format as Claude Code — `.md` files with YAML -frontmatter stored in `.opencode/agent/`. No conversion is technically -needed, but this integration packages the agents into the correct directory -structure for drop-in use. +OpenCode agents are `.md` files with YAML frontmatter stored in +`.opencode/agents/`. The converter maps named colors to hex codes and adds +`mode: subagent` so agents are invoked on-demand via `@agent-name` rather +than cluttering the primary agent picker. ## Install @@ -13,42 +13,46 @@ cd /your/project /path/to/agency-agents/scripts/install.sh --tool opencode ``` -This creates `.opencode/agent/.md` files in your project directory. +This creates `.opencode/agents/.md` files in your project directory. ## Activate an Agent -In OpenCode, reference an agent by its name or description: +In OpenCode, invoke a subagent with the `@` prefix: ``` -Use the Frontend Developer agent to help build this component. +@frontend-developer help build this component. ``` ``` -Activate the Reality Checker agent and review this PR. +@reality-checker review this PR. ``` You can also select agents from the OpenCode UI's agent picker. ## Agent Format -OpenCode agents use the same frontmatter as Claude Code: +Each generated agent file contains: ```yaml --- name: Frontend Developer description: Expert frontend developer specializing in modern web technologies... -color: cyan +mode: subagent +color: "#00FFFF" --- ``` +- **mode: subagent** — agent is available on-demand, not shown in the primary Tab-cycle list +- **color** — hex code (named colors from source files are converted automatically) + ## Project vs Global -Agents in `.opencode/agent/` are **project-scoped**. To make them available +Agents in `.opencode/agents/` are **project-scoped**. To make them available globally across all projects, copy them to your OpenCode config directory: ```bash -mkdir -p ~/.config/opencode/agent -cp integrations/opencode/agent/*.md ~/.config/opencode/agent/ +mkdir -p ~/.config/opencode/agents +cp integrations/opencode/agents/*.md ~/.config/opencode/agents/ ``` ## Regenerate