Skip to content

Customizing a reference

You never edit a file a plugin ships. You write a file above it that holds only what you change. The plugin’s file keeps its other sections and keeps getting its author’s updates.

The examples on this page run in a repository that has the plugin acme-release as a dependency. The plugin ships release-checklist:

---
description: Steps to run before cutting a release.
tags: [release]
---
## Steps
Run the tests, then tag the commit.
## Rollback
Revert the tag.

Paths in the output are shortened to <root>. The reference skill runs these commands for you: ask it to change a reference, and it shows each file and its path before it writes.

reference where lists the files a customization can go in, who each reaches, and the headings you can match:

Terminal window
npx -y cyber-agentkit reference where release-checklist
name: release-checklist
status: found
files[2]{scope,path,reaches}:
repo,.agents/references/release-checklist.md,everyone working in this repository
user,~/.agents/references/release-checklist.md,"only you, in every repository"
headings[2]: Steps,Rollback
used[1]: acme-release
hint: acme-release is read-only; a customization goes in one of the files.

Add --in <folder> for a folder’s project section, and --default <skill folder> when a skill loads the name with a default.

The repository wants a different rollback. It writes .agents/references/release-checklist.md with that section only:

## Rollback
Revert the tag, then post in #releases.

No merge means patch: the Rollback section replaces the plugin’s, and Steps is kept.

Terminal window
npx -y cyber-agentkit reference load release-checklist
## Steps
Run the tests, then tag the commit.
## Rollback
Revert the tag, then post in #releases.

reference create release-checklist --template <file> writes the same file and refuses to overwrite one that has a body. Commit the file, and everyone working in the repository gets it.

You want one more step, in every repository you work in. You write ~/.agents/references/release-checklist.md with merge: combine, so your text goes after the text below instead of in its place:

---
merge: combine
---
## Steps
Read the changelog before you tag.

With the repository’s Rollback still in place, the load is:

Where these sections conflict, the later text wins.
## Steps
Run the tests, then tag the commit.
Read the changelog before you tag.
## Rollback
Revert the tag, then post in #releases.

Write it with --scope user on create, or by hand.

A marker on the line after a heading applies one operation to that section only:

## Rollback
<!-- merge: remove -->

Where the file sits matters. In the user tier, this file removes the plugin’s Rollback, but the repository’s file still adds its own Rollback, because the repository applies after the user. The load is unchanged. To drop a section for everyone, remove it in the tier above every file that holds it.

merge: replace in the frontmatter drops everything below and stands alone. merge: remove with no body turns the name off: a load reports it missing with the code reference-removed, and a skill carries on without it.

Work in packages/web needs an extra build step. A project section states only that:

Terminal window
npx -y cyber-agentkit reference create release-checklist --in packages/web --template steps.md

That writes packages/web/.agents/references/release-checklist.md. The main document is unchanged, and the section follows it:

## Steps
Run the tests, then tag the commit.
## Rollback
Revert the tag, then post in #releases.
<project folder="packages/web">
## Steps
Also run `pnpm build` in this folder before you tag.
</project>

An agent follows the section while its work is in that folder, and the section wins where the two conflict.

Add a second dependency, house-style, that also ships release-checklist. Nothing says which builds on which, so the name is ambiguous:

<reference name="release-checklist" status="ambiguous" code="reference-ambiguous">the plugins acme-release, house-style hold it, and no extends orders them; options: acme-release/release-checklist, house-style/release-checklist</reference>

Pick the order, bottom first, with customize --extends:

Terminal window
npx -y cyber-agentkit reference customize release-checklist --extends acme-release house-style

It adds the pick to the repository’s file and keeps its body:

---
extends: [acme-release, house-style]
---
## Rollback
Revert the tag, then post in #releases.

Now house-style patches acme-release, and the repository patches both. A step can also carry an operation, such as house-style:combine, or be default for the loading skill’s default. --extends none removes the picks, and --extends-file <file> reads the whole list from YAML when a step needs more keys. --scope user writes the pick for you only. What a contribution builds on gives every rule.

load --trace says how the document was built: the stack and what built it, the contribution behind each section, and every layer checked with its outcome. For the two-plugin example:

