Summary
After PR #1316 (closes #1256) introduced auto-generated collection.md files from YAML manifests for GitHub and extension packaging, Docusaurus still maintains two parallel, hand-coded data sources that duplicate information already available in the collection YAML manifests. These should be replaced with dynamically generated content sourced from the same YAML manifests.
Problem
The Docusaurus site has two hand-maintained sources that duplicate collection metadata:
-
docs/getting-started/collections.md — A manually written table listing all 14 collections with descriptions, per-type artifact counts (Agents, Prompts, Instructions, Skills), maturity levels, and marketplace install links. Also includes a Mermaid dependency diagram.
-
docs/docusaurus/src/data/collectionCards.ts — 12 hard-coded CollectionCardDefinition objects with name, description, maturity, and href fields. The resolveCollectionCards(counts) function merges artifact counts from customFields.collectionCounts at runtime.
When a collection is added, renamed, or updated, maintainers must update three separate locations: the YAML manifest, collections.md, and collectionCards.ts. This creates drift risk and maintenance overhead.
Existing Infrastructure
docusaurus.config.js already reads collection YAML manifests at build time via countYamlPaths() to populate customFields.collectionCounts, which feeds artifact count badges on the homepage. This means the YAML-to-Docusaurus pipeline partially exists — it just needs to be extended to cover descriptions, maturity, and page content.
Proposed Approach
Phase 1: Replace collectionCards.ts hard-coded definitions
- Source card definitions (name, description, maturity, href) from collection YAML manifests at build time via
docusaurus.config.js custom fields.
- Remove the 12 hard-coded
CollectionCardDefinition objects from collectionCards.ts.
- Keep
resolveCollectionCards() as a thin adapter that merges the YAML-sourced definitions with counts.
Phase 2: Auto-generate the collections.md page
- Generate
docs/getting-started/collections.md (or a replacement) from collection YAML manifests and their companion collection.md files.
- Preserve the existing table structure (description, artifact counts, maturity, install links) but source all data dynamically.
- Consider whether the Mermaid dependency diagram can also be generated from manifest metadata.
Phase 3: Add per-collection Docusaurus pages (optional)
- Generate individual Docusaurus pages for each collection, sourced from the auto-generated
collections/*.collection.md files.
- Add a "Collections" category to
sidebars.js linking to individual collection pages.
- Update card hrefs to point to individual collection pages instead of the shared overview.
Files to Modify
| File |
Current State |
Change |
docs/docusaurus/src/data/collectionCards.ts |
12 hard-coded card definitions |
Source from YAML manifests via custom fields |
docs/getting-started/collections.md |
Hand-maintained table with 14 collections |
Auto-generate from YAML manifests |
docs/docusaurus/docusaurus.config.js |
Reads YAML for counts only via countYamlPaths() |
Extend to read descriptions, maturity, install links |
docs/docusaurus/sidebars.js |
No collection category |
Add collection category (Phase 3) |
docs/docusaurus/src/pages/index.tsx |
Renders cards from resolveCollectionCards() |
No change expected (adapter pattern preserved) |
Acceptance Criteria
Context
Summary
After PR #1316 (closes #1256) introduced auto-generated
collection.mdfiles from YAML manifests for GitHub and extension packaging, Docusaurus still maintains two parallel, hand-coded data sources that duplicate information already available in the collection YAML manifests. These should be replaced with dynamically generated content sourced from the same YAML manifests.Problem
The Docusaurus site has two hand-maintained sources that duplicate collection metadata:
docs/getting-started/collections.md— A manually written table listing all 14 collections with descriptions, per-type artifact counts (Agents, Prompts, Instructions, Skills), maturity levels, and marketplace install links. Also includes a Mermaid dependency diagram.docs/docusaurus/src/data/collectionCards.ts— 12 hard-codedCollectionCardDefinitionobjects with name, description, maturity, and href fields. TheresolveCollectionCards(counts)function merges artifact counts fromcustomFields.collectionCountsat runtime.When a collection is added, renamed, or updated, maintainers must update three separate locations: the YAML manifest,
collections.md, andcollectionCards.ts. This creates drift risk and maintenance overhead.Existing Infrastructure
docusaurus.config.jsalready reads collection YAML manifests at build time viacountYamlPaths()to populatecustomFields.collectionCounts, which feeds artifact count badges on the homepage. This means the YAML-to-Docusaurus pipeline partially exists — it just needs to be extended to cover descriptions, maturity, and page content.Proposed Approach
Phase 1: Replace
collectionCards.tshard-coded definitionsdocusaurus.config.jscustom fields.CollectionCardDefinitionobjects fromcollectionCards.ts.resolveCollectionCards()as a thin adapter that merges the YAML-sourced definitions with counts.Phase 2: Auto-generate the
collections.mdpagedocs/getting-started/collections.md(or a replacement) from collection YAML manifests and their companioncollection.mdfiles.Phase 3: Add per-collection Docusaurus pages (optional)
collections/*.collection.mdfiles.sidebars.jslinking to individual collection pages.Files to Modify
docs/docusaurus/src/data/collectionCards.tsdocs/getting-started/collections.mddocs/docusaurus/docusaurus.config.jscountYamlPaths()docs/docusaurus/sidebars.jsdocs/docusaurus/src/pages/index.tsxresolveCollectionCards()Acceptance Criteria
npm run docs:buildsucceeds withonBrokenLinks: 'throw'Context
collection.mdfiles for GitHub and extension contextscollections/*.collection.md, which is outside the Docusaurus docs include pathdocusaurus.config.jsalready demonstrates the pattern of reading YAML manifests at build time