ci: validate referenced component paths in plugin manifests - #244
ci: validate referenced component paths in plugin manifests#244rootkiller6788 wants to merge 2 commits into
Conversation
validate-plugins.mjs only checks plugin.json against the JSON schema and that the marketplace name matches. A typo'd component path (skills/agents/ commands/rules/hooks/mcpServers/logo) passes schema validation and CI but silently fails to load in Cursor. Add an existence check for every path declared in plugin.json, resolved relative to the plugin directory, with inline hooks/mcpServers objects and absolute-URL logos skipped. Also add scripts/** to the validate-plugins workflow paths filter so a PR that only changes the validator itself triggers the job that runs it.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.
Reviewed by Cursor Bugbot for commit 7b25915. Configure here.
Addresses Bugbot review on cursor#244: - Absolute URLs are only valid for `logo` per the schema; a URL in any other component field (skills/agents/commands/rules/hooks/mcpServers) was silently skipping the existence check and passing CI. - An explicitly empty/whitespace component path now fails instead of being treated as 'not a path'.
|
Thank you for the review. I've addressed both issues the Bugbot review flagged on commit 1. Remote URLs in non-logo component fields silently bypassed the existence check. The original code returned early for anything if (isAbsoluteUrl(declared)) {
if (field === "logo") return;
fail(
`Plugin "${pluginName}": ${field} path "${declared}" must be a local path relative to the plugin directory`
);
return;
}2. Empty/whitespace component paths were silently treated as "not a path". The previous guard combined the non-string and empty checks into an early return, so an empty string slipped through. Empty and whitespace-only paths now fail explicitly: if (declared.trim().length === 0) {
fail(`Plugin "${pluginName}": ${field} path must not be empty`);
return;
}Verification. CI note. The Bugbot check on the current head ( Could you please take another look? |

What
scripts/validate-plugins.mjsonly checks plugin.json against the JSON schema and that the marketplace name matches the manifest name. A typo'd component path — e.g."skills": "./skils/"or a renamedhooks/hooks.json— passes schema validation and CI but silently fails to load in Cursor. This PR adds an existence check for every path declared inplugin.json:skills,agents,commands,rules,hooks,mcpServers,logo./prefix stripped)hooks/mcpServersobjects and absolute-URLlogovalues are skipped, matching the schema's allowed shapesskills/*) are validated against their static directory prefix so a typo in the base directory is still caught..) or are absolute are rejectedAlso adds
scripts/**to thevalidate-plugins.ymlpathsfilter, so a PR that only changes the validator itself now triggers the job that runs it (previously a broken validator could merge without CI ever executing it).Why
All 32 current marketplace plugins pass the new check (verified locally). The check only guards future PRs — which is the point of a merge gate: a contributor adding a new plugin or tweaking an existing manifest can't merge a path that Cursor will silently ignore.
Verification
node scripts/validate-plugins.mjsexits 0 on the current repo.skills->./skils/) produces a clear error and non-zero exit:ERROR: Plugin "teaching": skills path "./skils/" does not exist (resolved to teaching\skils).hooksobject (skipped), absolute-URLlogo(skipped), glob with valid/invalid prefix, and../path traversal (rejected).Note
Low Risk
CI-only validation of plugin manifests; no runtime, auth, or data-handling changes.
Overview
Plugin CI now fails when a
plugin.jsonpoints at component files that do not exist, instead of only schema-checking the manifest (typos likeskils/previously merged and then silently failed to load in Cursor).After schema and name checks, the validator resolves
skills,agents,commands,rules,hooks,mcpServers, andlogorelative to the plugin directory. Inline objects and URL logos are skipped; globs are checked on their static prefix; empty, absolute, and..paths are rejected.The validate-plugins workflow also runs on
scripts/**so validator-only PRs are actually exercised.Reviewed by Cursor Bugbot for commit 0ac5375. Bugbot is set up for automated code reviews on this repo. Configure here.