cao-plugin
Skill1.4k starsChanged 2 months agoApache-2.0View on GitHub
Create 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.
- Reads credentials
- Installs packages
Trending
Quiet since October.about the whole repository
Who's talking about awslabs/cli-agent-orchestrator
- theplenkov-forks/cli-agent-orchestrator“Add Devin CLI provider”GitHub · Jun 28, 2026 · 4 reactions
- theplenkov-forks/cli-agent-orchestrator“Add Devin CLI provider”GitHub · Jun 23, 2026 · 4 reactions
- pavelkrotkov/aipro“fix(v3): persist CAO attribution for each accepted turn”GitHub · Sep 19, 2026 · 1 reactions
- theplenkov-forks/cli-agent-orchestrator“[feat] Official devcontainer feature for CAO”GitHub · Apr 3, 2026 · 1 reactions
- theplenkov-forks/cli-agent-orchestrator“[feat] Non-interactive / headless mode for containerized deployments”GitHub · Apr 3, 2026 · 1 reactions
The biggest 5 of 20 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 20
Talked about on GitHub (20 times).
On GitHub · 20
- Jun 28, 2026Add Devin CLI provider — theplenkov-forks/cli-agent-orchestrator4 reactions · 31 comments
- Jun 23, 2026Add Devin CLI provider — theplenkov-forks/cli-agent-orchestrator4 reactions · 30 comments
- Sep 19, 2026fix(v3): persist CAO attribution for each accepted turn — pavelkrotkov/aipro1 reaction · 1 comment
- Apr 3, 2026[feat] Official devcontainer feature for CAO — theplenkov-forks/cli-agent-orchestrator1 reaction
- Apr 3, 2026[feat] Non-interactive / headless mode for containerized deployments — theplenkov-forks/cli-agent-orchestrator1 reaction
15 more on GitHub
- Apr 3, 2026[feat] Make CORS origins configurable — theplenkov-forks/cli-agent-orchestrator1 reaction
- Apr 3, 2026[bug] tmux PTY attach inherits TERM=dumb in container environments — theplenkov-forks/cli-agent-orchestrator1 reaction
- Apr 3, 2026[bug] WebSocket PTY rejects connections from Docker bridge IPs — theplenkov-forks/cli-agent-orchestrator1 reaction
- Apr 3, 2026[feat] Add Devin CLI provider — theplenkov-forks/cli-agent-orchestrator1 reaction · 1 comment
- Apr 3, 2026[feat] Plugin/provider extension API — register providers without patching source — theplenkov-forks/cli-agent-orchestrator1 reaction
- Oct 4, 2026agent-plugins.github.awslabs.cli-agent-orchestrator: init at 2.5.1 — sudosubin/agents.nix0 reactions
- Oct 3, 2026agent-skills.github.awslabs.cli-agent-orchestrator: v2.5.1 → refs/tags/v2.5.1 — sudosubin/agents.nix0 reactions
- Oct 3, 2026Code review of a python segfault fix caused "cybersecurity prevention" — openai/codex0 reactions · 1 comment
- Sep 25, 2026agent-skills.github.awslabs.cli-agent-orchestrator: init at 2.5.1 — sudosubin/agents.nix0 reactions
- Sep 18, 2026RFC: modernize Passdown orchestration for ACP and cross-provider agents — vunm-io/passdown0 reactions · 8 comments
- Sep 10, 2026Add September 10 verified AI CLI discoveries — hasnocool/AI-CLI-Catalog0 reactions · 2 comments
- Jul 20, 2026feat: add CLI Agent Orchestrator (CAO) integration — ag-ui-protocol/ag-ui0 reactions · 8 comments
- Jul 20, 2026feat: add CLI Agent Orchestrator (CAO) integration — plauzy/ag-ui0 reactions · 2 comments
- Jul 20, 2026fix(cao-integration): canonical awslabs link + recurrence guard (P0-3, F-SL4) — plauzy/ag-ui0 reactions · 1 comment
- Apr 3, 2026[feat] Plugin/provider extension API — register providers without patching source — theplenkov-forks/cli-agent-orchestrator0 reactions · 1 comment
In this repository52 other files it gives its agents.
- cao-pluginSkill
- cao-providerSkill
- cao-agent-routingSkill
- cao-session-managementSkill
- cao-supervisor-protocolsSkill
- cao-worker-protocolsSkill
- aidlc-portfolioSkill
- agui-authorSkill
- cao-agent-routingSkill
- cao-contributingSkill
- cao-learningSkill
- cao-mcp-appsSkill
- cao-memorySkill
- cao-pluginSkill
- cao-providerSkill
- cao-session-livenessSkill
- cao-session-managementSkill
- cao-supervisor-protocolsSkill
- cao-worker-protocolsSkill
- cao-workflowSkill
- mcp-apps-builderSkill
- agui-authorSkill
- cao-agent-routingSkill
- cao-contributingSkill
- cao-learningSkill
- cao-mcp-appsSkill
- cao-memorySkill
- cao-providerSkill
- cao-session-livenessSkill
- cao-session-managementSkill
- cao-supervisor-protocolsSkill
- cao-worker-protocolsSkill
- cao-workflowSkill
- mcp-apps-builderSkill
- migrate-agent-pluginSkill
- alphaSkill
- alphaSkill
- alphaSkill
- alphaSkill
- alphaSkill
- alphaSkill
- alphaSkill
- alphaSkill
- alphaSkill
- alphaSkill
- escaped-skillSkill
- alphaSkill
- alphaSkill
- betaSkill
- not-the-folder-nameSkill
- alphaSkill
- linkedSkill
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 5 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 54
Must subclass CaoPlugin from cli_agent_orchestrator.plugins.
- Very specific: line 55
Must be zero-arg constructible — the registry instantiates plugins with cls().
- Very specific: line 58
No other methods are required.
- Distinctive: line 89
No CAO-side configuration is required to enable a plugin — installation plus entry-point declaration is sufficient.
- Very specific: line 93
Use hatchling as the build backend to match CAO's toolchain.
- Distinctive: line 138
All dispatch is async — hooks are awaited sequentially per event but no ordering is guaranteed across plugins or within a plugin.
- Distinctive: line 139
No filtering API — every hook registered for an event type receives every event of that type.
- Distinctive: line 140
No delivery guarantees beyond "invoked once per successful dispatch" — plugins are responsible for their own retries, buffering, and error …
- Very specific: line 146
Create the layout from §1.
- Very specific: line 170
Keep teardown() robust to partial setup() failures — guard any resource access with hasattr or an initialized flag.
- Very specific: line 178
Add the [project.entry-points."cao.plugins"] section to pyproject.toml per §4.
- Distinctive: line 249
When your plugin is complete, verify:
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CAO Plugin Creator
Guide for creating a new CAO plugin. A "plugin" is a Python package installed alongside CAO that subscribes to CAO lifecycle and messaging events via typed async hooks.
What You're Building
A CAO plugin is a standalone Python package that:
- Subclasses
CaoPluginfromcli_agent_orchestrator.plugins - Registers async hook methods with
@hook("<event_type>")decorators - Is discovered via the
cao.pluginsPython entry-point group atcao-serverstartup - Runs fire-and-forget — plugin exceptions are caught and logged as warnings, never propagated back into CAO
Typical uses: forwarding inter-agent messages to chat apps, logging/observability, external dashboards, metrics export, alerting on session or terminal lifecycle.
Before You Start
Gather this information:
- Which events do you need? See
references/hook-events.mdfor the full catalog. - Does the plugin need persistent state across events? (HTTP client, DB connection, buffer) — if so, use
setup()/teardown(). - How is it configured? v1 has no injected config API — read env vars in
setup(), optionally viapython-dotenv. - What are the failure semantics of your integration? Remember CAO swallows hook exceptions — you must decide whether to log, retry, or drop on your own.
Hard Requirements
These are the non-negotiable contracts a plugin must satisfy to be loaded and dispatched to. Verify each one before calling your plugin complete.
1. Package layout
Minimum viable layout:
my-cao-plugin/
├── pyproject.toml # Build config + entry-point declaration
├── my_cao_plugin/
│ ├── __init__.py # Can be empty
│ └── plugin.py # Contains the CaoPlugin subclass
├── tests/ # Optional but strongly recommended
│ └── test_plugin.py
├── env.template # Optional; only if the plugin reads env vars
└── README.md # Optional; install + config instructions for usersSee examples/plugins/cao-discord/ in this repo for a complete reference implementation.
2. Plugin class contract
- Must subclass
CaoPluginfromcli_agent_orchestrator.plugins. - Must be zero-arg constructible — the registry instantiates plugins with
cls(). Do NOT define__init__with required parameters. - May override
async def setup(self) -> None— called once atcao-serverstartup after instantiation. - May override
async def teardown(self) -> None— called once atcao-servershutdown. - No other methods are required. Hooks are opt-in via the
@hookdecorator.
A raising setup() disables that plugin for the lifetime of the server process (warning logged, other plugins continue to load). A raising teardown() is logged and does not stop other plugins from tearing down.
3. Hook method contract
A hook method must:
- Be
async def— sync hooks are not supported in v1. - Be decorated with
@hook("<event_type>")using the exact event-type string fromreferences/hook-events.md. - Accept exactly one positional argument: the typed event dataclass matching that event type.
- Return
None. - Be a regular method on the plugin class (the registry discovers hooks via
inspect.getmemberson the instance).
Multiple hook methods on the same plugin may subscribe to the same event type — each is dispatched independently. Execution order across hooks is not guaranteed.
Exceptions raised inside a hook are caught by the registry and logged as warnings. They do not affect CAO's primary operation and they do not stop other hooks for the same event from running.
4. Entry-point registration
Declare the plugin class under the cao.plugins entry-point group in pyproject.toml:
[project.entry-points."cao.plugins"]
my_plugin = "my_cao_plugin.plugin:MyPlugin"- The key (
my_plugin) is the plugin name used in CAO's startup log (Loaded CAO plugin: my_plugin). It has no other runtime effect. - The value must resolve to a class that is a subclass of
CaoPlugin. Entry points whose target is not aCaoPluginsubclass are skipped with a warning. - A single package may declare multiple entry points under
cao.pluginsif it ships multiple plugin classes.
No CAO-side configuration is required to enable a plugin — installation plus entry-point declaration is sufficient.
5. Build system
- Use
hatchlingas the build backend to match CAO's toolchain. - Target Python
>=3.10. - Declare
cli-agent-orchestratoras a runtime dependency soCaoPlugin,hook, and the event dataclasses are importable. - Declare any external libraries (e.g.
httpx,aiohttp,python-dotenv) your plugin uses.
Minimal pyproject.toml:
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "my-cao-plugin"
version = "0.1.0"
requires-python = ">=3.10"
dependencies = [
"cli-agent-orchestrator",
# ... your plugin's deps
]
[project.entry-points."cao.plugins"]
my_plugin = "my_cao_plugin.plugin:MyPlugin"6. Configuration
CAO does not inject configuration into plugins in v1. Options:
- Environment variables — read inside
setup()withos.environ.get(...). RaiseRuntimeErrorwith a clear message if a required var is missing so the startup log points the user at the misconfiguration. .envfiles — usepython-dotenv(load_dotenv(find_dotenv(usecwd=True))) insidesetup(). Process-level env vars override.envvalues, which is the expected precedence.- Config files — load any path you like inside
setup(); you own the format.
Ship an env.template alongside the plugin if it reads env vars, documenting every variable, whether it's required, and its default.
7. Lifecycle guarantees
setup()is awaited exactly once, after the plugin class is instantiated at server startup.teardown()is awaited exactly once at server shutdown, only for plugins whosesetup()succeeded.- There is no hot reload — changes to an installed plugin require restarting
cao-server. - Event dispatch only happens after the underlying CAO operation succeeds (e.g.
post_create_terminalfires after the terminal is persisted, not before). - There are no
pre_*hooks today — you cannot veto or mutate an operation from a plugin.
8. Dispatch semantics
- All dispatch is async — hooks are awaited sequentially per event but no ordering is guaranteed across plugins or within a plugin.
- No filtering API — every hook registered for an event type receives every event of that type; filter inside the handler if you need to.
- No delivery guarantees beyond "invoked once per successful dispatch" — plugins are responsible for their own retries, buffering, and error handling.
Step-by-Step Implementation
Step 1: Scaffold the package
Create the layout from §1. Populate pyproject.toml per §5. references/plugin-template.md has a copy-paste skeleton.
Step 2: Implement the plugin class
In my_cao_plugin/plugin.py:
from cli_agent_orchestrator.plugins import CaoPlugin, PostSendMessageEvent, hook
class MyPlugin(CaoPlugin):
async def setup(self) -> None:
# Read config, open clients. Raise on misconfiguration.
...
async def teardown(self) -> None:
# Close clients, flush buffers. Safe to call after failed setup.
...
@hook("post_send_message")
async def on_message(self, event: PostSendMessageEvent) -> None:
...Keep teardown() robust to partial setup() failures — guard any resource access with hasattr or an initialized flag. See examples/plugins/cao-discord/cao_discord/plugin.py for the pattern.
Step 3: Pick events and write handlers
Consult references/hook-events.md for the current event catalog, each event type's string, the matching dataclass, and available fields. Import event dataclasses from cli_agent_orchestrator.plugins.
Step 4: Register the entry point
Add the [project.entry-points."cao.plugins"] section to pyproject.toml per §4.
Step 5: Install into the CAO environment
The plugin must be importable by the same Python environment that runs cao-server.
# Editable install into the CAO dev virtual environment
uv pip install -e ./my-cao-plugin
# Or, if CAO was installed as a tool:
uv tool install --reinstall cli-agent-orchestrator \
--with-editable ./my-cao-pluginStep 6: Verify the plugin loads
Restart cao-server and check the startup log for one of:
Loaded CAO plugin: my_plugin— success.Failed to load plugin 'my_plugin'—setup()raised; check the traceback logged alongside.Plugin entry point 'my_plugin' is not a CaoPlugin subclass, skipping— the entry-point target is wrong.No CAO plugins registered (cao.plugins entry point group is empty)— the entry point is not declared, or the package was not installed into the same environment as CAO.
Step 7: Write unit tests
Unit tests for a plugin are straightforward because event dataclasses are zero-arg constructible:
import pytest
from cli_agent_orchestrator.plugins import PostSendMessageEvent
from my_cao_plugin.plugin import MyPlugin
@pytest.mark.asyncio
async def test_on_message_dispatches(monkeypatch):
plugin = MyPlugin()
await plugin.setup()
await plugin.on_message(
PostSendMessageEvent(
sender="a",
receiver="b",
message="hi",
orchestration_type="send_message",
)
)
await plugin.teardown()For plugins that make HTTP calls, use httpx.MockTransport (see examples/plugins/cao-discord/tests/test_plugin.py) rather than real network calls. Assert side-effects (requests sent, logs emitted) — do not assert CAO-side dispatch wiring, which is covered by CAO's own registry tests.
Install & Verify
Reload the plugin after code changes:
# Stop cao-server, then reinstall if dependencies changed:
uv pip install -e ./my-cao-plugin --force-reinstall --no-deps
# Then restart cao-server.Troubleshooting checklist if Loaded CAO plugin: does not appear:
- Is the package installed in the same venv that runs
cao-server? (uv pip list | grep my-cao-plugin) - Does
pyproject.tomlcontain[project.entry-points."cao.plugins"]? - Does the entry-point value point to an actual
CaoPluginsubclass? (python -c "from my_cao_plugin.plugin import MyPlugin; print(MyPlugin.__mro__)") - Did
setup()raise? Checkcao-serverlogs for aFailed to load pluginwarning. - If using
.env, is it in the directory wherecao-serverwas launched (or a parent)?
File Checklist
When your plugin is complete, verify:
pyproject.toml—hatchlingbuild backend,cli-agent-orchestratordependency,cao.pluginsentry pointmy_cao_plugin/__init__.py— present (can be empty)my_cao_plugin/plugin.py—CaoPluginsubclass with zero-arg construction and at least one@hook-decorated async methodenv.template— if any env vars are readtests/test_plugin.py— setup/teardown happy and failure paths; at least one test per hook methodREADME.md— install commands, config vars, troubleshooting- Plugin installs and shows
Loaded CAO plugin:incao-serverstartup logs
References
references/hook-events.md— Full catalog of supported event types, their string identifiers, and event dataclass fields.references/plugin-template.md— Annotated minimal plugin skeleton.examples/plugins/cao-discord/— Complete reference plugin (webhook forwarder with.envconfig, HTTP client lifecycle, unit tests).docs/feat-plugin-hooks-design.md— Full design document for the plugin system.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

