Skip to content

Extends

The extends field in agentsmesh.yaml lets you inherit shared configuration from remote repositories, local paths, or git URLs. Extended config merges with your local canonical config during generation.

Configuration

extends:
# GitHub release tag
- name: company-rules
source: github:my-org/ai-config@v1.0.0
features: [rules, commands]
# GitLab repo
- name: platform-config
source: gitlab:infra/ai-standards@v2.3.1
features: [rules, permissions]
# Git SSH
- name: private-rules
source: git+ssh://git@github.com/org/config.git#main
features: [rules]
# Local directory (monorepo)
- name: shared-local
source: ../shared-ai-config
features: [rules, commands, mcp]

Fields

FieldTypeRequiredDescription
namestringYesIdentifier for this extends entry. Used in error messages.
sourcestringYesSource URL or path (see formats below).
versionstringNoVersion tag for remote sources (alternative to @tag in source).
targetstringNoHint for native format auto-discovery (e.g., claude-code).
featuresstring[]NoWhich features to inherit. Omit to inherit all.
pathstringNoSubdirectory within the source to look for config.
pickobjectNoCherry-pick specific named resources.

Source formats

FormatExample
GitHub shorthandgithub:org/repo@v1.0.0
GitHub (latest)github:org/repo
GitLab shorthandgitlab:group/repo@main
Git SSHgit+ssh://git@github.com/org/repo#main
Git HTTPSgit+https://github.com/org/repo.git#v2.0.0
Local path../shared-config or local:../shared-config

Cherry-picking specific resources

Use pick to inherit only specific named rules, commands, or agents from a source:

extends:
- name: selective-rules
source: github:org/big-config@v3.0.0
features: [rules, commands]
pick:
rules: [security, performance, testing]
commands: [commit, review]

Only the listed items are inherited; everything else in the source is ignored.

Cache behavior

Remote sources are cached in ~/.agentsmesh/cache/ after the first fetch. Subsequent generate runs use the cache.

To force a re-fetch:

Terminal window
agentsmesh generate --refresh-cache
agentsmesh generate --no-cache # alias

Merge precedence

When extends sources define resources that conflict with your local canonical config, the merge order is:

  1. Local .agentsmesh/ (highest priority — always wins)
  2. Installed packs (.agentsmesh/packs/)
  3. Extended sources (lowest priority)

This means your local overrides always take precedence over shared org config.

Installing extends via CLI

Instead of manually editing agentsmesh.yaml, you can use agentsmesh install --extends:

Terminal window
agentsmesh install github:org/base-config --extends

This adds the entry to agentsmesh.yaml automatically.