{
  "schema": "https://ai-atoms.com/schemas/skill-v1.json",
  "type": "skill",
  "id": "skill/system-text-json-net11",
  "version": "1.0.1",
  "name": "system-text-json-net11",
  "description": "Imperative guidance for the System.Text.Json APIs added in .NET 11: the built-in `JsonNamingPolicy.PascalCase` naming policy, and the strongly-typed `JsonSerializerOptions.GetTypeInfo<T>()` and `JsonSerializerOptions.TryGetTypeInfo<T>(out JsonTypeInfo<T>? info)` metadata accessors. USE ONLY when the user is targeting net11.0 or later and needs PascalCase JSON property or dictionary-key names without writing a custom naming policy, a strongly-typed `JsonTypeInfo<T>` instead of the non-generic `JsonTypeInfo`, or a no-throw way to probe whether a type's serialization metadata is resolved. DO NOT USE when the target is earlier than net11.0, the requested behavior uses an established pre-net11 naming policy, or the user explicitly selected another JSON library.",
  "system_prompt_fragment": "# System.Text.Json — .NET 11\n\nNew APIs added to `System.Text.Json` across .NET 11 releases.\n\n## When to Use\n\n- Serializing or deserializing JSON in a .NET 11 (or later) project\n- Needing strongly-typed `JsonTypeInfo<T>` access instead of the untyped `JsonTypeInfo` overload\n- Wanting to safely check whether type metadata is available without catching exceptions (`TryGetTypeInfo<T>`)\n- Requiring PascalCase property naming during JSON serialization\n\n## When Not to Use\n\n- The project targets .NET 10 or earlier — these APIs are not available before .NET 11\n- Using a JSON library that is not `System.Text.Json` (e.g., Newtonsoft.Json)\n- The existing untyped `GetTypeInfo(Type)` / `TryGetTypeInfo(Type, ...)` overloads are sufficient\n\n## Target Framework\n\n```xml\n<TargetFramework>net11.0</TargetFramework>\n```\n\n## New APIs\n\n### Typed `JsonTypeInfo` Access\n\n#### `JsonSerializerOptions.GetTypeInfo<T>()`\n\nReturns a strongly-typed `JsonTypeInfo<T>` for the specified type, using the\noptions' configured type-info resolver.\n\n```csharp\nJsonTypeInfo<T> GetTypeInfo<T>()\n```\n\n#### `JsonSerializerOptions.TryGetTypeInfo<T>(out JsonTypeInfo<T>?)`\n\nAttempts to retrieve typed metadata without throwing if the type is not resolved.\n\n```csharp\nbool TryGetTypeInfo<T>(out JsonTypeInfo<T>? typeInfo)\n```\n\n### `JsonNamingPolicy.PascalCase`\n\nA new static property that converts property names to PascalCase during\nserialization.\n\n```csharp\nstatic JsonNamingPolicy PascalCase { get; }\n```\n\n## Examples\n\n### Get Typed JsonTypeInfo\n\n```csharp\nusing System.Text.Json;\nusing System.Text.Json.Serialization.Metadata;\n\nvar options = new JsonSerializerOptions(JsonSerializerDefaults.Web);\n\n// Retrieve strongly-typed metadata for MyClass\nJsonTypeInfo<MyClass> typeInfo = options.GetTypeInfo<MyClass>();\nConsole.WriteLine($\"Type: {typeInfo.Type.Name}\");\n```\n\n### TryGetTypeInfo for Safe Access\n\n```csharp\nusing System.Text.Json;\nusing System.Text.Json.Serialization.Metadata;\n\nvar options = new JsonSerializerOptions(JsonSerializerDefaults.Web);\n\nif (options.TryGetTypeInfo<MyClass>(out var info))\n{\n    Console.WriteLine($\"Resolved type info for {info!.Type.Name}\");\n}\nelse\n{\n    Console.WriteLine(\"Type info not available\");\n}\n```\n\n### PascalCase Naming Policy\n\n```csharp\nusing System.Text.Json;\n\nvar opts = new JsonSerializerOptions\n{\n    PropertyNamingPolicy = JsonNamingPolicy.PascalCase\n};\n\nvar obj = new { firstName = \"John\", lastName = \"Doe\" };\nstring json = JsonSerializer.Serialize(obj, opts);\nConsole.WriteLine(json);\n// Output: {\"FirstName\":\"John\",\"LastName\":\"Doe\"}\n```\n\n### Combined: Serialize with Typed Metadata\n\n```csharp\nusing System.Text.Json;\nusing System.Text.Json.Serialization.Metadata;\n\nvar options = new JsonSerializerOptions\n{\n    PropertyNamingPolicy = JsonNamingPolicy.PascalCase\n};\n\nJsonTypeInfo<Person> typeInfo = options.GetTypeInfo<Person>();\nstring json = JsonSerializer.Serialize(new Person(\"Jane\", 30), typeInfo);\nConsole.WriteLine(json);\n// Output: {\"Name\":\"Jane\",\"Age\":30}\n\npublic record Person(string Name, int Age);\n```",
  "applicable_domains": [
    "code",
    "dotnet",
    "engineering"
  ],
  "invocation": [
    "/system-text-json-net11"
  ],
  "tags": [
    "dotnet11",
    "dotnet",
    "csharp",
    "microsoft"
  ],
  "authored_by": "anthropics",
  "source_url": "https://github.com/dotnet/skills/blob/main/plugins/dotnet11/skills/system-text-json-net11/SKILL.md",
  "lifecycle": "stable",
  "category": "dotnet",
  "provenance": {
    "source": "dotnet/skills",
    "source_url": "https://github.com/dotnet/skills/blob/main/plugins/dotnet11/skills/system-text-json-net11/SKILL.md",
    "author": "Microsoft / .NET Foundation",
    "license": "MIT",
    "notes": "Imported by scripts/import-anthropic-skills.py."
  }
}