ts-schema-implementation

Implement schema.org types in TypeScript with TDD and PHP parity verification.

1|Updated Apr 10, 2024
One-click install
npx skills add https://github.com/EvaLok/schema-org-json-ld --skill ts-schema-implementation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ts-schema-implementation
Source: https://github.com/EvaLok/schema-org-json-ld/tree/main/.claude/skills/ts-schema-implementation
Command: npx skills add https://github.com/EvaLok/schema-org-json-ld --skill ts-schema-implementation

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a standardized, step-by-step process for developers to implement new schema.org types within the TypeScript version of the schema-org-json-ld library, ensuring consistency and maintainability.

Core Features & Use Cases

  • Structured Implementation Guide: Follows a clear, sequential process from understanding the schema to final code verification.
  • Test-Driven Development (TDD): Emphasizes writing failing tests before implementation to ensure correctness.
  • Code Generation Standards: Details the exact patterns for class structure, options interfaces, enum creation, and barrel exports.
  • PHP Parity Verification: Includes steps to ensure the TypeScript implementation matches the existing PHP version.
  • Use Case: A developer needs to add support for a new schema type, like Recipe, to the library. This Skill guides them through creating the Recipe.ts class, its options interface, writing tests in Recipe.test.ts, and exporting it correctly.

Quick Start

Use the ts-schema-implementation skill to add a new schema.org type called 'ProductModel' to the TypeScript library.

Frequently Asked Questions about ts-schema-implementation

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

FAQPage Schema
How do I implement new schema.org types in a TypeScript codebase?

To implement schema.org types in TypeScript, follow a structured process covering class definition, options interface creation, enum serialization, and barrel exports. This ensures new types are added consistently and maintainably to the library.

What is the best way to add JSON-LD support for a new schema type using TDD?

The best way to add JSON-LD schema types using TDD is to write failing unit tests first, then implement the TypeScript class and options interface to pass them. Finally, verify the build to ensure correct JSON-LD output.

How does TypeScript schema.org implementation maintain parity with existing PHP versions?

TypeScript schema.org implementations maintain PHP parity by following strict coding conventions and verification steps that ensure the generated JSON-LD output matches the existing PHP library exactly.

Do I need to write unit tests when adding schema.org classes to TypeScript?

Yes, you need to write unit tests when adding schema.org classes because the implementation process strictly adheres to Test-Driven Development principles, requiring failing tests before code generation.

What coding conventions are required for schema.org TypeScript class definitions?

Schema.org TypeScript class definitions require specific patterns including options interface creation, enum serialization, and barrel exports. These coding conventions ensure structural consistency across the entire library.