{
  "skill_name": "swift-concurrency",
  "evals": [
    {
      "id": 1,
      "prompt": "How do I use async/await in Swift?",
      "expected_output": "Mark functions as async, call with await. Avoid completion handlers. Example: let user = await fetchUser(). Use throws for async throwing.",
      "assertions": [
        {
          "id": "a1",
          "description": "Mentions async keyword",
          "type": "contains",
          "value": "async"
        },
        {
          "id": "a2",
          "description": "Mentions await keyword",
          "type": "contains",
          "value": "await"
        },
        {
          "id": "a3",
          "description": "Warns against completion handlers",
          "type": "contains",
          "value": "completion handlers"
        }
      ]
    },
    {
      "id": 2,
      "prompt": "How do I use actors to protect mutable state?",
      "expected_output": "Use actor Keyword for data isolation. Only allow access via async methods. Perfect for single-point state like Account or Database.",
      "assertions": [
        {
          "id": "a1",
          "description": "Mentions actor keyword",
          "type": "contains",
          "value": "actor"
        },
        {
          "id": "a2",
          "description": "Mentions data isolation",
          "type": "contains",
          "value": "isolation"
        },
        {
          "id": "a3",
          "description": "Mentions async methods",
          "type": "contains",
          "value": "async"
        }
      ]
    },
    {
      "id": 3,
      "prompt": "How do I annotate UI code with @MainActor?",
      "expected_output": "Add @MainActor to functions, classes, or properties to ensure execution on the main thread. Default on ViewModels and View.body.",
      "assertions": [
        {
          "id": "a1",
          "description": "Mentions @MainActor",
          "type": "contains",
          "value": "@MainActor"
        },
        {
          "id": "a2",
          "description": "Mentions main thread",
          "type": "contains",
          "value": "main thread"
        },
        {
          "id": "a3",
          "description": "Mentions ViewModels",
          "type": "contains",
          "value": "ViewModel"
        }
      ]
    },
    {
      "id": 4,
      "prompt": "How do I use async let for parallel execution?",
      "expected_output": "Use async let to run independent tasks in parallel: async let user = fetchUser(); async let posts = fetchPosts(). Then await both together.",
      "assertions": [
        {
          "id": "a1",
          "description": "Mentions async let",
          "type": "contains",
          "value": "async let"
        },
        {
          "id": "a2",
          "description": "Mentions parallel execution",
          "type": "contains",
          "value": "parallel"
        },
        {
          "id": "a3",
          "description": "Mentions await for grouped results",
          "type": "contains",
          "value": "Task"
        }
      ]
    },
    {
      "id": 5,
      "prompt": "How do I use TaskGroup in Swift?",
      "expected_output": "Use withTaskGroup or withThrowingTaskGroup for dynamic parallelism. add tasks to the group and collect results as they finish.",
      "assertions": [
        {
          "id": "id1",
          "description": "Mentions withTaskGroup",
          "type": "contains",
          "value": "TaskGroup"
        },
        {
          "id": "id2",
          "description": "Mentions Task.isCancelled",
          "type": "contains",
          "value": "isCancelled"
        }
      ]
    }
  ],
  "should_not_trigger": [
    "How do I set up Core Data?",
    "How do I use NSLayoutAnchor?",
    "How do I implement MVVM?",
    "How do I configure SwiftLint?"
  ]
}
