swift-library-design — Claude Code skill: Swift library design
Guides public API design for Swift libraries and frameworks: protocols, result builders, inlining, noncopyable types.
npx skills add wendylabsinc/claude-skills --skill swift-library-design -a claude-codeWhat swift-library-design does
The skill fires when a conversation turns to building a Swift library or framework, public API patterns, protocol-oriented architecture with associated types, result builders and DSLs, library performance, @inlinable and @usableFromInline, noncopyable types, progressive disclosure, or ResponseGenerator and builder patterns.
Two reference files carry the detail. references/api-patterns.md covers protocol design, result builders, the builder pattern, error handling and parameter extraction. references/performance.md deals with inlining, noncopyable types, data structures, lock-free patterns and state machines. The main file states four principles: protocols with associated types, compile-time safety, APIs that are efficient by default, and progressive disclosure.
Examples assume a modern Swift toolchain with generics and async/await. Code using some RequestContext and @resultBuilder will not compile on an older compiler, so check your version first. Installation is a single npx skills command.
What it helps with
- shape a library's public API so misuse fails at compile time
- build a result-builder DSL for composing middleware
- let a handler return several response types via a ResponseGenerator protocol
- mark hot paths
@inlinablewithout breaking API compatibility - define a protocol with associated types and type-safe composition
Example prompts for the agent
- Design the public API for a Swift networking library
- Write a result builder DSL so middleware can be listed inline
- Tell me where
@inlinablehelps here and where it does not
How to install swift-library-design
1Skills CLI (Vercel)
npx skills add wendylabsinc/claude-skills --skill swift-library-design -a claude-code2Manually: put the files in place
~/.claude/skills/swift-library-design/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/swift-library-design/
1Skills CLI (Vercel)
npx skills add wendylabsinc/claude-skills --skill swift-library-design -a codex2Manually: put the files in place
.agents/skills/swift-library-design/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add wendylabsinc/claude-skills --skill swift-library-design -a cursor2Manually: put the files in place
.cursor/skills/swift-library-design/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install wendylabsinc/claude-skills swift-library-design2Manually: put the files in place
.github/skills/swift-library-design/SKILL.md1Skills CLI (Vercel)
npx skills add wendylabsinc/claude-skills --skill swift-library-design -a gemini-cli2Platform CLI
gemini skills install https://github.com/wendylabsinc/claude-skills --path swift-library-designManually: put the files in place
.devin/skills/swift-library-design/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add wendylabsinc/claude-skills --skill swift-library-design -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 swift-library-design
How do I install swift-library-design in Claude Code?
Run npx skills add wendylabsinc/claude-skills --skill swift-library-design -a claude-code. The skill lands at ~/.claude/skills/swift-library-design/SKILL.md.
What does swift-library-design do?
It advises on Swift library and framework design: protocols with associated types, result builders, the builder pattern, inlining and noncopyable types.
What Swift version do the examples need?
A modern toolchain with generics and async/await. Constructs such as some RequestContext and @resultBuilder will not compile on older compilers.