Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions scripts/validate-template.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,34 @@ function resolveMarketplaceSource(source, pluginRoot) {

async function main() {
const marketplacePath = path.join(repoRoot, ".cursor-plugin", "marketplace.json");
const pluginManifestPath = path.join(repoRoot, ".cursor-plugin", "plugin.json");

const hasMarketplace = await pathExists(marketplacePath);
const hasSinglePlugin = await pathExists(pluginManifestPath);

if (!hasMarketplace && hasSinglePlugin) {
const pluginManifest = await readJsonFile(pluginManifestPath, "Plugin manifest");
if (!pluginManifest) {
summarizeAndExit();
return;
}

const pluginName = pluginManifest.name || "plugin";

const manifestFields = ["logo", "rules", "skills", "agents", "commands", "hooks", "mcpServers"];
for (const field of manifestFields) {
const values = extractPathValues(pluginManifest[field]);
for (const value of values) {
await validateReferencedPath(repoRoot, field, value, pluginName);
}
}

await validateComponentFrontmatter(repoRoot, pluginName);

summarizeAndExit();
return;
}

const marketplace = await readJsonFile(marketplacePath, "Marketplace manifest");
if (!marketplace) {
summarizeAndExit();
Expand Down