Skip to content

Keeping nself.org in sync with SPORT

All version strings, prices, and plugin counts on nself.org are generated at build time from authoritative SPORT source files. Hand-editing these values in the website source will cause your changes to be overwritten on the next build.

SPORT (Single Point of Reference Truth) is a set of 15 Markdown files at .claude/docs/sport/F01-F15.md inside the nself monorepo root. These files are code-verified and read-only. They are the canonical source for:

  • Plugin counts (F03, F04)
  • Bundle membership (F06)
  • Pricing tiers (F07)
  • Version strings (F01 / MASTER-VERSIONS.md)
SPORT source files → build scripts → generated files → Next.js pages

Three scripts run before every pnpm dev and pnpm build in web/org:

ScriptInputOutput
scripts/sync-sport.mjsSPORT + MASTER-VERSIONSsrc/generated/sport.json
scripts/gen-pricing.mjsF06, F07, sport.jsonsrc/data/generated-pricing.ts
scripts/validate-sport-json.mjssport.jsonCI gate (exits non-zero on errors)

The pages that consume generated data:

  • /pricing: imports GENERATED_TIERS and GENERATED_BUNDLES
  • /plugins: imports GENERATED_PLUGIN_COUNTS for header stats
  1. Edit the authoritative SPORT file:

    • Pricing changes.claude/docs/sport/F07-PRICING-TIERS.md
    • Bundle membership changes.claude/docs/sport/F06-BUNDLE-INVENTORY.md
  2. Regenerate the TypeScript data module:

    Terminal window
    cd web/org
    node scripts/gen-pricing.mjs
  3. Verify the output in src/data/generated-pricing.ts matches your intent.

  4. Run tests to confirm no canonical values regressed:

    Terminal window
    pnpm vitest run
  1. Edit MASTER-VERSIONS.md at the nself monorepo root (.claude/docs/MASTER-VERSIONS.md).

  2. Regenerate sport.json:

    Terminal window
    cd web/org
    node scripts/sync-sport.mjs
  3. The /pricing and /plugins pages pick up the new counts automatically via sport.json.

Plugin counts come from sport.json, which reads F03 (free plugins) and F04 (paid plugins) via sync-sport.mjs. To update:

  1. Add or remove plugins in plugins/ or plugins-pro/.
  2. Run node scripts/sync-sport.mjs to update sport.json.
  3. Run node scripts/gen-pricing.mjs to propagate counts to generated-pricing.ts.

The plugins page header will now show the correct counts.

validate-sport-json.mjs runs as part of predev and prebuild. It fails if:

  • sport.json is missing required keys
  • CLI version is not in vX.Y.Z format
  • Any superseded tier name (Basic, Pro, Elite, Business) appears in pricingTiers
  • Free plugin count drops below 25
  • Paid plugin count drops below 62

Fix validation failures by regenerating sport.json, not by patching validate-sport-json.mjs.

FileWhy
web/org/src/generated/sport.jsonOverwritten on every build
web/org/src/data/generated-pricing.tsOverwritten by gen-pricing.mjs

Changes to these files will be silently discarded.