json-serialization

Align Rust models with TypeScript types via JSON serialization.

309|58|Updated Apr 16, 2026
One-click install
npx skills add https://github.com/bkywksj/knowledge-base --skill json-serialization-bkywksj
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: json-serialization
Source: https://github.com/bkywksj/knowledge-base/tree/main/.claude/skills/json-serialization
Command: npx skills add https://github.com/bkywksj/knowledge-base --skill json-serialization-bkywksj

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rust and TypeScript projects often struggle to keep data models in sync across the backend and frontend. This skill provides robust JSON serialization and type-mapping between Rust structs and TypeScript interfaces, reducing data drift and runtime errors.

Core Features & Use Cases

  • Serde-powered serialization: derive Serialize/Deserialize for Rust models and generate corresponding TS types.
  • Cross-language type mapping for common data structures (strings, numbers, bools, arrays, options, and enums).
  • Guidance for end-to-end data flow across a three-layer architecture (models, database, services, commands) and front-end types.

Quick Start

Generate a Rust model and a matching TS interface, then verify JSON serialization across layers.

Frequently Asked Questions about json-serialization

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

FAQPage Schema
How do I sync Rust structs with TypeScript interfaces using JSON serialization?

You can sync Rust structs with TypeScript interfaces by deriving serde Serialize and Deserialize on Rust models and generating matching TS types with camelCase naming to prevent data drift across your stack.

What's the best way to handle Rust and TypeScript data exchange in a Tauri app?

Handling data exchange in a Tauri app involves aligning Rust models with TS types via serde JSON serialization, mapping structures like options and enums across multi-layer architectures to prevent runtime errors.

Does cross-language type mapping support Rust enums and Option types to TypeScript?

Yes, cross-language type mapping supports Rust enums and Option types by translating them into compatible TypeScript structures, ensuring end-to-end data flow and compatible error propagation between Rust and TS.

How do I map Rust database models to front-end TypeScript types across a three-layer architecture?

Map Rust database models to front-end TS types by applying serde derives and camelCase naming across your models, database, services, and commands layers to maintain consistent end-to-end JSON serialization.

Why does my Rust to TypeScript JSON serialization cause runtime errors?

Rust to TypeScript JSON serialization often causes runtime errors due to data drift, which you prevent by ensuring compatible error propagation, camelCase naming, and aligned serde derives across both languages.