How to publish resource collections
Define a named collection in a registry so consumers can install a set of resources in one step.
Prerequisites
- A Git registry with one or more resources.
agent-marketplaceon yourPATH.
1. Create a collection definition
Each collection lives in its own folder under collections/, in a file named exactly COLLECTION.yaml. Put collections/ next to the registry's resources, at the root the consumer's source points at (the repository root, or the folder named by the source's path).
mkdir -p collections/platform-onboarding
cat > collections/platform-onboarding/COLLECTION.yaml << 'EOF'
name: platform-onboarding
description: Common starter resources for platform teams
resources:
- kind: skill
name: frontend-design
- kind: command
name: release
- kind: mcp
name: docs-server
EOFThe commands succeed silently and create collections/platform-onboarding/COLLECTION.yaml.
Consumers install the collection by its name. Members without a registry field come from the same registry as the collection. kind defaults to skill and accepts skill, command, subagent, hook, or mcp. The CLI skips a flat file such as collections/platform-onboarding.yaml.
2. Add members from another registry (optional)
A member can name a different registry with registry, plus optional ref and path:
resources:
- kind: command
name: release
registry: https://github.com/example-org/shared-commands.git
path: commandsThe consumer must already have that registry configured in one of their configuration layers, or the collection fails to expand. Without ref, the member uses the ref the consumer configured for that registry.
3. Add nested collections (optional)
A collection can include other collections with includes:
name: onboarding
includes:
- name: security
- name: platform
version: v1.2.0
resources:
- kind: skill
name: welcomeAn included collection can come from any registry the consumer has configured.
4. Check the collection
From the registry root, run:
agent-marketplace list --from . --kind collectionExpected output:
REGISTRY KIND NAME TAGS (metadata) STATUS
. collection platform-onboarding availableIf a COLLECTION.yaml has no name, is not valid YAML, or uses an unsupported member kind, the command fails and names the collection or member. list does not check that members exist or that their registries are configured; a missing member or unconfigured registry shows up when a consumer syncs or installs the collection.
5. Install the collection
In a consumer project:
agent-marketplace install platform-onboarding \
--kind collection \
--from https://github.com/example-org/agent-resources.git \
--ref v1.4.0This adds collection/platform-onboarding to the include list of that source in the consumer's configuration, then installs the members. Typical output:
Installed collection platform-onboarding in this repoBoundaries
- The collection itself is not written into any harness folder. Its members are.
- Nested collections may share children across branches. A collection that includes one of its own ancestors is a cycle, and the CLI rejects it.
versionis display-only. The CLI matches collections byname, because the source's ref already decides which revision of the registry is used.
Troubleshooting
resource or collection "platform-onboarding" not found in configured registries(ornot found in registry <registry-url>when installing with--from): check thatcollections/sits at the root of the consumer's source, inside itspathif it has one.- A member does not install: sync prints
warning: <kind> "<name>" was selected but not found, with a note that the collection references it. Check that the member'skindandnamematch a real resource and that the consumer has not excluded it.