| source | https://github.com/juliusz-cwiakalski/agentic-delivery-os/blob/main/doc/guides/adding-tool-support.md |
|---|---|
| ados_distribution | internal |
This guide explains how to extend Agentic Delivery OS (ADOS) to support additional AI coding tools. The system uses a single source of truth architecture where .opencode/ contains canonical definitions, and build scripts generate tool-specific formats.
All agent and command definitions live in .opencode/:
.opencode/
├── agent/ # Agent definitions (canonical)
│ ├── pm.md
│ ├── coder.md
│ └── ...
└── command/ # Command definitions (canonical)
├── run-plan.md
├── write-spec.md
└── ...
Build scripts transform .opencode/ to tool-specific formats:
.ados-claude/— Claude Code plugin (generated)
Follow these steps to add support for a new AI coding tool (e.g., GitHub Copilot CLI, Codex, Cursor, Windsurf).
Investigate the target tool's format:
-
What format does it use?
- Markdown + YAML frontmatter?
- JSON configuration?
- Different directory structure?
-
What fields are required?
- Agent: name, description, model, tools?
- Command/Skill: name, description, prompt?
-
How are model assignments handled?
- Inline in definition?
- External config file?
-
Where should files live?
- What directory name?
- What file naming convention?
Example research findings for common tools:
| Tool | Format | Location | Model Assignment |
|---|---|---|---|
| Claude Code | Markdown + YAML | .ados-claude/agents/, .ados-claude/skills/ |
model in frontmatter |
| OpenCode | Markdown + YAML | .opencode/agent/, .opencode/command/ |
External config file |
| GitHub Copilot CLI | Markdown + YAML | .copilot/ (TBD) |
Inline or external |
Add a new frontmatter key for the tool in .opencode/agent/*.md and .opencode/command/*.md:
---
description: <agent description>
mode: all # OpenCode-specific
claude: # Claude Code-specific
model: opus
copilot: # NEW: Copilot CLI-specific
model: gpt-4 # or appropriate model
---Guidelines:
- Use the tool name as the key (e.g.,
copilot:,codex:,cursor:) - Keep it minimal — only what the tool needs
- OpenCode ignores unknown keys, maintaining backward compatibility
- Document the new key in AGENTS.md
Create scripts/build-<tool>-plugin.sh following this pattern:
#!/usr/bin/env bash
# ==============================================================================
# build-<tool>-plugin.sh - Generate <Tool> plugin from .opencode/ source
# ==============================================================================
set -euo pipefail
# Configuration
readonly TOOL="<tool>" # e.g., "copilot"
readonly SOURCE_DIR="${REPO_ROOT}/.opencode"
readonly OUTPUT_DIR="${REPO_ROOT}/.ados-${TOOL}"
# ... (see scripts/build-claude-plugin.sh for full implementation)Key functions:
transform_agent_frontmatter— Convert agent frontmatter from OpenCode to tool formattransform_command_to_skill— Convert commands to tool-specific skill format (if applicable)generate_manifest— Create tool-specific manifest or config fileapply_license_headers— Add ADOS license headers with source reference
Important:
- Make script idempotent (running twice produces identical output)
- Clean output directory before generation
- Handle missing tool-specific frontmatter gracefully (use defaults)
- Add extensibility documentation in comments
Add a verification job to .github/workflows/ci.yml:
jobs:
verify-<tool>-build:
name: Verify <Tool> plugin is current
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build <Tool> plugin
run: ./scripts/build-<tool>-plugin.sh
- name: Check for changes
run: |
if git diff --exit-code .ados-<tool>/; then
echo "✓ Generated plugin is current"
else
echo "::error::Generated plugin is stale. Run build script and commit."
exit 1
fi- README.md — Add section for new tool support
- AGENTS.md — Document new frontmatter key
- Create guide — Add tool-specific usage notes if needed
-
Build script:
- Run twice and verify identical output (idempotency)
- Verify all agents are generated
- Verify all commands/skills are generated
-
Tool compatibility:
- Test generated files with the target tool
- Verify model assignments are correct
- Verify body content is preserved
-
CI verification:
- Push a commit that modifies source without regenerating
- Verify CI fails with clear message
- Regenerate and commit
- Verify CI passes
Source (.opencode/agent/pm.md):
---
description: Orchestrate changes; manage tickets via MCP
mode: all
claude:
model: opus
---Target (.ados-<tool>/agents/pm.md):
---
name: pm
description: Orchestrate changes; manage tickets via MCP
model: opus
allowed-tools:
- Read
- Write
# ...
---Source (.opencode/command/run-plan.md):
---
description: Execute implementation plan phases
agent: coder
subtask: true
claude:
model: sonnet
---Target (.ados-<tool>/skills/run-plan/SKILL.md):
---
name: run-plan
description: Execute implementation plan phases
model: sonnet
allowed-tools:
- Read
- Write
# ...
---- Never manually edit generated files — they are overwritten by build script
- Modify
.opencode/files only — changes propagate to all tools - Commit generated output — keeps output in sync with source
- Mark generated files clearly — generated Markdown frontmatter must include
GENERATED FILE — DO NOT EDIT DIRECTLY, source path, and regeneration command
- Parameterize tool name — use
$TOOLvariable, not hardcoded paths - Consistent transformation interface — all tools use similar functions
- Document extension points — add comments explaining how to add new tools
- Per-tool model assignment — each tool specifies its own model preferences
- Fallback to defaults — if tool-specific model is absent, use default
- No build failures — missing frontmatter should not break the build
- Apply to all generated files — maintain ADOS licensing
- Include source reference — point back to original
.opencode/file - Include regeneration hint — tell contributors and AI agents to edit
.opencode/and run the generator - Format consistently — match existing header style
Problem: CI fails with "Generated plugin is stale" error.
Solution:
- Run the build script:
./scripts/build-<tool>-plugin.sh - Commit the changes:
git add .ados-<tool>/ && git commit
Problem: Agent uses default model instead of intended model.
Solution:
Add tool-specific frontmatter to .opencode/agent/<name>.md:
claude:
model: opusProblem: Running build twice produces different output.
Solution:
Check for:
- Non-deterministic ordering (use
sortwhere needed) - Timestamps or other dynamic values
- File system ordering issues
- AGENTS.md — Agent/command quick reference
- scripts/build-claude-plugin.sh — Reference implementation
- .github/workflows/ci.yml — CI verification example