Terminal window
npx -y cyber-agentkit reference load release-checklist --trace
release-checklist: found; stack: acme-release → house-style; built by repo <root>/.agents/references/release-checklist.md; harnesses: none detected
sections:
Steps: plugin house-style (patch)
Rollback: repo <root>/.agents/references/release-checklist.md (patch)
layers:
managed (no harness detected): not read (no harness detected, so no managed folder is read)
repo <root>/.agents/references/release-checklist.md: used; patch from default {"extends":["acme-release","house-style"]}
user ~/.agents/references: missing
plugin house-style <root>/node_modules/house-style/references/release-checklist.md: used; patch from default {"description":"The house release checklist."}
plugin acme-release <root>/node_modules/acme-release/references/release-checklist.md: used; patch from default {"description":"Steps to run before cutting a release.","tags":["release"]}
plugin cyber-agentkit <cyber-agentkit>/references: missing

The last row is the plugin running the command, which holds no release-checklist.

Read it top down:

  • The first line gives the status, the stack bottom first, the file whose extends built it, and the detected harnesses.
  • sections names the contribution each section came from, and its operation. A removed section reads removed by <contribution>.
  • layers lists every place checked, highest first, each with its outcome: used, stale, shadowed by <contribution>, not used (<reason>), not read (<reason>), ambiguous, or missing.
  • After each outcome come the operation, where the operation came from (default when the file names none), and the file’s frontmatter as written.
  • Project sections follow under project sections.

In text output the trace prints on stderr. --format json puts it in a trace field. list --trace gives one row per layer holding each name.

reference customize also writes a body generated from a request, for a change easier to ask for than to write. It runs no model; the agent that calls it does the generating:

  1. customize <name> --base prints what the generator reads, and writes nothing. It resolves the name with your picks, but leaves out the target file, the managed text, the tier above, and your personal text.
  2. The agent writes a body from your request.
  3. customize <name> --request <file> --body <file> writes the body as given. It records the picks as extends, the sources the body was built from with their versions, and your request. --merge says how it applies, patch by default.

For the request “Add a step to post the release notes in #releases.”, the repository file it writes is:

---
merge: patch
sources:
- plugin: acme-release
version: 1.0.0
request: |
Add a step to post the release notes in #releases.
---
## Steps
Run the tests, then tag the commit. Post the release notes in #releases.

A user-tier document records only plugins the harness has enabled, never a plugin found through the repository’s package.json. A name that is not Markdown records the same in <name>.meta.md.

When a source plugin’s version changes, load warns reference-stale. The document still loads. Customize it again to regenerate it from the new source and the recorded request. Never edit a generated document by hand.

reference delete removes a repo, user, or project-section file and says what answers the name afterwards:

Terminal window
npx -y cyber-agentkit reference delete release-checklist --dry-run
<root>/.agents/references/release-checklist.md
would delete. "release-checklist" is answered by plugin acme-release, on the stack acme-release, with the project sections of packages/web.

It never deletes a managed file, or a file in an installed plugin or skill. To turn off such a file, write a customization with merge: remove.

An administrator puts a file in the managed folder of the harness, such as /etc/claude-code/references/ on Linux. It applies over the repository, the user, and each project section, and no command writes there. The folder is read only when detection names exactly one harness.

Example: how /skill builds a skill’s code

Section titled “Example: how /skill builds a skill’s code”

/skill loads the reference skill.build when it creates or updates a skill that ships code, and before test and check run that code. Its default is generic on purpose. It tells the agent to work out the project’s toolchain from the repository (manifests, lockfiles, build files, CI configuration), to use the project’s own build, and to skip the step when the code runs as written. It names no command such as pnpm build, so a Python repository is built as Python and a JavaScript-only repository gets no TypeScript.

The agent runs the build; it does not only print it. It shows the exact command before the first run, and when the build fails it reports the output and stops, so the skill’s code never runs on a stale build.

A project adds steps the agent cannot know, such as a code generator, in its own copy. Find where it goes, then write the file:

Terminal window
npx -y cyber-agentkit reference where skill.build --default <skill folder>
npx -y cyber-agentkit reference create skill.build --template steps.md

The repository’s file is .agents/references/skill.build.md, and it applies over the default. The agent runs what the file says, so a repository’s copy can run any command. Review it as you review a script, and use merge: remove to turn the build off.