doctor-universal-plugin
Use this skill to diagnose a universal agent plugin — when `plugin build` reports "built 0" or "nothing to build", when it warns "No vendors declared in harnesses", when a repository still carries `.plugin/plugin.json` or a top-level `vendorExtensions` block after upgrading universal-plugin across a major, when a released version never reached the vendor manifests, when a runtime loads none of the plugin's skills, when a vendor manifest is missing or looks out of date after a pull, or when checking whether what the canonical plugin.json declares still matches what is on disk for Claude Code, Cursor, Codex, and GitHub Copilot CLI. Trigger on "is my plugin set up right", "why isn't my plugin loading", "the build says built 0", "why did nothing get built", "check the plugin", "are the vendor manifests current", or "what does this plugin declare".
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- doctor-universal-plugin
- description
- Use this skill to diagnose a universal agent plugin — when `plugin build` reports "built 0" or "nothing to build", when it warns "No vendors declared in harnesses", when a repository still carries `.plugin/plugin.json` or a top-level `vendorExtensions` block after upgrading universal-plugin across a major, when a released version never reached the vendor manifests, when a runtime loads none of the plugin's skills, when a vendor manifest is missing or looks out of date after a pull, or when checking whether what the canonical plugin.json declares still matches what is on disk for Claude Code, Cursor, Codex, and GitHub Copilot CLI. Trigger on "is my plugin set up right", "why isn't my plugin loading", "the build says built 0", "why did nothing get built", "check the plugin", "are the vendor manifests current", or "what does this plugin declare".
02 资源文件 2
- 参考文档README.md2.2 KB
- 脚本scripts/doctor.mjs33.0 KB
03 SKILL.md 正文
Plugin Doctor
Root plugin.json is the canonical manifest. Every other manifest a runtime reads is derived from
it, and a derived manifest that is missing, stale, or hand-edited fails silently: the runtime loads
what it finds, or loads nothing, and says nothing either way.
This skill is read-only. It never repairs. Every finding names the skill that owns its repair — hand it over rather than fixing it here, because a repair can rewrite a manifest the user maintains and that judgment belongs to the skill that owns the write.
Diagnose
node scripts/doctor.mjs
Resolve that path against this skill's own directory. It asks the project's installed CLI
(pnpm exec universal-plugin), else the CLI pinned to this skill's version (npx), about the
current working directory; add --root <path> to diagnose elsewhere.
Add --marketplace-root <path> (repeatable) to also check a separately-cloned shared marketplace
repository (e.g. a local clone of cyberuni/cyberplace) — see
Catalogs are checked at the repository root.
It never prompts and never writes, so it is safe to run unattended.
Stdout is one JSON object — that is the contract to read, not the CLI's own terminal output:
{
"root": "…",
"manifest": { "name": "my-plugin", "version": "1.0.0" },
"vendors": [{ "vendor": "claude-code", "path": ".claude-plugin/plugin.json", "status": "built", "exists": true, "stale": false }],
"findings": [{ "code": "unbuilt", "severity": "high", "detail": "…", "repair": "…" }],
"ok": false
}
findings is empty and ok is true when everything resolves — say so outright rather than
reporting an empty list. Exit status is 0 whether or not findings exist; a finding is a result, not
a failure. Add --verbose for a human-readable summary on stderr.
Read vendors[].status literally:
| Status | Means |
|---|---|
built |
the build writes this vendor's output. For copilot-cli that output is the com.github.copilot/ component tree, not a manifest |
canonical |
the vendor reads root plugin.json; no file is written, and that is correct |
skipped |
an unknown vendor id — a typo in vendors |
failed |
the write itself failed; the finding names why |
copilot-cli reporting canonical is a healthy plugin, not a missing build — root plugin.json
serves it, and a plugin declaring no agents, commands, rules, hooks, or LSP servers has nothing else
to derive. Never report it as a fault.
A plugin that does declare those reports copilot-cli as built at com.github.copilot/
instead. Declaring the canonical $schema moves them there: Copilot CLI stops reading them from the
plugin root entirely, so a root-only layout loads none of them and says nothing
(ADR-0015). That is what
copilot-root-components reports.
If node is unavailable, read scripts/doctor.mjs and apply the same checks by hand: it composes
universal-plugin plugin build --dry-run --format json with filesystem facts that build cannot see.
Findings and their repairs
Each code below is what the script emits.
| Finding | What it means | Repair |
|---|---|---|
no-manifest |
no root plugin.json — this is not a plugin yet |
/universal-plugin:init-universal-plugin (pnpm install: pnpm-universal-plugin-init-universal-plugin) |
legacy-manifest |
root plugin.json with neither $schema nor extensions — a single-vendor manifest on the canonical path |
/universal-plugin:init-universal-plugin (pnpm install: pnpm-universal-plugin-init-universal-plugin), adopt route |
vendor-only |
a vendor manifest with no canonical manifest above it | /universal-plugin:init-universal-plugin (pnpm install: pnpm-universal-plugin-init-universal-plugin), adopt route |
unbuilt |
a declared vendor whose output path holds no file — that runtime sees no plugin | /universal-plugin:build-plugin (pnpm install: pnpm-universal-plugin-build-plugin) |
stale |
a derived manifest older than plugin.json; for a derived directory (com.github.copilot/), its newest file is what is compared |
/universal-plugin:build-plugin (pnpm install: pnpm-universal-plugin-build-plugin) |
hand-edited |
a derived manifest that build would rewrite — the edit is already lost, it just has not been overwritten yet |
move the field to the canonical manifest or to harnesses.<vendor>, then rebuild |
unknown-vendor |
a vendors entry no build target matches; reported as skipped plus a warning |
fix the id in plugin.json |
unsupported-component |
a component path on the shared extension names a component one targeted vendor has none of (agents for Codex, rules for Claude Code, …); the build leaves it out of that vendor's manifest |
declare the path under harnesses.<vendor> for the vendors that read it, or leave it — nothing is lost |
stale-script |
a compiled skill script (scripts in the extension) is missing, or no longer matches what its source compiles to. A script that differs only in its embedded version is version-drift instead, never both |
/universal-plugin:build-plugin (pnpm install: pnpm-universal-plugin-build-plugin), then commit the compiled script |
script-compile-failed |
a declared script entry could not be compiled into one self-contained file — usually an import that does not resolve from the plugin root | fix the entry, then /universal-plugin:build-plugin (pnpm install: pnpm-universal-plugin-build-plugin) |
script-over-budget |
a compiled skill script is over the 150 KB budget | have the skill call the installed CLI instead: pnpm exec <bin> with a pinned npx fallback |
skill-link-escapes |
a relative Markdown link in a skill climbs out of the skill folder (../../readme.md). pnpm links or copies each skill folder on its own, and a plugin cache keeps only what ships, so the link resolves to nothing there |
copy the file into the skill and link it relatively, or link it by URL |
unaccepted-metadata |
plugin.json writes repository or author in a form the spec allows and a targeted runtime refuses — an object repository where Codex reads the canonical manifest, or an author with no name for Claude Code or Cursor. The build converts what it can in the derived manifests; this is what it cannot (severity high: the runtime does not load the plugin, or loses the field) |
rewrite the field in plugin.json as the warning says: repository as the URL string, author.name set |
undeliverable-override |
harnesses["copilot-cli"] sets fields that reach nothing |
/universal-plugin:init-universal-plugin (pnpm install: pnpm-universal-plugin-init-universal-plugin), update route — move them to a vendor that has a derived manifest, or drop them |
codex-fields-missing |
Codex is targeted without version or description; the build fails and writes nothing at all, including for the other vendors |
add both to the canonical top level |
version-drift |
one file carries a different version from the release's number — the canonical manifest, a derived vendor manifest, a catalog entry, a skill pin, a marked mcpServers entry, or the version a compiled skill script embeds; one finding per file, named by path |
/universal-plugin:version (pnpm install: pnpm-universal-plugin-version) (for a package-sourced drift, universal-plugin plugin version --from-package); then offer the CI check |
unstamped |
a place holds 0.0.0-development, semantic-release's placeholder. The release has not stamped it yet, so it is not drift (severity low) |
in prepareCmd, plugin version ${nextRelease.version}, and commit the stamped files back with @semantic-release/git; see /universal-plugin:version (pnpm install: pnpm-universal-plugin-version) |
unreleased-content |
shipped content was committed after the commit that set the current version — a consumer keyed on that version never re-extracts it | /universal-plugin:version (pnpm install: pnpm-universal-plugin-version) |
copilot-root-components |
agents, commands, rules, hooks, or LSP servers sit at the plugin root with no copy under com.github.copilot/ — Copilot CLI reads them only from there in spec mode, so it loads none of them, silently |
/universal-plugin:build-plugin (pnpm install: pnpm-universal-plugin-build-plugin) |
stale-github-plugin |
a leftover .github/plugin/plugin.json from an older build — shadowed by root and no longer generated |
/universal-plugin:remove-plugin (pnpm install: pnpm-universal-plugin-remove-plugin) |
shadowing-manifest |
a .plugin/plugin.json exists — it outranks root in Copilot CLI's search order and silently shadows the canonical manifest |
/universal-plugin:remove-plugin (pnpm install: pnpm-universal-plugin-remove-plugin) |
no-vendors |
no vendor is declared, so the build writes nothing and no runtime reads the plugin. When the repository carries vendorExtensions or a .plugin/plugin.json, the build stops rather than reporting an empty result, and the detail says so — read it beside legacy-manifest and shadowing-manifest, which name the signals |
/universal-plugin:init-universal-plugin (pnpm install: pnpm-universal-plugin-init-universal-plugin), adopt route when vendorExtensions or .plugin/plugin.json is present, else update route |
package-path-missing |
packagePath names a directory with no readable package.json |
fix packagePath, or create the package |
package-path-unknown |
the CLI could not report packagePath (a version too old to read it), so version-drift and unreleased-content were skipped rather than guessed |
upgrade universal-plugin |
undeclared-package-path |
the plugin root holds a public package.json that publishes plugin.json, but no packagePath is declared, so publish-plugin and marketplace add treat an npm-shipped plugin as git-distributed |
declare "packagePath": "." in .agents/universal-plugin.json, or set "private": true if the package is not published |
misplaced-package-path |
plugin.json declares packagePath under extensions["org.cyberuni.universal-plugin"], where the CLI never reads it — the plugin is silently treated as not shipping to npm |
move it to .agents/universal-plugin.json, relative to the plugin root |
changesets-no-package |
the repository is released with changesets, the plugin ships to no npm package, and its root has no package.json — changesets releases only a package, so changeset version and changeset publish fail |
/universal-plugin:init-universal-plugin (pnpm install: pnpm-universal-plugin-init-universal-plugin) — plugin init writes a private package.json |
changesets-private-untagged |
a non-npm plugin in a changesets repository, and .changeset/config.json does not set "privatePackages": { "version": true, "tag": true } — changeset publish tags no private package, so no release is made |
set privatePackages in .changeset/config.json |
changesets-no-publish-script |
a non-npm plugin in a changesets repository, and a workflow runs changesets/action with no publish-script (publish in v1) — after the Version Packages PR merges the action does nothing, so no tag or GitHub release is made |
add publish-script: pnpm release to the step, with a release script running changeset publish |
release-please-no-restamp |
the plugin ships to no npm package, release-please-config.json bumps its plugin.json through extra-files, and no workflow runs plugin version — release-please runs no command before its release commit, so the release PR leaves the vendor manifests, catalogs, skill pins and compiled scripts on the old version |
add a workflow step on the release PR branch running universal-plugin plugin version --from-manifest and pushing the stamped files — /universal-plugin:version (pnpm install: pnpm-universal-plugin-version) has the workflow |
release-please-restamp-no-ci |
a workflow restamps the release PR with plugin version --from-manifest and pushes with the default GITHUB_TOKEN — that push starts no workflow run, so the PR's checks never run on its head commit and a required check blocks the merge. A workflow_dispatch re-run does not fix it: its checks do not count toward a required check |
mint a GitHub App token with actions/create-github-app-token and pass it as token: to release-please-action and actions/checkout — /universal-plugin:version (pnpm install: pnpm-universal-plugin-version) has the workflow |
release-it-no-stamp |
a release-it config (.release-it.*, or the release-it key of package.json) has no hook running plugin version — release-it commits and tags the release with plugin.json and the vendor manifests still on the previous version |
add "hooks": { "after:bump": "universal-plugin plugin version ${version}" } to the config |
semantic-release-no-stamp |
a semantic-release config (.releaserc*, .config/releaserc*, release.config.*, or the release key of package.json) has no @semantic-release/exec prepareCmd running plugin version — the release is tagged with plugin.json, the vendor manifests and the catalogs still on the previous version |
add ["@semantic-release/exec", { "prepareCmd": "universal-plugin plugin version ${nextRelease.version}" }] before @semantic-release/git — /universal-plugin:init-universal-plugin (pnpm install: pnpm-universal-plugin-init-universal-plugin) wires it |
semantic-release-npm-unshipped |
the plugin ships to no npm package, and its semantic-release config lists @semantic-release/npm or relies on the default plugins list, which includes it — with no package.json the release fails (ENOPKG), and with one the plugin still rewrites its version |
remove @semantic-release/npm, writing the plugins list out if the config relies on the defaults — /universal-plugin:init-universal-plugin (pnpm install: pnpm-universal-plugin-init-universal-plugin) wires it |
semantic-release-no-commit |
a semantic-release config stamps with an @semantic-release/exec prepareCmd but runs no @semantic-release/git, and no prepareCmd runs git commit — the release tag points at plugin.json, the vendor manifests and the catalogs still on the previous version. Severity high, or medium when the plugin ships to npm, whose package still carries the number |
add ["@semantic-release/git", { "assets": [...] }] after @semantic-release/exec — /universal-plugin:init-universal-plugin (pnpm install: pnpm-universal-plugin-init-universal-plugin) wires it |
semantic-release-git-before-exec |
a JSON or YAML semantic-release config lists @semantic-release/git before the @semantic-release/exec that stamps — plugins prepare in list order, so the release commit carries the files from before the stamp |
move @semantic-release/exec above @semantic-release/git |
unparsable-manifest |
root plugin.json is not valid JSON |
fix the syntax error |
invalid-catalog |
a marketplace catalog — at the repository root, or at a --marketplace-root clone — is not a shape its runtime loads — it is found, read, and refused at install time, in the user's terminal |
/universal-plugin:marketplace (pnpm install: pnpm-universal-plugin-marketplace) |
marketplace-root-missing |
a --marketplace-root path does not exist, so it could not be checked at all |
clone the marketplace repository, or fix the path |
Catalogs are checked at the repository root
The marketplace catalogs sit above the plugin in a monorepo, so the catalog check runs against the
repository root rather than --root. It reports only a catalog that would be refused: a missing
one is not a fault, and nothing here has an opinion on which catalogs a repository ought to carry.
The detail names the key at fault, so hand it to /universal-plugin:marketplace (pnpm install: pnpm-universal-plugin-marketplace) as it stands. An
entry's fields are derived from the plugin's plugin.json, and the catalog's own name and owner
are authored in the catalog — which half is at fault decides where the repair goes.
A shared marketplace repository (e.g. cyberuni/cyberplace) is a repository of its own — a bad
entry that reached it by another path (a hand-edited entry, a PR from a different tool, a curator
edit) is invisible to a doctor run inside any plugin's own repo, because that run never sees the
shared repository at all. Clone it separately and name the clone explicitly:
node scripts/doctor.mjs --marketplace-root ../marketplace
Pass --marketplace-root once per clone to check more than one. Each invalid entry it finds is still
reported as invalid-catalog, with the clone's path in the detail so it reads apart from the plugin
repo's own catalogs; a path that does not exist is marketplace-root-missing rather than a silent
skip.
Checking staleness properly
The stale finding is an mtime comparison, which catches the common case and nothing more. It cannot
see a hand-edit made after the last build. The definitive check is to rebuild on a clean tree and read
the diff:
git status --short # must be clean first, or the diff proves nothing
npx universal-plugin plugin build
git diff -- .claude-plugin .cursor-plugin .codex-plugin com.github.copilot
An empty diff means the derived manifests match what the canonical manifest says. Any hunk is drift — either a stale build or a hand-edit that the rebuild has now discarded.
That rebuild is a write, so it is not part of the diagnosis. Report the check as a repair the user can run, or ask before running it yourself.
Version drift
A version lives in six places. Two are authored: the canonical plugin.json, and the package.json
at the packagePath the CLI reports (config get --key packagePath --infer), resolved from the plugin
root. With no packagePath declared, a public plugin-root package.json that publishes plugin.json
counts as that package.
The rest are stamped from them by plugin version: the vendor manifests, this plugin's entry in each
repository catalog, the npx/upx <package>@<version> pins in the skills, and each mcpServers
entry marked pinToPluginVersion.
The script asks universal-plugin publish check-version for the comparison and emits one
version-drift per file that disagrees. The reference is the release's number: the package.json
when there is one, declared or inferred, else plugin.json. Pins are compared only when there is a package to
pin, and a pin-exempt skill or a pin that is not a version (<version>, latest) is skipped. A place
holding 0.0.0-development is reported as unstamped, not as version-drift.
Files diverge when someone ran npm version, or when a release tool (changesets, release-please,
semantic-release) moved package.json and nothing stamped the number on. All of it is
/universal-plugin:version (pnpm install: pnpm-universal-plugin-version)'s to fix — never patch one file by hand to match another.
Offer the check to CI
doctor is advisory and always exits 0. publish check-version is the same comparison, read-only,
and exits 1 on drift, so a repository can fail the release PR instead of publishing a plugin that
claims the old version. Once the version findings are reported, check whether the repository
already runs it: search its package.json scripts and .github/workflows/ for check-version. If
it does not, offer to add it — ask first, because both are the user's files:
- a
verify(orcheck) script step:universal-plugin publish check-version --root <plugin-root>; - or a CI step after install on pull requests, for the release PR a changesets, release-please, or semantic-release bot opens.
Use the locked universal-plugin from the repository's devDependencies when it has one; otherwise
npx universal-plugin@0.20.1, pinned. This check matters most where the release tool picks the
number, because nothing else runs between that bump and publish.
Unreleased content
A runtime keys its plugin cache on the version, not on content: Claude Code resolves the version, finds it unchanged, and reports "already at the latest version" without re-extracting. So content pushed without a bump reaches nobody who already installed the plugin, and neither side is told (ADR-0010 §6).
The script compares the shipped paths — the canonical manifest, the skills directory, agents/,
governances/, references/, mcp.json — against the commit that set the version the manifest carries now, and
emits unreleased-content for anything committed since. Uncommitted work is not reported; it has not
shipped.
Two cases are deliberately silent. A plugin whose release picks the number is skipped, because
content waiting ahead of the last released version is the normal state of a branch there
(ADR-0010 §6). That is a plugin that ships to npm (a declared packagePath, or a public plugin-root package.json that publishes plugin.json), or a plugin a release tool versions:
changesets (.changeset/ and a private or absent plugin-root package.json), release-please (its
config bumps this plugin.json through extra-files), semantic-release (.releaserc*,
release.config.*, or a release key in package.json), or release-it (a .release-it.* file, or a
release-it key in package.json). A tree with no git history is skipped rather than guessed at.
The repair is the bump, and it belongs to /universal-plugin:version (pnpm install: pnpm-universal-plugin-version). Judge first whether the change
is meant to ship — content that is still being worked on is not a finding to act on.
Rules
- Never repair. Report the finding and name the skill that owns it.
- Never hand-edit a derived manifest to make a finding go away. The next build overwrites it and the finding comes back.
- Do not report
copilot-cliwriting no manifest as a fault. It reads the canonical manifest directly. Its components are a separate question — acopilot-root-componentsfinding is a real fault, andcanonicalis only healthy for a plugin that declares none of the moved kinds. - Do not treat repo-private agent configuration (
.claude/skills/,.agents/skills/) as part of the plugin. Diagnosing a repository's own skill wiring isbuddy-agent-harness:doctor-buddy-agent-harness.
Related skills
| Task | Skill |
|---|---|
| Create, adopt, or change what the plugin declares | init-universal-plugin |
Rebuild the derived manifests (unbuilt, stale, copilot-root-components) |
build-plugin |
| Move the plugin's version | version |
| Remove derived manifests, or the plugin itself | remove-plugin |
| Generate the repository's own marketplace catalogs | marketplace |
| Publish it to the shared marketplace repository | publish-plugin |
04 同仓库更多 Skills
upgrade-plugin
Use this skill when upgrading pinned `npx universal-plugin@<version>` calls across a project to a newer version.
remove-plugin
Use this skill to remove a universal agent plugin's artifacts — delete the generated vendor manifests for Claude Code, Cursor, or Codex, clear a stale or shadowing manifest left by an older build, or take the whole plugin out of a project. Trigger on "delete the generated manifests", "remove the vendor manifests", "clean the plugin build output", "drop Codex support", "get rid of this plugin", or "stop shipping this plugin".
migrate-plugin
Move a repository-root or sibling-workspace universal agent plugin into its npm package so the package distributes its manifest, vendor manifests, skills, and agents, and bundle the package's CLI with tsdown so it runs from an installed plugin directory with no node_modules. Use this skill when packaging an existing plugin for npm, relocating a top-level or plugins/<name> plugin into a package, fixing a package that omits plugin assets, or making a plugin's bundled CLI self-contained, even if the user says only 'ship this plugin through npm', 'move the plugin into the package', or 'the CLI can't find its dependencies when installed as a plugin.'
marketplace
Use this skill to run a repository's own plugin marketplace — generate the catalogs Claude Code, Codex, GitHub Copilot CLI, and Cursor read, list a plugin that lives elsewhere (an npm package, a GitHub repo, or `<plugin>@<marketplace>`), change one listed entry in place, check every catalog against the schema its runtime loads, and write the README install section. Trigger on "set up a local marketplace", "let users install this from my repo", "generate marketplace catalogs", "add a plugin to the marketplace", "list this npm package in my marketplace", "switch this entry to a url source", "bump the ref on this entry", "change the category of a marketplace entry", "make this repo installable", "add install instructions to the README", or "check my marketplace catalogs".
<skill-name>
Use this skill when <trigger>. <One-line summary.>
adopt-upx
Use this skill when the user wants to make their skills use upx — the fast local-first package runner shipped as @repobuddy/upx. Trigger on phrases like "make my skills use upx", "adopt the upx runner", "speed up npx calls", "switch to upx", or "rewrite npx pins to upx". Rewrites `npx <pkg>@<version>` references to a caret range on `upx` (`^<major>`, or `^0.<minor>` for a 0.x pin) across one skill, a named set, or every skill in the project.