{"name":"update-agent-skills","title":"Update Agent Skills","description":"Update installed Agent Skills wherever they live — project, global, plugin and manual copies — after correcting the changelog, README and release notes that describe them, and compose a project's adapted copy of a pack skill from a pinned release and the project's overlay. Symptoms: update my skills, sync this skill everywhere, bring my agents to the latest version, is my skill pack stale, reinstall the pack, adapt a pack skill to this project. It moves installed copies; it does not publish a new release — that is publish-agent-skill.","compatibility":"Agent Skills-compatible agents; the generic Skills CLI for managed project/global installs; native plugin/package updaters or manual artifact channels where applicable; Node.js 22 or newer and git for the composer, scripts/adapt.mjs.","allowedTools":"Read Write Grep Glob Bash Agent Workflow","license":"MIT","kind":"requestOnly","useWhen":"asked for by name, and only by the user: updating installed skills","group":"workflow","lifecycle":"release","version":"1.1.0","author":"crissmoldovan","install":["npx skills add crissmoldovan/agent-skills --skill update-agent-skills","node <skill-folder>/scripts/install-freshness-hook.mjs   # optional: check freshness each session","node <clone>/skills/update-agent-skills/scripts/adapt.mjs compose --repo . --pack <clone>   # optional: adapt a pack skill to this project"],"asks":["Update this released skill for all supported agents in global scope on this\nmachine. Inventory JSON and provenance first, preserve plugin namespaces and\ncopy/symlink form, update through each owning channel, reload cached runtimes, and\nreport unsupported or manual planes separately.","Adapt this pack skill to the project: compose it from the pinned release and our\noverlay, show me the change, and check it. Write nothing until I say so.","Prepare the update communication only. Make the changelog, repository README,\nrelease notes, and agent-facing update guidance agree with the published release.\nDo not update any local library."],"commands":[],"documents":[{"path":"references/adapting.md","slug":"adapting","title":"Adapting a pack skill to one project","body":"# Adapting a pack skill to one project\n\nA project often needs a pack skill to carry what only it knows: who rules a decision, the zone\ntimes are written in, where records go, which of its own skills does the job a sibling pack skill\ndoes, and the steps and traps it has learned. Copying the skill and editing the copy is a fork: it\nstops receiving fixes, and the two drift until nobody can say which rule is current.\n\nThe adapted copy is the alternative. It is **generated** from two inputs: the pack skill at a\npinned ref, and the project's overlay. It is committed, so every clone, worktree and branch that\ncarries it has it with no network. It is never edited by hand, the same discipline a project\nalready applies to any generated file a test byte-compares. The contract it follows — binding\nslots, hard-line and step ids, and the merge rules — is the pack's `docs/project-adaptation.md`.\nThis page is how `scripts/adapt.mjs` carries it out.\n\nWhy one generated skill rather than the pack skill installed beside a thin project skill: nothing\nin a skill's frontmatter makes one skill load another, so a second skill has to be found by its\ndescription, and a harness with many skills installed drops descriptions first for the skills\ninvoked least. A personal copy of the generic skill can also take precedence over the project's.\nOne invocation of the adapted copy brings the whole procedure, the project's values and its\nadditions together.\n\n## The files\n\n```text\n<project>/\n  .claude/skill-adapters/\n    .tool/adapt.mjs        the composer, vendored by compose --write\n    <name>/\n      adapter.json         written by a person\n      overlay.md           written by a person\n      references/\n        project/           the project's own reference files, listed in projectFiles\n  .claude/skills/<name>/   GENERATED: never edited by hand\n    SKILL.md\n    LICENSE\n    adapted.lock.json\n    (the skill's own references, scripts and assets, byte for byte)\n```\n\n`--adapters-dir` and `--skills-dir` move the two folders for a harness that reads skills from\nsomewhere else; pass the same values to every command, because the lock records them. Both stay\ninside the repository where they land, not only as written: `compose --write` refuses either\nfolder, or the vendored composer, when a symbolic link on the way takes it outside, and writes\nnothing. Reading is not limited, so the pack is read from a clone anywhere.\n`onboard-project` looks for adapted copies only in `.claude/skills/` and `.agents/skills/`, so a\ncopy composed anywhere else does not stand in for its skill there.\n\n### `adapter.json`\n\n```json\n{\n  \"version\": 1,\n  \"name\": \"triage-arrivals\",\n  \"description\": \"Take in what reaches this repository. Use when a file, a mail or a message arrives for the team.\",\n  \"base\": {\n    \"source\": \"https://github.com/<owner>/<pack>\",\n    \"skill\": \"<pack skill>\",\n    \"path\": \"<optional: the skill's folder in the source, when it is not skills/<pack skill>>\",\n    \"entry\": \"SKILL.md\",\n    \"ref\": \"v1.4.0\",\n    \"commit\": \"<optional: the full commit the ref was reviewed at>\",\n    \"tree\": \"<optional: the full tree of the skill's folder at that commit>\"\n  },\n  \"overlay\": \"overlay.md\",\n  \"projectFiles\": [],\n  \"names\": {}\n}\n```\n\n| key | what it holds |\n|---|---|\n| `name`, `description` | the adapted copy's own name and trigger text. The name is never the pack skill's name, so neither copy hides the other |\n| `base.source` | `https://github.com/<owner>/<repo>`, or a local path to a clone of the pack. Every other transport is refused |\n| `base.skill` | the pack skill's name, which its `SKILL.md` declares; its folder is `skills/<skill>` unless `base.path` names another |\n| `base.path` | optional: the skill's folder inside its source, for a source that keeps it elsewhere than `skills/<skill>`, such as `skills/<category>/skills/<skill>`. It is written from the source's root, with no `..` and no leading `/`, and it names a folder inside the source; anything else is refused. The tree, `outdated` and `--verify` read that folder, and the lock records it |\n| `base.entry` | `SKILL.md`, or one reference file of the skill when that file holds the procedure the project needs |\n| `base.ref` | a tag (`vX.Y.Z` or `<skill>-vX.Y.Z`) or a full commit sha. A branch is refused, because it moves, and so is an abbreviated sha. A per-skill tag is compared with newer tags of its own and with the latest catalogue tag, because a catalogue release can change the skill without a per-skill tag beside it |\n| `base.commit`, `base.tree` | optional. When present, a ref that now resolves elsewhere is refused |\n| `allowedTools` | optional: exactly the tools the copy pre-approves while it is active, each one word, such as `Read`, since the `allowed-tools` line separates them by spaces. Absent or empty, the copy pre-approves none, whatever the skill declares ([why](#no-tool-is-pre-approved-unless-the-project-names-it)) |\n| `overlay` | the overlay file, `overlay.md` unless named |\n| `projectFiles` | the project's own files, each listed by its path inside the adapter folder, and each inside a `project` folder under `references`, `scripts` or `assets`, so they never collide with the skill's: `<adapter>/references/project/record-forms.md` is listed as the part after `<adapter>/`. A file in those folders that is not listed is refused rather than left out |\n| `names` | rarely needed: a pack skill the carried text names in backticks that no slot covers, mapped to this project's skill. Its main use is a reference-file entry that sends the reader back to its own skill |\n\nAn unknown key is refused, because a misspelt one would otherwise be read as absent.\n\n### `overlay.md`\n\n```markdown\n## Bindings\n\n| id | value |\n|---|---|\n| B1 owner | Ada Example, the release manager. Only her own instruction is acted on. |\n| B5 defects (skill) | `triage-a-defect`, this repository's own skill |\n\n## Additions\n\n### S3\nAn arrival larger than 100 MB is kept on the shared drive; the repository keeps its hash.\n\n### H1\nNot even an automatic reply: the mailbox's auto-responder stays off.\n\n## Project traps\n\n| trap | so |\n|---|---|\n| two packs unpacked into one folder overwrote each other | every pack gets its own folder |\n```\n\n- **Bindings** bind slots the skill declares; a slot left out keeps its default. A `skill` slot's\n  value opens with one skill's name in backticks; that is what the names map is built from.\n- **Additions** are one `### <id>` heading per step or hard line. An addition whose first line is\n  `replaces: S2. <why, and where the decision is recorded>` supersedes the step instead; it is\n  refused on a hard line.\n- **Project traps** come last, as written.\n- Nothing else reaches the copy, so any other section, or text before the first one, is refused. A\n  `#` title and HTML comments before the first section are allowed.\n- Links in the overlay are written as they will be read from the generated `SKILL.md`: a project\n  file is reached at the same path it has in the adapter folder. Every link is checked, in fenced\n  code too, so an example writes a path as code, such as `docs/intake.md`, not as a link.\n- Fenced code in the overlay closes inside the addition or section it opens in, at a bare line of\n  at least as many of its character, indented as far as the fence or up to three columns further;\n  a fence may open on the line of its list marker. One left open would swallow every heading after\n  it, and the checks they face, so it is refused. A line that opens another part of the overlay, a\n  section or a `###` heading whose first word is an id, ends a fence open across it, and so does\n  such a heading indented one to three spaces, which Markdown still reads as a heading: an example\n  that shows one for a step indents the fence and its lines four spaces. One for a hard line is\n  shown only in the addition to that hard line.\n- An addition's heading starts at the left margin, so an indented `###` heading whose first word\n  is an id is refused outside fenced code too. A heading of any shape that names a hard line,\n  wherever the id sits in it, is refused anywhere but the addition to that hard line, at any indent\n  and fenced or not, and so is a line that opens with a hard line's id in bold (check 5). Elsewhere,\n  name a hard line in a sentence.\n\n## Commands\n\n```bash\n# The first time, and when a pin moves to a ref that ships another composer: run the composer\n# from a clone of the pack checked out at the pinned ref, a tag or a full commit sha.\ngit clone https://github.com/<owner>/<pack> <pack clone>\ngit -C <pack clone> fetch origin <ref>    # only for a commit that no branch or tag holds\ngit -C <pack clone> checkout --detach <ref>\nnode <pack clone>/skills/update-agent-skills/scripts/adapt.mjs compose --repo . --pack <pack clone>\nnode <pack clone>/skills/update-agent-skills/scripts/adapt.mjs compose --repo . --pack <pack clone> --write\n\n# From then on, the vendored copy:\nnode .claude/skill-adapters/.tool/adapt.mjs compose --repo .            # prints the change\nnode .claude/skill-adapters/.tool/adapt.mjs compose --repo . --write    # writes it\nnode .claude/skill-adapters/.tool/adapt.mjs check --repo .              # offline\nnode .claude/skill-adapters/.tool/adapt.mjs outdated --repo .           # online, reads only\nnode .claude/skill-adapters/.tool/adapt.mjs outdated --repo . --verify  # and compares every carried file\n```\n\n- `compose` reads each pin, holds the overlay to what the skill declares, and prints the files it\n  would add (`+`), change (`~`) or remove (`-`), what moved in the pin, and every addition to a hard\n  line for review. It writes nothing without `--write`. With it, it writes the generated folder and\n  vendors itself. `--adapter <name>` composes one; `--pack <dir>` reads a local clone instead of\n  fetching. When the pinned ref ships another composer than the one running, it says so.\n- `check` is offline: no git, no network. It exits 1 when any check below fails. `--adapter <name>`\n  checks one; a generated folder whose adapter is gone fails a check of every adapter, or of its\n  own name.\n- `outdated` exits 2 when something needs a person: a newer tag that changes the skill, a moved or\n  deleted tag, a vendored composer that is not the one the pinned ref ships, or a question it could\n  not answer. A version orders tags of one kind only, so for a per-skill tag against a catalogue\n  tag, or for a sha pin, a different tree is reported as differing, never as newer. It never says\n  \"current\" when it could not tell. With `--verify` it exits 1 when a carried file is not the\n  upstream bytes.\n\n**Which composer is vendored.** The one that ran `compose --write`, byte for byte; check 7 then\nholds every copy to it. `compose` reads the pack and never runs anything it fetched, the pinned\nrelease's own composer included, so the composer does not move with a pin by itself: a pin moved\nwith the vendored composer keeps that composer until a person runs the new one. Bootstrapping from\na clone at the pinned ref is what makes the vendored composer the release's. When the two differ,\n`compose` notes it and `outdated` flags it, and composing again with the composer from a clone at\nthe pinned ref replaces it.\n\nIn a repository onboarded with `onboard-project`, refresh its profile in the change that composes\na first copy, removes one, or moves a pin: its session-start check compares the copies on disk,\nwith their refs and trees, against the profile, and names any difference at every session start\nuntil a refresh records it. The refresh is also what routes a session to a new copy by name.\n\nWire `check` into the project's tests, so that drift is a red test even without CI, and add one\nline to the project's agent instructions: never edit `.claude/skills/<name>/`; edit the adapter\nfolder and compose. When branches that both changed an adapted skill merge, never merge the\ngenerated folder by hand: merge `adapter.json` and the overlay, then compose.\n\n## What the copy carries\n\n`SKILL.md`, in this order:\n\n1. the frontmatter: `name` and `description` from `adapter.json`; `license` and `compatibility`\n   from the skill; `allowed-tools` only when `allowedTools` names tools, and then exactly those;\n   `metadata` a map of the source, entry, ref, commit and tree;\n2. one generated line saying where to edit instead, and a short paragraph saying what the copy is\n   and, when an addition opens with `replaces:`, that the addition wins over the step it names;\n3. **Names in this copy**: where the text names a pack skill whose slot is bound to a project\n   skill, the project skill to use instead;\n4. **This repository's bindings**, the overlay's table as written;\n5. the skill's text between `<!-- base:begin -->` and `<!-- base:end -->` markers, byte for byte;\n6. **In this repository**: the additions under their ids, then the project traps.\n\nBeside it: the skill's other files byte for byte at their own paths, so its links still resolve;\nthe project files; the pack's `LICENSE`, since the copy is a substantial portion of an MIT work;\nand `adapted.lock.json`, which records the pin (source, ref, commit, tree, and the skill's folder\nwhen `base.path` names one other than `skills/<skill>`), the sha256 of every file of the skill and\nof the text between the markers, the sha256 of every adapter input and every generated file, which\ngenerated files are executable, and the composer's version and sha256.\n\n**A reference file as the entry.** Its text becomes the body of `SKILL.md` at the folder root, so\nevery relative link in it, fenced code included, is rewritten for that place, and it is still\ncarried at its own path. The skill's own `SKILL.md` is not carried, so a link to it from the entry\nis refused, and so is a binding or an addition to an id that only `SKILL.md` declares. Another\ncarried file that links to the skill's `SKILL.md` is carried byte for byte, so its link resolves to\nthis copy's `SKILL.md`, which holds the entry's text; `compose` and `check` warn and name each such\nlink, because only an edit to the skill can change it.\n\nComposing is concatenation at fixed points, never a model merging text, so the result can be\ncompared byte for byte: LF line endings, files in sorted order, no timestamps.\n\n### No tool is pre-approved unless the project names it\n\nA skill's `allowed-tools` line pre-approves tools while the skill is active, in a harness that reads\nit, and one entry can reach far: `Bash` alone covers every command, a push included. So the copy\ncarries no `allowed-tools` line unless `allowedTools` names the tools, and then exactly those, in\nthe order named. The skill's own line is never carried, not even in part: a pre-approval granted by\na shared skill would apply in every project that adapts it, chosen by none of them. A tool the copy\ndoes not name is asked for as the project's own settings decide, as it is for a skill without the\nline.\n\nThe lock still records what the skill declares, and `compose` says so, so a project that wants a\ntool pre-approved can see what the skill asked for and name it in `allowedTools`, where review sees\nit. `compose` lists every tool the copy pre-approves for review, and check 9 refuses an\n`allowed-tools` line that is not that list, one added by hand included.\n\n## The checks\n\n`check` holds every adapted copy to these. `compose` refuses an input that would break 4, 5, 6 or 10,\nor put a marker of check 2 into the overlay; the rest it writes true. A refusal or a failure is\nprinted with the number of its check. Two kinds carry a word instead: `[adapter]`, an adapter\nfolder that does not read as one (an unknown key, a missing overlay, an `adapter.json` or overlay\nthat is a symbolic link, a project file out of place or colliding with a file of the skill, an\noverlay section the copy would drop, a fence in the overlay that does not close inside its addition\nor section, an indented `###` heading whose first word is an id), and `[pin]`, a pin\nthat cannot be taken (a branch, an abbreviated sha, a tag that now names another commit, a\nrecorded commit or tree the ref no longer gives, a skill or entry the ref does not have, or a\nsource that cannot be read).\n\n| # | what it holds | what fails it |\n|---|---|---|\n| 1 | every generated file has the sha256 and the mode, executable or not, that its lock records, and the folder holds nothing else | a hand edit, a mode changed by hand, a file added or removed by hand |\n| 2 | the text between the markers has the sha256 recorded at compose time | an edit to the skill's own text |\n| 3 | composing again from the copy and the current adapter folder gives the same bytes | an overlay or `adapter.json` changed without composing; a pin moved in `adapter.json` but not composed |\n| 4 | every id the overlay cites is declared by a carried file; each slot is bound once and to a value, a `skill` slot to a skill's name; each step or hard line is added to once, with text; every required slot is bound; a `skill` slot whose default this project also adapts is bound to an adapted copy of it, and to no other skill (a copy over the skill's `SKILL.md` counts as one when the slot hands work back to its own skill; a copy over a reference file never does for itself); `names` maps only a skill the carried text names and no slot covers, and the names map says one thing per skill | a typo in an id; an id a newer release renamed; a handoff that would reach the generic copy, or another skill than the adapted copy; two rows for one slot; a carried file that declares `## Bindings` and holds a code block that meets a less indented line before it closes, or never closes, which the pack's verifier refuses too, since GitHub could show as code what a reading of it as text would declare |\n| 5 | no `replaces:` on a hard line, a reason on every `replaces:`, the id it names its own heading's, and no addition to a hard line, its heading included, or paragraph naming one written in the words of an exception (`unless`, `except`, `does not apply` …), on the line that names it, in the same sentence, read whole over the lines it wraps across, or opening the sentence after it. Ids and words are read as a reader sees them: through emphasis, character references, invisible characters and markup between letters. Outside the addition to a hard line, no heading names its id, wherever the id sits in it, in any shape Markdown gives a heading: a `#` heading at any level, in a quote or a list item, an underlined paragraph, a paragraph that is only bold, or an HTML heading, at any indent, fenced or not; and no line opens with one in bold, the form a skill declares it in | an overlay that relaxes a hard line, or puts text under a heading for one that no check reads as an addition to it. No script can tell stricter from looser in prose, so every addition to a hard line is also listed for review, and so is a paragraph that names one in a sentence and holds the words of an exception in another |\n| 6 | the adapted copy's name differs from the skill's | an adapter that takes its skill's name |\n| 7 | the vendored composer is the one that composed each copy, and the one running the check | a composer upgraded without composing again. Whether it is the one the pinned ref ships is `outdated`'s to say, since that needs the pack |\n| 8 | warning only: `SKILL.md` over 500 lines | a long trap table; move it into a project reference file |\n| 9 | the frontmatter follows the skill's `compatibility`, carries `allowed-tools` only as `allowedTools` names it, and once, and `metadata` is a map | a hand edit to the frontmatter, an `allowed-tools` line added by hand among them |\n| 10 | every relative link in the generated folder resolves and stays inside the repository, a symbolic link on the way followed to where it lands. A link inside fenced code is checked like any other, as the pack's verifier checks a skill's files: a link the check skipped would be checked by nothing, and no reading of fences by hand matches CommonMark. An example that shows a path writes it as code, such as `docs/guide.md`, not as a link. A link written from the root, such as `/docs/guide.md`, is refused: it is written from the file that holds it | a link in the overlay or a project file to something that is not there, an example's included |\n\nA generated folder whose adapter folder is gone fails as well.\n\nOffline checks prove nobody changed the copy since it was composed; they cannot prove the copy\nwas ever the real upstream, because a person who edits a file and its hashes together leaves\nnothing to disagree. `outdated --verify` fetches the pinned commit and compares every carried\nfile, and that is what proves it.\n\n## Moving a pin\n\n1. `outdated` prints, per adapted skill, either `v1.5.0 exists; skills/<skill> unchanged: moving the\n   pin is a no-op`, or `changed (tree a -> b): read git diff v1.4.0 v1.5.0 -- skills/<skill>`. For a\n   per-skill tag against a catalogue tag, or a sha pin, it says `differs`, never newer, and names\n   the same diff; read it with the release notes before moving the pin. Where `base.path` names the\n   skill's folder, that folder takes the place of `skills/<skill>` in each line.\n2. Read that diff in the pack. A release note that names a renamed or removed id says what an\n   overlay cites instead.\n3. Change `base.ref` (and `base.commit` and `base.tree`, if recorded). `compose` refuses, and names\n   the id, when the overlay cites one that is gone or a required slot the new release added.\n4. `compose --write`, then review the generated diff: it is the upstream change and nothing else.\n   If `compose` notes that the new ref ships another composer, compose again with the one from a\n   clone of the pack at that ref, so the vendored composer moves with the pin.\n5. Run `check` and whatever scenarios the project keeps for the skill, and commit it as one change.\n   In a repository onboarded with `onboard-project`, refresh its profile in that same change: its\n   session-start check compares each copy's ref and tree with the profile, so a re-pin it has not\n   recorded is reported at every session start, a same-tree re-pin included.\n\n`check-pack-freshness.mjs --repo <project>` lists the same pins against the latest release, beside\nthe global installs, as part of an inventory; a copy of another source is listed as not compared,\nand the run exits 2 when a pin moved or differs. A lock it cannot open is named, and a project or a\nnamed skills folder it cannot read is reported as unknown, never as a project with no copies.\nNeither it nor `skills update` ever moves one.\n\n## Failure modes\n\n| what goes wrong | what happens | what to do |\n|---|---|---|\n| someone edits the generated folder | `check` fails at 1, and for an edit to `SKILL.md` at 3 as well: at 2 too inside the base markers, and at 9 in the frontmatter; `compose` refuses to overwrite it | move the change into the overlay, then compose with `--discard-hand-edits` |\n| a folder of the same name was written by hand | `compose` refuses: it has no lock | move its project text into the overlay, then `--discard-hand-edits` |\n| a pinned tag is moved or deleted upstream | `outdated` raises an alarm; `compose` refuses the moved tag; the committed copy and the offline check are unaffected | read why; re-pin to a full sha or a new tag, or record the new commit in `base.commit` on purpose |\n| a newer release renames an id the overlay cites | `compose` refuses and names it | fix the overlay in the same change as the pin |\n| no network | only `compose` (without `--pack`) and `outdated` stop | nothing else needs it |\n| a git setting (`url.<base>.insteadOf`) rewrites GitHub addresses to ssh | `compose` without `--pack` refuses the pin, and `outdated` reports unknown: the composer allows a remote over https only, and the message names the setting | run the command with that setting left out (for one in the global configuration, `GIT_CONFIG_GLOBAL` naming an empty file), or compose from a clone with `--pack` |\n| the project wants a tool pre-approved that the skill's own `allowed-tools` names | the copy does not carry it, so the harness asks for the tool as the project's own settings decide | name it in `allowedTools` and compose; review reads it there |\n| the generic copy is picked instead of the adapted one | the session misses the project's values; an unbound slot falls back to its default, often \"ask once\" | give the adapted copy the project's own trigger phrases, and route the task to it by name in the project's agent instructions; `onboard-project`'s routing file does that for a repository it onboards |\n| two branches change one adapted skill | a conflict inside a generated folder | merge the adapter folder, then compose |\n| a security fix reaches the pack | the project has it only when the pin moves | run `outdated` on a schedule the project keeps |\n| a pin moved with the old composer | the copies are composed, vendored and checked by the old composer; nothing offline disagrees | `compose` notes it and `outdated` flags it; compose again with the composer from a clone at the pinned ref |\n\n## What it does not do\n\nIt installs nothing globally and changes no agent settings. It never runs anything from a fetched\ntree: it reads the pack with git plumbing only, never a checkout. It never asks a model to merge\ntext. It never writes outside the generated folder and its own vendored copy, and it writes\nnothing at all without `--write`.\n","bodyHtml":"<h2 id=\"adapting-a-pack-skill-to-one-project\">Adapting a pack skill to one project</h2>\n<p>A project often needs a pack skill to carry what only it knows: who rules a decision, the zone\ntimes are written in, where records go, which of its own skills does the job a sibling pack skill\ndoes, and the steps and traps it has learned. Copying the skill and editing the copy is a fork: it\nstops receiving fixes, and the two drift until nobody can say which rule is current.</p>\n<p>The adapted copy is the alternative. It is <strong>generated</strong> from two inputs: the pack skill at a\npinned ref, and the project&#39;s overlay. It is committed, so every clone, worktree and branch that\ncarries it has it with no network. It is never edited by hand, the same discipline a project\nalready applies to any generated file a test byte-compares. The contract it follows — binding\nslots, hard-line and step ids, and the merge rules — is the pack&#39;s <code>docs/project-adaptation.md</code>.\nThis page is how <code>scripts/adapt.mjs</code> carries it out.</p>\n<p>Why one generated skill rather than the pack skill installed beside a thin project skill: nothing\nin a skill&#39;s frontmatter makes one skill load another, so a second skill has to be found by its\ndescription, and a harness with many skills installed drops descriptions first for the skills\ninvoked least. A personal copy of the generic skill can also take precedence over the project&#39;s.\nOne invocation of the adapted copy brings the whole procedure, the project&#39;s values and its\nadditions together.</p>\n<h3 id=\"the-files\">The files</h3>\n<pre><code class=\"language-text\">&lt;project&gt;/\n  .claude/skill-adapters/\n    .tool/adapt.mjs        the composer, vendored by compose --write\n    &lt;name&gt;/\n      adapter.json         written by a person\n      overlay.md           written by a person\n      references/\n        project/           the project&#39;s own reference files, listed in projectFiles\n  .claude/skills/&lt;name&gt;/   GENERATED: never edited by hand\n    SKILL.md\n    LICENSE\n    adapted.lock.json\n    (the skill&#39;s own references, scripts and assets, byte for byte)\n</code></pre>\n<p><code>--adapters-dir</code> and <code>--skills-dir</code> move the two folders for a harness that reads skills from\nsomewhere else; pass the same values to every command, because the lock records them. Both stay\ninside the repository where they land, not only as written: <code>compose --write</code> refuses either\nfolder, or the vendored composer, when a symbolic link on the way takes it outside, and writes\nnothing. Reading is not limited, so the pack is read from a clone anywhere.\n<code>onboard-project</code> looks for adapted copies only in <code>.claude/skills/</code> and <code>.agents/skills/</code>, so a\ncopy composed anywhere else does not stand in for its skill there.</p>\n<h4 id=\"adapterjson\"><code>adapter.json</code></h4>\n<pre><code class=\"language-json\">{\n  &quot;version&quot;: 1,\n  &quot;name&quot;: &quot;triage-arrivals&quot;,\n  &quot;description&quot;: &quot;Take in what reaches this repository. Use when a file, a mail or a message arrives for the team.&quot;,\n  &quot;base&quot;: {\n    &quot;source&quot;: &quot;https://github.com/&lt;owner&gt;/&lt;pack&gt;&quot;,\n    &quot;skill&quot;: &quot;&lt;pack skill&gt;&quot;,\n    &quot;path&quot;: &quot;&lt;optional: the skill&#39;s folder in the source, when it is not skills/&lt;pack skill&gt;&gt;&quot;,\n    &quot;entry&quot;: &quot;SKILL.md&quot;,\n    &quot;ref&quot;: &quot;v1.4.0&quot;,\n    &quot;commit&quot;: &quot;&lt;optional: the full commit the ref was reviewed at&gt;&quot;,\n    &quot;tree&quot;: &quot;&lt;optional: the full tree of the skill&#39;s folder at that commit&gt;&quot;\n  },\n  &quot;overlay&quot;: &quot;overlay.md&quot;,\n  &quot;projectFiles&quot;: [],\n  &quot;names&quot;: {}\n}\n</code></pre>\n<table>\n<thead>\n<tr>\n<th>key</th>\n<th>what it holds</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>name</code>, <code>description</code></td>\n<td>the adapted copy&#39;s own name and trigger text. The name is never the pack skill&#39;s name, so neither copy hides the other</td>\n</tr>\n<tr>\n<td><code>base.source</code></td>\n<td><code>https://github.com/&lt;owner&gt;/&lt;repo&gt;</code>, or a local path to a clone of the pack. Every other transport is refused</td>\n</tr>\n<tr>\n<td><code>base.skill</code></td>\n<td>the pack skill&#39;s name, which its <code>SKILL.md</code> declares; its folder is <code>skills/&lt;skill&gt;</code> unless <code>base.path</code> names another</td>\n</tr>\n<tr>\n<td><code>base.path</code></td>\n<td>optional: the skill&#39;s folder inside its source, for a source that keeps it elsewhere than <code>skills/&lt;skill&gt;</code>, such as <code>skills/&lt;category&gt;/skills/&lt;skill&gt;</code>. It is written from the source&#39;s root, with no <code>..</code> and no leading <code>/</code>, and it names a folder inside the source; anything else is refused. The tree, <code>outdated</code> and <code>--verify</code> read that folder, and the lock records it</td>\n</tr>\n<tr>\n<td><code>base.entry</code></td>\n<td><code>SKILL.md</code>, or one reference file of the skill when that file holds the procedure the project needs</td>\n</tr>\n<tr>\n<td><code>base.ref</code></td>\n<td>a tag (<code>vX.Y.Z</code> or <code>&lt;skill&gt;-vX.Y.Z</code>) or a full commit sha. A branch is refused, because it moves, and so is an abbreviated sha. A per-skill tag is compared with newer tags of its own and with the latest catalogue tag, because a catalogue release can change the skill without a per-skill tag beside it</td>\n</tr>\n<tr>\n<td><code>base.commit</code>, <code>base.tree</code></td>\n<td>optional. When present, a ref that now resolves elsewhere is refused</td>\n</tr>\n<tr>\n<td><code>allowedTools</code></td>\n<td>optional: exactly the tools the copy pre-approves while it is active, each one word, such as <code>Read</code>, since the <code>allowed-tools</code> line separates them by spaces. Absent or empty, the copy pre-approves none, whatever the skill declares (<a href=\"#no-tool-is-pre-approved-unless-the-project-names-it\">why</a>)</td>\n</tr>\n<tr>\n<td><code>overlay</code></td>\n<td>the overlay file, <code>overlay.md</code> unless named</td>\n</tr>\n<tr>\n<td><code>projectFiles</code></td>\n<td>the project&#39;s own files, each listed by its path inside the adapter folder, and each inside a <code>project</code> folder under <code>references</code>, <code>scripts</code> or <code>assets</code>, so they never collide with the skill&#39;s: <code>&lt;adapter&gt;/references/project/record-forms.md</code> is listed as the part after <code>&lt;adapter&gt;/</code>. A file in those folders that is not listed is refused rather than left out</td>\n</tr>\n<tr>\n<td><code>names</code></td>\n<td>rarely needed: a pack skill the carried text names in backticks that no slot covers, mapped to this project&#39;s skill. Its main use is a reference-file entry that sends the reader back to its own skill</td>\n</tr>\n</tbody></table>\n<p>An unknown key is refused, because a misspelt one would otherwise be read as absent.</p>\n<h4 id=\"overlaymd\"><code>overlay.md</code></h4>\n<pre><code class=\"language-markdown\">## Bindings\n\n| id | value |\n|---|---|\n| B1 owner | Ada Example, the release manager. Only her own instruction is acted on. |\n| B5 defects (skill) | `triage-a-defect`, this repository&#39;s own skill |\n\n## Additions\n\n### S3\nAn arrival larger than 100 MB is kept on the shared drive; the repository keeps its hash.\n\n### H1\nNot even an automatic reply: the mailbox&#39;s auto-responder stays off.\n\n## Project traps\n\n| trap | so |\n|---|---|\n| two packs unpacked into one folder overwrote each other | every pack gets its own folder |\n</code></pre>\n<ul>\n<li><strong>Bindings</strong> bind slots the skill declares; a slot left out keeps its default. A <code>skill</code> slot&#39;s\nvalue opens with one skill&#39;s name in backticks; that is what the names map is built from.</li>\n<li><strong>Additions</strong> are one <code>### &lt;id&gt;</code> heading per step or hard line. An addition whose first line is\n<code>replaces: S2. &lt;why, and where the decision is recorded&gt;</code> supersedes the step instead; it is\nrefused on a hard line.</li>\n<li><strong>Project traps</strong> come last, as written.</li>\n<li>Nothing else reaches the copy, so any other section, or text before the first one, is refused. A\n<code>#</code> title and HTML comments before the first section are allowed.</li>\n<li>Links in the overlay are written as they will be read from the generated <code>SKILL.md</code>: a project\nfile is reached at the same path it has in the adapter folder. Every link is checked, in fenced\ncode too, so an example writes a path as code, such as <code>docs/intake.md</code>, not as a link.</li>\n<li>Fenced code in the overlay closes inside the addition or section it opens in, at a bare line of\nat least as many of its character, indented as far as the fence or up to three columns further;\na fence may open on the line of its list marker. One left open would swallow every heading after\nit, and the checks they face, so it is refused. A line that opens another part of the overlay, a\nsection or a <code>###</code> heading whose first word is an id, ends a fence open across it, and so does\nsuch a heading indented one to three spaces, which Markdown still reads as a heading: an example\nthat shows one for a step indents the fence and its lines four spaces. One for a hard line is\nshown only in the addition to that hard line.</li>\n<li>An addition&#39;s heading starts at the left margin, so an indented <code>###</code> heading whose first word\nis an id is refused outside fenced code too. A heading of any shape that names a hard line,\nwherever the id sits in it, is refused anywhere but the addition to that hard line, at any indent\nand fenced or not, and so is a line that opens with a hard line&#39;s id in bold (check 5). Elsewhere,\nname a hard line in a sentence.</li>\n</ul>\n<h3 id=\"commands\">Commands</h3>\n<pre><code class=\"language-bash\"># The first time, and when a pin moves to a ref that ships another composer: run the composer\n# from a clone of the pack checked out at the pinned ref, a tag or a full commit sha.\ngit clone https://github.com/&lt;owner&gt;/&lt;pack&gt; &lt;pack clone&gt;\ngit -C &lt;pack clone&gt; fetch origin &lt;ref&gt;    # only for a commit that no branch or tag holds\ngit -C &lt;pack clone&gt; checkout --detach &lt;ref&gt;\nnode &lt;pack clone&gt;/skills/update-agent-skills/scripts/adapt.mjs compose --repo . --pack &lt;pack clone&gt;\nnode &lt;pack clone&gt;/skills/update-agent-skills/scripts/adapt.mjs compose --repo . --pack &lt;pack clone&gt; --write\n\n# From then on, the vendored copy:\nnode .claude/skill-adapters/.tool/adapt.mjs compose --repo .            # prints the change\nnode .claude/skill-adapters/.tool/adapt.mjs compose --repo . --write    # writes it\nnode .claude/skill-adapters/.tool/adapt.mjs check --repo .              # offline\nnode .claude/skill-adapters/.tool/adapt.mjs outdated --repo .           # online, reads only\nnode .claude/skill-adapters/.tool/adapt.mjs outdated --repo . --verify  # and compares every carried file\n</code></pre>\n<ul>\n<li><code>compose</code> reads each pin, holds the overlay to what the skill declares, and prints the files it\nwould add (<code>+</code>), change (<code>~</code>) or remove (<code>-</code>), what moved in the pin, and every addition to a hard\nline for review. It writes nothing without <code>--write</code>. With it, it writes the generated folder and\nvendors itself. <code>--adapter &lt;name&gt;</code> composes one; <code>--pack &lt;dir&gt;</code> reads a local clone instead of\nfetching. When the pinned ref ships another composer than the one running, it says so.</li>\n<li><code>check</code> is offline: no git, no network. It exits 1 when any check below fails. <code>--adapter &lt;name&gt;</code>\nchecks one; a generated folder whose adapter is gone fails a check of every adapter, or of its\nown name.</li>\n<li><code>outdated</code> exits 2 when something needs a person: a newer tag that changes the skill, a moved or\ndeleted tag, a vendored composer that is not the one the pinned ref ships, or a question it could\nnot answer. A version orders tags of one kind only, so for a per-skill tag against a catalogue\ntag, or for a sha pin, a different tree is reported as differing, never as newer. It never says\n&quot;current&quot; when it could not tell. With <code>--verify</code> it exits 1 when a carried file is not the\nupstream bytes.</li>\n</ul>\n<p><strong>Which composer is vendored.</strong> The one that ran <code>compose --write</code>, byte for byte; check 7 then\nholds every copy to it. <code>compose</code> reads the pack and never runs anything it fetched, the pinned\nrelease&#39;s own composer included, so the composer does not move with a pin by itself: a pin moved\nwith the vendored composer keeps that composer until a person runs the new one. Bootstrapping from\na clone at the pinned ref is what makes the vendored composer the release&#39;s. When the two differ,\n<code>compose</code> notes it and <code>outdated</code> flags it, and composing again with the composer from a clone at\nthe pinned ref replaces it.</p>\n<p>In a repository onboarded with <code>onboard-project</code>, refresh its profile in the change that composes\na first copy, removes one, or moves a pin: its session-start check compares the copies on disk,\nwith their refs and trees, against the profile, and names any difference at every session start\nuntil a refresh records it. The refresh is also what routes a session to a new copy by name.</p>\n<p>Wire <code>check</code> into the project&#39;s tests, so that drift is a red test even without CI, and add one\nline to the project&#39;s agent instructions: never edit <code>.claude/skills/&lt;name&gt;/</code>; edit the adapter\nfolder and compose. When branches that both changed an adapted skill merge, never merge the\ngenerated folder by hand: merge <code>adapter.json</code> and the overlay, then compose.</p>\n<h3 id=\"what-the-copy-carries\">What the copy carries</h3>\n<p><code>SKILL.md</code>, in this order:</p>\n<ol>\n<li>the frontmatter: <code>name</code> and <code>description</code> from <code>adapter.json</code>; <code>license</code> and <code>compatibility</code>\nfrom the skill; <code>allowed-tools</code> only when <code>allowedTools</code> names tools, and then exactly those;\n<code>metadata</code> a map of the source, entry, ref, commit and tree;</li>\n<li>one generated line saying where to edit instead, and a short paragraph saying what the copy is\nand, when an addition opens with <code>replaces:</code>, that the addition wins over the step it names;</li>\n<li><strong>Names in this copy</strong>: where the text names a pack skill whose slot is bound to a project\nskill, the project skill to use instead;</li>\n<li><strong>This repository&#39;s bindings</strong>, the overlay&#39;s table as written;</li>\n<li>the skill&#39;s text between <code>&lt;!-- base:begin --&gt;</code> and <code>&lt;!-- base:end --&gt;</code> markers, byte for byte;</li>\n<li><strong>In this repository</strong>: the additions under their ids, then the project traps.</li>\n</ol>\n<p>Beside it: the skill&#39;s other files byte for byte at their own paths, so its links still resolve;\nthe project files; the pack&#39;s <code>LICENSE</code>, since the copy is a substantial portion of an MIT work;\nand <code>adapted.lock.json</code>, which records the pin (source, ref, commit, tree, and the skill&#39;s folder\nwhen <code>base.path</code> names one other than <code>skills/&lt;skill&gt;</code>), the sha256 of every file of the skill and\nof the text between the markers, the sha256 of every adapter input and every generated file, which\ngenerated files are executable, and the composer&#39;s version and sha256.</p>\n<p><strong>A reference file as the entry.</strong> Its text becomes the body of <code>SKILL.md</code> at the folder root, so\nevery relative link in it, fenced code included, is rewritten for that place, and it is still\ncarried at its own path. The skill&#39;s own <code>SKILL.md</code> is not carried, so a link to it from the entry\nis refused, and so is a binding or an addition to an id that only <code>SKILL.md</code> declares. Another\ncarried file that links to the skill&#39;s <code>SKILL.md</code> is carried byte for byte, so its link resolves to\nthis copy&#39;s <code>SKILL.md</code>, which holds the entry&#39;s text; <code>compose</code> and <code>check</code> warn and name each such\nlink, because only an edit to the skill can change it.</p>\n<p>Composing is concatenation at fixed points, never a model merging text, so the result can be\ncompared byte for byte: LF line endings, files in sorted order, no timestamps.</p>\n<h4 id=\"no-tool-is-pre-approved-unless-the-project-names-it\">No tool is pre-approved unless the project names it</h4>\n<p>A skill&#39;s <code>allowed-tools</code> line pre-approves tools while the skill is active, in a harness that reads\nit, and one entry can reach far: <code>Bash</code> alone covers every command, a push included. So the copy\ncarries no <code>allowed-tools</code> line unless <code>allowedTools</code> names the tools, and then exactly those, in\nthe order named. The skill&#39;s own line is never carried, not even in part: a pre-approval granted by\na shared skill would apply in every project that adapts it, chosen by none of them. A tool the copy\ndoes not name is asked for as the project&#39;s own settings decide, as it is for a skill without the\nline.</p>\n<p>The lock still records what the skill declares, and <code>compose</code> says so, so a project that wants a\ntool pre-approved can see what the skill asked for and name it in <code>allowedTools</code>, where review sees\nit. <code>compose</code> lists every tool the copy pre-approves for review, and check 9 refuses an\n<code>allowed-tools</code> line that is not that list, one added by hand included.</p>\n<h3 id=\"the-checks\">The checks</h3>\n<p><code>check</code> holds every adapted copy to these. <code>compose</code> refuses an input that would break 4, 5, 6 or 10,\nor put a marker of check 2 into the overlay; the rest it writes true. A refusal or a failure is\nprinted with the number of its check. Two kinds carry a word instead: <code>[adapter]</code>, an adapter\nfolder that does not read as one (an unknown key, a missing overlay, an <code>adapter.json</code> or overlay\nthat is a symbolic link, a project file out of place or colliding with a file of the skill, an\noverlay section the copy would drop, a fence in the overlay that does not close inside its addition\nor section, an indented <code>###</code> heading whose first word is an id), and <code>[pin]</code>, a pin\nthat cannot be taken (a branch, an abbreviated sha, a tag that now names another commit, a\nrecorded commit or tree the ref no longer gives, a skill or entry the ref does not have, or a\nsource that cannot be read).</p>\n<table>\n<thead>\n<tr>\n<th>#</th>\n<th>what it holds</th>\n<th>what fails it</th>\n</tr>\n</thead>\n<tbody><tr>\n<td>1</td>\n<td>every generated file has the sha256 and the mode, executable or not, that its lock records, and the folder holds nothing else</td>\n<td>a hand edit, a mode changed by hand, a file added or removed by hand</td>\n</tr>\n<tr>\n<td>2</td>\n<td>the text between the markers has the sha256 recorded at compose time</td>\n<td>an edit to the skill&#39;s own text</td>\n</tr>\n<tr>\n<td>3</td>\n<td>composing again from the copy and the current adapter folder gives the same bytes</td>\n<td>an overlay or <code>adapter.json</code> changed without composing; a pin moved in <code>adapter.json</code> but not composed</td>\n</tr>\n<tr>\n<td>4</td>\n<td>every id the overlay cites is declared by a carried file; each slot is bound once and to a value, a <code>skill</code> slot to a skill&#39;s name; each step or hard line is added to once, with text; every required slot is bound; a <code>skill</code> slot whose default this project also adapts is bound to an adapted copy of it, and to no other skill (a copy over the skill&#39;s <code>SKILL.md</code> counts as one when the slot hands work back to its own skill; a copy over a reference file never does for itself); <code>names</code> maps only a skill the carried text names and no slot covers, and the names map says one thing per skill</td>\n<td>a typo in an id; an id a newer release renamed; a handoff that would reach the generic copy, or another skill than the adapted copy; two rows for one slot; a carried file that declares <code>## Bindings</code> and holds a code block that meets a less indented line before it closes, or never closes, which the pack&#39;s verifier refuses too, since GitHub could show as code what a reading of it as text would declare</td>\n</tr>\n<tr>\n<td>5</td>\n<td>no <code>replaces:</code> on a hard line, a reason on every <code>replaces:</code>, the id it names its own heading&#39;s, and no addition to a hard line, its heading included, or paragraph naming one written in the words of an exception (<code>unless</code>, <code>except</code>, <code>does not apply</code> …), on the line that names it, in the same sentence, read whole over the lines it wraps across, or opening the sentence after it. Ids and words are read as a reader sees them: through emphasis, character references, invisible characters and markup between letters. Outside the addition to a hard line, no heading names its id, wherever the id sits in it, in any shape Markdown gives a heading: a <code>#</code> heading at any level, in a quote or a list item, an underlined paragraph, a paragraph that is only bold, or an HTML heading, at any indent, fenced or not; and no line opens with one in bold, the form a skill declares it in</td>\n<td>an overlay that relaxes a hard line, or puts text under a heading for one that no check reads as an addition to it. No script can tell stricter from looser in prose, so every addition to a hard line is also listed for review, and so is a paragraph that names one in a sentence and holds the words of an exception in another</td>\n</tr>\n<tr>\n<td>6</td>\n<td>the adapted copy&#39;s name differs from the skill&#39;s</td>\n<td>an adapter that takes its skill&#39;s name</td>\n</tr>\n<tr>\n<td>7</td>\n<td>the vendored composer is the one that composed each copy, and the one running the check</td>\n<td>a composer upgraded without composing again. Whether it is the one the pinned ref ships is <code>outdated</code>&#39;s to say, since that needs the pack</td>\n</tr>\n<tr>\n<td>8</td>\n<td>warning only: <code>SKILL.md</code> over 500 lines</td>\n<td>a long trap table; move it into a project reference file</td>\n</tr>\n<tr>\n<td>9</td>\n<td>the frontmatter follows the skill&#39;s <code>compatibility</code>, carries <code>allowed-tools</code> only as <code>allowedTools</code> names it, and once, and <code>metadata</code> is a map</td>\n<td>a hand edit to the frontmatter, an <code>allowed-tools</code> line added by hand among them</td>\n</tr>\n<tr>\n<td>10</td>\n<td>every relative link in the generated folder resolves and stays inside the repository, a symbolic link on the way followed to where it lands. A link inside fenced code is checked like any other, as the pack&#39;s verifier checks a skill&#39;s files: a link the check skipped would be checked by nothing, and no reading of fences by hand matches CommonMark. An example that shows a path writes it as code, such as <code>docs/guide.md</code>, not as a link. A link written from the root, such as <code>/docs/guide.md</code>, is refused: it is written from the file that holds it</td>\n<td>a link in the overlay or a project file to something that is not there, an example&#39;s included</td>\n</tr>\n</tbody></table>\n<p>A generated folder whose adapter folder is gone fails as well.</p>\n<p>Offline checks prove nobody changed the copy since it was composed; they cannot prove the copy\nwas ever the real upstream, because a person who edits a file and its hashes together leaves\nnothing to disagree. <code>outdated --verify</code> fetches the pinned commit and compares every carried\nfile, and that is what proves it.</p>\n<h3 id=\"moving-a-pin\">Moving a pin</h3>\n<ol>\n<li><code>outdated</code> prints, per adapted skill, either <code>v1.5.0 exists; skills/&lt;skill&gt; unchanged: moving the pin is a no-op</code>, or <code>changed (tree a -&gt; b): read git diff v1.4.0 v1.5.0 -- skills/&lt;skill&gt;</code>. For a\nper-skill tag against a catalogue tag, or a sha pin, it says <code>differs</code>, never newer, and names\nthe same diff; read it with the release notes before moving the pin. Where <code>base.path</code> names the\nskill&#39;s folder, that folder takes the place of <code>skills/&lt;skill&gt;</code> in each line.</li>\n<li>Read that diff in the pack. A release note that names a renamed or removed id says what an\noverlay cites instead.</li>\n<li>Change <code>base.ref</code> (and <code>base.commit</code> and <code>base.tree</code>, if recorded). <code>compose</code> refuses, and names\nthe id, when the overlay cites one that is gone or a required slot the new release added.</li>\n<li><code>compose --write</code>, then review the generated diff: it is the upstream change and nothing else.\nIf <code>compose</code> notes that the new ref ships another composer, compose again with the one from a\nclone of the pack at that ref, so the vendored composer moves with the pin.</li>\n<li>Run <code>check</code> and whatever scenarios the project keeps for the skill, and commit it as one change.\nIn a repository onboarded with <code>onboard-project</code>, refresh its profile in that same change: its\nsession-start check compares each copy&#39;s ref and tree with the profile, so a re-pin it has not\nrecorded is reported at every session start, a same-tree re-pin included.</li>\n</ol>\n<p><code>check-pack-freshness.mjs --repo &lt;project&gt;</code> lists the same pins against the latest release, beside\nthe global installs, as part of an inventory; a copy of another source is listed as not compared,\nand the run exits 2 when a pin moved or differs. A lock it cannot open is named, and a project or a\nnamed skills folder it cannot read is reported as unknown, never as a project with no copies.\nNeither it nor <code>skills update</code> ever moves one.</p>\n<h3 id=\"failure-modes\">Failure modes</h3>\n<table>\n<thead>\n<tr>\n<th>what goes wrong</th>\n<th>what happens</th>\n<th>what to do</th>\n</tr>\n</thead>\n<tbody><tr>\n<td>someone edits the generated folder</td>\n<td><code>check</code> fails at 1, and for an edit to <code>SKILL.md</code> at 3 as well: at 2 too inside the base markers, and at 9 in the frontmatter; <code>compose</code> refuses to overwrite it</td>\n<td>move the change into the overlay, then compose with <code>--discard-hand-edits</code></td>\n</tr>\n<tr>\n<td>a folder of the same name was written by hand</td>\n<td><code>compose</code> refuses: it has no lock</td>\n<td>move its project text into the overlay, then <code>--discard-hand-edits</code></td>\n</tr>\n<tr>\n<td>a pinned tag is moved or deleted upstream</td>\n<td><code>outdated</code> raises an alarm; <code>compose</code> refuses the moved tag; the committed copy and the offline check are unaffected</td>\n<td>read why; re-pin to a full sha or a new tag, or record the new commit in <code>base.commit</code> on purpose</td>\n</tr>\n<tr>\n<td>a newer release renames an id the overlay cites</td>\n<td><code>compose</code> refuses and names it</td>\n<td>fix the overlay in the same change as the pin</td>\n</tr>\n<tr>\n<td>no network</td>\n<td>only <code>compose</code> (without <code>--pack</code>) and <code>outdated</code> stop</td>\n<td>nothing else needs it</td>\n</tr>\n<tr>\n<td>a git setting (<code>url.&lt;base&gt;.insteadOf</code>) rewrites GitHub addresses to ssh</td>\n<td><code>compose</code> without <code>--pack</code> refuses the pin, and <code>outdated</code> reports unknown: the composer allows a remote over https only, and the message names the setting</td>\n<td>run the command with that setting left out (for one in the global configuration, <code>GIT_CONFIG_GLOBAL</code> naming an empty file), or compose from a clone with <code>--pack</code></td>\n</tr>\n<tr>\n<td>the project wants a tool pre-approved that the skill&#39;s own <code>allowed-tools</code> names</td>\n<td>the copy does not carry it, so the harness asks for the tool as the project&#39;s own settings decide</td>\n<td>name it in <code>allowedTools</code> and compose; review reads it there</td>\n</tr>\n<tr>\n<td>the generic copy is picked instead of the adapted one</td>\n<td>the session misses the project&#39;s values; an unbound slot falls back to its default, often &quot;ask once&quot;</td>\n<td>give the adapted copy the project&#39;s own trigger phrases, and route the task to it by name in the project&#39;s agent instructions; <code>onboard-project</code>&#39;s routing file does that for a repository it onboards</td>\n</tr>\n<tr>\n<td>two branches change one adapted skill</td>\n<td>a conflict inside a generated folder</td>\n<td>merge the adapter folder, then compose</td>\n</tr>\n<tr>\n<td>a security fix reaches the pack</td>\n<td>the project has it only when the pin moves</td>\n<td>run <code>outdated</code> on a schedule the project keeps</td>\n</tr>\n<tr>\n<td>a pin moved with the old composer</td>\n<td>the copies are composed, vendored and checked by the old composer; nothing offline disagrees</td>\n<td><code>compose</code> notes it and <code>outdated</code> flags it; compose again with the composer from a clone at the pinned ref</td>\n</tr>\n</tbody></table>\n<h3 id=\"what-it-does-not-do\">What it does not do</h3>\n<p>It installs nothing globally and changes no agent settings. It never runs anything from a fetched\ntree: it reads the pack with git plumbing only, never a checkout. It never asks a model to merge\ntext. It never writes outside the generated folder and its own vendored copy, and it writes\nnothing at all without <code>--write</code>.</p>\n","words":4386}],"body":"# Update Agent Skills\n\nMaintain release communication and update every explicitly requested Agent Skill\nlibrary without confusing one scope, agent, or channel for all of them. This skill\nis repository/account agnostic. It does not authorize publication, a new release,\nor mutation of an unmentioned machine, project, plugin, upload, or remote target.\n\n## When to Use\n\n- “Update my skills,” “sync this skill everywhere,” or “bring all my agents to the\n  released version.”\n- A released skill changed and its changelog, catalogue README, release notes, or\n  update guidance must be corrected before users are encouraged to update.\n- Installed project/global/native/manual copies need a provenance-aware refresh.\n- A project adapts a pack skill to its own values and steps: compose the adapted\n  copy from a pinned release, check it, or find out whether its pin is behind.\n\nDo not use to publish unreleased source; use the target's publishing workflow\nfirst. Do not mutate real local libraries unless the user explicitly requests the\nscope, machine, agent/channel set, or “all supported agents on this machine.”\n\n## Release Communication Gate\n\nBefore encouraging an update, verify the authoritative release exists. Maintain\nthese human and agent surfaces when they are part of the named source repository:\n\n1. **Changelog:** newest version/date first; outcomes, compatibility or migration,\n   and affected users—not a commit list.\n2. **Repository/catalogue README:** exact skill description, source, install and\n   update commands, scope behavior, and any native/manual alternatives.\n3. **Release notes:** human-readable “what changed / who should update / how to\n   update / restart or migration needed.” A tag or generated diff is not release\n   notes.\n4. **Agent-facing update guidance:** an executable prompt that inventories first,\n   preserves provenance and namespaces, updates only requested planes, verifies\n   readback, and reports partial results.\n\nEncourage users and agents to update only after those surfaces resolve to the\npublished source. Communication is not authorization to update their machines.\n\n## Inventory Every Requested Plane\n\nResolve the published source and literal skill identities. Then inventory both\nSkills CLI scopes in machine-readable form:\n\n```bash\nnpx skills list --global --json\nnpx skills list --json\n```\n\nRecord scope, source provenance, managed/unmanaged ownership, install path,\ncopy/symlink form, and every consuming agent projection. Also discover:\n\n- native plugin/package channels and their namespaces/versions;\n- adapted copies a project composed from a pinned pack skill (an adapter folder\n  beside a generated folder holding `adapted.lock.json`): the Skills CLI does not\n  list them and never updates them, so they are a plane of their own;\n- manual/upload/raw-file channels;\n- remote machines, containers, browser-only agents, and other runtimes;\n- unsupported clients reported by the owning installer.\n\nBefore writes, present a deduplicated target manifest: `machine × scope/profile ×\nagent/channel × physical path × mechanism`. Several agents may consume one shared\nphysical store; update it once and report every covered consumer. “All supported\nagents” authorizes only the discovered set shown in this manifest—not unknown\nprofiles, undetected clients, or guessed directories.\n\nA native plugin identity and a standalone bare skill are separate. A shared\nsymlinked canonical copy and several copied agent directories are different\nfreshness models. Never infer that this machine represents another target.\n\n## Update by Owning Channel\n\n### Generic Skills CLI\n\nFor CLI-managed skills, specify scope rather than relying on the current folder:\n\n```bash\nnpx skills update <skill...> --global --yes\nnpx skills update <skill...> --project --yes\n```\n\n`skills update` has no agent selector. It updates managed records at the selected\nscope; it is not proof that every copied agent projection changed. Re-inventory\nand verify each selected target path afterwards. Use an explicit `skills add`\nonly for missing selected projections, never as a substitute for provenance-aware\nupdate.\n\nFor a missing global projection across all supported agents:\n\n```bash\nnpx skills add <published-source> --skill <skill...> --global --agent '*' --yes\n```\n\nRun a missing project install from the exact project without `--global` and name\nits intended agents. `--agent '*'` means every agent supported by the installed\nCLI, not every possible agent. Preserve copy/symlink form; use `--copy` only when\nselected by the user or existing install.\n\n### Unmanaged or provenance-less copies\n\nDo not overwrite them as managed. Show the exact path, identity, requested scope,\nand authoritative replacement source. Ask before destructive replacement, remove\nonly that identity/scope, reinstall, and preserve unrelated or namespaced skills.\nDo not delete a local skill merely because it disappeared upstream. Report it as\na removal candidate and require separate destructive confirmation.\n\n### Native plugin/package plane\n\nUse the native plugin marketplace or package registry refresh/update flow. Read\nback exact installed version, namespace, path, and skill bytes. A generic CLI\nupdate does not prove a native plugin updated.\n\n### Manual/upload and remote planes\n\nVerify the released ZIP/raw file/artifact. Perform the UI replacement only when\nthat target is requested and controllable; otherwise report `manual action\nrequired`. Update each remote machine/container independently. Report an agent\nthe owning installer explicitly rejects as `unsupported`; report an explicitly\nrequested but currently unreachable target as `deferred`. Never invent a folder.\n\n## Verify and Report\n\n1. Re-run both JSON inventories and native version queries.\n2. Confirm expected project/global precedence and every requested supported-agent\n   projection.\n3. Where no trustworthy version exists, compare installed bytes or a cryptographic\n   hash with the published artifact.\n   If the authoritative source exposes no comparable version/ref/digest, report\n   freshness as `unknown` after update rather than manufacturing certainty.\n4. Restart or reload affected agents whose loaders cache skills; an active session\n   may continue using old instructions until reopened.\n5. Report `scope × agent/channel × identity` as `updated`, `already current`,\n   `manual action required`, `unsupported`, `deferred`, `failed`, or `out of scope`.\n6. Include the release-note/update link and encourage affected humans and agents to\n   update, but never collapse partial success into “everything is updated.”\n\n## Keeping a Pack Current\n\nNothing in the update path announces that a pack moved, and the Skills CLI cannot\nbe asked. Its `check` is a bare alias for `update`: it mutates, there is no dry\nrun, and its exit code reports failure rather than availability—exit 0 covers\nboth “nothing to do” and “I just rewrote every tracked skill.” Anything that runs\nthe CLI to *see* whether an update exists performs one instead, non-interactively,\nat a scope inferred from whatever directory it inherited.\n\nDetection must therefore be built apart from application. This skill carries both\nhalves, and the seam between them is where consent lives.\n\n### Detecting drift\n\n`scripts/check-pack-freshness.mjs` is read-only. It reads the global lockfile,\nasks the source repository for one tree, and compares the folder hash the\nlockfile already records against the hash upstream now has. It starts no process,\ncalls no CLI, and writes nothing but its own cache.\n\n```bash\nnode scripts/check-pack-freshness.mjs --source <owner>/<repo>\n```\n\nSilence means current. Drift prints the stale skill names, the latest release, and\nthe exact command that would apply it. With `--repo <project>` it also lists that\nproject's adapted pins, each against the latest release, current ones included,\nbecause that run is an inventory; a copy of another source is listed as not\ncompared, and an adapted copy is never named in the command. An inventory is\nnever silent, so `--repo` is refused with `--hook`.\nWhatever it could not determine—an unreadable lockfile, an unreachable source, an\nentry carrying no comparable hash, its own crash—prints a `PACK_FRESHNESS_UNKNOWN`\nblock that says so. Unknown is a third state and is never folded into “current”:\nwhere silence is the healthy signal, a failure that renders as silence reads as\nhealth.\n\nEvery verdict goes to stdout; only a usage error goes to stderr. That split is\nmechanical, not stylistic. On the hook channel below, stderr does not supplement\nstdout—it replaces it—so a verdict written to stderr is a verdict any stray line\nfrom any other process can erase.\n\nExit codes are a machine-readable API for a caller that wants one: 0 when current,\nuntracked, or unknown; 2 on drift, and with `--repo` when an adapted pin moved or\ndiffers from the latest release; 1 on a usage error. **Nothing user-facing may\ndepend on them.** An earlier version of this skill delivered through the exit code\nand so reported `unknown` by exiting silently—the exact failure the paragraph\nabove forbids, shipped inside the check that forbids it.\n\nA differing hash means different, not newer. Git tree hashes carry no ordering, so\nan upstream revert or force-push renders exactly like a release, and the printed\ncommand would move the installation to whatever upstream now holds, backwards\nincluded. Proving direction needs commit-history requests this check does not\nmake, so the notice states the limit rather than implying an upgrade.\n\nAnswers are cached with two deliberately different lifetimes. A current answer\nexpires in an hour; a drifted one in twelve. A drifted pack is re-announced every\nsession because the user has not acted yet, while the request is not repeated\nbecause the answer cannot change until they do. The verdict is recomputed from the\nlockfile on every run, so an update silences the notice at once instead of at the\nend of a cache window.\n\n### Being told, and being updated\n\n`scripts/install-freshness-hook.mjs` writes a `SessionStart` hook that runs the\nchecker. The user runs this. No skill may install it on their behalf.\n\n```bash\nnode scripts/install-freshness-hook.mjs --mode notify --source <owner>/<repo>\nnode scripts/install-freshness-hook.mjs --mode auto --source <owner>/<repo>\nnode scripts/install-freshness-hook.mjs --remove\n```\n\n`notify` reports and stops. It cannot mutate anything, because the checker cannot.\nIts hook is synchronous and always exits 0, handing the report to the model as\n`hookSpecificOutput.additionalContext`. The session waits for it: at most two\nrequests fenced at five seconds each, so roughly ten seconds on a cold check and a\nprocess spawn on a cached one. That cost is paid deliberately, because the\nasynchronous exit-2 rewake it replaced cannot carry this report at all. A\nsynchronous `SessionStart` hook that exits 2 *discards* the stdout exit 0 would\nhave delivered, and an asynchronous one delivers nothing on exit 0—which is the\ncode a check that could not determine freshness returns.\n\n`auto` applies exactly the update the checker named. **Installing auto mode is the\nuser's standing consent, for that source and that scope only.** This is not an\nexception to the rule that mutation requires an explicit request—it is the one\nchannel through which that request can be made ahead of time, recorded in a form\nthat can be read back and withdrawn with `--remove`. It authorizes nothing beyond\nthe source and scope named at install time: no other pack, no project scope, and\nno deletion.\n\nAuto cannot be synchronous—it may spend minutes inside `skills update`—so it stays\nasynchronous and wakes the model by exiting 2 whenever the checker had anything to\nsay: drift, a failed update, or a check that could not tell. It never keys that\ndecision off the checker's exit code, because 0 there covers both “current” and\n“could not tell”. Two costs come with that channel, measured rather than assumed\nand recorded in `adapters/HOOK-OUTPUT-NOTES.md`: in a non-interactive `claude -p`\nrun a rewake landing after the turn ends is dropped entirely, so the update happens\nand nobody is told; and the harness announces the wake as a `Stop hook blocking\nerror`, which is why the hook carries a `rewakeMessage` saying what the text is.\nWithout it, agents have been observed hunting the session for a fault that does not\nexist, and refusing the whole message as prompt injection.\n\nNever widen that command into a bare `skills update`. Named skills bound what is\nrewritten, `--global` pins the scope instead of letting the working directory\nchoose it, and `--yes` keeps an upstream deletion a printed warning rather than a\nremoval. An applied update still proves nothing about the agent projections;\nre-inventory and verify each one.\n\n## Adapting a Pack Skill to One Project\n\nA project that needs a pack skill to carry its own values — who rules, which zone,\nwhere records go, which of its own skills does a sibling's job — adapts the skill\ninstead of forking it. The adapted copy is generated from the pack skill at a\npinned ref and the project's overlay: bindings for the skill's slots, additions\nkeyed to its step and hard-line ids, and project traps. The copy is committed, so\nevery worktree and branch has it with no network, and it is never edited by hand.\nThe contract is the pack's `docs/project-adaptation.md`; the files, the ten checks\nand the failure modes are in [adapting a pack skill](references/adapting.md).\n\n`scripts/adapt.mjs` is the composer: dependency-free Node plus git, reading the pack\nwith git plumbing only, so nothing in a fetched tree runs. Run it the first time\nfrom a clone of the pack checked out at the pinned ref; it vendors itself into the\nproject, and the vendored copy runs from then on.\n\n```bash\n# The first time: a clone at the pinned tag or full sha (the guide says how for a\n# sha); compose prints the change, then writes it and vendors the composer.\ngit clone https://github.com/<owner>/<pack> <clone> && git -C <clone> checkout --detach <ref>\nnode <clone>/skills/update-agent-skills/scripts/adapt.mjs compose --repo <project> --pack <clone>\nnode <clone>/skills/update-agent-skills/scripts/adapt.mjs compose --repo <project> --pack <clone> --write\n# From then on, the vendored copy.\nnode <project>/.claude/skill-adapters/.tool/adapt.mjs check --repo <project>     # offline\nnode <project>/.claude/skill-adapters/.tool/adapt.mjs outdated --repo <project>  # online, reads only\n```\n\n- **Composing is installing, so this skill's consent rules hold.** `compose` prints\n  the change and writes nothing without `--write`, and it refuses to overwrite a copy\n  edited by hand unless told `--discard-hand-edits`.\n- **`check` belongs in the project's tests.** It is offline and fast. A hand edit, an\n  overlay changed without composing, a pin moved but not composed, or an overlay that\n  cites an id the skill does not declare turns it red.\n- **A pin is a tag or a full commit sha, never a branch.** Moving it is a review:\n  `outdated` says when a newer tag leaves the skill's tree unchanged, so there is\n  nothing to read, and names the `git diff` to read when it changed. Edit the ref,\n  compose, and review the generated diff, which is that upstream change and nothing\n  else. In a repository onboarded with `onboard-project`, refresh its profile in the\n  change that moves a pin, composes a first copy or removes one, or its check names\n  the copy at every session start.\n- **A moved tag stops the line.** `outdated` raises an alarm, and `compose` refuses\n  until the new commit is recorded on purpose.\n- **The composer moves with the pin only when a person runs the new one.** The\n  vendored composer is whichever ran `compose --write`, and check 7 holds every copy\n  to it; `compose` never runs one it fetched. When the pinned ref ships another\n  composer, `compose` notes it and `outdated` flags it: compose again with the one\n  from a clone at that ref.\n- **`skills update` never moves an adapted copy.** Inventory adapted copies with\n  `check-pack-freshness.mjs --repo <project>`; move one by moving its pin and composing.\n\n## Usage Examples\n\n```text\nUpdate this released skill for all supported agents in global scope on this\nmachine. Inventory JSON and provenance first, preserve plugin namespaces and\ncopy/symlink form, update through each owning channel, reload cached runtimes, and\nreport unsupported or manual planes separately.\n```\n\n```text\nAdapt this pack skill to the project: compose it from the pinned release and our\noverlay, show me the change, and check it. Write nothing until I say so.\n```\n\n```text\nPrepare the update communication only. Make the changelog, repository README,\nrelease notes, and agent-facing update guidance agree with the published release.\nDo not update any local library.\n```\n\n## Pitfalls\n\n- **Update before release:** branch bytes are not an update source.\n- **One scope called all:** project and global inventories are independent.\n- **One agent called all:** `--agent '*'` covers only the installed CLI's supported\n  set; native/manual/remote and unsupported clients remain separate.\n- **Shared path counted repeatedly:** deduplicate physical targets while still\n  reporting each consuming agent.\n- **Portable name, nonportable payload:** validate standard `SKILL.md`, relative\n  carried files, and absence of one-agent-only interpolation before copying.\n- **Upstream deletion mirrored:** deletion is a separately confirmed destructive\n  operation, never an ordinary update.\n- **Unmanaged overwritten:** absence of provenance requires approval, not guessing.\n- **Successful command called current:** verify version, namespace, bytes, or hash.\n- **Changelog as commit dump:** write outcomes and update action for a human reader.\n- **Announcement as consent:** encouraging adoption does not authorize mutation.\n- **A check that updates:** the CLI's `check` is an alias for `update`; asking it\n  whether a pack moved moves it. Detect drift read-only, apply it deliberately.\n- **Silence mistaken for health:** when “no output” means current, a check that\n  crashed or could not reach the network must report `unknown`, never nothing.\n- **Exit code used as the delivery channel:** an exit code that means two things\n  cannot announce either. Deliver the words; keep the code for machines.\n- **Drift read as an upgrade:** a tree hash is equal or unequal, never later. A\n  revert upstream reads as drift and “updating” to it walks the user backwards.\n- **An adapted copy treated as an install:** `skills update` never moves it, and a\n  hand edit is lost at the next compose. Put project text in the overlay; move the pin.\n- **A pin moved without reading:** a changed tree is upstream text the project now\n  carries. Read the diff `outdated` names before composing.\n\n## Verification\n\n- [ ] Published source/version/artifact exists and was read back.\n- [ ] Changelog, repository/catalogue README, human release notes, and agent update\n      guidance agree.\n- [ ] Every mutated scope/machine/agent/channel was explicitly requested.\n- [ ] Global and project inventories were captured before and after.\n- [ ] A deduplicated target manifest was presented before every local write.\n- [ ] Managed/unmanaged and copy/symlink ownership was preserved.\n- [ ] Upstream-missing skills are removal candidates requiring separate destructive\n      confirmation, not ordinary update deletions.\n- [ ] Without a comparable authoritative version/ref/digest, freshness is\n      `unknown`, never inferred from command success or timestamps.\n- [ ] Native, manual/upload, remote, and unsupported planes have literal outcomes.\n- [ ] Installed bytes/version/namespace and runtime reload were verified.\n- [ ] Users and agents receive exact update guidance without false completion.\n- [ ] Freshness was detected without invoking a command that mutates.\n- [ ] Any standing auto-update names the source and scope it covers, was installed\n      by the user, and can be withdrawn.\n- [ ] `unknown` reaches the conversation on the same channel a drift notice does,\n      and no verdict depends on an exit code to be delivered.\n- [ ] Adapted copies were inventoried by pin, moved only by composing, and `check`\n      passes on each.\n","bodyHtml":"<h2 id=\"update-agent-skills\">Update Agent Skills</h2>\n<p>Maintain release communication and update every explicitly requested Agent Skill\nlibrary without confusing one scope, agent, or channel for all of them. This skill\nis repository/account agnostic. It does not authorize publication, a new release,\nor mutation of an unmentioned machine, project, plugin, upload, or remote target.</p>\n<h3 id=\"when-to-use\">When to Use</h3>\n<ul>\n<li>“Update my skills,” “sync this skill everywhere,” or “bring all my agents to the\nreleased version.”</li>\n<li>A released skill changed and its changelog, catalogue README, release notes, or\nupdate guidance must be corrected before users are encouraged to update.</li>\n<li>Installed project/global/native/manual copies need a provenance-aware refresh.</li>\n<li>A project adapts a pack skill to its own values and steps: compose the adapted\ncopy from a pinned release, check it, or find out whether its pin is behind.</li>\n</ul>\n<p>Do not use to publish unreleased source; use the target&#39;s publishing workflow\nfirst. Do not mutate real local libraries unless the user explicitly requests the\nscope, machine, agent/channel set, or “all supported agents on this machine.”</p>\n<h3 id=\"release-communication-gate\">Release Communication Gate</h3>\n<p>Before encouraging an update, verify the authoritative release exists. Maintain\nthese human and agent surfaces when they are part of the named source repository:</p>\n<ol>\n<li><strong>Changelog:</strong> newest version/date first; outcomes, compatibility or migration,\nand affected users—not a commit list.</li>\n<li><strong>Repository/catalogue README:</strong> exact skill description, source, install and\nupdate commands, scope behavior, and any native/manual alternatives.</li>\n<li><strong>Release notes:</strong> human-readable “what changed / who should update / how to\nupdate / restart or migration needed.” A tag or generated diff is not release\nnotes.</li>\n<li><strong>Agent-facing update guidance:</strong> an executable prompt that inventories first,\npreserves provenance and namespaces, updates only requested planes, verifies\nreadback, and reports partial results.</li>\n</ol>\n<p>Encourage users and agents to update only after those surfaces resolve to the\npublished source. Communication is not authorization to update their machines.</p>\n<h3 id=\"inventory-every-requested-plane\">Inventory Every Requested Plane</h3>\n<p>Resolve the published source and literal skill identities. Then inventory both\nSkills CLI scopes in machine-readable form:</p>\n<pre><code class=\"language-bash\">npx skills list --global --json\nnpx skills list --json\n</code></pre>\n<p>Record scope, source provenance, managed/unmanaged ownership, install path,\ncopy/symlink form, and every consuming agent projection. Also discover:</p>\n<ul>\n<li>native plugin/package channels and their namespaces/versions;</li>\n<li>adapted copies a project composed from a pinned pack skill (an adapter folder\nbeside a generated folder holding <code>adapted.lock.json</code>): the Skills CLI does not\nlist them and never updates them, so they are a plane of their own;</li>\n<li>manual/upload/raw-file channels;</li>\n<li>remote machines, containers, browser-only agents, and other runtimes;</li>\n<li>unsupported clients reported by the owning installer.</li>\n</ul>\n<p>Before writes, present a deduplicated target manifest: <code>machine × scope/profile × agent/channel × physical path × mechanism</code>. Several agents may consume one shared\nphysical store; update it once and report every covered consumer. “All supported\nagents” authorizes only the discovered set shown in this manifest—not unknown\nprofiles, undetected clients, or guessed directories.</p>\n<p>A native plugin identity and a standalone bare skill are separate. A shared\nsymlinked canonical copy and several copied agent directories are different\nfreshness models. Never infer that this machine represents another target.</p>\n<h3 id=\"update-by-owning-channel\">Update by Owning Channel</h3>\n<h4 id=\"generic-skills-cli\">Generic Skills CLI</h4>\n<p>For CLI-managed skills, specify scope rather than relying on the current folder:</p>\n<pre><code class=\"language-bash\">npx skills update &lt;skill...&gt; --global --yes\nnpx skills update &lt;skill...&gt; --project --yes\n</code></pre>\n<p><code>skills update</code> has no agent selector. It updates managed records at the selected\nscope; it is not proof that every copied agent projection changed. Re-inventory\nand verify each selected target path afterwards. Use an explicit <code>skills add</code>\nonly for missing selected projections, never as a substitute for provenance-aware\nupdate.</p>\n<p>For a missing global projection across all supported agents:</p>\n<pre><code class=\"language-bash\">npx skills add &lt;published-source&gt; --skill &lt;skill...&gt; --global --agent &#39;*&#39; --yes\n</code></pre>\n<p>Run a missing project install from the exact project without <code>--global</code> and name\nits intended agents. <code>--agent &#39;*&#39;</code> means every agent supported by the installed\nCLI, not every possible agent. Preserve copy/symlink form; use <code>--copy</code> only when\nselected by the user or existing install.</p>\n<h4 id=\"unmanaged-or-provenance-less-copies\">Unmanaged or provenance-less copies</h4>\n<p>Do not overwrite them as managed. Show the exact path, identity, requested scope,\nand authoritative replacement source. Ask before destructive replacement, remove\nonly that identity/scope, reinstall, and preserve unrelated or namespaced skills.\nDo not delete a local skill merely because it disappeared upstream. Report it as\na removal candidate and require separate destructive confirmation.</p>\n<h4 id=\"native-pluginpackage-plane\">Native plugin/package plane</h4>\n<p>Use the native plugin marketplace or package registry refresh/update flow. Read\nback exact installed version, namespace, path, and skill bytes. A generic CLI\nupdate does not prove a native plugin updated.</p>\n<h4 id=\"manualupload-and-remote-planes\">Manual/upload and remote planes</h4>\n<p>Verify the released ZIP/raw file/artifact. Perform the UI replacement only when\nthat target is requested and controllable; otherwise report <code>manual action required</code>. Update each remote machine/container independently. Report an agent\nthe owning installer explicitly rejects as <code>unsupported</code>; report an explicitly\nrequested but currently unreachable target as <code>deferred</code>. Never invent a folder.</p>\n<h3 id=\"verify-and-report\">Verify and Report</h3>\n<ol>\n<li>Re-run both JSON inventories and native version queries.</li>\n<li>Confirm expected project/global precedence and every requested supported-agent\nprojection.</li>\n<li>Where no trustworthy version exists, compare installed bytes or a cryptographic\nhash with the published artifact.\nIf the authoritative source exposes no comparable version/ref/digest, report\nfreshness as <code>unknown</code> after update rather than manufacturing certainty.</li>\n<li>Restart or reload affected agents whose loaders cache skills; an active session\nmay continue using old instructions until reopened.</li>\n<li>Report <code>scope × agent/channel × identity</code> as <code>updated</code>, <code>already current</code>,\n<code>manual action required</code>, <code>unsupported</code>, <code>deferred</code>, <code>failed</code>, or <code>out of scope</code>.</li>\n<li>Include the release-note/update link and encourage affected humans and agents to\nupdate, but never collapse partial success into “everything is updated.”</li>\n</ol>\n<h3 id=\"keeping-a-pack-current\">Keeping a Pack Current</h3>\n<p>Nothing in the update path announces that a pack moved, and the Skills CLI cannot\nbe asked. Its <code>check</code> is a bare alias for <code>update</code>: it mutates, there is no dry\nrun, and its exit code reports failure rather than availability—exit 0 covers\nboth “nothing to do” and “I just rewrote every tracked skill.” Anything that runs\nthe CLI to <em>see</em> whether an update exists performs one instead, non-interactively,\nat a scope inferred from whatever directory it inherited.</p>\n<p>Detection must therefore be built apart from application. This skill carries both\nhalves, and the seam between them is where consent lives.</p>\n<h4 id=\"detecting-drift\">Detecting drift</h4>\n<p><code>scripts/check-pack-freshness.mjs</code> is read-only. It reads the global lockfile,\nasks the source repository for one tree, and compares the folder hash the\nlockfile already records against the hash upstream now has. It starts no process,\ncalls no CLI, and writes nothing but its own cache.</p>\n<pre><code class=\"language-bash\">node scripts/check-pack-freshness.mjs --source &lt;owner&gt;/&lt;repo&gt;\n</code></pre>\n<p>Silence means current. Drift prints the stale skill names, the latest release, and\nthe exact command that would apply it. With <code>--repo &lt;project&gt;</code> it also lists that\nproject&#39;s adapted pins, each against the latest release, current ones included,\nbecause that run is an inventory; a copy of another source is listed as not\ncompared, and an adapted copy is never named in the command. An inventory is\nnever silent, so <code>--repo</code> is refused with <code>--hook</code>.\nWhatever it could not determine—an unreadable lockfile, an unreachable source, an\nentry carrying no comparable hash, its own crash—prints a <code>PACK_FRESHNESS_UNKNOWN</code>\nblock that says so. Unknown is a third state and is never folded into “current”:\nwhere silence is the healthy signal, a failure that renders as silence reads as\nhealth.</p>\n<p>Every verdict goes to stdout; only a usage error goes to stderr. That split is\nmechanical, not stylistic. On the hook channel below, stderr does not supplement\nstdout—it replaces it—so a verdict written to stderr is a verdict any stray line\nfrom any other process can erase.</p>\n<p>Exit codes are a machine-readable API for a caller that wants one: 0 when current,\nuntracked, or unknown; 2 on drift, and with <code>--repo</code> when an adapted pin moved or\ndiffers from the latest release; 1 on a usage error. <strong>Nothing user-facing may\ndepend on them.</strong> An earlier version of this skill delivered through the exit code\nand so reported <code>unknown</code> by exiting silently—the exact failure the paragraph\nabove forbids, shipped inside the check that forbids it.</p>\n<p>A differing hash means different, not newer. Git tree hashes carry no ordering, so\nan upstream revert or force-push renders exactly like a release, and the printed\ncommand would move the installation to whatever upstream now holds, backwards\nincluded. Proving direction needs commit-history requests this check does not\nmake, so the notice states the limit rather than implying an upgrade.</p>\n<p>Answers are cached with two deliberately different lifetimes. A current answer\nexpires in an hour; a drifted one in twelve. A drifted pack is re-announced every\nsession because the user has not acted yet, while the request is not repeated\nbecause the answer cannot change until they do. The verdict is recomputed from the\nlockfile on every run, so an update silences the notice at once instead of at the\nend of a cache window.</p>\n<h4 id=\"being-told-and-being-updated\">Being told, and being updated</h4>\n<p><code>scripts/install-freshness-hook.mjs</code> writes a <code>SessionStart</code> hook that runs the\nchecker. The user runs this. No skill may install it on their behalf.</p>\n<pre><code class=\"language-bash\">node scripts/install-freshness-hook.mjs --mode notify --source &lt;owner&gt;/&lt;repo&gt;\nnode scripts/install-freshness-hook.mjs --mode auto --source &lt;owner&gt;/&lt;repo&gt;\nnode scripts/install-freshness-hook.mjs --remove\n</code></pre>\n<p><code>notify</code> reports and stops. It cannot mutate anything, because the checker cannot.\nIts hook is synchronous and always exits 0, handing the report to the model as\n<code>hookSpecificOutput.additionalContext</code>. The session waits for it: at most two\nrequests fenced at five seconds each, so roughly ten seconds on a cold check and a\nprocess spawn on a cached one. That cost is paid deliberately, because the\nasynchronous exit-2 rewake it replaced cannot carry this report at all. A\nsynchronous <code>SessionStart</code> hook that exits 2 <em>discards</em> the stdout exit 0 would\nhave delivered, and an asynchronous one delivers nothing on exit 0—which is the\ncode a check that could not determine freshness returns.</p>\n<p><code>auto</code> applies exactly the update the checker named. <strong>Installing auto mode is the\nuser&#39;s standing consent, for that source and that scope only.</strong> This is not an\nexception to the rule that mutation requires an explicit request—it is the one\nchannel through which that request can be made ahead of time, recorded in a form\nthat can be read back and withdrawn with <code>--remove</code>. It authorizes nothing beyond\nthe source and scope named at install time: no other pack, no project scope, and\nno deletion.</p>\n<p>Auto cannot be synchronous—it may spend minutes inside <code>skills update</code>—so it stays\nasynchronous and wakes the model by exiting 2 whenever the checker had anything to\nsay: drift, a failed update, or a check that could not tell. It never keys that\ndecision off the checker&#39;s exit code, because 0 there covers both “current” and\n“could not tell”. Two costs come with that channel, measured rather than assumed\nand recorded in <code>adapters/HOOK-OUTPUT-NOTES.md</code>: in a non-interactive <code>claude -p</code>\nrun a rewake landing after the turn ends is dropped entirely, so the update happens\nand nobody is told; and the harness announces the wake as a <code>Stop hook blocking error</code>, which is why the hook carries a <code>rewakeMessage</code> saying what the text is.\nWithout it, agents have been observed hunting the session for a fault that does not\nexist, and refusing the whole message as prompt injection.</p>\n<p>Never widen that command into a bare <code>skills update</code>. Named skills bound what is\nrewritten, <code>--global</code> pins the scope instead of letting the working directory\nchoose it, and <code>--yes</code> keeps an upstream deletion a printed warning rather than a\nremoval. An applied update still proves nothing about the agent projections;\nre-inventory and verify each one.</p>\n<h3 id=\"adapting-a-pack-skill-to-one-project\">Adapting a Pack Skill to One Project</h3>\n<p>A project that needs a pack skill to carry its own values — who rules, which zone,\nwhere records go, which of its own skills does a sibling&#39;s job — adapts the skill\ninstead of forking it. The adapted copy is generated from the pack skill at a\npinned ref and the project&#39;s overlay: bindings for the skill&#39;s slots, additions\nkeyed to its step and hard-line ids, and project traps. The copy is committed, so\nevery worktree and branch has it with no network, and it is never edited by hand.\nThe contract is the pack&#39;s <code>docs/project-adaptation.md</code>; the files, the ten checks\nand the failure modes are in <a href=\"references/adapting.md\">adapting a pack skill</a>.</p>\n<p><code>scripts/adapt.mjs</code> is the composer: dependency-free Node plus git, reading the pack\nwith git plumbing only, so nothing in a fetched tree runs. Run it the first time\nfrom a clone of the pack checked out at the pinned ref; it vendors itself into the\nproject, and the vendored copy runs from then on.</p>\n<pre><code class=\"language-bash\"># The first time: a clone at the pinned tag or full sha (the guide says how for a\n# sha); compose prints the change, then writes it and vendors the composer.\ngit clone https://github.com/&lt;owner&gt;/&lt;pack&gt; &lt;clone&gt; &amp;&amp; git -C &lt;clone&gt; checkout --detach &lt;ref&gt;\nnode &lt;clone&gt;/skills/update-agent-skills/scripts/adapt.mjs compose --repo &lt;project&gt; --pack &lt;clone&gt;\nnode &lt;clone&gt;/skills/update-agent-skills/scripts/adapt.mjs compose --repo &lt;project&gt; --pack &lt;clone&gt; --write\n# From then on, the vendored copy.\nnode &lt;project&gt;/.claude/skill-adapters/.tool/adapt.mjs check --repo &lt;project&gt;     # offline\nnode &lt;project&gt;/.claude/skill-adapters/.tool/adapt.mjs outdated --repo &lt;project&gt;  # online, reads only\n</code></pre>\n<ul>\n<li><strong>Composing is installing, so this skill&#39;s consent rules hold.</strong> <code>compose</code> prints\nthe change and writes nothing without <code>--write</code>, and it refuses to overwrite a copy\nedited by hand unless told <code>--discard-hand-edits</code>.</li>\n<li><strong><code>check</code> belongs in the project&#39;s tests.</strong> It is offline and fast. A hand edit, an\noverlay changed without composing, a pin moved but not composed, or an overlay that\ncites an id the skill does not declare turns it red.</li>\n<li><strong>A pin is a tag or a full commit sha, never a branch.</strong> Moving it is a review:\n<code>outdated</code> says when a newer tag leaves the skill&#39;s tree unchanged, so there is\nnothing to read, and names the <code>git diff</code> to read when it changed. Edit the ref,\ncompose, and review the generated diff, which is that upstream change and nothing\nelse. In a repository onboarded with <code>onboard-project</code>, refresh its profile in the\nchange that moves a pin, composes a first copy or removes one, or its check names\nthe copy at every session start.</li>\n<li><strong>A moved tag stops the line.</strong> <code>outdated</code> raises an alarm, and <code>compose</code> refuses\nuntil the new commit is recorded on purpose.</li>\n<li><strong>The composer moves with the pin only when a person runs the new one.</strong> The\nvendored composer is whichever ran <code>compose --write</code>, and check 7 holds every copy\nto it; <code>compose</code> never runs one it fetched. When the pinned ref ships another\ncomposer, <code>compose</code> notes it and <code>outdated</code> flags it: compose again with the one\nfrom a clone at that ref.</li>\n<li><strong><code>skills update</code> never moves an adapted copy.</strong> Inventory adapted copies with\n<code>check-pack-freshness.mjs --repo &lt;project&gt;</code>; move one by moving its pin and composing.</li>\n</ul>\n<h3 id=\"usage-examples\">Usage Examples</h3>\n<pre><code class=\"language-text\">Update this released skill for all supported agents in global scope on this\nmachine. Inventory JSON and provenance first, preserve plugin namespaces and\ncopy/symlink form, update through each owning channel, reload cached runtimes, and\nreport unsupported or manual planes separately.\n</code></pre>\n<pre><code class=\"language-text\">Adapt this pack skill to the project: compose it from the pinned release and our\noverlay, show me the change, and check it. Write nothing until I say so.\n</code></pre>\n<pre><code class=\"language-text\">Prepare the update communication only. Make the changelog, repository README,\nrelease notes, and agent-facing update guidance agree with the published release.\nDo not update any local library.\n</code></pre>\n<h3 id=\"pitfalls\">Pitfalls</h3>\n<ul>\n<li><strong>Update before release:</strong> branch bytes are not an update source.</li>\n<li><strong>One scope called all:</strong> project and global inventories are independent.</li>\n<li><strong>One agent called all:</strong> <code>--agent &#39;*&#39;</code> covers only the installed CLI&#39;s supported\nset; native/manual/remote and unsupported clients remain separate.</li>\n<li><strong>Shared path counted repeatedly:</strong> deduplicate physical targets while still\nreporting each consuming agent.</li>\n<li><strong>Portable name, nonportable payload:</strong> validate standard <code>SKILL.md</code>, relative\ncarried files, and absence of one-agent-only interpolation before copying.</li>\n<li><strong>Upstream deletion mirrored:</strong> deletion is a separately confirmed destructive\noperation, never an ordinary update.</li>\n<li><strong>Unmanaged overwritten:</strong> absence of provenance requires approval, not guessing.</li>\n<li><strong>Successful command called current:</strong> verify version, namespace, bytes, or hash.</li>\n<li><strong>Changelog as commit dump:</strong> write outcomes and update action for a human reader.</li>\n<li><strong>Announcement as consent:</strong> encouraging adoption does not authorize mutation.</li>\n<li><strong>A check that updates:</strong> the CLI&#39;s <code>check</code> is an alias for <code>update</code>; asking it\nwhether a pack moved moves it. Detect drift read-only, apply it deliberately.</li>\n<li><strong>Silence mistaken for health:</strong> when “no output” means current, a check that\ncrashed or could not reach the network must report <code>unknown</code>, never nothing.</li>\n<li><strong>Exit code used as the delivery channel:</strong> an exit code that means two things\ncannot announce either. Deliver the words; keep the code for machines.</li>\n<li><strong>Drift read as an upgrade:</strong> a tree hash is equal or unequal, never later. A\nrevert upstream reads as drift and “updating” to it walks the user backwards.</li>\n<li><strong>An adapted copy treated as an install:</strong> <code>skills update</code> never moves it, and a\nhand edit is lost at the next compose. Put project text in the overlay; move the pin.</li>\n<li><strong>A pin moved without reading:</strong> a changed tree is upstream text the project now\ncarries. Read the diff <code>outdated</code> names before composing.</li>\n</ul>\n<h3 id=\"verification\">Verification</h3>\n<ul>\n<li><input disabled=\"\" type=\"checkbox\"> Published source/version/artifact exists and was read back.</li>\n<li><input disabled=\"\" type=\"checkbox\"> Changelog, repository/catalogue README, human release notes, and agent update\nguidance agree.</li>\n<li><input disabled=\"\" type=\"checkbox\"> Every mutated scope/machine/agent/channel was explicitly requested.</li>\n<li><input disabled=\"\" type=\"checkbox\"> Global and project inventories were captured before and after.</li>\n<li><input disabled=\"\" type=\"checkbox\"> A deduplicated target manifest was presented before every local write.</li>\n<li><input disabled=\"\" type=\"checkbox\"> Managed/unmanaged and copy/symlink ownership was preserved.</li>\n<li><input disabled=\"\" type=\"checkbox\"> Upstream-missing skills are removal candidates requiring separate destructive\nconfirmation, not ordinary update deletions.</li>\n<li><input disabled=\"\" type=\"checkbox\"> Without a comparable authoritative version/ref/digest, freshness is\n<code>unknown</code>, never inferred from command success or timestamps.</li>\n<li><input disabled=\"\" type=\"checkbox\"> Native, manual/upload, remote, and unsupported planes have literal outcomes.</li>\n<li><input disabled=\"\" type=\"checkbox\"> Installed bytes/version/namespace and runtime reload were verified.</li>\n<li><input disabled=\"\" type=\"checkbox\"> Users and agents receive exact update guidance without false completion.</li>\n<li><input disabled=\"\" type=\"checkbox\"> Freshness was detected without invoking a command that mutates.</li>\n<li><input disabled=\"\" type=\"checkbox\"> Any standing auto-update names the source and scope it covers, was installed\nby the user, and can be withdrawn.</li>\n<li><input disabled=\"\" type=\"checkbox\"> <code>unknown</code> reaches the conversation on the same channel a drift notice does,\nand no verdict depends on an exit code to be delivered.</li>\n<li><input disabled=\"\" type=\"checkbox\"> Adapted copies were inventoried by pin, moved only by composing, and <code>check</code>\npasses on each.</li>\n</ul>\n","outline":["When to Use","Release Communication Gate","Inventory Every Requested Plane","Update by Owning Channel","Verify and Report","Keeping a Pack Current","Adapting a Pack Skill to One Project","Usage Examples","Pitfalls","Verification"],"words":3061}
