AGENT SKILL

init-universal-plugin

Use this skill to create or change a universal agent plugin — scaffold a new one, adopt an existing vendor-specific plugin or already-shipped skills onto the open Agent Plugins Specification, or add and remove vendors and components on the canonical plugin.json that drives Claude Code, Cursor, Codex, and GitHub Copilot CLI. Trigger on "init a plugin here", "make my Claude Code plugin work in Cursor", "convert this to the open plugin standard", "turn these skills into a plugin", "add Codex support", or "add a hooks component".

License 许可
MIT
最近更新
2026-11-14
Stars
★ 1
Forks
0

01 前言 Front Matter

name
init-universal-plugin
description
Use this skill to create or change a universal agent plugin — scaffold a new one, adopt an existing vendor-specific plugin or already-shipped skills onto the open Agent Plugins Specification, or add and remove vendors and components on the canonical plugin.json that drives Claude Code, Cursor, Codex, and GitHub Copilot CLI. Trigger on "init a plugin here", "make my Claude Code plugin work in Cursor", "convert this to the open plugin standard", "turn these skills into a plugin", "add Codex support", or "add a hooks component".
argument-hint
[--name <name>] [--vendor <id>] [--scaffold] [--npm] [--no-marketplace] [--force]

02 资源文件 13

03 SKILL.md 正文

Plugin Init

Give a project one canonical plugin manifest — a root plugin.json on the Agent Plugins Specification — and derive from it the manifest each runtime expects.

Most of the manifest is shared. The divergence is small and asymmetric: Copilot CLI reads the canonical plugin.json directly and gets no derived manifest, while Claude Code, Cursor, and Codex each read their own path. Keep that asymmetry in mind — this is a consolidation job, not a copy-everywhere job.

That asymmetry does not extend to components. Declaring the canonical $schema puts a plugin in Open Plugin Spec mode, and Copilot CLI then reads its native components — agents, commands, rules, hooks, LSP servers — from a com.github.copilot/ directory rather than the plugin root. Authoring still happens at the canonical locations: plugin build derives that directory (ADR-0015), so do not tell an author to move agents/ into it — the root copy is what the other three vendors derive from. See references/vendors/copilot-cli.md.

references/standard.md defines the baseline every plugin gets. Read the vendor file for each runtime you are enabling, and only those.

Vendor Derived manifest Extra requirements Read
Claude Code .claude-plugin/plugin.json none references/vendors/claude-code.md
Cursor .cursor-plugin/plugin.json none references/vendors/cursor.md
Codex .codex-plugin/plugin.json version, description references/vendors/codex.md
GitHub Copilot CLI none — reads root plugin.json native components derived under com.github.copilot/ (ADR-0015) references/vendors/copilot-cli.md

This skill owns the authoring side: the plugin a project ships. Setting a repository up to consume skills — the .agents/skills/ layout, AGENTS.md, per-harness bridges — is buddy-agent-harness:init-buddy-agent-harness, not this.

Prerequisites

Before any work that adds or removes components, load plugin-design with the reference skill in the cyber-agentkit plugin.

It is the authoritative source for which component to reach for and which anti-patterns to avoid.

Arguments

An invocation may carry the CLI's own flags: /universal-plugin:init-universal-plugin --name my-plugin --scaffold --npm.

Read them from the invocation itself rather than from a placeholder. Claude Code appends what the caller typed as ARGUMENTS: <value>, and Codex substitutes nothing at all, so on every runtime the flags arrive as text you can read. Writing $ARGUMENTS into this body would resolve on Claude Code and stay literal everywhere else.

  • --name, --vendor, --scaffold, --force, --npm, and --root pass through to universal-plugin plugin init in Phase 4.
  • Prose carries the same weight: "ship it on npm" means --npm, "overwrite what's there" means --force.
  • An argument never skips a phase. --force still needs the Phase 3 approval, and the survey still runs first.
  • Say what you did not recognize and carry on. Never guess at a flag.

Work in five phases. Do not skip Phase 3.

1. Survey

