Agent skill
Swift Concurrency
Standards for async/await, Actors, Task Groups, and MainActor
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/concurrency-hoangnguyen0403-agent-skills-standar
Metadata
Additional technical details for this skill
- labels
-
swift concurrency async await actor
- triggers
-
{ "files": [ "**/*.swift" ], "keywords": [ "async", "await", "actor", "Task", "MainActor" ] }
SKILL.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
- async/await & Actors
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?