types-schemas

Synchronize shared TypeScript types and JSON schema contracts across Madoc services.

57|15|Updated Nov 28, 2018
One-click install
npx skills add https://github.com/digirati-co-uk/madoc-platform --skill types-schemas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: types-schemas
Source: https://github.com/digirati-co-uk/madoc-platform/tree/main/.agents/skills/types-schemas
Command: npx skills add https://github.com/digirati-co-uk/madoc-platform --skill types-schemas

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It ensures that shared TypeScript type definitions and JSON schema contracts stay consistent across the Madoc platform, preventing mismatched data structures and integration errors.

Core Features & Use Cases

  • Unified Type Definitions: Centralized src/types for all services.
  • Schema Management: Organized JSON schemas in src/types/schemas.
  • Cross-layer Consistency: Guarantees that API, frontend, and extensions share the same contracts.
  • Use Case: When adding a new field to an API response, update the shared type and corresponding JSON schema in one place to propagate changes throughout the system.

Quick Start

Use the types-schemas skill to update shared TypeScript types and JSON schemas in the Madoc codebase.

Frequently Asked Questions about types-schemas

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

FAQPage Schema
How do I sync TypeScript types and JSON schemas across services?

To sync TypeScript types and JSON schemas across services, you update shared type definitions in src/types and schema contracts in src/types/schemas, then run schema_index.py and validate type checks to maintain cross-layer data contract integrity.

Why do my API responses and frontend TypeScript types have mismatched data structures?

Mismatched data structures occur when API, frontend, and extension layers lack centralized contracts. Synchronizing shared TypeScript type definitions and JSON schema contracts in a single repository ensures cross-layer consistency and prevents integration errors.

What's the best way to manage shared JSON schemas in a TypeScript codebase?

The best way to manage shared JSON schemas in a TypeScript codebase is centralizing them in src/types/schemas and executing schema_index.py to validate type checks, ensuring all services reference identical contract definitions.

Do I need to run a validation script when updating shared TypeScript type definitions?

Yes, you need to run the schema_index.py validation script after updating shared TypeScript type definitions. Executing this script and validating type checks guarantees that cross-layer data contracts remain consistent throughout the Madoc services.

Can I update a new API field and propagate the TypeScript type changes across all services?

Yes, you can update a new API field and propagate changes across all services by modifying the shared TypeScript type and corresponding JSON schema in one centralized location, specifically within the src/types directory of the Madoc codebase.

What limitations exist when synchronizing TypeScript schemas outside of the Madoc platform?

Synchronizing TypeScript schemas is limited to projects under services/madoc-ts, requiring updates specifically within src/types and src/types/schemas directories to ensure cross-layer data contracts remain consistent and valid.