Problem
docs/docusaurus/src/data/collectionCards.ts hardcodes artifact counts for each collection and for hve-core-all. These values duplicate information already present in collections/*.collection.yml and must be manually updated every time an artifact is added or removed from any collection.
Every new skill, agent, or prompt added to a collection can silently break the Docusaurus test suite. Short-term mitigation is tracked in #1248. This issue covers the permanent fix.
Note: the test file collectionCards.test.ts already implements countYamlPaths() that reads the YAML files correctly — the production data file should do the same.
Proposed Solution
Change collectionCards.ts to derive counts by reading collections/*.collection.yml at build or test time rather than storing static integers.
Preferred option — build-time derivation (Option A):
Read the YAML files directly in collectionCards.ts using Node's fs module (already used in the test file) and compute counts dynamically. This eliminates the duplication entirely with minimal complexity and without adding a new build step.
Alternative — codegen script (Option B):
Add a docs:sync-counts npm script that regenerates the static counts from YAML and writes them back to collectionCards.ts. Wire into plugin:generate.
Option A is preferred.
Acceptance Criteria
Related
Problem
docs/docusaurus/src/data/collectionCards.tshardcodes artifact counts for each collection and forhve-core-all. These values duplicate information already present incollections/*.collection.ymland must be manually updated every time an artifact is added or removed from any collection.Every new skill, agent, or prompt added to a collection can silently break the Docusaurus test suite. Short-term mitigation is tracked in #1248. This issue covers the permanent fix.
Note: the test file
collectionCards.test.tsalready implementscountYamlPaths()that reads the YAML files correctly — the production data file should do the same.Proposed Solution
Change
collectionCards.tsto derive counts by readingcollections/*.collection.ymlat build or test time rather than storing static integers.Preferred option — build-time derivation (Option A):
Read the YAML files directly in
collectionCards.tsusing Node'sfsmodule (already used in the test file) and compute counts dynamically. This eliminates the duplication entirely with minimal complexity and without adding a new build step.Alternative — codegen script (Option B):
Add a
docs:sync-countsnpm script that regenerates the static counts from YAML and writes them back tocollectionCards.ts. Wire intoplugin:generate.Option A is preferred.
Acceptance Criteria
collectionCards.tsno longer contains hardcoded artifact count integersnpm run docs:testpasses after any collection YAML change without a separate PR editnpm run docs:buildproduces a correctly-rendered site with accurate countsRelated