Skip to content

Authoring references

This page is for the author of a plugin or a skill. It covers what to put in a reference, where the file goes, and how a skill asks for it.

Move text out of SKILL.md into a reference when someone other than you should be able to change it: a checklist, a house style, the commands for one tracker, a set of weights. Keep in the skill what it cannot work without: when to use it, its purpose, and steps with no sensible alternative.

If the agent must decide from the task that it needs the text, it is a skill, not a reference. A reference is read only when something names it.

reference advise <path>... points at text an agent reads that hard-codes something a reference could hold. For the fixture skill file-bug of this site:

editable: true
files[1]{path,bytes}:
skills/file-bug/SKILL.md,248
leads[2]{file,line,category,kind,match,text,status}:
skills/file-bug/SKILL.md,8,provider,host,GitHub,"Run `gh issue create` to open the issue on GitHub, with the title `[Bug] <summary>`.",candidate
skills/file-bug/SKILL.md,8,tool,command,gh issue create,"Run `gh issue create` to open the issue on GitHub, with the title `[Bug] <summary>`.",candidate

Each lead is a candidate for you to judge, not a finding. The skill’s Advise mode reads the text, decides each one with you, and names the interface the text should depend on instead of the concrete provider.

A reference is top-level ## sections, with no # title over them, and a description in its frontmatter. Write instructions an agent follows, and leave the rationale out. Each heading is a place another tier can patch, so give each topic its own section.

---
description: Labels to put on a new bug.
tags: [triage, labels]
---
## Labels
`bug`, `needs-triage`

description and tags are what search matches, so always write a description.

Start the file with create. --plugin <plugin folder> writes into a plugin’s source folder in this repository:

Terminal window
npx -y cyber-agentkit reference create acme-bugs.labels --plugin plugins/acme-bugs --template labels.md
create flag Writes to
(none) .agents/references/<name>.md at the root, for everyone in the repository
--in <folder> <folder>/.agents/references/<name>.md, a project section
--scope user ~/.agents/references/<name>.md, for you in every repository
--plugin <plugin folder> references/<name>.md in the plugin’s source folder
--default <skill folder> references/<name>.default.md in the skill’s source folder

Without --template, create writes a stub with a description, tags, and an ## Overview section. --merge <operation> sets how it applies; patch is the default. --dry-run prints the file and writes nothing. create never overwrites a file that has a body, and never writes into an installed plugin or skill.

A name is a file name, never a path: lowercase words joined by -, with . between parts. It never ends in .default or .meta, which are reserved.

Names are one namespace across every plugin installed, matched exactly. The command does not require any prefix. To avoid two plugins shipping one name by accident, prefix a name with something your plugin owns:

  • the plugin’s own name, such as acme-bugs.labels, or a topic it owns, such as cyber-agentkit’s skill-design.*;
  • for an implementation, the interface id, which is its namespace: <id> or <id>.<key>;
  • for a capability reference, the system: asana.capabilities, with no plugin prefix;
  • for a blueprint, <id>.<system>.<solution>.

A repository’s or a user’s own reference needs no prefix. Two plugins that ship the same name make the name ambiguous until a customizer orders them.

A plugin that changes how another plugin’s reference reads, such as a house style, ships the same name, lists the other plugin in extends, and holds only the sections it changes. create records the other plugin’s version in sources, so check warns base-moved when that plugin moves on. Never give such a file merge: replace; create refuses it with extends-replace.

Write an interface when your skill should work with things you do not ship: trackers, recipes, sandboxes. The skill depends on the contract, and a new tracker is a new implementation, not an edit to the skill.

Write the interface document, <id>.interface.md, with the contract in its frontmatter:

---
description: How a team ranks a new bug.
interface:
cardinality: many
version: 1
sections:
- {heading: Rank, required: true, holds: How to rank the bug.}
---
## Purpose
One ranking scheme per team.
Terminal window
npx -y cyber-agentkit reference create bug-rank.interface --plugin plugins/acme-bugs --template bug-rank.interface.md

Choose one when there is a single slot a team swaps, and many when a consumer lists several and picks. Interfaces and implementations gives every key. Renaming or removing a section raises the version.

Start one from the interface’s sections with --implements:

Terminal window
npx -y cyber-agentkit reference create scaffold.recipe.python-lib --implements scaffold.recipe --dry-run
---
description: What this scaffold.recipe implementation covers, and when an agent should read it.
implements: scaffold.recipe@1
merge: replace
---
## Recipe
**Unsupported.** Replace this line with the section, or say in one sentence why it is not supported.
## Files
**Unsupported.** Replace this line with the section, or say in one sentence why it is not supported.
## Verify
**Unsupported.** Replace this line with the section, or say in one sentence why it is not supported.

