Automate marketplace.json generation from plugin directories#715
Automate marketplace.json generation from plugin directories#715aaronpowell merged 3 commits intomainfrom
Conversation
- Add context-engineering, gem-team, and ospo-sponsorship to marketplace.json - Create eng/generate-marketplace.mjs to automatically generate marketplace.json - Update package.json build script to include marketplace generation - Update GitHub workflow to trigger on plugin changes Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
- Document generate-marketplace.mjs in eng/README.md - Add plugin folder documentation to AGENTS.md - Update setup commands to include marketplace generation - Add plugin checklist to code review guidelines Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR automates the generation of .github/plugin/marketplace.json from plugin directories to eliminate manual maintenance errors. Previously, the marketplace.json file was manually maintained and was missing 3 of 43 plugins (context-engineering, gem-team, ospo-sponsorship).
Changes:
- Added automated marketplace.json generation script that scans plugin directories and extracts metadata from plugin.json files
- Integrated the generation into the build process (runs automatically with
npm run build) - Updated workflow to trigger on plugin changes and documentation to reflect the new automation
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| eng/generate-marketplace.mjs | New script that scans plugins/* directories, reads .github/plugin/plugin.json metadata, and generates consolidated marketplace.json |
| package.json | Integrates marketplace generation into build script and adds standalone plugin:generate-marketplace command |
| eng/README.md | Documents the new generate-marketplace.mjs script, its purpose, how it works, and manual invocation |
| AGENTS.md | Adds comprehensive plugin structure guidelines, including required fields and workflow integration |
| .github/workflows/validate-readme.yml | Adds plugins/** to trigger paths so workflow runs when plugin content changes |
| .github/plugin/marketplace.json | Generated output with 3 previously missing plugins and updated descriptions from source plugin.json files |
Comments suppressed due to low confidence (2)
eng/generate-marketplace.mjs:64
- According to the guidelines in AGENTS.md (line 101), the plugin.json
namefield should match the folder name. The script should validate that metadata.name matches dirName and either warn or skip plugins where they don't match, to maintain consistency.
plugins.push({
name: metadata.name,
source: `./plugins/${dirName}`,
description: metadata.description,
version: metadata.version || "1.0.0"
});
console.log(`✓ Added plugin: ${metadata.name}`);
eng/generate-marketplace.mjs:62
- According to the plugin structure guidelines in AGENTS.md (line 103), plugin.json must have a
versionfield. The fallback to "1.0.0" on line 62 allows plugins without version fields to pass silently. Consider validating that the version field exists and logging a warning or error if it's missing, to enforce the documented requirement.
version: metadata.version || "1.0.0"
| if (metadata) { | ||
| plugins.push({ | ||
| name: metadata.name, | ||
| source: `./plugins/${dirName}`, | ||
| description: metadata.description, | ||
| version: metadata.version || "1.0.0" | ||
| }); | ||
| console.log(`✓ Added plugin: ${metadata.name}`); | ||
| } else { | ||
| console.log(`✗ Skipped: ${dirName} (no valid plugin.json)`); | ||
| } | ||
| } |
There was a problem hiding this comment.
The script should validate that required fields (name, description) exist in the plugin.json before adding to the marketplace. Currently, if a plugin.json is missing these fields, the script will add an entry with undefined values. Consider adding validation similar to validate-collections.mjs and validate-skills.mjs, or at minimum checking that metadata.name and metadata.description are truthy before pushing to the plugins array.
This issue also appears in the following locations of the same file:
- line 58
- line 62
Pull Request Checklist
npm startand verified thatREADME.mdis up to date.Description
The
.github/plugin/marketplace.jsonwas out of sync with the 43 plugin directories, missing 3 plugins (context-engineering, gem-team, ospo-sponsorship). No automation existed to maintain this file.Changes:
eng/generate-marketplace.mjs- Scansplugins/*/directories, reads.github/plugin/plugin.jsonmetadata, generates marketplace.jsonnpm run buildnow updates both README.md and marketplace.json automatically.github/workflows/validate-readme.ymltriggers onplugins/**changesScript behavior:
Result: 43/43 plugins now in marketplace.json. Future plugin additions auto-sync via build process.
Type of Contribution
Additional Notes
The marketplace.json is consumed by GitHub Copilot CLI for plugin discovery (
copilot plugin marketplace add github/awesome-copilot). Manual maintenance was error-prone - this automation ensures accuracy.By submitting this pull request, I confirm that my contribution abides by the Code of Conduct and will be licensed under the MIT License.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.