json-serialization

json-serialization is a skill for Claude Code, Codex from smicolon/ai-kit. It costs 30 tokens per session (473 once invoked), scanned A, original, MIT.

A guide to converting Dart objects to JSON and back in Flutter apps. JSON is a common text format used to exchange data with web APIs; the guide covers manual conversion and code generation with Freezed.

In plain words
What is it for?
Use it to create model constructors that read API responses, methods that produce JSON requests, and immutable model-copy patterns.
Why use it?
It prevents API data from being handled as unstructured maps throughout the app. Consistent conversion makes models safer to read, send, and update.

Skill for Claude CodeCodex

Part of the flutter plugin — 9 skills shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/smicolon/ai-kit/json-serialization
Any agent
npx skills add smicolon/ai-kit --skill json-serialization
Clone the repo
git clone --depth 1 https://github.com/smicolon/ai-kit

Made for: Claude Code, Codex.

Or install flutter, the plugin that ships this one along with the rest of its 9 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for json-serialization

README.md
[![agentmods](https://agentmods.dev/badge/skills/smicolon/ai-kit/json-serialization.svg)](https://agentmods.dev/skills/smicolon/ai-kit/json-serialization)
Your own site
<a href="https://agentmods.dev/skills/smicolon/ai-kit/json-serialization"><img src="https://agentmods.dev/badge/skills/smicolon/ai-kit/json-serialization.svg" alt="Measured on agentmods" height="20"></a>
Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 473 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00030 $0.00473
Opus 5 $0.00015 $0.00236
Sonnet 5 $0.00006 $0.00095
Haiku 4.5 $0.00003 $0.00047

Measured yesterday against content hash 7cd25d1cae18, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

json-serialization scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packs/flutter/skills/json-serialization/SKILL.md · 82 lines

What it actually says

JSON Serialization in Flutter

Best practices for mapping API JSON payloads to Dart models safely.

1. Immutable Model Pattern (No Code-Gen)

Ideal for simple to medium entities without heavy dependencies:

class UserModel {
  final String id;
  final String email;
  final String? displayName;
  final DateTime createdAt;

  const UserModel({
    required this.id,
    required this.email,
    this.displayName,
    required this.createdAt,
  });

  factory UserModel.fromJson(Map<String, dynamic> json) {
    return UserModel(
      id: json['id'] as String,
      email: json['email'] as String,
      displayName: json['display_name'] as String?,
      createdAt: DateTime.parse(json['created_at'] as String),
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'id': id,
      'email': email,
      if (displayName != null) 'display_name': displayName,
      'created_at': createdAt.toIso8601String(),
    };
  }

  UserModel copyWith({
    String? id,
    String? email,
    String? displayName,
    DateTime? createdAt,
  }) {
    return UserModel(
      id: id ?? this.id,
      email: email ?? this.email,
      displayName: displayName ?? this.displayName,
      createdAt: createdAt ?? this.createdAt,
    );
  }
}

2. Safe Parsing Helper

Always guard against nulls or unexpected types from network responses:

int parseCount(dynamic value) {
  if (value is int) return value;
  if (value is String) return int.tryParse(value) ?? 0;
  return 0;
}

3. List Parsing Pattern

List<UserModel> parseUsers(List<dynamic> list) {
  return list
      .whereType<Map<String, dynamic>>()
      .map(UserModel.fromJson)
      .toList();
}
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 82 lines · 30 tokens per session scan A 7cd25d1cae18

Subscribe to this mod's changes

json-serialization is a skill published in the GitHub repository smicolon/ai-kit (6 stars, last pushed yesterday), licensed MIT. It adds 30 tokens to every session and 473 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.

Related

Other skills, from other repositories

add-signal

Add Signal channel integration via signal-cli device-link. Native adapter — no Chat SDK bridge.

nanocoai/nanoclaw · 22 tokens

swiftui-dev

Use this skill for SwiftUI development, architecture, structure, performance, and Apple native app profiling. It combines.

Orkas-AI/Orkas · 3 tokens

designing-hardware-products

AI-automated hardware product pipeline: from requirements to manufacturable Gerber + compiled firmware + cross-platform app. Orchestrates system design, ESP-IDF firmware, KiCad PCB, UniApp client, and release packaging in a zero-human-touch flow.

telagod/code-abyss · 58 tokens

developing-mobile-apps

Mobile development knowledge reference covering iOS (SwiftUI), Android (Jetpack Compose), React Native, and Flutter. Use when building mobile apps, working with cross-platform frameworks, or implementing native UI patterns.

telagod/code-abyss · 47 tokens

aio-ios-device-debug

Debug iOS apps on physical devices from the terminal — deploy to iPhone or iPad with xcodebuild, capture syslog via idevicesyslog, pull crash reports from the device, analyze .ips crash files, and take device screenshots. Covers the full loop: build, install, launch, capture syslog, pull crash report, analyze .ips…

aiocean/claude-plugins · 157 tokens

lumi-app-finder

Finds verified live Lumi Studio iPhone and iPad apps from a first-party catalog covering 46 apps and all 50 Apple locales. Use when a user asks which iOS or App Store app fits a task, especially for pay-once or one-time-unlock, privacy-conscious, learning, productivity, photo, travel, or wellness needs. Returns…

alice51849/lumi-mcp · 92 tokens