Use when creating or modifying CocoaPods podspec files. Covers required attributes, file patterns, dependencies, and platform specifications for iOS, macOS, tvOS, watchOS, and visionOS projects.
View on GitHubSelect agents to install to:
npx add-skill https://github.com/TheBushidoCollective/han/blob/main/plugins/tools/cocoapods/skills/podspec-fundamentals/SKILL.md -a claude-code --skill cocoapods-podspec-fundamentalsInstallation paths:
.claude/skills/cocoapods-podspec-fundamentals/# CocoaPods - Podspec Fundamentals
Essential patterns for creating and maintaining podspec files that define CocoaPods libraries.
## Required Attributes
Every podspec must include these attributes:
```ruby
Pod::Spec.new do |spec|
# Identity
spec.name = 'MyLibrary'
spec.version = '1.0.0'
# Metadata
spec.license = { :type => 'MIT', :file => 'LICENSE' }
spec.homepage = 'https://github.com/username/MyLibrary'
spec.authors = { 'Your Name' => 'email@example.com' }
spec.summary = 'Brief description under 140 characters'
# Source
spec.source = { :git => 'https://github.com/username/MyLibrary.git', :tag => spec.version.to_s }
# Platform Support
spec.ios.deployment_target = '13.0'
spec.osx.deployment_target = '10.15'
end
```
## Platform Specifications
### Current Platform Support (2024)
```ruby
# iOS (iPhone, iPad)
spec.ios.deployment_target = '13.0'
# macOS (Mac computers)
spec.osx.deployment_target = '10.15'
# tvOS (Apple TV)
spec.tvos.deployment_target = '13.0'
# watchOS (Apple Watch)
spec.watchos.deployment_target = '6.0'
# visionOS (Apple Vision Pro) - Added in CocoaPods 1.15.0+
spec.visionos.deployment_target = '1.0'
```
### Multi-Platform Support
```ruby
# Simple approach - all platforms same version
spec.platform = :ios, '13.0'
# Recommended - specify per platform
spec.ios.deployment_target = '13.0'
spec.osx.deployment_target = '10.15'
spec.tvos.deployment_target = '13.0'
spec.watchos.deployment_target = '6.0'
```
## Source File Patterns
### Basic Source Files
```ruby
# All Swift and Objective-C files in Source directory
spec.source_files = 'Source/**/*.{swift,h,m}'
# Public headers only
spec.public_header_files = 'Source/**/*.h'
# Private/internal headers
spec.private_header_files = 'Source/**/*Private.h'
# Exclude specific files or directories
spec.exclude_files = 'Source/**/Internal/*', 'Source/**/Tests/*'
```
### Platform-Specific Source Files
```ruby
# iOS-only files
spec.iosIssues Found: