{
  "skill_name": "golang-error-handling",
  "evals": [
    {
      "id": 1,
      "prompt": "How do I wrap an error with context in Go so callers can still check the original error type?",
      "expected_output": "Use fmt.Errorf(\"operation failed: %w\", err) to wrap. Callers use errors.Is(err, target) or errors.As(err, &target) to unwrap and check the original error.",
      "assertions": [
        { "type": "contains", "value": "%w" },
        { "type": "contains", "value": "errors.Is" }
      ]
    },
    {
      "id": 2,
      "prompt": "I want to define a sentinel error for 'not found' in my Go repository. How should I do this?",
      "expected_output": "Define as var ErrNotFound = errors.New(\"not found\") at the package level. Callers check with errors.Is(err, ErrNotFound). Do not use string comparison.",
      "assertions": [
        { "type": "contains", "value": "errors.New" },
        { "type": "contains", "value": "errors.Is" }
      ]
    },
    {
      "id": 3,
      "prompt": "My Go function returns an error but I'm ignoring it with _. Is this ever acceptable?",
      "expected_output": "Rarely. Ignoring errors silently swallows failures. Always handle, log, or wrap and return. If ignoring is intentional, add a comment explaining why.",
      "assertions": [
        { "type": "contains", "value": "handle" },
        { "type": "contains", "value": "log" }
      ]
    }
  ],
  "should_not_trigger": [
    "How do I write a table-driven test in Go?",
    "Set up CORS middleware for my Echo server",
    "Configure golangci-lint"
  ]
}
