Skip to content

Use meta.stats from spec payload in BadgeTable template #13

Description

@a6b8

Context

Per Memo 059 Phase 4 PRD-018, the dot-github profile generator must source schema stats (count_schemas, count_unique_datasources, count_tools, count_resources, count_skills) from the flowmcp-spec payload's meta.stats block — NOT directly from flowmcp-schemas-public. This keeps the spec payload as the Single-Source-of-Truth for downstream consumers.

Scope

  • Extend scripts/fetch-refs.mjs to also fetch generated/docs-payload/manifest.json from flowmcp-spec and merge meta.stats into refs.json under a stats key
  • Extend src/lib/placeholder-replace.mjs regex to recognize {{stats.*}} placeholders
  • Null fallback: render instead of crashing when stats value is null (handles spec-payload null block)
  • Update src/data/template.txt: replace hardcoded "530+ curated API schemas" with dynamic {{stats.count_schemas}} etc.
  • Build fail-safe: manifest fetch failures fall back to null block, BadgeTable still renders

Acceptance

  • No direct fetch from flowmcp-schemas-public (verified via grep — only badge-config references remain)
  • npm run fetch-refs && npm start succeeds with null stats (current state: upstream manifest pre-PRD-016)
  • Happy path tested locally with injected stats (365 schemas, 288 datasources, 1575 tools)
  • Build never crashes on null stats

Reference

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions