audit-swiftui-async-data

Audit macOS SwiftUI async data loading for lifecycle, state, and networking defects.

2|1|Updated Jun 7, 2026
One-click install
npx skills add https://github.com/yigitkonur/plugin-swiftui --skill audit-swiftui-async-data-yigitkonur
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: audit-swiftui-async-data
Source: https://github.com/yigitkonur/plugin-swiftui/tree/main/plugins/swiftui/skills/audit-swiftui-async-data
Command: npx skills add https://github.com/yigitkonur/plugin-swiftui --skill audit-swiftui-async-data-yigitkonur

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? SwiftUI views often load async data incorrectly: bare Task calls in .onAppear that never cancel, missing loading/error/empty states, undebounced search requests, and AsyncImage without failure handling or caching. This Skill systematically detects and fixes these defects in macOS SwiftUI projects. ## Core Features & Use Cases - Ten-rule defect detection: Covers async-01 through async-10, from Task-in-onAppear lifecycle leaks to missing .refreshable and .redacted skeletons, using a hybrid grep plus ast-grep lint engine. - Grounded fixes: Every correction is backed by a consensus API shape and a permalinked real-world macOS example from a corpus of 1,857 shipping apps, verified against Apple documentation via Sosumi. - Structured findings: Writes findings to disk in a unified schema with severity, fix mode, and cross-references to related audit domains like concurrency-safety and state-observation. - Use Case: Point it at an in-progress macOS SwiftUI codebase to catch a search field firing a network request per keystroke, or a list with no pull-to-refresh, before shipping. ## Quick Start Audit the async data loading in my macOS SwiftUI project and report any lifecycle, state, or networking defects.

Frequently Asked Questions about audit-swiftui-async-data

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit SwiftUI async data loading in a macOS app?

Run the shared lint runner with this skill against your SwiftUI sources to locate candidates via grep tells and ast-grep structural rules, then read each hit in full. Absence defects like missing loading or empty states are found by reading the load site, not by linting.

What async data defects does this SwiftUI audit detect?

It covers ten defects: bare Task in .onAppear, missing loading/error/empty states, raw URLSession in views, undebounced search, AsyncImage without failure phase or cache, missing .refreshable, stale-result races, and missing .redacted skeletons.

Does the SwiftUI async audit auto-fix the defects it finds?

Only async-01, the mechanical Task-in-onAppear to .task rewrite, is auto-fixed when the captured state is already Sendable or main-actor-safe. All other findings are flag-only, reported with a grounded correct shape for the developer to apply.

Why is a bare Task inside .onAppear a problem in SwiftUI?

A Task launched in .onAppear is unstructured and not bound to view identity, so it is never cancelled when the view disappears and races a re-appearing view. Moving the work to .task or .task(id:) binds it to the view lifecycle with automatic cancellation.

Can this audit handle SwiftData or concurrency isolation issues?

No, those are explicit boundary seams. @Query and SwiftData fetching belong to the swiftdata skill, and Sendable or actor isolation verdicts belong to concurrency-safety; this skill emits cross-references and stays on async loading concerns.