/cao-contributor:cao-providerfrom cao-contributor
Scaffolds a new CLI agent provider for CAO (CLI Agent Orchestrator), including provider class, regex patterns, status detection, and integration steps.
Ships in cao-contributor. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Guide for creating a new CLI agent provider for CLI Agent Orchestrator. A "provider" is an adapter that lets CAO interact with a specific CLI-based AI agent through tmux.
A provider translates between CAO's unified interface and a specific CLI tool's terminal output. It needs to:
Gather this information about the target CLI:
claude, kiro-cli chat, codex)> , ❯ , ask a question)⏺, inside a box, plain text)--dangerously-skip-permissions or similar flags?/exit, /quit, Ctrl+C)File: src/cli_agent_orchestrator/models/provider.py
class ProviderType(str, Enum):
# ... existing providers ...
NEW_CLI = "new_cli"
The value string is used everywhere — in API requests, database, config. Use snake_case.
File: src/cli_agent_orchestrator/providers/new_cli.py
Read references/provider-template.md for the full annotated template. The key sections:
Regex patterns — Define at module level, not inside methods. You need patterns for:
r"\x1b\[[0-9;]*m")⏺ for Claude Code)Status detection priority — The order in get_status() matters. Read references/lessons-learnt.md for the critical "stale buffer" lesson. The recommended pattern:
1. Strip ANSI codes from terminal output
2. Check WAITING_USER_ANSWER first (permission prompts need immediate attention)
3. Check COMPLETED (response marker + idle prompt both present in recent lines)
4. Check IDLE (just idle prompt, no response marker)
5. Check PROCESSING (spinner/thinking indicator in recent lines only)
6. Default to ERROR
Message extraction — Find the last response boundary in the terminal output and extract everything between it and the next prompt. Always strip ANSI codes from the final extracted text.
File: src/cli_agent_orchestrator/providers/manager.py
Add the import and elif branch:
from cli_agent_orchestrator.providers.new_cli import NewCliProvider
# In create_provider():
elif provider_type == ProviderType.NEW_CLI.value:
provider = NewCliProvider(
terminal_id, tmux_session, tmux_window, agent_profile, allowed_tools
)
File: src/cli_agent_orchestrator/cli/commands/launch.py
If the provider executes code or accesses the filesystem, add it:
PROVIDERS_REQUIRING_WORKSPACE_ACCESS = {
# ... existing ...
"new_cli",
}
Two separate questions, answered in two places. Read docs/tool-restrictions.md for full context.
How CAO delivers the policy (one of three mechanisms):
--disallowedTools, Copilot CLI --deny-tool, Grok --allow/--deny): add the provider to TOOL_MAPPING in src/cli_agent_orchestrator/utils/tool_mapping.py to translate CAO vocabulary to native tool names.allowedTools into the agent file at install time in its own vocabulary or the CLI's permission schema. No TOOL_MAPPING entry needed.TOOL_MAPPING entry needed.Whether the CLI then enforces it is a separate fact, recorded per provider in src/cli_agent_orchestrator/utils/enforcement.py (native, prompt, none) and shown to the operator on the launch gate. The mechanism does not decide it: OpenCode enforces its agent-file permission block (native, at install time), while Kiro is launched --trust-all-tools with tools: ["*"] and its allowedTools only suppresses approval prompts (none). Adding a provider means adding BOTH its delivery code and its PROVIDER_ENFORCEMENT row; test/test_enforcement_tables.py fails until the docs tables agree.
Only add a TOOL_MAPPING entry if the CLI has its own native tool names that differ from CAO's vocabulary.
Many CLIs show cascading prompts on first launch (workspace trust, permission bypass, terms acceptance). Handle these in initialize() or a dedicated _handle_startup_prompts() method using a polling loop — not a single check. See references/lessons-learnt.md #17 for the stabilization loop pattern. Also consider shell warm-up (#14) and TERM variable compatibility (#15).
File: test/providers/test_new_cli_unit.py
Read references/test-guide.md for the full test structure. Minimum coverage:
Use unittest.mock.patch to mock tmux_client. Create fixture files in test/providers/fixtures/.
Add test classes to existing e2e test files and a fixture in test/e2e/conftest.py. Read references/test-guide.md for the full list of e2e test classes to add.
This is the canonical multi-agent e2e test. It exercises assign (non-blocking), handoff (blocking), send_message (async inbox), and status detection under concurrent load. Use the examples/assign/ profiles:
cao install examples/assign/data_analyst.md
cao install examples/assign/report_generator.md
cao install examples/assign/analysis_supervisor.md
cao launch --agents analysis_supervisor --provider new_cli --auto-approve
Test flow: Supervisor assigns 3x data_analyst workers in parallel + handoff 1x report_generator (blocking) → analysts send_message results back to supervisor → supervisor combines template + results into final report.
If any step fails, investigate:
See test/e2e/test_assign.py for the automated version. Reference: https://github.com/awslabs/cli-agent-orchestrator/tree/feature/kimi-cli/examples/assign
Create docs/new-cli.md with prerequisites, launch examples, agent profile format, known limitations, and troubleshooting. Update README.md provider table and add a one-line changelog.d/<PR>.Added.md fragment.
When your provider is complete, verify you've touched all these files:
src/cli_agent_orchestrator/models/provider.py — ProviderType enumsrc/cli_agent_orchestrator/providers/new_cli.py — Provider classsrc/cli_agent_orchestrator/providers/manager.py — Import + elif branchsrc/cli_agent_orchestrator/cli/commands/launch.py — PROVIDERS_REQUIRING_WORKSPACE_ACCESSsrc/cli_agent_orchestrator/utils/tool_mapping.py — TOOL_MAPPING (only if CLI needs translation)test/providers/test_new_cli_unit.py — Unit teststest/providers/fixtures/new_cli_*.txt — Test fixturestest/e2e/conftest.py — require_new_cli fixturetest/e2e/test_*.py — E2E test classesdocs/new-cli.md — Provider documentationREADME.md — Provider tablechangelog.d/<PR>.Added.md — One-line new provider entryWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub awslabs/cli-agent-orchestrator --plugin cao-contributor3 skills in this plugin
/cao-contributingContribute changes to the CAO (CLI Agent Orchestrator) codebase — the local dev loop, the CI gate map, and the pre-PR checklist. Use when the user says "open a PR", "why did CI fail", "run the checks before I push", "the mypy/Code Quality job is red", "add a test and verify coverage", "bump a dependency", "the uv.lock diff is noisy", "a CVE blocks the dependency gate", or when making any code change intended to land on a branch/PR. Covers uv-based build/test/lint, lockfile and CVE-floor rules, the ci.yml jobs and their pass/fail semantics, and the golden rules that stop a green-locally / red-in-CI surprise. Not for authoring agent skills, building providers/plugins/MCP-apps, or operating running sessions./cao-event-pluginCreate a new CAO (CLI Agent Orchestrator) plugin. Use this skill whenever the user wants to add a plugin that reacts to CAO lifecycle or messaging events, scaffold a plugin package, understand plugin requirements, or integrate an external system (Discord, Slack, dashboards, logging, metrics) with CAO. Also use when the user asks what plugin events are available, how plugin discovery works, or how to install a plugin into a CAO environment.Other plugins' skills for the same job