generate-schema

Generate JSON schema from LandDefinitions and a TypeScript client SDK.

1|Updated Nov 22, 2025
One-click install
npx skills add https://github.com/gmliao/swift-state-tree --skill generate-schema
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: generate-schema
Source: https://github.com/gmliao/swift-state-tree/tree/main/.agent/skills/SwiftStateTree/generate-schema
Command: npx skills add https://github.com/gmliao/swift-state-tree --skill generate-schema

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill automates the generation of JSON schema from LandDefinitions and the TypeScript client SDK from the schema for the Swift StateTree project.

Core Features & Use Cases

  • Generate JSON Schema from LandDefinitions to ensure a machine-readable contract
  • Generate TypeScript Client SDK from the generated schema for client-server integration
  • Use Case: After modifying LandDefinitions, regenerate the schema and client SDK to keep server and client in sync.

Quick Start

Run the following steps to regenerate schema and client SDK:

  • cd Examples/HummingbirdDemo && swift run SchemaGen --output schema.json
  • cd Examples/HummingbirdDemo/WebClient && npm run codegen
  • ls -la Examples/HummingbirdDemo/WebClient/src/generated/
  • cat Examples/HummingbirdDemo/schema.json | jq .
  • git add Examples/HummingbirdDemo/schema.json
  • git add Examples/HummingbirdDemo/WebClient/src/generated/
  • git commit -m "chore: regenerate schema and client SDK"

Frequently Asked Questions about generate-schema

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

FAQPage Schema
How do I generate a TypeScript client SDK from a JSON schema?

To generate a TypeScript client SDK from a JSON schema, run npm run codegen in the WebClient directory. This executes the codegen script to produce typed TypeScript client code from the schema for server-client integration.

What's the best way to keep my Swift server and TypeScript client in sync after modifying LandDefinitions?

To keep your Swift server and TypeScript client in sync after modifying LandDefinitions, regenerate both the JSON schema and TypeScript client SDK. This ensures both sides share a single, updated machine-readable contract.

Do I need Swift and Node.js to run schema generation and client SDK codegen?

Yes, you need both Swift and Node.js to run schema generation and client SDK codegen. The Swift SchemaGen tool generates the JSON schema, while Node.js and npm execute the TypeScript client SDK codegen.

How does generating a JSON schema from LandDefinitions work?

Generating a JSON schema from LandDefinitions works by running the Swift SchemaGen tool, which parses LandDefinitions and outputs a machine-readable schema.json file. This creates a formal contract for client-server integration.

When should I regenerate the schema and client SDK for StateTree?

You should regenerate the schema and client SDK for StateTree whenever LandDefinitions are modified and before updating the client code. This ensures the server and client remain synchronized with the latest definitions.