Replace each stub with the section, or keep a mark with one sentence: **Unsupported.**, or **Partial.** for a section honored only in part. A required section cannot stay unsupported. Then run reference check <name>.

A name the interface does not allow is refused:

error: an implementation of scaffold.recipe is named scaffold.recipe.<key>, not "scaffold.python-lib".
code: name-outside-interface
help:
- Name it scaffold.recipe.<key>, or write it for one folder with --in.

--implements with --in <folder> writes a project section instead, with neither implements nor merge.

For a capability reference or a blueprint, see capability references and blueprints.

Ship a default copy of each reference your skill loads in the skill’s references/ folder, so the skill still works when installed without its plugin. Kinds of reference gives the file names.

When the skill’s plugin holds the canonical file, let reference defaults <skill folder> write the copies, and run reference defaults <skill folder> --check in CI. A skill with no plugin writes its own with create <name> --default <skill folder>. How a name resolves says how a default joins the stack.

A skill never runs the command itself. It carries one load line naming the reference skill and its package:

Load `acme-bugs.labels` and `release-checklist` with the `reference` skill of `cyber-agentkit`.
Load the implementations of the `bug-rank` interface with the `reference` skill of `cyber-agentkit`.

Name the package as well as the skill, so an agent that does not have the skill can tell the user what to install. Write the skill’s name in words: each harness types skills differently. A skill written for one harness may add that harness’s typed form; the reference skill page lists each one.

Declare the same names in the skill’s frontmatter, under the metadata map the Agent Skills specification defines:

---
name: triage
description: Use this skill when triaging a new bug.
metadata:
references: acme-bugs.labels release-checklist
reference-interfaces: bug-rank
---

The specification makes each metadata value a string, so each list is one string of names separated by spaces. references lists reference names, and reference-interfaces lists the interfaces whose implementations the skill loads. reference uses, skill doctor, and reference defaults read these lists, so they find a skill’s loads whatever language its text is written in.

When a skill declares either key, the lists are the whole of what it loads. A skill that declares neither is read for its loads instead: each English load line like the ones above, and each backticked name in its text that resolves to a reference here. Detection skips fenced code blocks, text inside <example> tags, the skill’s evals folder, and its root README.md.

skill check fails SHP-20 on:

  • a load the declared lists leave out;
  • a declared name the text never mentions in backticks;
  • names listed in bullets under a lead-in such as “Load these with the reference skill:”.

The fix for the last one is to move the names to the declared lists.

  • List the old name in the new file’s aliases, so load lines and customizations written for the old name still reach it.
  • When a name moves to another plugin, list the old pin, <old plugin>/<name>, in the receiving plugin’s aliases.
  • When a plain reference becomes the document of a many interface, list its old name in the interface document’s aliases. For a one interface, add the rename to references/_renames.yaml instead.

Aliases and renames says what each does at load.

A skill names a reference, and a reference can name another. Each link costs the agent something:

  • Accuracy drops as the facts a task needs spread over more places (Weakest Link Effect), and drops again with each hop from one document to the next (NovelHopQA). Both are long-context reading benchmarks, not studies of instruction documents. Anthropic’s skill authoring best practices say Claude may read a file referenced from a referenced file only in part, and advise keeping references one level deep. So keep each document readable on its own, and keep a chain of documents short.
  • No evidence was found that a cycle, two documents that each need the other, costs more than the two one-way links it is made of. Nor was any found for or against a pair of self-contained documents that each mark their boundary with the other (“A is not B”).
  • The loops seen in practice are skills invoking each other at run time, not reading loops. One reproduced case (anthropics/claude-code#55592) spawned about a hundred subagents in minutes. A skill that can invoke another skill that leads back to it needs a termination guard, such as a depth limit.

The research behind this, with its evidence and confidence, is in circular-spec-references.

Registering an interface, or a system’s capability reference, lists it in the public interface registry or capability registry. It is optional: loading never reads the registry.

Terminal window
npx -y cyber-agentkit reference register bug-rank --plugin acme-bugs --description "How a team ranks a new bug."
npx -y cyber-agentkit reference register asana.capabilities --plugin cyber-asana \
--blueprint project-tracker.blueprints.asana.sections

It looks the id up in the live registry first, so it needs network access. When the registry already has the id, it stops and points at the entry, which you extend with a pull request. When it has a similar id, it shows why and stops until you pass --seen <id> for each.

Then it shows the route it would take. It opens a pull request that adds registry/interfaces/<id>.md (or registry/capabilities/<system>.md), or an issue carrying it, only with --yes or --as pull-request|issue.