Command Reference
This document lists all VS Code commands provided by the AI Primitives Hub extension.
Hub governance validation (CLI)
ai-primitives-hub hub validate --governance [--config <path>] [--policy <path>] [--report-path <path>] [--check-sources] [--verbose] [-o <format>]
--policy and --report-path also enable governance. The output formats are
text, json, yaml and ndjson; any error returns exit code 1, warnings alone 0.
Add --base-ref <commit> --head-ref <commit> or --scope-file <path> for
semantic source/profile scope (requires --governance). In Git mode, both default
and explicit --policy files are read from the merge base. Explicit policies must
resolve within the repository and exist at that commit; otherwise CFG001 fails.
Without Git refs, policies are loaded from the working tree. See
hub governance and the
rule catalogue. No consumer workflow is included.
Hub Replication (CLI)
ai-primitives-hub hub replicate --source-hub owner/repo --target-root https://artifactory.example/repo
Replication reads the source hub-config.yml at --source-ref and processes enabled type: github sources. A release is a candidate only when its name matches <collectionid>-vX.Y.Z, it contains one deployment-manifest.yml and one <collectionid>.bundle.zip (other differently named assets are allowed), and its manifest id/version match the release name. Noncompliant releases are excluded with warnings. Replication derives the stable ID <owner>-<repo>[-<manifest.id>] and accepts only SemVer versions. --mode latest (the default) selects the newest stable version for unpinned profile references, falling back to the highest prerelease only when no stable candidate exists; --mode all retains every verified release. A profile with any unresolved or unsupported bundle reference is excluded as a whole with a warning.
The command is metadata-only by default: it never downloads archives or publishes. Add --publish --review to opt into publication. Bundle objects and index-v1.json are written under <target-root>/sources/replicated and hub-config.yml at <target-root>; each object is checked with HEAD and SHA-256 before upload, and the write order is bundle objects, an immutable catalog generation, the compatibility index-v1.json, then hub-config.yml. The generated hub points to its exact catalog generation so overlapping runs cannot mix its profiles with another run's catalog. Existing objects with the same digest are resumed/skipped. Conflicting or unverifiable bundle objects fail closed by default. With --allow-unverified-existing, the CLI skips unverified bundles with warnings and omits them from the generated index. Any profile that references an unverified bundle is excluded as a whole. An unverifiable existing catalog generation still stops publication, with or without --allow-unverified-existing. Only the index and hub config may be refreshed after verified bundle publication: metadata creation uses If-None-Match and replacement requires a strong ETag with If-Match. Missing validators or concurrent-write precondition failures stop publication. GitHub reads retry transient failures with a bounded backoff; Artifactory uploads are not retried, so rerun the command to resume. When --request-budget is exhausted the command stops with a message to rerun with the same cache directory. Publication credentials are read from the environment variable named by --publisher-credential-ref (default ARTIFACTORY_PUBLISHER_TOKEN); --target-credential-ref only records the consumer reference in the generated hub config. Credentials never appear in logs, cache keys, URLs, or generated configuration.
--cache-dir, --workers, and --request-budget control persistent metadata/archive reuse, concurrency, and the GitHub request ceiling. Cache files are atomically written with directory mode 700 and file mode 600. No GitHub fallback client or gh CLI is used by production replication.
Security Scanning
ai-primitives-hub security scan [PATH...] [--ci] [--fail-on HIGH]
Scans Markdown artifacts and Claude settings without executing them. Reports are opt-in; secret evidence is redacted. See the scanner reference for options, failure policies, and exit codes.
| Command ID | Command Palette title |
|---|---|
promptregistry.securityScanFile | Security Scan Current File |
promptregistry.securityScanWorkspace | Security Scan Workspace |
promptregistry.securityShowLastReport | Show Last Security Report |
promptregistry.securityClearDiagnostics | Clear Security Diagnostics |
Bundle Build (CLI)
ai-primitives-hub bundle build --collection-file collections/example.collection.yml --version 1.0.0
ai-primitives-hub bundle build --collection-file collections/example.collection.yml --version 1.0.0 --layout apm
For a governed build, commit the collection manifest and its source files before
building. If a referenced item lives in a Git submodule, the build reads it and
its bundled resources from the exact commit pinned by the parent revision,
not from the submodule's current checkout. Initialize submodules with
git submodule update --init --recursive (or use submodules: recursive with
actions/checkout). Missing required submodules or pinned commits fail the
build; unrelated submodules do not need to be initialized. A submodule does
not replace the collection repository's root license evidence.
For CI, pass the paths from git diff --name-only to collection affected
using repeated --changed-path flags. A changed gitlink marks collections
that reference paths below it or bundle it as a skill resource as affected.
Detection does not require checking out or diffing the submodule itself.
--layout aph is the unchanged default. The experimental --layout apm keeps
source collection files and original Hub paths unchanged, adds installable
primitive mirrors under .apm/, and emits root deployment-manifest.yml and apm.yml. Both manifests
are also written beside the ZIP; structured output adds apmManifestAsset.
Hub primitive and provenance references remain unchanged; governed inventories
include the mirrors. Matching root APM metadata is validated but never installed
as a target primitive. Installation honors manifest-selected copies and avoids
installing unselected mirrors twice.
The initial APM layout packages prompts, instructions, agents/chatmodes and skills,
including skill resources, under ordinary, .github/ or .apm/ directories.
Nested/noncanonical native discovery and dependency/MCP translation limitations
produce warnings without dropping APH content. Unsupported kinds, empty
collections and mirror collisions fail explicitly. See
APM layout validation
for metadata mapping and qualification limits. This CLI option does not change
the legacy npm collection builder or Artifactory replication.
Bundle Install (CLI)
ai-primitives-hub install [bundle-id] [--from <dir> | --source <value>] [--target <target>] [--skip-unsupported]
--from <dir>installs a local bundle. Without a bundle id, the manifestidis accepted as-is; with a bundle id, it must match the manifest.--source <value>is looked up first as a source id (or name) in the active hub, then as a hub id (the hub's profiles name the source that carries the bundle), and only then used as a GitHubowner/repo. When none matches, the command fails withBUNDLE.NOT_FOUNDand names the three lookups it tried. When none matches and the active hub (or the hub named by--source) exists but its configuration cannot be loaded, the command fails withHUB.LOAD_FAILED, naming the hub and the load error.install --source <hub-id> --interactivereports a failure that stops the interactive install, such as a hub that cannot be loaded, asHUB.INSTALL_FAILED, naming the hub and the cause, and exits 1. An error that already carries its own code is reported with that code. A bundle that fails to install is written to stderr and the remaining bundles are still installed; the command then reports how many were installed (Installed <n>/<total> bundles) and exits 0.- GitHub bundle ids may use the hub form
{owner}-{repo}-{manifestId}, with or without a-{version}/-v{version}suffix. The repo prefix is compared case-insensitively; in this form the bundle name and any pinned version must match the manifest exactly. For compatibility, the earlier rule still applies too: an id equal to the manifestid, or ending in-{manifestId}-{version}/-{manifestId}-v{version}after any prefix, is accepted, so this check does not by itself confirm which repository a bundle came from.profile activateandinstall --lockfile(for GitHub lockfile sources) apply the same rule. - An install is all-or-nothing by default: when the target cannot hold part of the bundle, it fails with
BUNDLE.UNSUPPORTED_CONTENTand writes nothing.--skip-unsupportedinstalls the items the target supports and lists each skipped item with its reason, in text output underSkipped:and in-o jsonasdata.skipped[](path,code,reason). The result has statuswarningand exits 0. When the target supports none of the bundle, the install still fails withBUNDLE.UNSUPPORTED_CONTENT. Skipped items are not recorded in the install record, souninstallremoves only what was installed. The flag works with<bundle-id>,--fromand--source <hub-id> --interactive. It is refused with--lockfile(USAGE.INVALID_FLAG), because replay installs every recorded bundle in full, and has no effect with--dry-run.profile activateandupdatestay all-or-nothing: to pick up a new version of a partially installed bundle, runinstallagain with--skip-unsupported. install --source <hub-id> --interactiveinstalls each selected bundle and prints one summary:data.installed(count),data.total,data.bundles[](bundleId,version) anddata.failures[](bundleId,reason). When some bundles fail, the others are still installed, the failures are listed, and the command exits 1 with statuswarning; when none installs, it fails withHUB.INSTALL_FAILED. With-o jsonthe selection preview is written to stderr, so stdout holds a single envelope.profile publish <profile-id> --hub <hub-id>fails withCONFIG.INVALID_PROFILE_YAMLand exits 1 when the profile file is empty, is not a YAML mapping, or is not valid YAML; the error names the file and, for invalid YAML, includes the parser message.profile install <profile-id>installs a profile's bundles as ordinary installs, without activating it: no activation state is saved, active profiles stay active, andprofile deactivatedoes not remove them (useuninstall). Repository and user targets record them in the install record (data.records[]); workspace targets keep the older lockfile.--hub,--targetand--dry-runwork as forprofile activate.- A bundle already recorded for the tool at the same version is listed under
Already installed:. A version change is listed underInstalled:and removes files the new version no longer ships. - Two targets of one tool at one level are refused with
USAGE.INVALID_FLAGbefore anything is written. - When a
required: truebundle installs on no target, the command fails withHUB.REQUIRED_BUNDLE_MISSINGand removes the bundles it added; earlier installs and updated entries stay. An unexpected error, such as an unwritable record, is undone the same way and reported asFS.PROFILE_INSTALL_FAILED. A file it cannot remove is named in the error and keeps its entry. - The record does not say which command installed a bundle, so deactivating an active profile that lists the same bundle removes it.
- A bundle already recorded for the tool at the same version is listed under
profile activatefails withHUB.REQUIRED_BUNDLE_MISSINGwhen a bundle the profile marksrequired: trueis installed on none of the targets. The error names each such bundle with its install error, the activation is rolled back, and no profile is left active (the previously active profile stays deactivated). A failed bundle markedrequired: false, or a required bundle that failed on only some targets, is listed underFailures:and the command exits 1 with the profile active.
Choosing a target
install, uninstall and update take --target <name>. Without it they use the only configured target. With none or several, install fails with USAGE.MISSING_FLAG listing the targets, before writing anything, while update and uninstall --bundle let the install record decide (below). .ai-primitives-hub/target-state.json (the last used target) is no longer used; while it exists, the hint says so.
When no target is inferred, the install record decides:
updateupdates every recorded tool at the level through its own configured target; a tool with no target is reported inskipped.uninstall --bundle <bundle-id>uses the configured target of the bundle's tool (the first by name, noted inwarnings). It fails withUSAGE.MISSING_FLAGwhen there is none, and is refused for a bundle recorded for several tools. A loneunknownentry is removed and its files are kept.
The level comes from --lockfile (update only), then --scope, then the default rule of status: the repository record at the git root (or an older prompt-registry.* file there), else the user record. In a repository with neither, they act on the user level; pass --scope repository or --target. With no entry for the action, --target is required. Bundles only in a not-yet-migrated older file do not decide: pass --target once to migrate the level (update reports them as failed when the record has other entries). A record replay (install --lockfile <record>, or a bare install) needs no target.
init creates no install record; until the first repository install, status and a bare install use the user record.
Where files land
install, install --lockfile, profile activate and update place a bundle by its manifest when the manifest's prompts: list names the files (file: and type:), wherever the files sit in the bundle (for example under .github/):
- Each item goes to the target layout's route for its type:
skill→skills/,instructions→instructions/,prompt→prompts/,agentandchatmode→agents/. Each target maps those routes to its own folders; Kiro, for example, puts instructions and prompts insteering/. - A skill's whole directory is copied to
skills/<id>/. Any other item is renamed to<id>.<type>.md(for example<id>.instructions.md). A trailing type marker in the id is dropped first, so the idrules.instructionsgivesrules.instructions.md, notrules.instructions.instructions.md. A missingtype:is detected from the file name and tags. - Entries that are not files, such as
mcpServers, are not placed this way; see MCP servers. Entries whosetype:is not one of the five above, and bundle files no item lists, keep the path-based routing below. - When the target cannot place an item (its type is excluded by the target's
--allowed-kinds, the layout has no route for it, or an earlier item already uses its destination, such as idsalphaandalpha.instructionsof typeinstructions), the install fails withBUNDLE.UNSUPPORTED_CONTENTand writes nothing, unless--skip-unsupportedis set, which skips the item instead (see above). - A skill item's
file:may name the skill directory (skills/<name>) or a file in it (skills/<name>/SKILL.md); either way only that skill's directory is copied. - Re-installing or updating a bundle that is already in the install record removes the files of the previous install that the new one no longer writes (for example a
prompts/x.mdthat is now placed asprompts/x.prompt.md), compared by installed location.
Bundles whose manifest lists no items keep path-based routing: a file is installed under the target route matching its bundle path prefix (for example prompts/, skills/), with its name unchanged.
The install record lists each written file by its path relative to the level root (the git root, or your home folder) with its checksum; uninstall removes them, except files you edited or another entry still lists. The older 2.0.0 lockfile (workspace scope) keeps bundle-relative path entries and, for manifest-placed items, installedPath, which uninstall and profile deactivate remove; entries without it are removed by path routing.
Repository-scope VS Code and Copilot CLI targets keep their own .github/ writer and are not affected.
Files stored executable in the bundle (a committed 100755 file is archived as 0755) are installed executable by install, install --lockfile, profile activate and update, on every target and at both scopes, including the .github/ writer. Execute permission is added wherever read permission is granted, so the result follows your umask (0644 becomes 0755). Every other file keeps the default mode, and an update that ships a file as non-executable clears its execute bits. install --from <dir> takes the bit from the files on disk. The install record stores mode for executable files only. On Windows, and on filesystems that do not allow the mode change (for example vfat/exFAT mounts), the mode is ignored without an error. Bundles that the hub assembles itself from skills and awesome-copilot sources record every file as non-executable, so their scripts are installed without the execute bit.
Repository install record
At repository scope, installs are recorded in a format 3.0.0 file at the git root:
ai-primitives-hub.lock.json(commit) orai-primitives-hub.local.lock.json(local-only, listed in.git/info/exclude).- One entry per bundle and tool: installing for
vscodeandkirokeeps both, and another version replaces that tool's entry, also when the bundle id ends with its version. - An unreadable record stops the command with a
RECORD.*error (exit 1) before anything is written; seeai-primitives-hub explain <code>. - Older
prompt-registry*.lock.jsonfiles are migrated first; see Migrating older records. - Text output ends with
Record: <level> <path>;-o jsonaddslevelandrecords(data.lockfileforinstall).
Commands:
uninstallremoves the target's entry and its files, keeps files another entry lists or that you edited (with a warning), and deletes an empty record. Without--targetit is refused when several tools have the bundle.uninstall --lockfile <record> --target <name>removes only that target's entries.updateupdates every tool that has the bundle through its own target;--targetnarrows it to one. Tools that share files, such asvscodeandvscode-insidersin.github/, move to the same version (alsoUpdated).unknownentries and sources without an installable release are listed inskipped.install --lockfile <record>, or a bareinstallin a repository with a record, replays every recorded tool at its version, in the commit mode of the file holding it.unknownentries are listed inneedsReinstall, entries without a matching target inskipped.--dry-runis refused; usestatus.statuslists one row per bundle and tool;-o jsongiveslevel,recordsandentries.- A recorded source is used through the matching configured source (active hub first, then
source add). Otherwise the recorded copy is used without credentials, and alocalfolder outside the repository is skipped.
A source from a shared hub records it as hubId. The top-level hubs map keeps the hub's import reference (name, type, location, and ref or configFile, never a credential) under a readable id such as hub:github:github.com/acme/hub#main, the same on every machine. Sources added with source add, and hubs that are only a local path, get none; unused hubs entries are dropped. A source belongs to one hub: installing it from another hub fails with RECORD.HUB_CONFLICT before anything is written. status shows hub <id> per entry.
The VS Code extension uses the same record under its editor's tool (vscode, vscode-insiders, kiro or windsurf):
- It changes only its own tool's entries. Changing another tool's entry shows
RECORD.CLI_MANAGEDwith the CLI command to use; a bundle installed only for another tool can still be installed for this editor. - Updates keep files you edited, move tools that share files together, and leave each tool one version. The repository view lists one item per bundle.
- It migrates the older files before its first change, as the CLI does.
- "Clean Up Stale Repository Bundles" offers entries whose files are all missing (never
unknownones) and removes only the entries.
MCP servers
A bundle's mcpServers go into the tool's MCP file at the install level, such as .vscode/mcp.json, .kiro/settings/mcp.json or ~/.kiro/settings/mcp.json. They are named ai-primitives-hub:<owner>:<repo>:<collection>:<server>, and ${env:VAR} stays unresolved.
- The record lists the servers each entry wrote (
mcpServers[]:config,name,item,checksum), since the file also holds servers you added yourself. - Uninstall removes only the entry's servers. A server you changed is kept and reported (toggling
disabledis not a change), and a server another entry lists stays. The file is deleted only when no server is left. - Update removes servers the new version dropped and rewrites the rest.
- A server name already in the file and not recorded fails with
RECORD.MCP_CONFLICTbefore any of the bundle's files are written, unless its definition is the one being installed, as a failed install leaves it. A file that is not plain JSON is never rewritten: install fails withRECORD.MCP_CONFIG_UNREADABLE, uninstall warns. - An MCP file whose folder, or whose own symlink, leads outside the level root is refused with
RECORD.PATH_OUTSIDE_ROOT. A rewrite keeps the file's permission bits. - A tool with no MCP file at the level, such as Windsurf at repository level, gets no servers, with a warning.
- The record replaces the extension's
prompt-registry-mcp-tracking.json: the first change at a level moves tracked servers into their entries and deletes the file. Servers with no entry, and user-level servers under WSL, stay tracked there.
User install record
User installs are recorded in one file per machine, shared by the CLI and every VS Code profile: $XDG_CONFIG_HOME/ai-primitives-hub/ai-primitives-hub.user.lock.json (default ~/.config/ai-primitives-hub/; on Windows %USERPROFILE%\.config\ai-primitives-hub\). It has the repository format, with paths relative to your home folder.
- User-scope
install,uninstall,updateandinstall --lockfileuse it, as dostatusand a bareinstalloutside a repository with a record. - A bundle installed from one VS Code profile is installed for every profile. Each tool keeps one version, and uninstall keeps files you edited.
- A target folder outside your home folder, also through a symlink, is refused with
RECORD.PATH_OUTSIDE_ROOTbefore anything is written. - The CLI's old user lockfile,
ai-primitives-hub.lock.jsonin the same folder, is imported once and never changed; workspace-scope targets still use it. - Under WSL remote, and for linked
local-skills, the extension keeps per-profile records. - The CLI and the extension each read
XDG_CONFIG_HOMEfrom their own environment: a VS Code started from the Dock or Start menu does not see a value set only in your shell. The extension logs the path it uses.
Migrating older records
For upgrade and rollback, see Upgrading to 0.3.0: install records.
The first command that changes a level moves its older records into the new ones. Read-only commands (status, doctor, update --dry-run, install --lockfile <older file>, the extension's listings) never migrate.
- Repository level.
prompt-registry.lock.jsonandprompt-registry.local.lock.jsonat the git root are merged intoai-primitives-hub.lock.jsonandai-primitives-hub.local.lock.json, then deleted, with no backup. Each bundle keeps one entry: the new record's wins, else the higher version, and the other is listed inversionConflicts. - User level. The CLI's old user lockfile is imported once (
importedUserLockfileAt). The extension moves the current profile's user installs in under its tool; nothing moves under WSL or for linkedlocal-skills. - The
unknowntool. Older entries do not name their tool, so they are recorded underunknownand need a reinstall. Installing the bundle for a tool replaces that entry and keeps its files; uninstalling a bundle with onlyunknownentries keeps the files. The extension refuses to move or switch the commit mode of such a bundle. - Report. The CLI prints
Migrated <level> record:beforeRecord:(data.migrationin-o json); the extension shows one notification. - Errors. An unreadable older file stops the command with
RECORD.MALFORMEDand nothing is written. One that cannot be deleted after the save givesRECORD.WRITE_FAILEDand is deleted by the next change. profile activate.profile activateandprofile deactivateuse the record for repository and user targets; workspace targets keep the old lockfile. Deactivate removes a bundle at whatever version the record holds. Bundles activated by an older release becomeunknownentries, which deactivate keeps and lists (data.unknown). Two targets of one type at one level are refused withUSAGE.INVALID_FLAG. Output ends withRecord:per level;-o jsonaddsdata.recordsanddata.migrations.
Plugin Create (CLI)
ai-primitives-hub plugin create <name> [--path <dir>] [--collection <id>] [--description <text>] [--version <version>] [--author <name>]
Writes <dir>/<name>/plugin.json (default plugins/<name>/plugin.json), an Agent Plugins 1.0.0 manifest with $schema, name, version (default 1.0.0), description (default A <name> plugin) and an object author (default: the USER environment variable, else Your Name). The manifest passes collection validate as written.
<name>must be 1–64 characters of lowercase letters, digits,.and-, start and end with a letter or digit, and contain no--or... An invalid name fails withPRIMITIVE.INVALID_NAMEand a suggested valid name, and nothing is written.- An existing
plugin.jsonis never overwritten; the command fails withPRIMITIVE.ALREADY_EXISTS. --collection <id>adds akind: pluginitem tocollections/<id>.collection.yml. The collection is read before anything is written, so a missing or unreadable collection fails withFS.COLLECTION_UPDATE_FAILEDand writes nothing. If writing the collection fails, the files the command created are removed.
See Plugin Items for the plugin layout.
Security Rate (CLI)
ai-primitives-hub security rate [path] [--findings <report.json>] [--fail-on <level>] [--report-json <file>] [--report-markdown <file>] [--overwrite] [-o <format>]
Rates the collections (or skills) of a source checkout from a security scan: each bundle and the source get a 0-100 score, a risk band and a pass/fail gate. Without --findings the checkout is scanned with the security scanner, with the same rules as security scan; with --findings the findings of a scan report are rated instead.
- Scan. The checkout is scanned recursively for
.mdand.markdownfiles, documentation files included (they cost fewer points, see Score). Repository suppressions (.markdown.ignore) are ignored, so a rated repository cannot tune its own rating. An incomplete scan (for example an unreadable file) is reported and exits 65; no report file is written, so an incomplete scan never leaves a passing report behind. - Findings input.
--findingsis the--report-jsonofsecurity scan, or any JSON object with afindingsarray, or a bare array. Each finding needsruleId(orrule_id),fileandseverity(CRITICAL,HIGH,MEDIUM,LOWorINFO);confidence(defaultHIGH),title,lineandrecommendedFix(orrecommended_fix) are optional. Entries that lack a required field are skipped and counted in the output. Absolutefilepaths inside the checkout are made relative to it. A file that is not valid JSON, has no findings array, has entries but none usable, or is a report withcomplete: falseexits 65. Findings whose path lies outside the checkout are ignored.PATHmust be an existing directory, otherwise the command exits 64. - Bundles. With
collections/*.collection.yml, each collection is one bundle made of its collection file, its items (askillorpluginitem brings its whole folder) and its readme. Otherwise eachskills/<name>/SKILL.mdfolder is a bundle. With neither, the whole repository is rated as one unit.--collections-pathand--skills-pathchange the folders; paths that leave the checkout and symlinks are ignored with a warning. - Score. Each finding costs points: severity (
CRITICAL40,HIGH20,MEDIUM8,LOW3,INFO0) times confidence (HIGH1,MEDIUM0.5,LOW0.25) times the file context (primitive files 1, documentation 0.25, vendored code 0.1). The rulesINJ-002,HKS-008andMD-001, which often match documentation, count 0.25. Repeats of the same rule in the same file count 1, 0.5, then 0.25. A bundle scoresround(100 * exp(-penalty / 40)). The source score is the average of its bundles. - Risk.
lowfrom 90,mediumfrom 70,highfrom 40, otherwisecritical. - Gate.
--fail-on(defaultCRITICAL;nonedisables) fails when any bundle scores belowCRITICAL40,HIGH70,MEDIUM90 orLOW100. The exit code is 1 when the gate fails, 0 when it passes, 64 for invalid options, 65 for an incomplete scan or unreadable findings, and 74 for a failed write. - Reports.
--report-jsonwritessecurity-rating-report.json(schemasecurity-rating-report.schema.json,schemaVersion1) and--report-markdowna summary suited to a job summary or pull-request comment. Existing files are not replaced unless--overwriteis set, and neither file is written when either already exists. The two paths must differ.--repositoryand--commitdefault toGITHUB_REPOSITORYandGITHUB_SHA;--tagdefaults toGITHUB_REF_NAMEonly whenGITHUB_REF_TYPEistag, otherwise it is empty.--scanner-namerecords which scanner produced the findings (defaultai-primitives-hub-security, orunspecifiedwith--findings).-o json|yaml|ndjsonprints the report in the standard envelope.
Doctor Diagnostics (CLI)
ai-primitives-hub doctor diagnostics [--primitives [--kinds <csv>] [--targets <csv>] [--scopes <csv>]] [--retain-workspace] [-v] [-o <format>]
Without --primitives, the command runs an end-to-end smoke test in a throwaway workspace whose home, XDG and temp directories are sandboxed. With --primitives, it runs the primitive install matrix instead: fixture bundles are validated and built, then installed with install --from on every target type at user and repository scope, and uninstalled after a successful install. The bundles are:
- one bundle per primitive kind, including a spec-compliant Agent Plugin (root
plugin.jsonwith$schema, a nested skill, a rootmcp.jsonand an executable script that uses${PLUGIN_ROOT}); - two mixed-kind bundles: a portable mix (prompt, instruction, agent, skill, plugin, hook) and one with every kind. On a target that supports only some of a bundle's kinds, the expected outcome is a partial install of the supported items. The run installs with the default all-or-nothing behaviour, not the opt-in
install --skip-unsupported(#550), so these cases are a known gap; - invalid plugin bundles (missing
$schema, invalidname, stringauthor,plugin.jsonoutside the plugin root). They are never installed: each passes only whencollection validateandbundle buildboth reject it with the documented message and no archive is written.
Beyond placement and clean uninstall, the run checks that a rejected install lists exactly the items of the kinds the target does not support, that executable files stay executable in the archive and after install (not applicable on Windows, which has no executable bit), and that an installed plugin's skills and MCP servers are projected for the target with ${PLUGIN_ROOT} resolved.
--kinds,--targetsand--scopes(user,repository) take comma-separated values and narrow the cases. They are only valid with--primitives. A mixed bundle runs only when every kind it contains is selected. An unknown value, an empty list or a filter that matches no case fails withUSAGE.INVALID_FLAGbefore anything is written.- Each bundle and case is reported as
pass,known-gap(a failure the product is known to have today, matched exactly) orfail. A known gap names the GitHub issue that tracks its fix, when there is one (issuein the JSON report). Known gaps that no longer occur are listed as unused ([WARN]in text output) and do not fail the run. - A bundle's
I0check carries the kind/route mismatch warnings ofcollection validate(see Kind and Path) aswarnings; text output prints each one as awarning:line under its bundle. They do not change the outcome. - The exit code is 0 when nothing fails, 1 otherwise.
-o json|yaml|ndjsonprints the full report;--retain-workspacekeeps the workspace for inspection.
Primitive governance (CLI)
ai-primitives-hub primitive validate <path>... [--kind <kind>] [--policy <path>] [--report-path <path>] [-o <format>]
This command always uses governance; skill validate remains legacy validation.
Paths are files or recursively searched directories inside the current repository
root. Kinds are skill, agent, prompt, instruction and mcp-server; filenames
are inferred unless --kind is supplied. Output formats are text, JSON, YAML and
NDJSON. Errors or report-write failures exit 1; warnings alone exit 0.
Add --base-ref <commit> --head-ref <commit> for PR mode, with full Git history
and the PR head checked out. Paths become optional (default: whole repository).
--config <path> selects the hub config for changed-source discovery (default:
hub-config.yml). Enabled GitHub sources added or modified by the PR are downloaded;
their collection-referenced primitives are checked regardless of profiles, including
arbitrarily named MCP files declared by item kind. Shared items are checked once
per path/kind; unreferenced files and unchanged sources are excluded. Downloads
reuse existing GitHub authentication, do not execute code and fail closed.
PTH001 rejects missing or out-of-root paths and escaping/broken symlinks.
MCP003 rejects invalid transport/input structures; BOD001 warns on empty
Markdown bodies. Reports mark uninspected kinds Not applicable. See
primitive validation,
safety checks
and the rule catalogue.
Bundle Management
Collection governance (CLI)
ai-primitives-hub collection validate --governance [--root <dir>] [--collection-file <path>...]
Use --policy <path>, --report-path <path>, --markdown-path <path> and
-o text|json|yaml|ndjson for configuration and reports. --check-releases --repository owner/repo enables publication verification (COL002); --check-sources [--config hub-config.yml] --repository owner/repo verifies ownership against the
central .config/sources/collection-index.yml, relative to the directory containing
that hub config (COL004), without scanning other sources. Both files must come
from the same trusted registry revision.
Missing or malformed registry data fails the check; there is no remote-scan fallback.
--base-ref <commit> --head-ref <commit> enables PR scope and requires the head
checked out and full history. Default and explicit policies come from the merge
base; missing explicit policies and outside-repository paths fail CFG001.
Changed enabled GitHub hub sources are downloaded
and their collections validated. See Collection Governance (CLI).
| Command | Title | Description |
|---|---|---|
promptRegistry.viewBundle | View Bundle Details | View detailed information about a bundle |
promptRegistry.updateBundle | Update Bundle | Update a specific bundle to the latest version |
promptRegistry.uninstallBundle | Uninstall Bundle | Remove an installed bundle |
promptRegistry.checkBundleUpdates | Check for Bundle Updates | Check if updates are available for a bundle |
promptRegistry.updateAllBundles | Update All Bundles | Update all installed bundles to their latest versions |
promptRegistry.manualCheckForUpdates | Check for Updates (Manual) | Manually trigger an update check |
promptRegistry.enableAutoUpdate | Enable Auto-Update | Enable automatic updates for a bundle |
promptRegistry.disableAutoUpdate | Disable Auto-Update | Disable automatic updates for a bundle |
Index & Search
| Command | Title | Description |
|---|---|---|
promptRegistry.searchPrimitives | Search Primitives | Search indexed prompts, instructions, chat modes, agents, and skills |
promptRegistry.rebuildPrimitiveIndex | Rebuild Primitive Index | Rebuild the shared primitive index from enabled sources, with progress in a notification and the AI Primitives Hub output channel |
Primitive search reads only a pre-built local index. It does not synchronize sources or rebuild the index. Rebuild Primitive Index is the explicit lifecycle operation that may access configured sources; it reports harvest, indexing, and embedding milestones in the AI Primitives Hub output channel and shows a completion or failure notification.
Scope Management
Commands for managing bundle installation scope. These are available via context menu on installed bundles in the Registry Explorer.
| Command | Title | Description |
|---|---|---|
promptRegistry.moveToRepositoryCommit | Move to Repository (Commit) | Move a user-scoped bundle to repository scope, tracked in Git |
promptRegistry.moveToRepositoryLocalOnly | Move to Repository (Local Only) | Move a user-scoped bundle to repository scope, excluded from Git |
promptRegistry.moveToUser | Move to User | Move a repository-scoped bundle to user scope |
promptRegistry.switchToLocalOnly | Switch to Local Only | Change a repository bundle from commit to local-only mode |
promptRegistry.switchToCommit | Switch to Commit | Change a repository bundle from local-only to commit mode |
promptRegistry.cleanupStaleLockfileEntries | Clean Up Stale Repository Bundles | Remove install record entries whose files no longer exist |
Move to Repository
Migrates a bundle from user scope to repository scope.
Commands:
promptRegistry.moveToRepositoryCommit— Files tracked in version controlpromptRegistry.moveToRepositoryLocalOnly— Files excluded via.git/info/exclude
Parameters:
bundleId— The ID of the bundle to move
Requirements: A workspace must be open.
Move to User
Migrates a bundle from repository scope to user scope.
Command: promptRegistry.moveToUser
Parameters:
bundleId— The ID of the bundle to move
The bundle becomes available across all workspaces after migration.
Switch Commit Mode
Changes how a repository-scoped bundle interacts with Git.
Commands:
promptRegistry.switchToLocalOnly— Exclude files from Git (adds to.git/info/exclude)promptRegistry.switchToCommit— Track files in Git (removes from.git/info/exclude)
Parameters:
bundleId— The ID of the bundle
Clean Up Stale Repository Bundles
Removes repository install record entries whose files no longer exist in the repository.
Command: promptRegistry.cleanupStaleLockfileEntries
This is useful when bundle files have been manually deleted but the install record still lists them. The command:
- Migrates older
prompt-registryfiles first, then finds entries whose files are all missing (neverunknownor file-less entries) - Shows a confirmation dialog with the count of stale entries
- Removes confirmed stale entries from the install record, without deleting files
Source Management
| Command | Title | Description |
|---|---|---|
promptRegistry.addSource | Add Source | Add a new bundle source |
promptRegistry.editSource | Edit Source | Modify an existing source configuration |
promptRegistry.removeSource | Remove Source | Delete a source from the registry |
promptRegistry.syncSource | Sync Source | Synchronize bundles from a specific source |
promptRegistry.syncAllSources | Sync All Sources | Synchronize bundles from all configured sources |
promptRegistry.toggleSource | Toggle Source Enabled/Disabled | Enable or disable a source |
Profile Management
| Command | Title | Description |
|---|---|---|
promptRegistry.createProfile | Create New Profile | Create a new bundle profile |
promptRegistry.editProfile | Edit Profile | Modify an existing profile |
promptRegistry.activateProfile | Activate Profile | Activate a profile to install its bundles |
promptRegistry.deactivateProfile | Deactivate Profile | Deactivate a profile |
promptRegistry.deleteProfile | Delete Profile | Remove a profile |
promptRegistry.exportProfile | Export Profile | Export a profile to a file |
promptRegistry.importProfile | Import Profile | Import a profile from a file |
promptRegistry.listProfiles | List All Profiles | Display all available profiles |
promptRegistry.toggleProfileView | Toggle Favorites View | Switch between profile views |
promptRegistry.toggleProfileFavorite | Toggle Favorite | Mark or unmark a profile as favorite |
Hub Management
| Command | Title | Description |
|---|---|---|
promptregistry.importHub | Import Hub | Import a hub configuration |
promptregistry.listHubs | List Hubs | Display all configured hubs |
promptregistry.syncHub | Sync Hub | Synchronize with a hub |
promptregistry.deleteHub | Delete Hub | Remove a hub configuration |
promptregistry.switchHub | Switch Hub | Switch to a different hub |
promptregistry.exportHubConfig | Export Hub Configuration | Export hub configuration to a file |
promptregistry.openHubRepository | Open Hub Repository | Open the hub's repository in a browser |
promptregistry.contributeToHub | Contribute to Hub (Fork, Clone & Open Visual Editor) | Fork and clone the active GitHub-connected hub, check out a branch, and open hub-config.yml in the Visual Editor (Artifactory hubs are read-only and excluded) |
promptregistry.openHubVisualEditor | Open Hub Configuration in Visual Editor | Open hub-config.yml in the Visual Master-Detail Custom Editor |
promptregistry.validateHubConfig | Validate Hub Configuration (Sources, Catalogs & Profiles) | Run static and deep source/bundle validation on hub-config.yml |
promptregistry.touchHubUpdatedAt | Hub Config: Update Timestamp (updatedAt) | Update metadata.updatedAt in hub-config.yml to the current ISO-8601 timestamp |
promptregistry.addHubSource | Hub Config: Add Source | Guided wizard to add a source to hub-config.yml |
promptregistry.discoverHubSourceBundles | Hub Config: Discover Source Bundles | Probe a hub source and cache its discovered bundle catalog |
promptregistry.addHubProfile | Hub Config: Add Profile | Guided wizard to add a profile to hub-config.yml |
promptregistry.addHubProfileBundle | Hub Config: Add Bundle to Profile | Pick or add a bundle to a hub profile with automatic source-type prefixing |
promptregistry.submitHubPullRequest | Hub Config: Commit & Create Pull Request | Commit hub-config.yml, push to fork, and open a Pull Request against the upstream hub repository |
promptregistry.refreshHubPullRequestStatus | Hub Config: Refresh Pull Request Status | Refresh the active Pull Request and CI check-run status |
promptregistry.openHubPullRequest | Hub Config: Open Pull Request in Browser | Open the active Pull Request or upstream hub repository in the browser |
Hub Profile Management
| Command | Title | Description |
|---|---|---|
promptregistry.listHubProfiles | List Hub Profiles | Display profiles from a hub |
promptregistry.browseHubProfiles | Browse Hub Profiles | Browse available hub profiles |
promptregistry.viewHubProfile | View Hub Profile | View details of a hub profile |
promptregistry.activateHubProfile | Activate Hub Profile | Activate a hub profile |
promptregistry.deactivateHubProfile | Deactivate Hub Profile | Deactivate a hub profile |
promptregistry.showActiveProfiles | Show Active Hub Profiles | Display currently active hub profiles |
promptregistry.checkForUpdates | Check Hub Profile for Updates | Check for updates to a hub profile |
promptregistry.viewProfileChanges | View Hub Profile Changes | View changes in a hub profile |
promptregistry.syncProfileNow | Sync Hub Profile Now | Immediately sync a hub profile |
promptregistry.reviewAndSyncProfile | Review and Sync Hub Profile | Review changes before syncing |
promptregistry.viewSyncHistory | View Hub Profile Sync History | View synchronization history |
promptregistry.rollbackProfile | Rollback Hub Profile | Revert to a previous profile state |
promptregistry.clearSyncHistory | Clear Hub Profile Sync History | Clear the sync history |
Collection & Validation
| Command | Title | Description |
|---|---|---|
promptRegistry.createCollection | Create New Collection | Create a new prompt collection |
promptRegistry.validateCollections | Validate Collections | Validate collection YAML files including file references and duplicate detection |
promptRegistry.validateApm | Validate APM Package | Validate an APM package |
promptRegistry.listCollections | List All Collections | Display all collections |
promptregistry.contributeToCollection | Contribute to Collection (Fork, Clone & Open Visual Editor) | Fork and clone a GitHub-backed collection repository from a Marketplace tile or Explorer item, check out a branch, and open the target .collection.yml in the Visual Collection Editor (Artifactory sources are read-only and excluded) |
promptregistry.openCollectionVisualEditor | Open Collection in Visual Editor | Open a .collection.yml manifest in the Visual Master-Detail Custom Editor |
promptregistry.openCollectionYamlBeside | Collection: Open Split YAML View | Open the raw .collection.yml file in a split editor beside the Visual Collection Editor |
promptregistry.createNewCollectionVisual | Collection: Create New Collection (Visual) | Create a new .collection.yml manifest (with starter README) and open it in the Visual Collection Editor |
promptregistry.duplicateCollectionVisual | Collection: Duplicate Collection | Duplicate an existing collection under a new ID |
promptregistry.deleteCollectionVisual | Collection: Delete Collection | Delete a .collection.yml manifest from the workspace |
promptregistry.addCollectionItemVisual | Collection: Create or Add Primitive Item | Open the Visual Collection Editor on the Create/Add Primitive wizard |
promptregistry.scaffoldMissingCollectionFile | Collection: Create Missing Referenced File | Scaffold a missing referenced item or README file on disk from template |
promptregistry.openCollectionItemFile | Collection: Open Referenced Primitive File | Open a collection item's referenced primitive file beside the active editor |
promptregistry.bumpCollectionVersion | Collection: Bump Version (Patch / Minor / Major) | Increment a collection's semantic version (patch, minor, or major) |
promptregistry.submitCollectionPullRequest | Collection: Commit & Create Pull Request | Validate collections, stage modified .collection.yml and primitive files, push to fork, and open a Pull Request against upstream |
promptregistry.refreshCollectionPullRequestStatus | Collection: Refresh Pull Request Status | Refresh the active collection Pull Request and CI check-run status |
promptregistry.openCollectionPullRequest | Collection: Open Pull Request in Browser | Open the active collection Pull Request or upstream repository in the browser |
Scaffolding & Resources
| Command | Title | Description |
|---|---|---|
promptRegistry.scaffoldProject | Scaffold Project | Create a new project from a template |
promptRegistry.addResource | Add Resource | Add a prompt, instruction, agent, or skill |
Cross-Platform Path Handling
The scaffold command normalizes path separators to forward slashes before checking for the templates/scaffolds directory, ensuring correct template resolution on Windows where backslash separators are used.
Settings & Configuration
| Command | Title | Description |
|---|---|---|
promptRegistry.exportSettings | Export Settings | Export extension settings to a file |
promptRegistry.importSettings | Import Settings | Import extension settings from a file |
promptRegistry.openSettings | Open Settings | Open extension settings |
Authentication & Access
| Command | Title | Description |
|---|---|---|
promptregistry.forceGitHubAuth | Force GitHub Authentication | Force re-authentication with GitHub |
Utilities
| Command | Title | Description |
|---|---|---|
promptregistry.openItemRepository | Open Repository | Open an item's repository in a browser |
promptRegistry.resetFirstRun | Reset First Run | Reset first-run state to re-trigger hub selection dialog |
See Also
- Settings Reference — Extension configuration options
- Getting Started — Installation and first steps