json

Serialize CSL data structures to JSON strings with opt-in field selection.

Updated Feb 7, 2026
One-click install
npx skills add https://github.com/All-Out-Games/reusable-weapons-csl --skill json-all-out-games
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: json
Source: https://github.com/All-Out-Games/reusable-weapons-csl/tree/main/.claude/skills/json
Command: npx skills add https://github.com/All-Out-Games/reusable-weapons-csl --skill json-all-out-games

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Serialization and deserialization of CSL data structures to JSON strings, with opt-in field serialization and safe deserialization to prevent data loss or corruption.

Core Features & Use Cases

  • Opt-in serialization: Only fields with @ao_serialize are serialized.
  • Type preservation: Supports strings, numbers, bools, and nested classes.
  • Safe deserialization: Use try_deserialize which returns success/failure.
  • Persistence integration: Use Save.set_json / Save.try_get_json to store serialized data efficiently.

Quick Start

Serialize a sample structure to JSON and persist it using the Save interface.

Frequently Asked Questions about json

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

FAQPage Schema
How do I serialize nested CSL data structures to JSON?

To serialize nested CSL data structures to JSON, mark desired fields with @ao_serialize. This opt-in approach ensures only tagged primitives and nested classes are converted into JSON strings.

What is the best way to safely deserialize JSON to prevent save data corruption?

Safe deserialization to prevent save data corruption uses try_deserialize, which returns a success or failure result. This robust load workflow prevents data loss when handling invalid JSON strings.

How do I save and load JSON strings for persistence in CSL?

Save and load JSON strings for persistence in CSL using Save.set_json and Save.try_get_json. These provide the preferred storage path for serialized data structures.

Why are my CSL fields missing from the serialized JSON output?

Your CSL fields are missing from the serialized JSON output because serialization is opt-in. Only fields explicitly marked with the @ao_serialize annotation are included in the JSON string.

Does JSON serialization in CSL support primitive types and nested classes?

JSON serialization in CSL supports primitive types and nested classes. It preserves type preservation for strings, numbers, and bools during the opt-in serialization process.