audit-swiftui-document-model

Audits macOS SwiftUI document architecture for API correctness and production conventions.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? AI-generated SwiftUI document apps frequently contain subtle but serious defects: phantom APIs like @FocusedDocument, classes conforming to the value-type FileDocument protocol, missing snapshot(contentType:) methods, undeclared UTTypes, and serialization pinned to the main actor. This Skill systematically detects these document-model defects in macOS SwiftUI projects before they cause data loss or build failures. ## Core Features & Use Cases - 12-Defect Detection Index: Locates document architecture problems from phantom property wrappers (doc-01) to missing UndoManager wiring (doc-12), each with severity ratings and grounded fixes. - Hybrid Lint Engine: Combines tier-1 grep tells with tier-2 ast-grep structural rules (missing snapshot detection, @MainActor-pinned documents) that plain text search cannot express, emitting unified JSON and SARIF output. - Evidence-Grounded Fixes: Every finding cites a consensus code shape from 1,857 real shipping macOS apps plus Apple documentation fetched via Sosumi, never hand-invented snippets. - Use Case: Run this on an AI-scaffolded document-based Mac app to catch a class conforming to FileDocument, a ReferenceFileDocument missing its snapshot method, or DocumentGroupLaunchScene used on a platform where it has no macOS arm. ## Quick Start Audit my macOS SwiftUI document-based app for document model correctness issues and report any findings with fixes.

Frequently Asked Questions about audit-swiftui-document-model

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

FAQPage Schema
How do I audit a SwiftUI document-based Mac app for correctness?▼

Run the shared lint runner with this skill's rule set against your SwiftUI sources, then read each located file in full. The workflow locates candidates via grep and ast-grep, verifies uncertain symbols against real app code and Apple docs, and reports only 100%-certain findings.

What is the difference between FileDocument and ReferenceFileDocument?▼

FileDocument is a value protocol for small, snapshot-serializable struct models, while ReferenceFileDocument is a class protocol for large or incrementally mutated models requiring snapshot(contentType:). A class conforming to FileDocument breaks value semantics and is flagged as a defect.

Does @FocusedDocument exist in SwiftUI?▼

No, @FocusedDocument is not a real Apple symbol and no shipping Mac app uses it. To expose the active document to menu commands, define a custom FocusedValues @Entry key and read it with @FocusedValue instead.

Can DocumentGroupLaunchScene be used in a macOS app?▼

No, DocumentGroupLaunchScene is iOS and iPadOS only with no macOS implementation. On Mac, DocumentGroup already presents the standard open panel, so its presence in a macOS target is a hard-fail defect indicating copied iOS code.

Does this skill automatically fix the document model issues it finds?▼

No, this domain is flag-only end to end because document type, binding, and UTI corrections require judgment rather than mechanical fixes. Each finding includes a grounded correct code shape from a real shipping app for the developer to apply.