Locate the plugin root — the directory that holds, or will hold, the canonical plugin.json. In a monorepo that is usually the package that ships the plugin, not the repository root; migrate-plugin covers moving one that sits in the wrong place.

Inventory both the canonical surface (root plugin.json, its extensions block, the component directories it names) and every pre-existing vendor artifact listed in references/detection.md. Note the release tool the repository uses, if any: .changeset/ (changesets), .releaserc*, release.config.*, or a release key in package.json (semantic-release), .release-it.* or a release-it key in package.json (release-it), or release-please-config.json (release-please). Read what you find. Write nothing yet.

2. Classify

Sort each finding into exactly one bucket:

  • canonical — a root plugin.json with $schema on agent-plugins.org and an extensions object. This is the source of truth; every edit lands here.
  • derived — .claude-plugin/, .cursor-plugin/, .codex-plugin/ manifests that plugin build regenerates. Rebuild them; never hand-edit them.
  • adoptable — a hand-written vendor manifest with no canonical manifest above it, a legacy root plugin.json carrying neither $schema nor extensions, or publicly-shipped skills with no manifest at all. These become canonical content in Phase 4.
  • undeliverable — a vendor-specific field with no delivery path, because Copilot CLI reads the canonical manifest directly and has no derived file of its own. Two shapes reach this bucket: a harnesses["copilot-cli"] override, which the build warns about; and a non-spec field on a legacy root plugin.json — category, tags — which nothing warns about at all, because the correct adoption never writes a harnesses entry for it. Report every one by name; do not invent a home for it.
  • not a plugin — repo-private agent configuration (.claude/skills/, .agents/skills/, .cursor/rules/). It is this project's own tooling, not something it distributes. Say nothing about packaging it.

references/detection.md maps each signal to its bucket, and draws the public-versus-private line that decides the last two.

3. Confirm

Present the plan before touching anything the user wrote: which files will be created, which hand-written vendor manifests become generated artifacts, which vendors will be enabled, what the canonical metadata will say (show name, version, and description verbatim), and what is being left alone and why.

An adoption also presents every non-spec field it is about to drop, by name and value — the undeliverable bucket from Phase 2. Nothing downstream warns about those, so this is the only notice the user gets. references/adopt.md Step 2 has the command that enumerates them.

Get explicit approval before any step that deletes, replaces, or rewrites a user-authored file — adoption always crosses that line, because it turns manifests the user maintains into build output. Creating a missing plugin.json, a missing component directory, or a missing skill scaffold needs no approval; report those rather than asking.

One case needs asking even when nothing is overwritten: two vendor manifests that disagree on a shared field. A silent pick there is a silent behavior change for one runtime.

An npm-shipped plugin (--npm) in a changesets repository gets one more plan line. When the repository root carries .changeset/ and its package.json version script is exactly changeset version, plugin init --npm rewrites that script to changeset version && universal-plugin plugin version --from-package --root <plugin-root> and adds universal-plugin to the root devDependencies. Without it the first Version Packages PR moves package.json and leaves the plugin version behind. Show the new script and the devDependency in the plan, and ask before running init: it rewrites the user's root package.json. If the user declines, run init without --npm and wire files by hand. A custom version script is never rewritten; init prints the line to append, so relay it and let the user place it.

A plugin that ships to no npm package in a changesets repository gets its own plan line. Changesets releases only a package, so when the repository root carries .changeset/ and the plugin root has no package.json, plugin init writes a minimal private one: name from the plugin name, "private": true, and version from the plugin.json it replaces (else 0.0.0), with no files, main, or exports. It also wires the root version script as above and adds "release": "changeset publish", which tags the release for changesets/action. Offer this in the plan and show the file; if the user declines, add --no-changesets to the init call. Relay init's notes: a plugin below the repository root must be a workspace package, and .changeset/config.json needs "privatePackages": { "version": true, "tag": true } before changeset publish tags anything.

