convert — AgentTeamsModule¶
Format migration utilities for converting existing agent teams between supported frameworks while preserving body prose. The CAI-based sibling path is interop; for a runtime compatibility layer that keeps the source canonical rather than migrating it, use bridge. The interoperability guide frames when to reach for each, and the CLI Reference documents the --convert-from surface.
Source:
agentteams/convert.py
Public Types¶
ConvertResult¶
Summary of a conversion run.
Fields:
converted: paths written (or that would be written in dry-run)skipped: paths skipped due to overwrite policy or classificationerrors: conversion errorsdry_run: whether writes were simulated
Property:
success:Truewhenerrorsis empty
Public Function¶
convert_team(source_dir, target_dir, target_framework, *, project_manifest=None, dry_run=False, overwrite=False, description=None)¶
Under write_policy: "orchestrator-only", read from the target's build-log or from description (the --description brief), it raises ValueError before writing (interop_write_policy.refuse_outside_interop). For claude and goose, the message names the --interop-from … --description command; for other frameworks, it says to regenerate natively. A build-log that exists but is unreadable counts as switched (it fails closed); a missing one reads as off. Conversion doesn't apply the policy.
Convert an existing team into a target framework format.
Args:
source_dir(Path): source agent directory.target_dir(Path): destination agent directory.target_framework(str): one ofcopilot-vscode,copilot-cli,claude, orgoose. (convert_team()itself accepts any framework id registered inagentteams/frameworks/registry.py, includingagents-md; the CLI —agentteams/cli/parser_validate.py— separately rejectsagents-mdas a--convert-from/--bridge-fromtarget, since its instructions-file emission is generate-only.)project_manifest(dict | None): optional context for adapter rendering.dry_run(bool): simulate write operations.overwrite(bool): overwrite existing files when true.
Returns:
ConvertResult
Raises:
ValueErrorfor unknown framework ids.FileNotFoundErrorwhen source directory does not exist.
Notes¶
- Preserves body prose while rewriting framework wrappers/front matter.
- The instructions file is placed at the adapter's
finalize_output_pathlocation —copilot-instructions.md,CLAUDE.md, or, forgoose, the repo-rootAGENTS.md(front matter stripped) — and rendered through the target adapter'srender_instructions_file. - Emits any adapter sidecars via
extra_output_files— e.g.goose's repo-root.goosehintsintegrator, capabilities reference, and resilient-runner script (see Framework Adapters). - Copies passthrough assets such as
SETUP-REQUIRED.mdandreferences/.
Goose target (--framework goose) — beta¶
Beta
Goose is a beta convert target; its emitted-artifact shapes are not yet covered by the stability policy.
Converting an existing team to Goose emits one recipe per agent under .goose/recipes/*.yaml, plus the repo-root AGENTS.md + .goosehints, a capabilities reference, and scripts/goose-run-resilient.py. The orchestrator's sub_recipes delegation is reconstructed from each agent's handoffs:
copilot-vscodesources keep handoffs inline in their agent files, so delegation wires fully (identical to a native--framework goosegeneration).claude/copilot-clisources strip handoffs at their own generation (handoffs live inreferences/runtime-handoffs.json), so they currently convert to valid but flat (un-delegated) recipes. Recovering that delegation from the sidecar is planned (see the handoff-recovery work).
convert_team synthesizes the team roster into manifest["output_files"] so the Goose adapter's _team_slugs can resolve delegation targets.