rule-schema-versioning

Enforce centralized JSON Schema $id versioning across builds and runtime.

1|Updated Apr 17, 2025
One-click install
npx skills add https://github.com/carrot-foundation/schemas --skill rule-schema-versioning
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: rule-schema-versioning
Source: https://github.com/carrot-foundation/schemas/tree/main/.agents/skills/rule-schema-versioning
Command: npx skills add https://github.com/carrot-foundation/schemas --skill rule-schema-versioning

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This rule ensures every generated JSON Schema uses a correct, traceable $id URL that points to the exact version of the schema, enabling consumers to fetch and validate against the correct release.

Core Features & Use Cases

  • Enforces the standardized $id URL format for all generated schemas.
  • Integrates with SCHEMA_VERSION, tsup build-time injection, and runtime version resolution.
  • Supports CI/CD pipelines to validate released schema versions across builds.

Quick Start

Set SCHEMA_VERSION in your environment and run the generate-ipfs-schemas script to produce versioned schemas.

Frequently Asked Questions about rule-schema-versioning

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce a consistent JSON Schema $id URL format across releases?▼

To enforce a consistent JSON Schema $id URL format, you can use a centralized versioning rule that sources the version from SCHEMA_VERSION or package.json and applies it during schema generation.

How does build-time version injection work for JSON Schemas using tsup?▼

Build-time version injection for JSON Schemas using tsup works by resolving the version from SCHEMA_VERSION or package.json at build time and injecting it into the standardized $id URL format.

Can I validate JSON Schema versions automatically in a CI/CD pipeline?▼

Yes, you can validate JSON Schema versions in a CI/CD pipeline by applying a rule that checks if generated schemas follow the defined $id template and match the expected release version.

What is the best way to generate traceable JSON Schemas for release validation?▼

The best way to generate traceable JSON Schemas is to run a generation script that enforces a standardized $id URL pointing to the exact schema version, enabling consumers to validate against the correct release.

Why do my JSON Schema IDs show inconsistent versions across different builds?▼

Inconsistent JSON Schema IDs across builds happen when schema generation lacks a centralized $id format and relies on unmanaged version sources instead of SCHEMA_VERSION or package.json.