/cao-contributor:cao-contributingfrom cao-contributor
Guides contributors through the CAO codebase's local dev loop, CI gate map, and pre-PR checklist. Covers uv-based build/test/lint, lockfile rules, CI job semantics, and golden rules to avoid green-local/red-CI surprises.
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.
How to make a change to the cli-agent-orchestrator codebase and get it through CI
cleanly. Read this before pushing a branch or opening a PR. The canonical human docs are
DEVELOPMENT.md,
CONTRIBUTING.md, and
CODEBASE.md —
this skill is the operational checklist that mirrors what CI actually enforces.
uv. uv sync --locked --all-extras --dev,
uv run pytest …, uv run mypy src/, uv run cao …. There is no bare pip workflow, and the venv CI
builds is the one uv manages. Repo scripts are documented in their own text as plain
python scripts/<name>.py (for example scripts/sync_skills.py, whose fix-up message
and test_skill_packaging_parity.py both quote that form) — run them as
uv run python scripts/<name>.py, which satisfies both.gh pr checks <number> for every workflow on the PR, or
gh run list --branch <branch> --workflow CI for ci.yml alone, then
gh run view <id> / gh run view <id> --log-failed..github/workflows/*.yml, pyproject.toml,
mypy.ini) — before concluding the cause is pre-existing or external. The signal is
often in your own diff (git diff <base>..HEAD -- .github/). A displaced one-line
workflow key can turn a tolerated warning into a hard failure, or the reverse.uv sync --locked --all-extras --dev # install (mirrors what CI does)
uv run pytest test/path/to/test_x.py # run targeted tests while iterating
uv run black src/ test/ # format (CI checks --check)
uv run isort src/ test/ # import order (CI checks --check-only)
uv run ruff check --config pyproject.toml --no-respect-gitignore src/ test/ examples/ .github/pr-review/ # dead code -- BLOCKING, and green on main
uv run python scripts/mypy_ratchet.py # type check -- the gate CI runs (see note below)
uv run mypy src/ # the raw mypy output, if you want to read it
Write tests RED-first: add a test that reproduces the bug/behavior and fails, then implement until it passes. New features and bug fixes ship with tests.
Keeping patch coverage at 100% for changed lines is a team convention, not a gate.
Nothing fails your build over it: the repo has no codecov.yml, so there is no configured
status check or target, and the Unit Tests job uploads coverage with
fail_ci_if_error: false — even a broken upload is tolerated. Treat the Codecov comment as
a review signal to justify, not a red gate to chase.
.github/workflows/ci.yml)Know which jobs are blocking vs tolerated so you can tell a real failure from
noise. test/test_cao_contributing_skill_accuracy.py fails if this table drifts from
ci.yml, so trust it — and if you rename a job, update it here.
| Job | Runs | Blocking? |
|---|---|---|
| Unit Tests (3.11 / 3.12) | uv run pytest test/ examples/workflow/tests/ examples/skills/tests/ examples/remote/ec2/tests/ --ignore=test/providers/test_kiro_cli_integration.py --ignore=test/e2e -m "not e2e" --cov=src/cli_agent_orchestrator --cov-branch --cov-fail-under=80 --cov-report=term-missing --cov-report=json -n auto --dist loadgroup | Yes |
| ↳ step: Validate Markdown links | uv run python scripts/validate_markdown_links.py — every relative link in every tracked .md, including skills/ | Yes |
| ↳ step: Check links inside each built agent plugin package | make check-agent-plugin-links — builds each agent-plugin/ package on its own and checks its links, including the generated README.md and CHANGELOG.md | Yes |
| Code Quality | black --check, isort --check-only, uv run ruff check --config pyproject.toml --no-respect-gitignore src/ test/ examples/ .github/pr-review/, then uv run python scripts/mypy_ratchet.py | Yes (all four; the mypy step's continue-on-error was removed in issue #1005) |
| AG-UI demo (shift-left recording) | boots a CAO_AGUI_ENABLED server, drives the viewer, records a GIF artifact | Yes |
| AG-UI construct demos (shift-left recordings) | same pattern for the L2 construct library | Yes |
| AG-UI stock-client live (AC3) | drives a real third-party AG-UI client against the surface | Yes |
| AG-UI operator dashboard | examples/ag-ui/ag-ui-operator-dashboard: installs tmux, then npm ci, test:dependencies, tsc, vitest with a 100% coverage floor on core/, vite build, and a keyless e2e against a private cao-server with mock_cli terminals | Yes |
| Agent Plugins dog-food (shift-left recording) | records the plugin pipeline from examples/agent-plugins/agent-plugins-dogfood/tools and gates on drift | Yes |
| CAO MCP Apps | MCP Apps build and frontend coverage summary | Yes |
| Coverage ratchet | reads the Unit Tests 3.12 Python report and MCP Apps frontend summary | Yes |
| CAO MCP Apps E2E (Playwright) | browser E2E over the ui://cao/* views | Yes |
| Rust TUI (Linux x86_64 / macOS arm64) | cargo test for the tui/ crate | Yes |
| Web UI Build | frontend build | Yes |
| AI-DLC Portfolio Example | example project builds | Yes |
| Security Scan | Trivy | Yes |
| CodeQL | GitHub Actions, JavaScript/TypeScript, Python, and Rust analysis and upload in the same CI run, including forks after required workflow approval | Yes — no project build; the hosted scan/status rules remain as documented in SECURITY.md |
| Dependency Security | Full locked npm, Bun, uv, and Cargo inventories, including development dependencies and unfixed advisories, classified against a shipped set measured from the builds; independent clean-install mitigation checks | Yes — every HIGH/CRITICAL finding in the shipped set (wheel runtime closure, bundled web/MCP App/docs packages, TUI crates, the decision-model-host CDK app's runtime packages), a malware advisory anywhere, a toolchain HIGH/CRITICAL with a fix that the PR adds or changes, or any scan, completeness or shipped-set error, fails; other toolchain-only findings are listed and do not block; locally, build the bundles first, then scripts/security-scan.sh dependencies with Trivy installed |
| Dependency Review | actions/dependency-review-action over the PR's dependency delta: fail-on-severity: high plus denied licences GPL-3.0/AGPL-3.0 | Yes — CI-only; there is nothing to run locally, and it is skipped on forks (if: github.repository == 'awslabs/cli-agent-orchestrator'), so a green run on your fork has not exercised it |
| Changed paths for filtered jobs | PRs compare base with tested head and fail closed if the diff cannot be read; pushes to main and merge queue entries select every filtered job | Yes |
| Antigravity provider tests | provider tests (3.11 / 3.12), path-selected | Yes when selected |
| Antigravity provider lint | black and isort block when selected; mypy is advisory (continue-on-error) | Yes when selected |
| Claude provider tests | provider tests (3.11 / 3.12), path-selected | Yes when selected |
| Claude provider lint | black and isort block when selected; mypy is advisory (continue-on-error) | Yes when selected |
| Codex provider tests | provider tests (3.11 / 3.12), path-selected | Yes when selected |
| Codex provider lint | black and isort block when selected; mypy is advisory (continue-on-error) | Yes when selected |
| Kiro provider tests | provider tests (3.11 / 3.12), path-selected | Yes when selected |
| Kiro provider lint | black and isort block when selected; mypy is advisory (continue-on-error) | Yes when selected |
| Transport simulator | transport example (3.11 / 3.12), path-selected | Yes when selected |
| Factory simulator | factory example (3.11 / 3.12), path-selected | Yes when selected |
| Docs site build | Docusaurus typecheck and build when docs paths change; production Pages deployment stays separate | Yes when selected |
| Filtered jobs gate | validates every selected job: only a no-match PR path result allows a skip | Yes |
| CI gate (advisory) | one pass/fail verdict over every other ci.yml job; filtered jobs may skip only when changed paths succeeded and did not select them; Dependency Review may skip outside upstream PRs | Yes — like the jobs above, a failure fails the CI run. No ruleset requires it yet (#1350 step 6). |
CodeQL's four language jobs are part of ci.yml, so Re-run all jobs includes
them. The standalone codeql.yml is only for weekly and manual scans; both use
the same maintainer-owned scan action. Existing PR branches must pick up the
current main workflow before their new CI runs use this wiring. Resolve merge
conflicts, update the branch, and approve fork workflows when required rather
than merely rerunning a CI run created before the change. An Expected
required check without an actual job is not a running scan.
Dependency Security also runs weekly and on manual dispatch through
dependency-security.yml, using the same action as CI. A passing local-patch
check does not exempt an open HIGH/CRITICAL advisory. See
SECURITY.md for inventory artifacts,
failure states, and the required-status rollout after the workflow lands.
The
-m "not e2e"on the CI command replaces your localaddopts— it does not compose with it. Since #1005 the two agree:addoptsis-m 'not e2e', so a default local run uses the same marker expression CI does — the path differences below are what still separates the two populations. Before that change,addoptsread-m 'not e2e and not integration', a strictly narrower marker than CI's, and a local run could be green while CI was red. If you override-myourself, compare deselected counts, not just pass counts.CI's selection is narrower than the marker alone implies. The same command passes
--ignore=test/providers/test_kiro_cli_integration.pyand--ignore=test/e2e, and--ignorewins over-m: that Kiro provider test needs an authenticated external CLI and never runs in CI. So mostintegration-marked tests do run in CI — but not that one, and nothing in CI covers it. If you change it, you have to run it yourself.
mypy is blocking, via a ratchet (issue #1005). The repo has known, pre-existing, repo-wide mypy errors — 177 of them in 22 files when the ratchet landed, concentrated in
services/agui/run_plane.py,utils/agent_profiles.py,utils/orchestration.py,mcp_server/server.py, andservices/vault/reader.py. They are frozen inmypy-baseline.jsonper file and per error code, andscripts/mypy_ratchet.pyfails only when a count rises. Therefore:
- Your change must add zero new mypy errors. Check the delta, not the raw count — which is exactly what
uv run python scripts/mypy_ratchet.pyreports. A new error in one file does not cancel out a fix in another; the comparison is per file per code.- Do not bundle unrelated repo-wide type-fixes into a feature PR (they belong in a dedicated cleanup PR) — but if you do fix some, run
uv run python scripts/mypy_ratchet.py --updateand commit the lowered baseline.- Raising the baseline needs a reviewer's explicit OK.
--updatewill write a higher number without complaint, so nothing but the review stops you. Prefer a# type: ignore[code]with a reason on the offending line, which is visible where the problem is.- Do not add
continue-on-errorto the mypy step. That key is the whole difference between a gate and a decoration, andtest/scripts/test_mypy_ratchet.pyasserts it stays absent from the Code Quality job.mypy.iniat the repo root is the config mypy actually loads. The[tool.mypy]section inpyproject.tomlis shadowed by it and has no effect — including itsstrict = true.
ci.yml is not the only workflow on a pull request: secret scanning, cargo-deny, the
per-provider suites, the two robotics examples, the docs site and zizmor gate too, and none of
them tolerates a failure. The full table, with the local command for each and the warning that
two checks can share a name, is in
references/pr-gating-workflows.md.
uv run pytest test/ is flaky locally — it needs a running server, tmux,
and real CLI binaries, and can hit a flaky OTel/gRPC abort. Run targeted test files
while iterating and lean on CI (the Unit Tests job) for breadth; get authoritative
missing-coverage lines from that job's term-missing output ∩ your diff. CI is not the
full suite, though — it excludes test/e2e and the Kiro provider integration test by
path (see the callout above), so those two are only ever covered by someone running them
deliberately.HOME and a throwaway CAO_HOME_DIR — HOME alone is not enough. The recipe,
and why its exact shape decides whether a failing run reports success, is in
references/test-isolation.md.TestClient must use base_url="http://localhost" — the Host-header /
DNS-rebinding guard returns 400 otherwise.examples/ag-ui/ag-ui-eventsource-viewer/tools) needs a
Chromium headless_shell matching the pinned @playwright/test version (npm run playwright:install), and boots its own CAO_AGUI_ENABLED server (npm ci brings ffmpeg
via ffmpeg-static). On Linux, also run npx playwright install-deps chromium. It gates
in CI, so you don't have to run it locally to land a change. The construct-demo recorder
is the sibling at examples/ag-ui/ag-ui-construct-demos/tools.A lockfile change should contain only the change you meant. These rules come from #1119, where each one cost time to rediscover.
setup-uv installs the latest
release and nothing pins a version, so run uvx uv@latest lock in every project whose
lockfile you change — git ls-files '*uv.lock' lists them, and it is more than the root one.
If git diff uv.lock changes the revision = header or the markers of packages you did not
touch, suspect your uv first: a local 0.12.20 once rewrote revision = 5 to 3, where
0.13.6 changed only the 4 intended lines. Confirm uvx uv@latest --version is really the
newest uv release. If that uv still rewrites the header, keep the change and say so in the
PR — an older uv (Dependabot's, say) wrote the committed lock, and no uv version gives a
quieter diff.pip install — for the base install. uv.lock governs
uv sync, not what pip resolves from the published metadata. The gate scans far more than
the base install, though, so find out where the package sits before you declare anything:
uv export --frozen --no-dev --no-hashes | grep -i '^<name>==' (grep the PEP 503 normalised
name — lowercase, _ and . as - — which is how uv export prints it). A match means the
base install gets it (check its marker, if any), and a CVE fixed only by bumping it
transitively in the lock also needs a floor in [project].dependencies, with a comment
naming the CVE and the dependency path, as cryptography and dnspython do in
pyproject.toml. No match? Re-run the export with --all-extras: a match there means an
extra, and the floor belongs in that extra's [project.optional-dependencies] list, not in
the base dependencies, which stay lean. Still no match means dev-only, and the lock bump is
the whole fix.uv build --wheel --clear, then
unzip -p dist/*.whl '*.dist-info/METADATA' | grep Requires-Dist. Keep the --clear (or
build into a fresh --out-dir): a plain uv build leaves earlier wheels in place, the glob
then expands to several, and unzip reads the first while treating the rest as member names.
It exits 11, but the pipe reports grep's status, so a floor read off a stale wheel looks
like a pass.SECURITY.md):
uv run python scripts/dependency_security.py (after npm run build in web/,
npm run build:all in cao_mcp_apps/ and npm run build in docusaurus/, which record
the shipped set). Every HIGH or CRITICAL finding in the shipped set blocks, and local
mitigations are not exemptions; a finding only in the build or test toolchain is listed
and does not block (see SECURITY.md, "Shipped set and toolchain findings").Five jobs in ci.yml run in mcr.microsoft.com/playwright:v<version>-noble@sha256:<digest>. The tag
is checked against each job's locked playwright-core, and the digest keeps a re-pushed tag from
changing what CI runs; test/test_playwright_image_matches_lockfiles.py requires both, on all five
jobs, with one digest. When a Playwright bump changes the locked version, change the tag and the
digest together:
curl -sS -D - -o /tmp/pw.json -H 'Accept: application/vnd.oci.image.index.v1+json' https://mcr.microsoft.com/v2/playwright/manifests/v<version>-noble
and read docker-content-digest from the headers.shasum -a 256 /tmp/pw.json must print the same
hash.v<old>-noble@sha256:<old digest> with the new value on every container: line that
names the image (grep -n 'playwright:v' .github/workflows/ci.yml lists them), then run
uv run pytest test/test_playwright_image_matches_lockfiles.py.uv run black src/ test/ && uv run isort src/ test/ (or --check to verify).uv run ruff check --config pyproject.toml --no-respect-gitignore src/ test/ examples/ .github/pr-review/ — must be clean. Blocking, like the mypy
ratchet, but with no tolerated backlog at all, so any finding is yours. Do not reach for
--fix on a pytest fixture re-import: ruff cannot see that pytest injects the name,
and removing it breaks collection (it turned test/decisions into 113 errors once).
Use # noqa: F401 # <reason> there. Selected rules and the deferred ones (F811, ARG,
B) are documented in pyproject.toml.uv run python scripts/mypy_ratchet.py — must print PASS. This is the blocking gate;
pre-existing errors are fine, new ones are not. If it reports improvements, run it again
with --update and commit mypy-baseline.json.uv run pytest <targeted files> green; add/keep tests for changed behavior..md, run uv run python scripts/validate_markdown_links.py —
a dead relative link fails the Unit Tests job, and skills/ is in scope. CAO has no
root AGENTS.md; the contributor map is CODEBASE.md.pyproject.toml or a uv lockfile, follow
Dependency and lockfile changes first. For npm, Bun or
Cargo lockfiles only rule 4, the dependency gate, applies — the rest of that section is
uv-specific.skills/, run uv run python scripts/sync_skills.py so the packaged mirror
stays in lockstep (test/test_skill_packaging_parity.py enforces it). A skill that also
ships in a plugin package under agent-plugin/ has a third copy: rebuild it with
make agent-plugin-keep-pin (build_agent_plugin.py --keep-committed-pin), commit
agent-plugin/, and finish with make check-agent-plugin and
make check-agent-plugin-links, or the Unit Tests job's steps of those names go red
(the second step is named "Check links inside each built agent plugin package"). It rebuilds at the version the committed packages already pin,
because the release workflow's regenerate-agent-plugin job moves that pin after
publishing and a contributor PR should not; it contacts no PyPI, and it refuses with the
reason when the committed packages disagree. git diff agent-plugin/ should then show
only your skill edit.main.gh pr create / gh pr checks.SKILL.md, frontmatter, evals) → no shipped skill covers this
yet; follow the Agent Skills specification directly.What 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-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./cao-providerCreate a new CLI agent provider for CAO (CLI Agent Orchestrator). Use this skill whenever the user wants to add support for a new CLI-based AI agent (e.g., a new coding assistant CLI), integrate a new provider, or scaffold a provider implementation. Also use when the user asks about the provider architecture, what files to modify, or how providers work in CAO.Other plugins' skills for the same job