A plugin released with semantic-release gets the release wiring as a plan line too. plugin init writes nothing for it, so the skill edits the config itself, once the user approves. Add @semantic-release/exec with prepareCmd: "universal-plugin plugin version ${nextRelease.version}", and add @semantic-release/git with the stamped files as assets. For a plugin that ships to no npm package, also drop @semantic-release/npm: npmPublish: false is not enough, because the plugin still edits package.json. Show the plugins list before and after, and edit the config file the survey found, in its own format. references/release-tools.md has the config, the plugin order, the full assets list, and the packages the release job must install. If the user declines, leave the config alone.

A plugin released with release-it gets its wiring as a plan line as well. Add an after:bump hook running universal-plugin plugin version ${version}, after any hook the user already has. For a plugin that ships to no npm package, also set "npm": false, and run the hook through the pinned npx universal-plugin@0.20.1. release-it then reads the current number from the latest git tag, so when git describe --tags finds none, propose tagging the current commit with the version plugin.json holds (git tag v1.2.0). Without that tag the first release starts from 0.0.0 and fails. Create the tag only once the user approves, and leave pushing it to the user.

A plugin released with release-please gets its wiring as a plan line too. For a plugin that ships to no npm package, write release-please-config.json with release-type: simple and an extra-files entry bumping plugin.json. Put the version plugin.json holds in .release-please-manifest.json, so the first release PR starts from it. The restamp runs in a workflow step on the release PR and pushes with a GitHub App token, so the PR's checks run. Show that step and the App setup, and hand both to the user.

references/release-tools.md has the configs for release-it and release-please, the npm-shipped variants, and the tag and manifest checks. Show each file before and after. If the user declines, leave the config alone.

When the survey found no release tool, ask the user how the plugin will be released before running init. A new repository may simply not have set one up yet:

  • changesets. Set up .changeset/ first (buddy-changesets:init-changesets when it is installed, else npx @changesets/cli init), then run init. It then finds .changeset/ and writes the private package.json above.
  • semantic-release. Propose a new .releaserc.json carrying the wiring above, and write it once the user approves. No package.json is needed.
  • release-it. Propose a new .release-it.json carrying the wiring above, with the initial tag for a plugin that ships to no npm package. Write it once the user approves.
  • release-please. Propose release-please-config.json and .release-please-manifest.json as above, and hand over the workflow step. Write them once the user approves.
  • None. Run init as planned. The author picks each number with version.

4. Apply

Route by what Phase 2 found. Read exactly the reference for the work at hand — do not load them all.

What Phase 2 found Do this Reference
nothing — greenfield scaffold a canonical manifest and its components references/create.md
adoptable carry it onto the canonical manifest, losslessly references/adopt.md
canonical, and a vendor or component changes edit extensions, then rebuild references/update.md

Three asks leave this skill rather than routing inside it. Hand them over instead of improvising a route: doctor-universal-plugin reports what is declared, built, stale, or drifting; version moves the number; remove-plugin deletes derived manifests or the plugin itself.

Every route ends in the same two commands. Scaffold with this skill's launcher, which runs the project's installed CLI or the pinned npx one:

node scripts/init.mjs --name <plugin-name> --vendor claude-code --vendor cursor

Resolve that path against this skill's own directory. The launcher runs the bundled CLI, so nothing is downloaded; fall back to npx universal-plugin plugin init when the path cannot be resolved. plugin init never prompts, so it is safe to run unattended (--yes is accepted as a no-op).

Then derive the vendor manifests:

npx universal-plugin plugin build

To try the result before publishing, npx universal-plugin plugin install puts the working copy into every runtime the manifest declares and names the reload each one needs. Never hand-write a symlink for this — references/create.md records why the recipe that circulated for it does not work.

With --vendor, plugin init also registers the plugin in the repository's local marketplace: it writes each selected vendor's catalog at the repository root and folds an entry for this plugin into it, so users can add the repository as a marketplace and install from it. Say what it wrote, and read back any line it printed on stderr — a repository with no author, no package author, and no remote gets no catalog, because every runtime requires an owner. --no-marketplace skips the step.

The catalog is named after the repository, <owner>-<repo>-local, not after the plugin: it lists every plugin the repository develops. Re-running init-universal-plugin folds the entry back in and leaves the marketplace name, the owner, and every other entry alone, so it is safe over a catalog someone edited. Generating catalogs for a repository that already holds several plugins, and writing the README install section, is the marketplace skill's job.

