How a name resolves
A skill asks for a name. The reference command finds every file that holds it, orders them, and applies each one over
the ones below it. Each file is a contribution, and each place that holds contributions is a tier.
The tiers
Section titled “The tiers”From highest to lowest:
| Tier | Folder | Who it reaches |
|---|---|---|
| managed | references/ beside the managed-policy files of the detected harness, such as /etc/claude-code/references on Linux |
Every user of that harness on the machine |
| repo | .agents/references/ at the repository root |
Everyone working in the repository |
| user | ~/.agents/references/ |
One person, in every repository |
| plugin | Each plugin’s references/ folder |
Everyone who has the plugin |
| default | references/<name>.default.md in the folder of the skill loading the name |
Everyone who has the skill |
The managed tier is read only when detection names exactly one harness. With none or several, the trace says why it was not read.
The root is the nearest folder at or above the working folder that holds .git, a folder or a file, so a git
worktree counts. With no .git, the working folder is the root. --root sets it.
Which plugins are read
Section titled “Which plugins are read”A plugin layer is read for:
- the plugin running the command, such as
cyber-agentkititself; - each plugin the detected harness has enabled (read for Claude Code, Codex, and GitHub Copilot CLI);
- each dependency in the root’s
package.jsonthat has a plugin manifest.
A plugin is named by the name in its plugin manifest, never by its npm package name. A plugin that is installed but
not enabled is never read, because a reference is instruction text an agent follows.
Which skills’ defaults are read
Section titled “Which skills’ defaults are read”load, where, and customize read a skill’s defaults when you pass the skill’s folder with --default. The
reference skill does this for every skill that loads a name. list, search, and check also find the defaults of
the skills the detected harness reads: its project and user skill folders, its machine-wide skill folders, and each
enabled plugin’s skills. A skill is known by the name in its SKILL.md, not by its folder’s name.
The order contributions apply in
Section titled “The order contributions apply in”Contributions apply bottom first, each over the result of everything below it:
- The stack: the plugins and the skill’s default, in the order
extendsgives them. - The user contribution.
- The repo contribution.
- The managed contribution.
A higher contribution wins where they conflict. A repository’s text wins over a user’s, and an administrator’s wins over both.
When a user removes a section and the repository’s file also holds that section, the repository’s section comes back, because the repository applies after the user.
Merge operations
Section titled “Merge operations”Frontmatter merge says how a contribution applies over what is below it:
merge |
Effect |
|---|---|
patch (default) |
Keeps what is below, and puts each section’s text in place of the text it matches by heading |
combine |
Keeps what is below, and adds each section’s text after the text it matches |
replace |
Drops everything below; this contribution stands alone |
remove |
Drops everything below and turns the name off; its body is ignored with a warning |
Sections match by heading path, read from each document’s own top heading level, so # Review and ## Review match.
Matching ignores case and extra spaces.
Under patch:
- a section with empty text keeps the text below;
- a section that matches nothing is added at the end;
- its subsections replace the ones they match, and the others are kept.
Under combine, the lower text comes first, and subsections combine too. When any text was joined, the document opens
with one line saying that the later text wins where combined text conflicts:
Where these sections conflict, the later text wins.
## Steps
Run the tests, then tag the commit.
Read the changelog before you tag.A contribution with no body changes nothing, except with remove. When a remove is the last contribution with an
effect, the name is missing with the code reference-removed, and the trace names the remove.
One section at a time
Section titled “One section at a time”A marker on the line after a heading applies one operation to that section alone. A section with no marker takes its document’s operation:
## Weights<!-- merge: combine -->
- Tests: 30
## Rollback<!-- merge: remove -->An unknown merge value or marker is read as patch, with a warning. A marker that matches no section below warns
marker-unmatched, and its text goes at the end.
What a contribution builds on: extends
Section titled “What a contribution builds on: extends”Frontmatter extends lists what a contribution builds on, bottom first. A step is a plugin by its manifest name, or
default for the loading skill’s default:
---extends: [default, acme-release, house-style]---How the stack is chosen:
- The highest
extendswritten in the managed, repo, or user tier builds the stack. A plugin or the default it leaves out is not used. A lower tier’sextendsthat differs warnsextends-not-used. - With no
extendswritten in those tiers, the plugins’ ownextendsorder them, and the default sits lowest. - Plugins that nothing orders make the name
ambiguous. The answer lists each<plugin>/<name>, anddefault, as options. Customizing a reference shows how to settle it. - A plugin that holds the name, but that no repo or user
extendslists and nodeclinednames, warnsplugin-not-selected. A user-tierextendscan pick only plugins the harness has enabled. - A step not installed, or not holding the name, is skipped with a warning. When every step is missing, the
extendscounts as not written.
A contribution with extends and no body is a selection: it picks the stack and changes nothing else.
Steps with their own keys
Section titled “Steps with their own keys”A step can carry its own keys, as a one-key mapping:
extends: - acme-release - house-style: combine - review-kit: {merge: patch, extends: [], sections: [Checklist]}mergesets the operation for that step. A step’s operation is its ownmerge, else the file’s, elsepatch.extendsreplaces that plugin’s ownextends.sectionslimits the step to those top-level headings, each with its own operation. A heading the plugin lacks warnssection-not-held.
Building on another reference
Section titled “Building on another reference”A step can be <plugin>/<reference>, which brings that plugin’s file for a different reference. A bare plugin step
takes the name of the file whose extends lists it. Down the chain, that name follows the file being read. A chain
merges from the bottom up. A cycle makes the name ambiguous. When two steps build on the same base, that base applies
once.
Only a step written in a managed, repo, or user file may name another reference. A plugin’s own extends naming one is
skipped with extends-step-not-allowed.
Qualified names
Section titled “Qualified names”A qualified name, <plugin>/<name>, builds that plugin’s own stack. A written extends is not used for it. Managed,
repo, and user contributions still apply over it.
A skill’s default and the plugin’s copy
Section titled “A skill’s default and the plugin’s copy”A skill’s default, references/<name>.default.md, is a contribution like any other. It joins the stack as default.
- When no plugin holds the name, the default answers alone.
- When a plugin holds the name too, the default sits at the bottom of the stack and the plugin applies over it. With no
extendsnaming either, the name still answers, with adefault-not-selectedwarning that namesreference customize. - An
extendsthat lists the plugins and leaves outdefaultdrops the default.
A skill’s default is usually a copy of its plugin’s file. A plugin’s author keeps the copies in step with
reference defaults <skill folder>, run from the repository. It reads the skill’s loads, and for each one copies the
plugin’s references/<name>.md to the skill’s references/<name>.default.md, with default taken out of extends.
The body is copied as the plugin has it. An interface the skill loads is copied as <id>.interface.default.md. A data
reference, such as references/<name>.json, is copied byte for byte as <name>.default.json, and its metadata file
<name>.meta.md as <name>.default.meta.md.
For a skill triage in the plugin acme-bugs that loads acme-bugs.labels (paths shortened to <root>):
npx -y cyber-agentkit reference defaults plugins/acme-bugs/skills/triagefolder: <root>/plugins/acme-bugs/skills/triagepluginRoot: <root>/plugins/acme-bugsok: trueentries[1]{name,state,file,written}: acme-bugs.labels,current,references/acme-bugs.labels.default.md,trueWith --check it writes nothing, and fails with bundle-out-of-date when a copy is missing, stale, misnamed, or
no longer loaded by the skill (orphan). A name the plugin has no file for is unbundled, which is not a failure.
Orphans of every extension are reported and never deleted.
Interface documents are never composed
Section titled “Interface documents are never composed”An interface document, <id>.interface, is a contract, so it is never stacked. The lowest contribution answers: a
plugin’s document, else a repo or user copy, else a skill’s <id>.interface.default.md. A higher copy, and extends
or merge on one, is ignored with interface-not-composed. Two plugins holding one make it ambiguous. To change a
contract, define a new interface id.
Project sections
Section titled “Project sections”A .agents/references/<name>.md in a folder below the root, one that git does not ignore, is a project section for
that folder.
loaddelivers each one after the main document, in path order. In text it is wrapped as<project folder="packages/web">...</project>. In structured output it is a record inprojectSections.- A
package.jsonbelow the root that declares a plugin adds that plugin’s<name>.mdas a section for the folder, markedplugin="...", unless the plugin is already in the plugin tier. - The managed contribution applies over each section by heading. A managed
replaceorremovedrops them all. merge,extends,implements, andaliasesin a project section are ignored with a warning. A section is never checked against an interface.- When no main document exists but sections do, the name is
foundwith empty content.
Write one with --in <folder> on create, customize, delete, or where. The folder must be below the root, exist,
and not be ignored by git.
Data references
Section titled “Data references”A data reference answers whole. The highest tier holding the name answers with its file as written, and everything
below is shadowed. Sections, patch, and combine mean nothing inside JSON.
- A Markdown contribution above a data file is ignored with
format-mismatch, exceptmerge: remove, which turns the name off. - When one folder holds several files for a name, the first of
<name>.md,<name>/README.md,.json,.yaml,.yml,.toml,.txtanswers, and the others are ignored withfile-ignored. - A YAML or JSON file merges over the file below it, key by key, in two cases: its metadata file writes
extends, or a writtenextendslists it above another data file. Mappings merge, an array replaces the lower one whole, andnullremoves a key. The merged answer is written out again, so comments in the lower files do not survive. Both files must be the same format. - TOML and text answer whole. One that writes
extendswarnsdata-not-merged.
To change which file a skill uses, override by name. Say a skill ships permissions.default.json and another plugin
ships permissions.json. A selection (reference customize permissions --extends <plugin>), or a repo or user
permissions.json, decides which one answers.
Aliases and renames
Section titled “Aliases and renames”A plugin’s or a skill default’s file lists its older names in frontmatter aliases. A load of an older name resolves
to the new one with a reference-renamed warning. A repo or user file still filed under an older name applies as the new
name. aliases in a managed, repo, or user file is ignored with alias-invalid.
An interface document’s aliases list the interface’s older ids. Each is also an older name of the document, so a
plain reference that became the document of a many interface keeps its name:
---aliases: [project-tracker.contract]interface: cardinality: many version: 1 sections: [Tracker, Detect]---With that in project-tracker.capabilities.interface.md, reference load project-tracker.contract loads the
interface document, and implements: project-tracker.contract@1 still finds the interface. For a one interface, the
old id names the implementation, not the document.
When a name moves from one plugin to another, the receiving plugin lists the old pin, <old plugin>/<name>, in
aliases. A load of the old pin reaches the new plugin’s document with a reference-renamed warning, as long as the
old plugin no longer holds the name.
A rename that aliases cannot state, such as a plain document that became a one interface’s document, goes in the
plugin’s rename table. reference migrate applies it.
Names and statuses
Section titled “Names and statuses”A name is letters, digits, -, and ., optionally after <plugin>/. A name is invalid when it ends in .md,
.default, or .meta, is a path, or has any other character. Nothing is read for it, and the other names still resolve.
| Status | Code | Means |
|---|---|---|
found |
The composed document | |
missing |
reference-missing |
No contribution answers, or a qualified name’s plugin is not installed |
missing |
reference-removed |
A remove turned the name off on purpose |
ambiguous |
reference-ambiguous |
The contributions cannot be put in one order; options lists the choices |
invalid |
reference-invalid |
It is not a reference name |
Frontmatter
Section titled “Frontmatter”Frontmatter is read as YAML. Frontmatter that is not a YAML mapping is ignored with frontmatter-invalid.
| Key | Read by | Means |
|---|---|---|
description |
list, search, where |
One line on what the reference covers |
tags |
search |
Extra words to match |
merge |
the resolver | patch, combine, replace, or remove |
extends |
the resolver | What the contribution builds on, bottom first |
declined |
the resolver | Plugins a customizer left out on purpose, so they raise no plugin-not-selected |
aliases |
the resolver | Older names, in a plugin’s or a skill default’s file only |
interface |
check, implementations |
The contract, in an interface document only |
implements |
check, implementations |
<id>@<version> of the interface it fills |
sources, request |
load |
The record of a document customize generated |
Any other key passes into the composed metadata that load --metadata prints, and a higher contribution wins each key.