/plugin-directory-preflight:checkfrom Plugin Directory Preflight
/plugin-directory-preflight:check — Run before uploading a Claude Code plugin to the plugin directory, and again when the upload scan reports a hold. Runs the local gate and validator, reads a scan report compactly, and pins a stubborn hold with a throwaway probe repository instead of guessing. Trigger when the user mentions uploading or submitting a plugin, the directory scan, a hold, a scan report, a policy review, or the MCP_FORWARDS_CREDENTIAL_ENV finding.
Ships in Plugin Directory Preflight. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
The directory's upload scan cannot be run locally, and it reports only the first match in path order. Without this routine, every fix reveals the next hold and each try costs a release, an upload and a long report. The goal: reach a clean report in one or two uploads.
Scripts live in ${CLAUDE_PLUGIN_ROOT}/scripts/. Run them with node (Node 22.6+ strips the types).
.claude-plugin/plugin.json (the repo root, or a plugin/
subdirectory). Note the plugin's name and version.node "${CLAUDE_PLUGIN_ROOT}/scripts/install-gate.ts" <repo> --check
If it is missing or outdated, run it without --check (it never overwrites a CI workflow that differs,
unless --force). Commit the gate as its own change.node scripts/check-plugin-safety.ts .
The gate also checks the listing icon. plugin.json should set icon to the image, for example
./.claude-plugin/icon.png: the directory documents that field, and the portal also reads that default file when the
field is unset. The image must be a square PNG or JPEG, 512 to 2048 px on each side, up to 10 MiB. If an icon file
exists and icon does not name it, or the plugin has no icon, the gate warns. If icon does not start with ./, names a path that does not
resolve (or differs in letter case from the file), the gate fails. The portal shows no image for an icon it knows only by path, so upload the icon in the portal as well.
A stylesheet that names an image or a font in the repo is a note too: the directory warns about it.claude plugin validate <plugin-root> --strict (also on the manifest files).What the gate checks, and why each rule exists, is in references/scanner-rules.md. For plugins that bundle
third-party code, read references/vendored-bundles.md before the first upload.
These cost the most rounds last time. Each was a fix that created the next hold:
set is one). Build the list from an array.references/scanner-rules.md, section "Known conflicts".Ask the user for only the diagnostics array of the report (browser developer tools, or save the whole
JSON to a file). Never ask for the whole report: it is ~40k tokens of file listings.
node "${CLAUDE_PLUGIN_ROOT}/scripts/read-report.ts" <report.json>
It prints the phases, each hold or blocking finding, the file the scanner named, and the files that sort before it. Then:
The scan follows the default branch only, so each try on the real repository is a merge. Before the second
upload, ask the user, then push the working tree to a throwaway public repository and upload that one instead:
git push <scratch-url> HEAD:main. Merge to the real repository only when the report shows no hold. Delete the
scratch repository afterwards.
The finding names a file (credential_at). If it is a large file, cut it up:
node "${CLAUDE_PLUGIN_ROOT}/scripts/make-probe.ts" round1 <file> <outDir> writes a small plugin whose
probe/ holds the file in 16 slices that sort in line order, plus a send target for the scanner to pair
with.<outDir>, and have them upload it.read-report.ts; the named slice (probe/s1-NN.js) is the first match.... narrow <outDir> <slice> cuts that slice into smaller ones; push; upload; read.... windows <outDir> <slice>; the smallest window that triggers shows how many lines
the trigger needs. ... explain <outDir> <window> prints the original lines.delete_repo scope: gh auth refresh -h github.com -s delete_repo).Run the gate on a probe with --no-icon: a probe is never listed, so it has no icon.
Three rounds usually reach one line. The probe is the reliable way to find a trigger; reading the file and
guessing was wrong several times.
references/scanner-rules.md: what held typescript-patterns-enforcer, the rule behind each hold, and
why the scan appears to move from file to file.references/vendored-bundles.md: build-time transforms for bundled third-party code.references/policy-review.md: the separate AI policy review (credential routing across services).What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub gagoar/plugin-directory-preflight --plugin plugin-directory-preflight