plugin init writes a minimal manifest — $schema, name, the vendor list, and, with --npm, the package's version. It never reads an existing vendor manifest, so shared metadata and per-vendor overrides are carried in by hand afterwards, per the reference you routed to.

If the request spans more than one route ("add Codex, then cut a release"), take this skill's part first and hand the rest to the skill that owns it. If the route is unclear, ask which the user means rather than guessing.

5. Verify and report

Confirm the build wrote what the manifest declares: one file per derived vendor, canonical status and no file for Copilot CLI. Read the build's warnings — an unknown vendor id and an undeliverable override both surface there and both are silent capability loss if ignored.

When the work was an adoption, the proof is the diff:

git diff -- plugin.json .claude-plugin .cursor-plugin .codex-plugin .github/plugin

From the four derived paths, expect only formatting and key-order churn. Root plugin.json is different and is in the list on purpose: it shows real hunks — the $schema/extensions rewrite — and under the legacy layout it was Copilot CLI's manifest, so it is the one file where a field can vanish unnoticed. Read those hunks rather than skimming them.

Any field that disappeared is a regression, not a cleanup — trace it back to the shared metadata, to that vendor's harnesses entry, or to the drop list you reported in Phase 3, before shipping.

Audit each skill the plugin ships, per references/create.md Step 6. Report what was created, adopted, derived, and left alone. For a fuller read of the plugin's state than this phase gives — drift, version skew, shadowing manifests — hand off to doctor-universal-plugin.

This skill is not a formatter. If the project has one, run it over the written files and say so.

Rules

  • Edit the canonical manifest, never a derived one. .claude-plugin/plugin.json and its siblings belong to plugin build; a hand-edit there is overwritten on the next build.
  • Never hand-edit a version field. Two authored files and every derived artifact fall out of sync. The version skill owns that move.
  • Adoption is lossless by contract. Every vendor that worked before must still work after, and the Phase 5 diff — root plugin.json included — is the check that proves it. Where a field genuinely cannot be carried, losing it is a decision the user makes, not one the adoption makes quietly: name it first.
  • Do not package repo-private agent configuration. A .claude/skills/ directory is the project's own tooling; offering to publish it is wrong.
  • Do not convert vendor settings without a documented mapping. Hooks have one: author them in canonical PascalCase and plugin build derives each vendor's form, dropping handler types a vendor cannot run — see references/vendors/claude-code.md. Unmapped settings stay where they are, reported.
  • Offer adoption once. If the user declines, or asked for something unrelated, drop it and do what they asked.
  • Plugin authoring only. Do not change CI workflows, repository settings, or unrelated project files. The release tool's config is the one file outside the plugin this skill edits, and only once the user approves it in Phase 3. The one git write is release-it's initial tag, on the same approval.

Related skills

Task Skill
Diagnose a plugin — what is declared, built, stale, or drifting doctor-universal-plugin
Make the repository installable, and document how marketplace
Move the plugin's version, or reconcile one that drifted version
Delete derived manifests, or the whole plugin remove-plugin
Move a repo-root plugin into its npm package migrate-plugin
Publish a packaged plugin to the marketplace publish-plugin
Bump the pinned universal-plugin@<version> the project calls (not the plugin's own version) upgrade-plugin
Rewrite npx pins to the upx runner adopt-upx
Set a repository up to consume skills (AGENTS.md, .agents/skills/) buddy-agent-harness:init-buddy-agent-harness

References

04 同仓库更多 Skills

cyberuni
cyberuni/universal-plugin

upgrade-plugin

Use this skill when upgrading pinned `npx universal-plugin@<version>` calls across a project to a newer version.

★ 1
cyberuni
cyberuni/universal-plugin

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".

★ 1
cyberuni
cyberuni/universal-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.'

★ 1
cyberuni
cyberuni/universal-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".

★ 1
cyberuni
cyberuni/universal-plugin

<skill-name>

Use this skill when <trigger>. <One-line summary.>

★ 1
cyberuni
cyberuni/universal-plugin

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.

★ 1