pencilkit — Claude Code skill: what it does, how to install
Guides Apple Pencil drawing setup via PencilKit in Swift, configuring tool pickers and serializing strokes. Helpful when building signature pads or drawing screens on iOS.
npx skills add dpearson2699/swift-ios-skills --skill pencilkit -a claude-codeWhat pencilkit does
The skill guides an AI assistant through implementing PencilKit canvas views and stroke handling in Swift. It details how to set up PKCanvasView with suitable input policies and show the standard floating PKToolPicker. Drawing data gets converted to raw bytes via PKDrawing for atomic file storage and safe synchronization.
The framework functions without entitlements or Info.plist settings, though tailoring tool items relies on iOS 18+ alongside visionOS 2+. Version checks matter here. Targeting earlier operating systems with custom tool palettes will trigger build errors.
The workflow also covers rendering drawings to images using image(from:scale:). It requires checking bounds before generating the output image.
What it helps with
- configure
PKCanvasViewwith touch and stylus input policies - attach
PKToolPickerto switch pens, highlighters, and erasers - serialize
PKDrawingstrokes into binary data for disk storage - render canvas drawings to raster images with custom scaling
Example prompts for the agent
- Configure PKCanvasView for a signature field accepting both finger and pencil
- Add PKDrawing atomic file serialization and safe decoding
- Display PKToolPicker alongside the active canvas in my view controller
How to install pencilkit
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill pencilkit -a claude-code2Manually: put the files in place
~/.claude/skills/pencilkit/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/pencilkit/
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill pencilkit -a codex2Manually: put the files in place
.agents/skills/pencilkit/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill pencilkit -a cursor2Manually: put the files in place
.cursor/skills/pencilkit/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install dpearson2699/swift-ios-skills pencilkit2Manually: put the files in place
.github/skills/pencilkit/SKILL.md1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill pencilkit -a gemini-cli2Platform CLI
gemini skills install https://github.com/dpearson2699/swift-ios-skills --path skills/pencilkitManually: put the files in place
.devin/skills/pencilkit/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill pencilkit -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about pencilkit
How to install pencilkit in Claude Code?
Run npx skills add dpearson2699/swift-ios-skills --skill pencilkit -a claude-code in your terminal to install the skill for your coding agent.
What does the pencilkit skill do?
It directs coding assistants on adding Apple Pencil support to Swift code, managing PKCanvasView interaction policies, displaying PKToolPicker, and saving drawings.
Are any Info.plist entries needed for PencilKit?
No special entitlements or Info.plist keys are necessary. You only need to import PencilKit in Swift and instantiate your canvas view.