{
  "skill_name": "swift-codable",
  "evals": [
    {
      "id": 0,
      "prompt": "Write the networking model layer for a read-only podcast directory API. Responses look like {\"data\": [...], \"meta\": {\"page\": 1, \"total_pages\": 9}}, dates are ISO 8601 strings, and each show has fields like show_title, image_url and published_at. We want a reusable helper that unwraps the envelope.",
      "expected_output": "Decodable models, a status-checked fetch, an ISO 8601 date strategy, correct handling of image_url, and an envelope helper that owns its decoder.",
      "files": [],
      "assertions": [
        "Declares the response models Decodable rather than Codable",
        "Checks the HTTPURLResponse status code before decoding",
        "Sets dateDecodingStrategy to .iso8601",
        "Notes that convertFromSnakeCase turns image_url into imageUrl, so an imageURL property needs an explicit CodingKeys entry",
        "Declares the decoder inside the envelope helper instead of referring to a decoder from another function"
      ]
    },
    {
      "id": 1,
      "prompt": "Our API is all snake_case: display_name, created_at, image_url, base_uri, user_id. A colleague set keyDecodingStrategy to convertFromSnakeCase, but imageURL, baseURI and userID come back missing. Another colleague wants to delete the strategy and hand-write CodingKeys for every field. What is the right fix?",
      "expected_output": "Keep the strategy for ordinary keys and add explicit keys only for the acronym-cased properties.",
      "files": [],
      "assertions": [
        "Confirms the strategy correctly maps display_name to displayName",
        "Explains that the strategy cannot produce URL, URI or ID capitalization",
        "Adds explicit CodingKeys for imageURL, baseURI and userID",
        "Advises against hand-mapping every simple snake_case key"
      ]
    },
    {
      "id": 2,
      "prompt": "We store a Codable struct ShippingAddress on a SwiftData @Model and a small Codable ReaderPrefs struct in @AppStorage. Someone suggested marking the address @Attribute(.transformable) and saving it as encoded Data because Codable structs only work on iOS 18. ReaderPrefs also has default property values but decoding \"{}\" fails. Sort this out.",
      "expected_output": "Typed Codable properties on the model, a complete and non-recursive RawRepresentable bridge for AppStorage, and a correct explanation of defaults, without drifting into general SwiftData or SwiftUI state design.",
      "files": [],
      "assertions": [
        "States that @Model persists supported noncomputed stored properties, including Codable structs and enums, without claiming an iOS 18 requirement",
        "Does not recommend transformable, encoded Data or encoded String fallbacks",
        "Provides a complete RawRepresentable bridge with a JSON String rawValue for @AppStorage",
        "Explains that synthesized Decodable ignores property defaults, so {} needs custom decoding with decodeIfPresent or a tolerant rawValue initializer",
        "Stays on the Codable boundary rather than redesigning the SwiftData schema or SwiftUI state"
      ]
    }
  ]
}
