[docs] Add OB1 catalog generator + committed ob1-catalog.json#187
Conversation
Ships the site-ready catalog artifact that the natejones.com /ob1 directory will load, plus the generator script and a PR gate drift check that keeps the artifact in sync with repo content. Pipeline: - scripts/build_catalog.py discovers every non-template contribution under the seven canonical category folders, loads metadata.json, rewrites intra-repo links in README.md, resolves requires_skills / requires_primitives into forward and reverse dependency edges, and emits resources/ob1-catalog.json. - .github/workflows/ob1-gate.yml now runs the generator in --check mode whenever a PR touches contribution content, the generator, or the artifact. A drift failure tells the contributor exactly which command to run. Generator-time validation (runs before artifact is emitted): - category in metadata.json matches the folder category - requires.open_brain is one of required | optional - learning_order is only set on extensions - every requires_skills / requires_primitives slug resolves to a real contribution - no two entries share the same site_path - every relative intra-repo link in a contribution README resolves to an existing file in the repo Link rewriting: - relative links to contribution folders or their READMEs become /ob1/<category>/<slug> - links to category index folders or READMEs become /ob1/<category> - deeper relative files inside contribution folders go to the raw GitHub blob URL - image / asset references go to raw.githubusercontent.com - other intra-repo links (docs/, root markdown) go to blob/tree URLs - absolute URLs, anchors, and mailto: / tel: schemes pass through Site loader precedence (documented here for PR3 in the site repo): - OB1_CATALOG_LOCAL_PATH env var takes precedence when set - otherwise fetch from raw.githubusercontent.com on main - missing or invalid artifact must fail the site build Pre-existing fix included: - recipes/email-history-import/README.md linked to a non-existent primitives/content-fingerprint-dedup path. The dedup logic lives in recipes/content-fingerprint-dedup. The generator's strict link check flagged it, so fixed the link instead of loosening the rule. Output: 59 catalog entries across all seven categories (recipes 29, skills 13, extensions 6, primitives 5, integrations 3, dashboards 2, schemas 1) — 4 required + 9 optional in skills, all other categories required for v1. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Thanks for the contribution. The catalog generator ( Two things, though. This PR is stacked on #186 ( Recommend handling #186 and #187 together; this one effectively waits on #186. — Alan (community reviewer; non-binding) |
Summary
scripts/build_catalog.py— the generator that scans every non-template contribution folder and emits a site-ready JSON artifact with rewritten READMEs, resolved dependency edges, and per-entry compatibility metadata.resources/ob1-catalog.jsonartifact (59 entries, ~570 KB)..github/workflows/ob1-gate.yml— any PR that touches contribution content, the generator, or the artifact must also update the artifact or the gate fails.Stacked on PR #186
This PR's base is
contrib/jonathanedwards/ob1-compatibility-catalog(PR #186) because the generator relies on the newrequires.open_brainstring enum. Merge #186 first, then retarget this tomainand merge.Why the generator runs at commit time (not site build time)
Generator-time validation (the contract)
categoryinmetadata.jsonmatches the folder category.requires.open_brainis one ofrequired|optional.learning_orderis only present on extensions.requires_skills/requires_primitivesslug resolves to a real contribution.site_path.The loader on the site side only has to validate artifact shape, not repo semantics.
Link rewriting rules
/ob1/<category>/<slug>/ob1/<category>raw.githubusercontent.com(so they render on the site)docs/, root markdown) → GitHub blob/tree URLmailto:/tel:— pass through untouchedSite loader precedence (documented here; implemented in the site PR)
OB1_CATALOG_LOCAL_PATHenv var takes precedence when set (local dev override)raw.githubusercontent.com/.../main/resources/ob1-catalog.jsonPre-existing fix included
recipes/email-history-import/README.mdlinked toprimitives/content-fingerprint-dedup/— that directory does not exist; the fingerprint dedup logic lives inrecipes/content-fingerprint-dedup/. The generator's strict relative-link check flagged it. Fixed the link rather than loosening the rule, per the plan.Catalog breakdown (first artifact)
Test plan
ob1-catalog.jsonon the current tree (59 entries, no validation errors).--checkmode returns 0 on the committed artifact.skills/auto-captureshowsrecipes/auto-captureas a reverse dep).skills/panning-for-gold) serializes withcompatibility.open_brain = "optional".skills/auto-capture) serializes withcompatibility.open_brain = "required".recipes/auto-captureREADME:skills/auto-capture/→/ob1/skills/auto-capture,docs/01-getting-started.md→ GitHub blob URL.In-flight contribution impact
Any open contribution PR that adds a new folder under
recipes/,skills/, etc. will now needresources/ob1-catalog.jsonregenerated in the same PR. The error message includes the exact command to run. Maintainer-side fix on merge is fine for current volume.🤖 Generated with Claude Code