Docs
View as markdown

relate skill

The relate skill command, which installs, lists, checks and removes the agent skill bundle embedded in the binary, with agents, paths and exit codes.

cliagents

relate skill manages the copies of relate's agent skill The SKILL.md cheat sheet and reference files a coding agent reads before it uses relate; relate skill install writes them. Read more in the glossary in the home directories of coding agents. The skill bundle The set of files that make up the relate skill: SKILL.md and 15 reference files, embedded in the binary and served by the site. Read more in the glossary (SKILL.md and 15 reference files) is embedded in the binary, so every action works offline. The command has four actions: install writes the bundle into each detected agent's skills directory, list prints each agent's install state, check compares installed copies with the binary's bundle, and remove deletes copies relate wrote. It never opens a store.

Synopsis

relate skill install|remove|list|check [--agent NAME] [--force]
ActionDoesPrints on stdoutExit code on success
installWrites the bundle into <skills dir>/relate for each target agentinstalled relate skill into <path>, one line per agent0
listReads each target agent's <skills dir>/relate and classifies it<agent>: <state> (<path>), one line per agent0
checkCompares each installed copy with the binary's bundle, file by file<agent>: up to date (<path>) or <agent>: drifted (<path>) with one line per differing file; agents without a copy get their list line0 when every copy matches, 1 when any has drifted
removeDeletes <skills dir>/relate for each target agentremoved relate skill from <path>, one line per agent0

Without --agent, an action targets every detected agent. list and check write nothing.

Options

FlagArgumentDefaultScopeSinceDescription
--agentNAMEall detected agentsrelate skill—Scope the action to one agent (case-insensitive).
--force—refuserelate skill—Clobber <skills dir>/relate even when the command would refuse it; a usage error on list and check.

A — under Since: the data does not record the release that added the flag.

RuleBehavior
--agent namesMatched case-insensitively against the names in the agent table; given twice, the last one applies
--agent and detectionA named agent is a target whether or not its directory exists; install --agent <name> creates the skills directory
--forceAccepted by install and remove only; with list or check it is a usage error (exit code 2)

Agents and paths

An agent is detected when the directory in the "Detected when this exists" column exists. The skill goes to relate under the agent's skills directory. The names are the ones the binary prints in its valid agents: line, in its order.

--agentAgentDetected when this existsThe skill goes to
claude-codeClaude Code~/.claude~/.claude/skills/relate
cursorCursor~/.cursor~/.cursor/skills/relate
windsurfWindsurf~/.codeium/windsurf~/.codeium/windsurf/skills/relate
copilotCopilot~/.copilot~/.copilot/skills/relate
antigravityAntigravity~/.gemini/antigravity~/.gemini/antigravity/skills/relate
gemini-cliGemini CLI~/.gemini~/.gemini/skills/relate
clineCline~/.cline~/.agents/skills/relate
codexCodex~/.codex~/.codex/skills/relate
piPi~/.pi/agent~/.pi/agent/skills/relate
opencodeOpenCode$XDG_CONFIG_HOME/opencode$XDG_CONFIG_HOME/opencode/skills/relate
junieJunie~/.junie~/.junie/skills/relate

~ is $HOME. When XDG_CONFIG_HOME is unset or empty, OpenCode's paths use $HOME/.config in its place. A skills directory inside a project, such as .claude/skills/, is outside every action's reach.

Install states

list and check print one of four states for each agent's <skills dir>/relate. The state decides what install and remove may do without --force.

StateWhat is at the pathinstallremove
not installedNothingWrites the bundleSucceeds; nothing to delete
installedA directory with relate's .relate-installed marker fileReplaces the bundleDeletes the directory
installed (legacy bundle)A directory without the marker whose SKILL.md frontmatter has name: relate and a version: line: an older or hand-copied bundleReplaces it and adds the markerRefused
foreign (not managed by relate)Anything else, including a symbolic linkRefusedRefused

A refusal names the path and exits with exit code The number a relate run returns to the shell; each nonzero value names a class of failure, such as 2 for usage, 5 for conflict, 6 for a rejected statement. Read more in the glossary 1. --force replaces or deletes the directory whatever its state.

What install writes

ItemContent
SKILL.mdThe bundle's cheat sheet, with the binary's version written into its version: frontmatter line
references/The 15 reference files, unchanged
.relate-installedThe marker that makes the directory relate's own

The bundle is written into a staging directory beside the destination and then renamed into place, so a reader never sees a half-written bundle; the previous copy is replaced whole, and a reference file the new bundle no longer has does not linger. With several targets, install and remove check every target's state before changing any, so a refusal on one agent leaves the others untouched.

check compares the bytes install would write. Each difference is one indented line: missing: <file>, differs: <file> or extra: <file>, with paths relative to the skill directory.

After relate upgrade replaces the binary, it runs relate skill install from the new binary for the detected agents. When any of them holds a relate copy, this happens without a prompt; when none does, it asks first on a terminal, installs without asking under --yes, and otherwise prints run: relate skill install and installs nothing. A foreign directory is never touched.

Errors and exit codes

Exit codeWhen
0The action completed; for check, every installed copy matches
1check found drift; no agent detected and no --agent; a refused path; a file system error
2A usage error: no action, an unknown action or flag, --force with list or check, or an unknown --agent name
Message on stderrExit codeCause
Error: skill: no supported agents detected1No --agent, and none of the directories in the agent table exists; a second line lists the valid names
Error: skill: unknown agent: '<name>'2--agent names no agent in the table; a second line lists the valid names
Error: skill: refusing to touch <path>: no .relate-installed marker present (directory was not created by relate); pass --force to override1install met a foreign directory, or remove met a foreign or legacy one
Error: skill requires an action (install, remove, list or check)2relate skill with no action
Error: unexpected argument to skill: <argument>2An unknown action or flag, or --force with list or check

The second line of the two agent errors is the same:

valid agents: claude-code, cursor, windsurf, copilot, antigravity, gemini-cli, cline, codex, pi, opencode, junie

The errors reference has the remedies.

Examples

The examples run with a fresh home directory, written <home>. With no agent directory in it, every action that has no --agent stops:

relate skill list
echo "exit=$?"
Error: skill: no supported agents detected
valid agents: claude-code, cursor, windsurf, copilot, antigravity, gemini-cli, cline, codex, pi, opencode, junie
exit=1

--agent installs for one agent, and creates its directory:

relate skill install --agent claude-code
installed relate skill into <home>/.claude/skills/relate

With a Codex directory present too, list reports both detected agents:

mkdir -p "$HOME/.codex"
relate skill list
claude-code: installed (<home>/.claude/skills/relate)
codex: not installed (<home>/.codex/skills/relate)

After a local edit to SKILL.md, check reports the drift and exits 1:

printf 'local note\n' >> "$HOME/.claude/skills/relate/SKILL.md"
relate skill check
echo "exit=$?"
claude-code: drifted (<home>/.claude/skills/relate)
  differs: SKILL.md
codex: not installed (<home>/.codex/skills/relate)
exit=1

remove deletes the copy that carries the marker:

relate skill remove --agent claude-code
removed relate skill from <home>/.claude/skills/relate

See also

  • Install the agent skill: the CLI installer, the skills CLI, and a checked manual copy
  • relate upgrade: the binary update that refreshes installed copies
  • Agent mode: how the CLI behaves under a detected agent harness The program that runs a model and executes the commands it chooses, such as Claude Code, Codex or Cursor; relate detects one from its environment variables. Read more in the glossary
  • Exit codes and errors: the exit codes every command shares