Optimizes JSON serialization across .NET, Node, Python, Java/Kotlin, and Go. Covers reflection overhead, serializer reuse, codegen, streaming, and payload trimming for high-throughput APIs.
Ships in AI for Developers Toolkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Make JSON serialization faster and leaner - reused serializer configuration, schema/codegen-based serializers, streaming, and the small mistakes that cost a lot. The wins are the same in every stack; the libraries differ.
Works on a target: a file, folder, project/repo, or GitHub URL. Find serializer usage, where config objects are created, and the hottest paths (API responses, message consumers, cache writes). Report which files you scanned.
| Manifest | Look for | Grep |
|---|---|---|
*.csproj | System.Text.Json (in-box), Newtonsoft.Json | JsonSerializer\.|JsonSerializerOptions|JsonConvert\. |
package.json | fastify, fast-json-stringify, superjson | JSON.stringify|JSON.parse|fast-json-stringify |
pyproject.toml, requirements*.txt | orjson, msgspec, pydantic, ujson | json.dumps|json.loads|model_dump|orjson\. |
pom.xml, build.gradle(.kts) | jackson-databind, kotlinx-serialization-json, gson | new ObjectMapper|ObjectMapper()|Json.encodeToString |
go.mod | encoding/json (stdlib), goccy/go-json, bytedance/sonic, mailru/easyjson | json.Marshal|json.Unmarshal|json.NewEncoder |
serialize(deserialize(x)) passthroughs, or serializing to a string and then encoding to bytes again.JsonSerializerOptions - create one static instance (or use JsonSerializerOptions.Web / the ASP.NET Core-configured instance). A new options object per call is a common big loss.JsonSerializerContext:[JsonSerializable(typeof(Order))]
[JsonSerializable(typeof(List<Order>))]
[JsonSourceGenerationOptions(PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase)]
public partial class AppJsonContext : JsonSerializerContext { }
var json = JsonSerializer.Serialize(order, AppJsonContext.Default.Order);
// ASP.NET Core: builder.Services.ConfigureHttpJsonOptions(o => o.SerializerOptions.TypeInfoResolverChain.Insert(0, AppJsonContext.Default));
Faster startup, lower allocations, required for Native AOT and trimming.
3. Stream - JsonSerializer.SerializeAsync(stream, ...) / DeserializeAsync, DeserializeAsyncEnumerable for large arrays, instead of serializing to a string then writing.
4. Utf8JsonWriter / Utf8JsonReader for the hottest custom paths - work on UTF-8 bytes directly; SerializeToUtf8Bytes beats Serialize + Encoding.UTF8.GetBytes.
5. Trim - [JsonIgnore], DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull.
6. Newtonsoft.Json - migrating hot paths to System.Text.Json is usually worthwhile; check converter and behavior differences (case sensitivity, reference handling) first.
JSON.stringify / JSON.parse are native and fast for most payloads; the real cost is blocking the event loop on large payloads. Stream large arrays (e.g. NDJSON, stream-json for parsing) or move heavy work off the main thread.fast-json-stringify compiles a JSON Schema into a serializer; Fastify uses it automatically when you declare response schemas per route (also strips undeclared fields - a security bonus).JSON.parse(JSON.stringify(x)) for cloning - use structuredClone.superjson and similar add type fidelity (Date, Map) at a cost - don't use them on hot paths that don't need it.json stdlib is slow for large payloads. orjson (returns bytes, natively handles datetime, dataclass, UUID, numpy) or msgspec (msgspec.json.encode/decode, typed Struct decoding with validation) are typically much faster.model.model_dump_json() and Model.model_validate_json(raw) (the Rust core parses directly) instead of json.dumps(model.model_dump()) / Model(**json.loads(raw)); build a TypeAdapter once and reuse it.ORJSONResponse; avoid double validation (validating the model and again via response_model on large lists) on hot endpoints..decode() to str just to write bytes again.ObjectMapper - it is thread-safe after configuration and expensive to build. Prefer a single configured bean; derive ObjectReader / ObjectWriter (mapper.readerFor(Order.class)) for hot types.JsonGenerator / JsonParser or SequenceWriter instead of building trees (JsonNode) in memory.@JsonInclude(JsonInclude.Include.NON_NULL), @JsonIgnore, DTO projections instead of entities (Hibernate proxies and bidirectional relations cause lazy loads and cycles).kotlinx.serialization is compile-time (no reflection) and a good fit for Ktor/multiplatform; with Jackson, register jackson-module-kotlin once on the shared mapper.encoding/json is reflection-based; it caches type info per type, so reuse is automatic, but it allocates heavily.json.NewEncoder(w).Encode(v) straight to http.ResponseWriter; json.NewDecoder(r.Body) for request bodies (and Token() for huge arrays).goccy/go-json (drop-in compatible API), bytedance/sonic (JIT, amd64/arm64), json-iterator/go, or codegen with mailru/easyjson. Verify behavior parity with your tests before switching.json.RawMessage to pass through sub-documents without decoding them.map[string]interface{} on hot paths - decode into typed structs.## Summary
<stack + serializer detected; where the time/allocations go>
## Findings
🔴 [Options per call] <file:line> - <cost> -> <fix>
🟡 [Buffering large response] ...
## Optimized code
<serializer setup + rewritten hot paths, ready to paste>
## Measure
<benchmark to run before/after - see benchmark-setup>
"Speed up my JSON serialization", "add System.Text.Json source generation", "why does serializing this allocate so much", "switch this FastAPI service to orjson", "add Fastify response schemas", "is my ObjectMapper set up right", "make this Go handler's JSON faster", "stream this large JSON response". Pairs with benchmark-setup and caching-strategy-setup.
What SKILL.md sets; muted values are Claude Code's defaults
/ai-dev-toolkit:serialization-optimizerfrom AI for Developers Toolkit
npx claudepluginhub stefanthecode/ai-for-developers --plugin ai-dev-toolkit45 skills in this plugin
/api-endpoint-scaffolderScaffold HTTP API endpoints in any stack - ASP.NET Core Minimal APIs or controllers, Express, Fastify, NestJS, FastAPI, Django REST Framework, Spring Boot controllers, Go net/http, chi, Gin - one feature per endpoint (REPR style) with request validation, typed responses, route grouping, auth, and OpenAPI metadata. Use this skill whenever the user wants to add an endpoint or route, convert controllers to minimal APIs, structure routes or routers, set up endpoint groups, TypedResults, route handlers, request DTOs/schemas (zod, Pydantic, Bean Validation, binding tags), or asks "how do I add an endpoint / structure my API routes". Always use this skill for endpoint scaffolding; it generates a complete, validated endpoint that matches the project's conventions./architecture-test-generatorGenerate architecture tests / fitness functions that fail the build when architectural rules are violated - layer dependencies, module boundaries, cycles, naming, and visibility conventions - in any stack: NetArchTest or ArchUnitNET (.NET), ArchUnit or Konsist (Java/Kotlin), dependency-cruiser or eslint-plugin-boundaries (TypeScript/JavaScript), import-linter (Python), go-arch-lint or depguard (Go). Use this skill whenever the user wants architecture tests, to enforce layering or the dependency rule, dependency rules as tests, import rules, forbidden imports, no circular dependencies, naming conventions, fitness functions, or asks "how do I stop people breaking the architecture / enforce my layers / keep modules from importing each other". Always use this skill for architecture-test requests; it generates rules matching the project's real structure./async-await-auditorAudit async and concurrent code in any language for correctness and performance bugs - C#/.NET (async/await, Task), JavaScript/TypeScript (Promises, async/await), Python (asyncio), Java/Kotlin (CompletableFuture, virtual threads, coroutines), Go (goroutines, channels, context), Rust (tokio/async). Use this skill whenever the user shares async or concurrent code, or asks about deadlocks, hangs, blocking calls, .Result/.Wait(), async void, ConfigureAwait, floating or unhandled promises, await in a loop vs Promise.all, blocking the event loop, forgotten await, asyncio.gather/TaskGroup, CompletableFuture.join, virtual thread pinning, goroutine leaks, context cancellation, WaitGroup/errgroup, holding a lock across .await, fire-and-forget tasks, cancellation tokens, or "why does my async code hang". Always use this skill for async/concurrency reviews instead of answering from memory; it applies a fixed checklist and rewrites the code./authorization-setupDesign API authorization in any stack - policy-based, role-based, claims/permission-based, and resource-based (ownership) checks. Covers ASP.NET Core policies and AuthorizationHandler, NestJS guards, Express middleware and CASL, FastAPI dependencies/scopes, Django and DRF permission classes, Spring Security (@PreAuthorize, SecurityFilterChain), Go middleware, and Casbin/OPA. Use this skill whenever the user wants authorization policies, role/claim/permission checks, RBAC/ABAC, custom authorization rules, resource-based authorization, IDOR protection, "deny by default", or asks "how do I authorize this / policy vs role / restrict this endpoint to X / stop users seeing other users' data". Always use this skill for authorization requests; it generates policies, handlers, and endpoint wiring./benchmark-setupSet up correct micro-benchmarks in any stack and interpret the results - BenchmarkDotNet (.NET), JMH (Java/Kotlin), pytest-benchmark / pyperf (Python), Vitest bench / tinybench / mitata (JavaScript/TypeScript), Go testing.B + benchstat, Rust criterion. Use this skill whenever the user wants to benchmark code, measure performance, compare two implementations or functions, set up a benchmark harness, or asks "which is faster", "benchmark these two functions", "how do I benchmark this", "is this optimization worth it", or "interpret these benchmark results". Always use this skill for micro-benchmarking requests; it writes correct benchmarks, avoids the classic pitfalls, and explains the numbers./caching-strategy-setupAdd the right caching to an app in any stack - in-process, distributed (Redis/Valkey/Memcached), two-level, or HTTP/output caching - with correct keys, expiration, stampede protection, and invalidation. Covers HybridCache / IMemoryCache / IDistributedCache / output caching in .NET, lru-cache / keyv / cache-manager / ioredis in Node, functools / cachetools / redis-py / Django cache in Python, Spring Cache with Caffeine or Redis in Java/Kotlin, and ristretto / groupcache / singleflight / go-redis in Go. Use this skill whenever the user wants caching, to cache a query/response, Redis caching, @Cacheable, lru_cache, HybridCache, cache-aside, output caching, or asks "how do I cache this / add caching / avoid cache stampede / invalidate this cache". Always use this skill for caching requests; it picks the right layer and wires expiration + invalidation correctly.Other plugins' skills for the same job