# Conan

Recommend AXM extensions from a Conan (C, C++) package and target Conan packages from an extension.

AXM reads C/C++ extension metadata from a top-level `agentExtensions:` key in
`conandata.yml`. This is the
[two-way linking](/docs/package-ecosystems/overview) model applied to the Conan
ecosystem.

## Recommend extensions from a package

Add an `agentExtensions:` list to `conandata.yml`. Each entry is an extension
reference (`@owner/<type>/<name>`):

```yaml
# conandata.yml
agentExtensions:
  - { ref: "@examples/packs/cpp-conan-tinyflags" }
```

`conandata.yml` is exported alongside the recipe, so the recommendation travels
with your package.

Keep recommendations **identity-only** — omit `versionRange`. AXM resolves the
reference to the newest matching extension version and pins it in the user's
`axm.lock`. Prefer recommending a single **pack** so you keep one stable
reference while its contents evolve.

Add a semver `versionRange` only when your package genuinely pairs with a
bounded major line of the extension:

```yaml
agentExtensions:
  - { ref: "@examples/packs/cpp-conan-tinyflags", versionRange: "^1.0.0" }
```

## Target Conan packages from an extension

On the extension manifest (`skill.json`, `pack.json`, `subagent.json`, …), add a
`packages` array with a Conan [purl](https://github.com/package-url/purl-spec):

```jsonc
// pack.json
{
  "packages": [{ "purl": "pkg:conan/agentxm-example-tinyflags" }],
}
```

Use the Conan recipe name as the purl name.

### Version ranges

Default to identity-only. Add a [VERS](https://github.com/package-url/vers-spec)
`versionRange` with the `conan` scheme only when the extension depends on
package APIs introduced or removed in a known range:

```jsonc
{
  "packages": [
    {
      "purl": "pkg:conan/agentxm-example-tinyflags",
      "versionRange": "vers:conan/>=0.1.0|<1.0.0",
    },
  ],
}
```

## Official status

When the Conan package recommends an extension through the AgentXM Registry
**and** that extension names the package as a companion via its purl, AXM
derives **official** status for the pair — no extra flag. See
[Official extensions](/docs/package-ecosystems/overview#official-extensions).

## Reference fixture

The
[`cpp-conan-lib`](https://github.com/agentxm/polyglot-examples/tree/main/cpp-conan-lib)
and
[`cpp-conan-app`](https://github.com/agentxm/polyglot-examples/tree/main/cpp-conan-app)
directories in `polyglot-examples` are the working fixtures for everything
above. The package publishes a TinyFlags companion pack and recommends it from
the `agentExtensions:` key in `conandata.yml`; the pack and each skill declare
the package's `pkg:conan` purl as an identity-only companion package.