> swift-concurrency
Standards for async/await, Actors, Task Groups, and MainActor. Use when implementing Swift async/await, Actors, or structured concurrency in iOS/macOS. (triggers: **/*.swift, async, await, actor, Task, MainActor)
curl "https://skillshub.wtf/HoangNguyen0403/agent-skills-standard/swift-concurrency?format=md"Swift Concurrency
Priority: P0
Implementation Guidelines
async/await
- Async Functions: Mark with
async, call withawait. - Error Handling: Combine with
throwsfor async throwing functions. - No Completion Handlers: Prefer
asyncover callback-based APIs.
Actors
- Data Isolation: Use
actorfor mutable state accessed from multiple tasks. - MainActor: Annotate UI code with
@MainActorfor main thread execution. - Actor Isolation: All actor properties/methods are isolated automatically.
Task Management
- Structured Concurrency: Use
Task {},async let,TaskGroup. - Cancellation: Check
Task.isCancelled, propagate cancellation. - Detached Tasks: Avoid
Task.detachedunless necessary.
Anti-Patterns
- Blocking Main Thread:
**No synchronous work in @MainActor**: Use Task. - Missing MainActor:
**UI updates must be @MainActor**: Compiler error. - Ignoring Cancellation:
**Check Task.isCancelled**: Respect cancellation.
References
> related_skills --same-repo
> typescript-tooling
Development tools, linting, and build config for TypeScript. Use when configuring ESLint, Prettier, Jest, Vitest, tsconfig, or any TS build tooling. (triggers: tsconfig.json, .eslintrc.*, jest.config.*, package.json, eslint, prettier, jest, vitest, build, compile, lint)
> typescript-security
Secure coding practices for TypeScript. Use when validating input, handling auth tokens, sanitizing data, or managing secrets and sensitive configuration. (triggers: **/*.ts, **/*.tsx, validate, sanitize, xss, injection, auth, password, secret, token)
> typescript-language
Modern TypeScript standards for type safety and maintainability. Use when working with types, interfaces, generics, enums, unions, or tsconfig settings. (triggers: **/*.ts, **/*.tsx, tsconfig.json, type, interface, generic, enum, union, intersection, readonly, const, namespace)
> typescript-best-practices
Idiomatic TypeScript patterns for clean, maintainable code. Use when writing or refactoring TypeScript classes, functions, modules, or async logic. (triggers: **/*.ts, **/*.tsx, class, function, module, import, export, async, promise)