swift-development
/swift-development
Pomaga pisać w Swift 6 warstwy ViewModel, Service i Repository, modele danych, algorytmy oraz testy jednostkowe.
- Autor
- projanvil ↗
- Repozytorium
- mindforge ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 25.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 1
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 25.10.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Pomaga pisać w Swift 6 warstwy ViewModel, Service i Repository, modele danych, algorytmy oraz testy jednostkowe.
Oryginalny opis (EN)
Provides core Swift 6+ language development capabilities, covering concurrency, macros, model design, and business logic. Use this skill when writing ViewModel, Service, or Repository layer code, defining data models, implementing algorithms, writing unit tests, or fixing concurrency warnings and data races.
Jak działa
- Instructions
- What This Skill Does
- When to Use This Skill
- Examples
- Best Practices
- Notes
Podgląd SKILL.md
---
name: swift-development
description: Provides core Swift 6+ language development capabilities, covering concurrency, macros, model design, and business logic. Use this skill when writing ViewModel, Service, or Repository layer code, defining data models, implementing algorithms, writing unit tests, or fixing concurrency warnings and data races.
---
# Swift 6 Development Skill
## Instructions
Follow this guide when working on non-UI Swift code, business logic, algorithms, or the data layer. Your goal is to write high-performance, thread-safe, and expressive Swift code.
## What This Skill Does
- **Concurrent Programming**: Write safe concurrent code using Actors, async/await, Task, and TaskGroup.
- **Type Safety**: Define Sendable types and use Typed Throws for precise error handling.
- **Testing**: Write modern unit tests using the Swift Testing framework.
- **Data Processing**: Write Codable models and encapsulate JSON parsing and network requests.
- **Macros**: Use or create macros to reduce boilerplate.
## When to Use This Skill
Trigger scenarios:
- When writing ViewModel, Service, or Repository layer code.
- When defining data models (structs, enums).
- When implementing algorithms or utility functions.
- When writing unit tests.
- When fixing concurrency warnings or data races.
## Examples
### Example 1: Defining a Safe Actor Service
```swift
/// A thread-safe user data service
actor UserService {
private var cache: [String: User] = [:]
// Use typed throws to specify the error type explicitly
func fetchUser(id: String) async throws(NetworkError) -> User {
if let cached = cache[id] {
return cached
}
// Simulate network request
let user = try await NetworkClient.shared.get("/users/\(id)", as: User.self)
cache[id] = user
return user
}
}
```
### Example 2: Testing with Swift Testing
```swift
import Testing
@testable import MyApp
@Test("User parsing should succeed")
func userParsing() async throws {
let json = """
{ "id": "1", "name": "Alice" }
""".data(using: .utf8)!
let user = try JSONDecoder().decode(User.self, from: json)
#expect(user.name == "Alice")
#expect(user.id == "1")
}
```
## Best Practices
- **Conform to Sendable**: Any type passed between concurrency domains must conform to the `Sendable` protocol.
- **Avoid Global Mutable State**: Avoid global variables unless protected by an Actor.
- **Implicitly Unwrapped Optionals**: Strictly forbidden (the force unwrap operator), except where unavoidable in initializers (very rare).
- **Use `let` over `var`**: Default to constants; use variables only when necessary.
- **Error Handling**: Prefer `throws` and `do-catch` over returning `Optional` or `Result` types (throws is more natural in async contexts).
## Notes
- Always pay attention to "Strict Concurrency Checking" compiler warnings.
- When handling closures across Actor boundaries, be mindful of `[weak self]` or `[unowned self]` (though usually not needed in `Task` unless breaking a reference cycle).
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · projanvil/mindforge | 100 | MIT |
| projanvil/mindforge | 100 | MIT |
| rshankras/claude-code-apple-skills | 85 | MIT |
Identyczna treść występuje jeszcze w 1 innych folderach na GitHubie. Tu pokazujemy jedną, najlepiej ocenioną kopię.
Migawka bazy z 13.11.2026 · wersja paczki a48574b42555 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100swift-test-scaffold
Dodaje testy Swift: tworzy cele testowe, szkielet testów ViewModel i usług oraz dobiera Swift Testing zamiast XCTest. - 100swift-concurrency-expert
Przegląda użycie Swift Concurrency w Swift 6.2+ i naprawia zgodność oraz błędy kompilatora współbieżności w funkcji lub pliku. - 100write-swift
Pomaga pisać nowoczesny Swift: modelowanie typami wartości, współbieżność Swift 6, protokoły, testy i ARC. - 100write-swift
Pomaga pisać nowoczesny Swift: modelowanie typami wartości, współbieżność Swift 6, protokoły, testy i ARC. - 100swift-concurrency-expert
Przegląda kod Swift 6.2 pod kątem zgodności ze współbieżnością i naprawia błędy kompilatora w funkcji lub pliku. - 100swift-testing
Pisze testy jednostkowe, ViewModel i snapshot dla projektów Swift i SwiftUI, używając Swift Testing lub istniejącego XCTest.