Skip to content

Checking references

Each check examines something different:

Command Examines Writes
reference check [name]... Each reference as load composes it: its shape, its interface, and the defects composing it raises; with --since <ref>, each contract’s version against its text at a git ref; with --plugin <folder>, the references a plugin’s source folder ships Nothing
reference check-report <contract> <file> Whether a report opens with a contract’s version line, Model:, and Status: Nothing
reference uses <path>... The references a skill or any agent text loads, and whether a default ships for each Nothing
reference advise <path>... What a text hard-codes that could move into a reference Nothing
reference defaults <folder> --check Whether a skill’s bundled default copies match its plugin’s files Nothing
/reference doctor <system>.capabilities Whether the system on this machine matches what its capability reference says Nothing
skill check (rule SHP-20) Whether a skill’s declared loads match the loads its text names Nothing

reference check reads each reference as load composes it, since a contribution above can drop or change a section. With no names, it checks:

  • every name found;
  • a name that several plugins hold, once as each <plugin>/<name>;
  • each skill’s default, as its skill loads it.

A failure is an entry in the answer, not an error. check exits 0 when it answered, so CI reads the failed list:

Terminal window
npx -y cyber-agentkit reference check scaffold.recipe.typescript-lib scaffold.recipe.interface --trace
passed: 2
references[2]:
- name: scaffold.recipe.typescript-lib
kind: implementation
status: passed
unsupported[1]: Verify
- name: scaffold.recipe.interface
kind: interface
status: passed

--trace adds every entry checked, with its kind (interface, implementation, capability, contract, or none) and its unsupported and partial sections.

Check Fails when
interface-found implements is not one <id>@<version>, or names no found, valid <id>.interface
version the declared version is not in the interface’s versions
name the name is not <id> or <id>.<key>, as the cardinality says
order the listed sections are out of order, or one appears twice
required a required section is left out or marked **Unsupported.**
nested-order a section’s listed nested sections are out of order under it, or one appears twice
nested-required a required nested section is left out of its section, or marked **Unsupported.**
frontmatter-required a frontmatter key the interface lists is missing
frontmatter-type a frontmatter key the interface lists has a value of another type
interface an interface document’s interface block is malformed
compose the document itself has a defect when composed (see below)
capability a capability reference does not open with System, Detect, and Verified, in that order, or declares implements
support-level a **Partial.** or **Unsupported.** mark has no sentence after it, in any reference
contract a contract’s contract: block is malformed, or its name is not <id>.contract
parties a party the block lists has no top-level section, or the parties are out of order
version-line a contract’s body carries a Version: line; the version lives only in the block
contract-customized a repo, user, managed, or project contribution changes a contract’s text and keeps the id and version the plugin ships
contract-version with --since <ref>: a contract file’s text changed since the ref while its version did not go up
blueprint a blueprint interface is not many, a blueprint’s name has no solution, its capability reference is not found, or a Needs: line names a feature that reference has no section for

A name not found fails with its status code, such as reference-missing or reference-ambiguous. A name a remove turned off passes: it is off on purpose.

Every warning load would raise is reported, sorted into two kinds.

A defect is a fault in a file, and fails the compose check: frontmatter-invalid, merge-unknown, marker-unknown, marker-unmatched, heading-repeated, remove-body-ignored, extends-invalid, extends-self, extends-step-not-allowed, extends-reference-missing, data-not-merged, data-merge-invalid, default-in-tier, file-ignored, format-mismatch, metadata-ignored, interface-not-composed, reference-legacy-format, and alias-invalid.

An environment warning depends on what is installed here, and is listed under warned without failing: extends-step-missing, extends-all-missing, extends-not-used, section-not-held, default-not-selected, plugin-not-selected, default-folder-missing, interface-check, feature-unsupported, base-moved, reference-stale, reference-renamed, alias-not-used, rename-invalid, reference-hidden, and repo-hides-user.

check adds two of these itself. It warns reference-hidden for a repo, user, or project-section file that a replace or remove above it hides (repo-hides-user when a repository file hides your user file). It warns base-moved for a plugin’s or a skill default’s file whose recorded base plugin has moved to a new version.

A project section is never checked against an interface, but every warning it raises is passed on, naming its file.

The library exports the check as checkReferences.

A plugin author checks the files the plugin will ship with --plugin <folder>, the plugin’s source folder in this repository, as create, delete, and migrate take it. The plugin need not be installed:

Terminal window
npx -y cyber-agentkit reference check --plugin packages/civitas

It checks each reference in the folder’s references/, or only the names given, as <plugin>/<name> composed through the plugin’s own stack: the folder stands in for any installed copy of the plugin, its extends may name any other plugin read here, and the aliases and renames it declares apply. No managed, repo, user, or project file joins, so a customization in this repository does not change the result. A skill in the folder’s skills/ that holds a default of a checked name adds an entry as that skill loads the name, with its loadedBy, when the default changes what the name composes to. The answer has the same failed, warned, and passed entries.

A folder with no plugin manifest, or one outside the repository, fails with folder-invalid.

reference uses lists the references the given files or folders load, as a skill declares them under metadata.references and metadata.reference-interfaces, or else as its text names them:

Terminal window
npx -y cyber-agentkit reference uses plugins/acme-bugs/skills/triage
loads[1]:
- name: acme-bugs.labels
default: true
status: found
answeredBy[1]: default
defaultAnswers: true
files[1]: plugins/acme-bugs/skills/triage/SKILL.md
source: declared

Each load gives:

  • default: whether a bundled default ships beside the skill;
  • status: how it resolves here;
  • answeredBy: which tiers answer it;
  • defaultAnswers: whether only the default answers;
  • the files that name it;
  • source: whether it was declared or detected.

interfaces lists the interfaces it loads, and gaps lists the loads with no bundled default.

reference advise reports pattern leads in any text an agent reads: hosts and providers, tool commands, paths, URLs, step lists, and templates, each with its line. --also <term> adds a host or tool of your own. A lead is a suggestion, never a pass or fail. It marks text under node_modules or a plugin cache as editable: false, since that is an installed copy. Authoring references shows its output.

reference audit runs advise and uses together. It is deprecated and will be removed in the next minor release.

reference defaults <skill folder> --check fails with bundle-out-of-date when a skill’s default copy is missing, stale against its plugin’s file, misnamed, or no longer loaded by the skill. How a name resolves explains the copies.

reference check reads a capability reference as written. The doctor examines the system it describes, as it runs on this machine:

/reference doctor gitlab.capabilities

It is a mode of the reference skill, not a subcommand: the agent follows it. It runs load --trace and check on the name. Then it shows each command the reference’s Detect section names, and runs the ones that only read, such as glab --version. Those commands are the reference author’s, so a command that would change something is listed as not run. The report gives:

  • the capability reference, and the tier and plugin that answered it, saying so when a local patch applies;
  • the version and tier found, or that the system was not detected or a needed tool is missing, in which case no feature is compared;
  • each feature that disagrees, which is one of:
    • found outside its Since: and Until: lines, with the section not marked **Unsupported.**;
    • found inside them, with the section marked **Unsupported.** or **Partial.**;
  • the Verified entry that covers what was found, or that none does, so the reference is unverified for it.

The doctor changes no file. Its report leaves out local paths, hosts, and tokens, so it can be sent to the author as is. A name that is not a capability reference is an error, and nothing runs.

skill check rule SHP-20 compares a skill’s declared loads with its text. It fails on a load the declared lists leave out, on a declared name the text never mentions in backticks, and on a metadata value that is not a string. Wire a skill to load references gives the form.