Agent-skills-standard swift-tooling
Configure SPM packages, SwiftLint, and build settings for Swift projects. Use when managing Swift packages with SPM, configuring build settings, or enforcing Swift code quality. (triggers: Package.swift, .swiftlint.yml, package, target, dependency)
install
source · Clone the upstream repo
git clone https://github.com/HoangNguyen0403/agent-skills-standard
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/HoangNguyen0403/agent-skills-standard "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/swift/swift-tooling" ~/.claude/skills/hoangnguyen0403-agent-skills-standard-swift-tooling && rm -rf "$T"
manifest:
skills/swift/swift-tooling/SKILL.mdsource content
Swift Tooling Standards
Priority: P0
Define SPM Packages
- Package.swift: Define clear targets, products, and dependencies.
- Modularization: Break large projects into local packages for faster builds.
- Versioning: Use semantic versioning (Major.Minor.Patch) for shared packages.
See implementation examples for Package.swift structure, SwiftLint config, and environment-specific code.
Enforce Code Quality
- SwiftLint: Use for consistent style enforcement. Create
in project root with.swiftlint.yml
anddisabled_rules
sections.opt_in_rules - Compiler Warnings: Treat warnings as errors in CI to maintain code health.
- Documentation: Use triple slashes
for documentation comments on public APIs (DocC-compatible).///
Manage Build Configurations
- Xcconfig: Use external configuration files to manage build settings.
- Environment Flags: Use
for development-only code, closed with#if DEBUG
.#endif - Schemes: Maintain separate schemes for Development, Staging, and Production.
Anti-Patterns
- No API keys in code: Use environment variables or build configs.
- No // swiftlint:disable: Fix underlying issue.
- No manually added frameworks: Use SPM.