audit-swiftui-charts

Audit macOS SwiftUI Swift Charts code for hallucinated APIs, wrong marks, and availability gating defects.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @ast-grep/cli, and includes scripts (resource) and references (resource) components.

What problem does it solve? AI-generated Swift Charts code frequently contains invented chart types (BarChart, PieMark), mis-floored availability gates, hand-rolled bar charts built from Rectangles, and missing accessibility descriptors. This Skill audits a macOS SwiftUI project to detect and, where safe, fix these defects using a corpus of 1,857 real shipping apps and Apple documentation. ## Core Features & Use Cases - Hallucination detection: Flags invented symbols like BarChart, PieMark, DonutMark, and .chartType, replacing them with real Swift Charts APIs (Chart, SectorMark, PointMark). - Availability gating checks: Verifies SectorMark (macOS 14), LinePlot (macOS 15), and chart selection modifiers are correctly gated, including detecting wrong-arm #available(iOS) gates in macOS targets. - Hybrid lint engine: Combines ripgrep tells with ast-grep structural rules to locate hand-rolled charts and gate-scope containment that grep cannot express, emitting JSON and SARIF reports. - Use Case: Run the audit on an in-progress macOS app to find a Chart hand-rolled from a ForEach of Rectangles, receive a finding with the correct Chart { BarMark } rewrite sourced from a real shipping app, and apply the fix under a safety protocol. ## Quick Start Audit the Swift Charts code in my macOS project for incorrect APIs, wrong marks, and availability gating issues.

Frequently Asked Questions about audit-swiftui-charts

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

FAQPage Schema
How do I audit Swift Charts code for hallucinated APIs?

Run the audit skill against your SwiftUI sources; it locates invented symbols like BarChart, PieMark, and .chartType using grep tells, then verifies each against a corpus of 1,857 shipping macOS apps and Apple docs before reporting findings with correct replacements.

What macOS version does SectorMark require in Swift Charts?

SectorMark requires macOS 14, not macOS 13 like the base Chart and BarMark APIs. The audit flags both ungated use below the floor and needless over-gating above it, citing the corrected floor from Apple documentation.

Can the audit fix Swift Charts defects automatically?

Only mechanical one-to-one fixes are applied automatically: hallucinated mark renames (PieMark to SectorMark) and wrong-arm iOS gates rewritten to macOS. Structural changes like converting hand-rolled charts to Chart are flagged with a correct example for the developer to apply.

Does the audit work for iOS SwiftUI chart code?

No, the audit is macOS-only and SwiftUI-only. It specifically detects the wrong-arm defect where an #available(iOS) gate wraps chart symbols in a macOS target, which makes the chart unreachable on Mac.

Why does the lint runner report parse warnings on some files?

The runner runs a per-file parse probe; a parse warning means the file did not fully parse, so structural ast-grep rules may have missed defects. Those files must be read by hand rather than treated as clean.