Skip to content

dpearson2699/swift-ios-skills / skills/pdfkit

pdfkit

Verified

Display and manipulate PDF documents using PDFKit. Use when embedding PDFView to show PDF files, creating or modifying PDFDocument instances, adding annotations (highlights, notes, signature widgets), extracting text with PDFSelection, navigating pages, generating thumbnails, filling PDF forms, or wrapping PDFView in SwiftUI.

FileKindSize
SKILL.mdskill md13.7 KB
evals/evals.jsonconfig3.4 KB
references/pdfkit-patterns.mdmarkdown23.4 KB

evals/evals.json

View on GitHub
{
  "skill_name": "pdfkit",
  "evals": [
    {
      "id": 1,
      "prompt": "Review this PDFKit page-navigation code for iOS: `if let page = document.page(at: selectedIndex) { pdfView.go(to: page) }`, plus remove/exchange buttons that call `removePage(at:)` and `exchangePage(at:withPageAt:)` directly. What should change?",
      "expected_output": "A concise PDFKit review that explains zero-based page indices, guards page access and page mutations before calling PDFDocument APIs, and supplies corrected Swift snippets.",
      "files": [],
      "assertions": [
        "States that PDFDocument page indices are zero-based and that page(at:), insert(_:at:), removePage(at:), and exchangePage(at:withPageAt:) must be called only with valid bounds.",
        "Corrects the page navigation snippet by checking selectedIndex is greater than or equal to zero and less than document.pageCount before calling page(at:).",
        "Corrects remove or exchange operations with pageCount-based guards instead of relying on optional binding or catching nil.",
        "Does not claim page(at:) safely returns nil for out-of-range indices."
      ]
    },
    {
      "id": 2,
      "prompt": "I'm adding a PencilKit-style drawing layer over a PDFView using PDFPageOverlayViewProvider. Sketch the PDFKit-side structure for provider ownership, visible-page lifecycle, and saving the edits back into the PDF.",
      "expected_output": "A PDFKit overlay plan that keeps the overlay provider strongly owned, uses PDFPageOverlayViewProvider lifecycle callbacks to persist per-page overlay state, and explains that overlay views must be converted to PDF annotations or burned in before saving.",
      "files": [],
      "assertions": [
        "Notes that PDFView.pageOverlayViewProvider is weak and the provider must be strongly retained by a controller, coordinator, or other owner.",
        "Uses pdfView(_:overlayViewFor:) for creating page overlay views and willEndDisplayingOverlayView to capture state before a page overlay leaves display.",
        "States that overlay views are not automatically saved as PDF content.",
        "Recommends converting overlay data into annotations, custom annotation appearance streams, or rendered/burned-in page content before write(to:) or dataRepresentation().",
        "Keeps PencilKit drawing details as a handoff rather than turning the answer into a general PencilKit tutorial."
      ]
    },
    {
      "id": 3,
      "prompt": "Which skill should handle a feature that displays a PDF, fills text and checkbox fields, shows thumbnails, and wraps the view in SwiftUI? Mention any sibling-skill handoffs for broader SwiftUI or drawing behavior.",
      "expected_output": "A boundary-aware answer that activates PDFKit for PDFView, PDFDocument, widget annotations, thumbnails, and PDF-specific SwiftUI wrapping while routing broad interop and drawing-tool concerns to sibling skills.",
      "files": [],
      "assertions": [
        "Keeps PDF display, form widgets, text extraction/search, annotations, thumbnails, and PDFDocument save behavior in the PDFKit skill.",
        "Routes general UIViewRepresentable architecture beyond the PDFView wrapper to swiftui-uikit-interop when needed.",
        "Routes freehand drawing tool behavior to PencilKit or PaperKit when the task is about drawing tools rather than PDF overlay lifecycle.",
        "Does not claim PDFKit itself provides the full PencilKit drawing tool model or PaperKit markup UI."
      ]
    }
  ]
}
canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall