{
  "skill_name": "pdfkit",
  "evals": [
    {
      "id": 1,
      "prompt": "Review this helper from our statement viewer: it treats the first page as page 1, calls document.page(at: userNumber) and relies on it returning nil past the end, and passes user input straight into insert(_:at:), removePage(at:) and exchangePage(at:withPageAt:). What needs fixing?",
      "expected_output": "Explains that PDFKit page indices are zero-based, that every index must be checked to be at least 0 and below pageCount before page(at:), insert, removePage or exchangePage, that inserting at pageCount appends, and that out-of-range indices raise exceptions instead of returning nil.",
      "files": [],
      "assertions": [
        "States that page indices start at zero",
        "Checks index >= 0 and index < pageCount before page(at:)",
        "Applies the same bounds check to insert, removePage and exchangePage",
        "Does not claim that page(at:) safely returns nil for an out-of-range index"
      ]
    },
    {
      "id": 2,
      "prompt": "We want users to draw signatures on top of pages in our contract app using a per-page overlay, and then save the signed PDF. Outline the PDFKit side of this.",
      "expected_output": "Uses PDFPageOverlayViewProvider, keeps the provider strongly owned because pageOverlayViewProvider is weak, implements overlayViewFor and willEndDisplayingOverlayView to capture state, explains that overlay views are not written by write(to:) or dataRepresentation(), converts the drawing into annotations, appearance streams or burned-in page content before saving, and hands PencilKit tool details to the drawing skill.",
      "files": [],
      "assertions": [
        "Retains the overlay provider elsewhere because pageOverlayViewProvider is weak",
        "Uses pdfView(_:overlayViewFor:) and pdfView(_:willEndDisplayingOverlayView:for:)",
        "States that overlay views are not saved automatically",
        "Converts overlay content to annotations, appearance streams or burned-in content before saving",
        "Leaves PencilKit tool configuration to a PencilKit-focused skill"
      ]
    },
    {
      "id": 3,
      "prompt": "Which of these belong in the PDFKit skill: showing a PDF with form fields, searching and extracting text, adding highlight annotations, generating thumbnails, saving the file, designing a general UIViewRepresentable architecture for our whole app, and building a freehand pen and marker toolbar?",
      "expected_output": "Keeps display, form widgets, search and extraction, annotations, thumbnails and saving in PDFKit, routes general representable architecture to swiftui-uikit-interop, and routes freehand drawing tools to PencilKit or PaperKit, noting that PDFKit does not supply the PencilKit tool model or PaperKit markup UI.",
      "files": [],
      "assertions": [
        "Keeps display, form widgets, search, extraction, annotations, thumbnails and saving in PDFKit",
        "Routes general UIViewRepresentable architecture to swiftui-uikit-interop",
        "Routes freehand drawing tools to PencilKit or PaperKit",
        "States that PDFKit does not provide the PencilKit tool model or PaperKit markup UI"
      ]
    }
  ]
}
