swift-rules
Swift Rules provides comprehensive coding standards for Swift development, covering style conventions, naming patterns, type system best practices, and framework guidance. The skill applies standards for SwiftUI, Combine, async/await, and Core Data to ensure consistency across your codebase. Use it when writing or reviewing Swift code to maintain quality and follow established patterns.
Swift Rules applies style, naming, and type conventions to maintain consistent Swift code quality.
AI-generated summary based on this skill's SKILL.md
Install
softspark/ai-toolkit/swift-rules · repository language: Python
git clone https://github.com/softspark/ai-toolkit
cp -r ai-toolkit/app/skills/swift-rules ~/.claude/skills/swift-rulesFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
What swift coding standards and best practices does Swift Rules cover?
Swift Rules provides comprehensive coding standards for Swift development, covering style conventions, naming patterns, type system best practices, and framework guidance. The skill applies standards for SwiftUI, Combine, async/await, and Core Data to ensure consistency across your codebase. Use it when writing or reviewing Swift code to maintain quality and follow established patterns.
How does Swift Rules help with async/await concurrency rules?
Swift Rules guides you through writing async/await, actor-based, and concurrent Swift code safely. It covers proper patterns for managing asynchronous operations, thread safety with actors, and avoiding common concurrency pitfalls to ensure your code runs reliably in multi-threaded environments.
What does Swift Rules recommend for SwiftUI state management?
Swift Rules covers SwiftUI patterns and frameworks for building views with proper state management. It guides you on using @State, @Binding, and other property wrappers correctly, ensuring your UI remains responsive and data flows predictably through your view hierarchy.
How can Swift Rules help with secure authentication and data protection?
Swift Rules implements guidance for secure authentication, keychain, and data protection. It covers best practices for storing sensitive credentials safely, handling input validation and sanitization, and protecting user data throughout your application lifecycle.
What testing frameworks does Swift Rules support?
Swift Rules provides guidance for testing Swift code with both XCTest and the Swift Testing framework. It helps you write effective unit tests, integration tests, and understand testing patterns that ensure your code quality and reliability.
Does Swift Rules cover dependency injection and memory management?
Yes, Swift Rules includes guidance on dependency injection patterns, memory management with weak self, struct vs class decisions, and optional handling with guard let. These patterns help you write maintainable code that avoids memory leaks and manages object lifecycles properly.
SKILL.md
rendered from the published skill — quoted content, verbatim
Swift Rules
These rules come from app/rules/swift/ in ai-toolkit. They cover
the project's standards for coding style, frameworks, patterns,
security, and testing in Swift. Apply them when writing or
reviewing Swift code.
Swift Coding Style
Naming
- PascalCase: types, protocols, enums, struct, class.
- camelCase: functions, methods, properties, variables, enum cases.
- No prefixes: Swift has module namespacing (no
NSorUIprefix for your types). - Use descriptive names:
removeElement(at:)notremove(i:). - Boolean properties read as assertions:
isEmpty,hasChildren,canSubmit.
Types
- Prefer
structoverclassby default (value semantics, no reference cycles). - Use
classonly when reference semantics or inheritance is required. - Use
enumwith associated values for modeling finite states. - Use
protocolfor defining capabilities. Prefer protocol composition. - Use
typealiasfor complex generic signatures
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 1 file
app/skills/swift-rules/SKILL.md