NOASSERTIONupdated 1mo ago
Let be the absolute plugin directory two levels above this SKILL.md. Resolve that path before running commands or opening shared references. When these instructions say swiftui-ctx, invoke /scripts/swiftui-ctx; do not assume the command is on PATH.
What can you do with Audit Swiftui API Currency?
name: audit-swiftui-api-currency description: Audit macOS SwiftUI api currency for correctness, current APIs, and production conventions. Use for that domain or as part of a full audit.
Bundled resource root
Let <swiftui-plugin-root> be the absolute plugin directory two levels above this SKILL.md. Resolve that path before running commands or opening shared references. When these instructions say swiftui-ctx, invoke <swiftui-plugin-root>/scripts/swiftui-ctx; do not assume the command is on PATH.
Audit SwiftUI API Currency
AUDIT-ONLY Β· macOS-only Β· SwiftUI-only. Run this on a finished or in-progress macOS SwiftUI
project to detect β and where certain, fix β every way an API drifts out of currency on a macOS 26
(Tahoe) target: the stale symbol the model learned from a 2019β2022 corpus (NavigationView,
.foregroundColor, 1-param onChange), the freshly-deprecated macOS-26.5 call, the renamed
gesture, and the hallucinated modifier AI confabulated for a surface it never saw. Findings are
written to disk in the toolkit's unified schema; certain mechanical renames are fixed under the
fix-safety protocol. This is never a from-scratch modernizer.
Three mechanisms compound: training recency (renames every year; the corpus is the old surface), confident confabulation (an unknown surface yields a plausible invented name, not an admission of absence), and no availability awareness (a macOS-26-only call emitted with no gate). The unifying tell: the code reads idiomatic and usually compiles, so it survives casual review.
Boundary / seam note (stay in lane)
- api-currency owns the deprecation/hallucination flag; the positive replacement craft is a
sibling's. Emit
cross_refon every shared seam (<swiftui-plugin-root>/references/_shared/cross-ref-graph.md):.foregroundColor/.accentColor/.cornerRadiuscraft βaudit-swiftui-appearance-color.Text + Text/Font.system(_:design:)craft βaudit-swiftui-typography-text.NavigationView/tabItem/ inlineNavigationLinkstructural migration βaudit-swiftui-navigation-toolbars.- 1-param
onChange,ObservableObjectdefault βaudit-swiftui-state-observation. DispatchQueue.main.asyncisolation fix βaudit-swiftui-async-data/ concurrency.- Gesture renames mechanics β
audit-swiftui-pointer-gestures;dropDestinationβaudit-swiftui-sandbox-files. - Hallucinated glass names + glass design β
audit-swiftui-liquid-glass.
- The blanket "is every OS-floored API gated" sweep belongs to
audit-swiftui-availability-gating. This skill flags the deprecation; whether a current-but-floored replacement is gated is noted and routed there. The Liquid-Glass design audit (placement, containers, morphing) is out of scope β this skill only flags the hallucinated glass names; route the rest toaudit-swiftui-liquid-glass.
The currency model (three failure shapes)
- Deprecated/renamed β a real symbol Apple superseded; it compiles with a warning today and breaks
when the window closes (
NavigationViewβ 26.5;Text + Textβ 26.0). Flag + cite the current idiom. - Hallucinated β a name that never existed on macOS; a hard-fail. A
swiftui-ctx lookupexit 3 (not-found) corroborates it: no shipping Mac app uses the symbol. - Ungated current API β the right replacement carries its own macOS floor; using it below the
deployment target is a build break. This skill notes it and routes the depth to
availability-gating.
Defect index (curr-01 β¦ curr-14)
id Β· tell Β· severity Β· fix Β· open reference. Severities: hard-fail (never-correct / build break),
warning (compiles but stale/deprecated), advisory (smell / judgment). auto = mechanical
single-answer rename; flag = show the β
, dev applies.
| id | One-line tell | Sev | Fix | Reference |
|---|---|---|---|---|
| curr-01 | NavigationView { β¦ } (deprecated macOS 10.15β26.5) |
warning | flag | deprecations-and-renames.md |
| curr-02 | .foregroundColor(_:) (deprecated β .foregroundStyle) |
warning | auto | deprecations-and-renames.md |
| curr-03 | .cornerRadius(_:) (deprecated β .clipShape(.rect(cornerRadius:))) |
warning | auto | deprecations-and-renames.md |
| curr-04 | 1-param .onChange(of:) { newValue in } (introduced macOS 11, deprecated macOS 14) |
warning | flag | deprecations-and-renames.md |
| curr-05 | .tabItem { β¦ } (β Tab("β¦", systemImage:) { }, macOS 15) |
warning | flag | deprecations-and-renames.md |
| curr-06 | inline NavigationLink(β¦, destination:) inside List/ForEach |
warning | flag | deprecations-and-renames.md |
| curr-07 | Text("β¦") + Text("β¦") concatenation (deprecated macOS 26.0) |
warning | flag | deprecations-and-renames.md |
| curr-08 | DispatchQueue.main.async cargo-cult in async-aware code |
advisory | flag | deprecations-and-renames.md |
| curr-09 | 3-arg dropDestination(for:action:isTargeted:) (deprecated macOS 26.5) |
warning | flag | deprecations-and-renames.md |
| curr-10 | MagnificationGesture / RotationGesture (renamed macOS 26.5) |
warning | auto | deprecations-and-renames.md |
| curr-11 | Font.system(_:design:) design-only, no weight: (deprecated 26.5) |
advisory | flag | deprecations-and-renames.md |
| curr-12 | .accentColor(_:) (deprecated macOS 26.5 β .tint(_:)) |
warning | auto | deprecations-and-renames.md |
| curr-13 | .glassBackground() / .liquidGlass() / LiquidGlassView / .material(.glass) / .cardStyle() |
hard-fail | flag | hallucinated-currency.md |
| curr-14 | .glassBackgroundEffect() on a Mac target (visionOS-only) |
hard-fail | flag | hallucinated-currency.md |
Two claims are version-sensitive β confirm before asserting, never invent: the exact dropDestination
successor signature (dropDestination(for:isEnabled:action:)) and any GlassProminentButtonStyle
availability; carry as the citation from swiftui-ctx + Sosumi or as source: verify against Xcode 26 SDK.
The real API, at a glance
Deprecated β current (macOS): NavigationView β NavigationStack / NavigationSplitView Β·
.foregroundColor(_:) β .foregroundStyle(_:) Β· .cornerRadius(_:) β
.clipShape(.rect(cornerRadius:)) Β· 1-param .onChange β (old, new) or 0-param Β· .tabItem β
Tab(){} Β· inline NavigationLink(destination:) β .navigationDestination(for:) Β· Text + Text β
interpolation / AttributedString Β· DispatchQueue.main.async β @MainActor / await MainActor.run
Β· 3-arg dropDestination β dropDestination(for:isEnabled:action:) Β· MagnificationGesture /
RotationGesture β MagnifyGesture / RotateGesture Β· Font.system(_:design:) β
Font.system(_:design:weight:) Β· .accentColor(_:) β .tint(_:).
Hallucinated (never exist on macOS): .glassBackground(), .liquidGlass(), LiquidGlassView,
.material(.glass), .background(.glass), .cardStyle(). Real-but-platform-wrong:
.glassBackgroundEffect() (visionOS-only). NOT hallucinated β do not flag: Glass.interactive(_:)
is macOS 26.0+ and pointer-driven on the Mac.
Grounded β
example (the shape step 7 FIX embeds β real code, not a placeholder). For curr-02
(.foregroundColor β .foregroundStyle), swiftui-ctx lookup foregroundStyle --json returns the
consensus shape (_) at 100% with recommended permalink below β this is what ## Correct carries:
// β
.foregroundStyle(_:) β consensus shape (_), real macOS-26 call site
Circle()
.stroke(lineWidth: lineWidth)
.opacity(0.3)
.foregroundStyle(.secondary)
- Source (real GitHub permalink): sindresorhus/Gifski (8.4kβ
,
min_macos: 26) β https://github.com/sindresorhus/Gifski/blob/7f873856e2acd8b52e6681dee3aec31e6cab23e4/Gifski/Utilities.swift#L5192 - Spec (Sosumi
doc:): https://sosumi.ai/documentation/swiftui/view/foregroundstyle - Re-fetch live with
bash <swiftui-plugin-root>/scripts/swiftui-ctx file ex_032f0b9e2b --smart; never hand-write the β β it is always the currentswiftui-ctxconsensus + its permalinked example.
Floor values are the reconciled truth in <swiftui-plugin-root>/references/_shared/floors-master.md
and the canonical invented-name list in
<swiftui-plugin-root>/references/_shared/hallucination-blacklist.md β read, never restate them. The
canonical β
shape + a real macOS-26 example come from swiftui-ctx (step VERIFY/FIX), not a hand-written
snippet.
The 8-step audit workflow (execute verbatim)
- ORIENT.
tree/findthe SwiftUI sources. Read the deployment target (project.pbxprojMACOSX_DEPLOYMENT_TARGET, orPackage.swiftplatforms:). It governs the gating angle (a current-but-floored replacement must be gated below its floor). Record it. - LOCATE. Run the shared hybrid lint runner:
bash <swiftui-plugin-root>/scripts/swiftui-lint.sh --skill audit-swiftui-api-currency --dir <sources> --json /tmp/curr.json --sarif /tmp/curr.sarif. It runs this skill's tier-1 grep tells (lint/grep-tells.tsv) + tier-2 structural ast-grep rules (lint/ast-grep/*.ymlβ the 1-param-onChangeshape and the inline-NavigationLink-in-Listcontainment grep can't express), plus a per-file parse probe, and emits unified JSON + SARIF. Read itsparse_warningsβ a flagged file did not fully parse, so a structural miss can't masquerade as clean; READ those by hand. The runner only LOCATES β never treat a hit as a finding. Engine + rule-file format + degradation:<swiftui-plugin-root>/references/_shared/lint-architecture.md. - READ. Open every located file in full β never pattern-match-and-patch blind. A 1-param vs
2-param
onChangeclosure, whether aNavigationLinkis inside aList, whether aDispatchQueue.main.asyncsits in async-aware code, and whether aFont.systemalready passesweight:are all invisible to a flat grep. Build a per-file inventory: each candidate symbol + its era + its gate. - DETECT. Apply the index. Assign each candidate a confidence; report a finding only at 100%
certainty (e.g. a literally-deprecated symbol, a verified hallucinated name, a 1-param
onChange). - VERIFY. For anything β€ ~70% confidence (a symbol you're unsure exists, a deprecation date or
floor you can't place, a successor signature), run both evidence sources. (a) Practice β
bash <swiftui-plugin-root>/scripts/swiftui-ctx lookup <api> --jsonAND, for every currency rule,bash <swiftui-plugin-root>/scripts/swiftui-ctx deprecated <api>: read itsconsensus(the canonical shape),deprecated+replacement,recommendedpermalink,introduced_macos, andco_occurs_with. Alookupexit 3 (not-found, with a did-you-meansuggestion) corroborates a hallucination (curr-13/14) β no shipping Mac app uses the symbol. (b) Spec β confirm via Sosumi:curl -sSL https://sosumi.ai/<apple-path>usingreferences/source-directory.mdfor the path and<swiftui-plugin-root>/references/_shared/sosumi-reference.mdfor the protocol (neverWebFetchdeveloper.apple.com). Cross-checkintroduced_macosagainstfloors-master.mdand the Sosumidoc:floor. The CLI contract is<swiftui-plugin-root>/references/_shared/swiftui-ctx-reference.md. Promote with the citation or discard; carry an unconfirmed successor signature assource: verify against Xcode 26 SDK.- Deeper corpus evidence (currency BASELINE). Open the sweep with the corpus deprecation set:
bash <swiftui-plugin-root>/scripts/swiftui-ctx deprecated --json(no arg) orbash <swiftui-plugin-root>/scripts/swiftui-ctx insights deprecatedβ the deprecated APIs real Mac apps STILL ship, with repo counts (e.g..foregroundColor/curr-02 in 1,119 repos,NavigationView/curr-01 in 257). Use it to rank which curr-IDs to hunt first and to ground each finding'sera("still shipped by N repos"), per_shared/swiftui-ctx-reference.md.
- Deeper corpus evidence (currency BASELINE). Open the sweep with the corpus deprecation set:
- REPORT. Write each confirmed finding (output contract below). One finding per file, zero-padded,
ordered. Write the run's
_index.md. - FIX. Apply corrections under the fix-safety protocol
(
<swiftui-plugin-root>/references/_shared/fix-safety-protocol.md): clean-tree gate, findings-first, onlyfix_mode: auto(curr-02/03/10/12 β the pure mechanical renames), one conventional commit per finding citing itsrule_id, never weaken a check. The β "Correct" is not a hand-written snippet β it is the swiftui-ctx consensus shape put in## Correct, backed by a real macOS-26 example fetched withbash <swiftui-plugin-root>/scripts/swiftui-ctx file <recommended.id> --smartwhose GitHub permalink (plus the Sosumidoc:) goes in## Sourceas the canonical example. Leaveflag-onlyfindingsopenwith that β in## Correct. - DOUBLE-CHECK. Re-grep each fixed file to confirm the tell no longer matches; record the evidence
in
## Fix applied?. Re-confirm every citation still resolves. If a fix introduced a new tell (e.g. a.foregroundStylereplacement that now needs a macOS-12 gate below the floor), loop that file back to DETECT and route the gating note toavailability-gating.
Confidence gating (load-bearing)
Report a finding only at 100% certainty. Anything β€ ~70% goes to VERIFY (step 5) before it can
become a finding β never emit a speculative finding. Auto-fix only the mechanical rename set
(curr-02/03/10/12); everything else is fix_mode: flag-only.
Output contract
Inherits the toolkit's unified contract (full schema + body sections + frontmatter keys:
<swiftui-plugin-root>/references/_shared/finding-schema.md β do not restate it). Specialized for this
domain:
- Findings:
swiftui-audits/api-currency/<context>/NN-slug.md(one finding per file, zero-padded, ordered). Per-run index:swiftui-audits/api-currency/_index.md. domain: api-currency. Uses the additive fieldera(free-string release wave, e.g.WWDC22/macOS-13,macOS-26.5,WWDC25/macOS-26).fix_modeisautofor curr-02/03/10/12, elseflag-only.availabilityreads fromfloors-master.md.sourceis an Apple URL + access date (fetched via Sosumi) orverify against Xcode 26 SDK. Emitcross_refper the seam note.
Starter <context> folders (file here whenβ¦):
<context> |
File a finding here when⦠|
|---|---|
deprecated-renamed/ |
a real symbol Apple superseded β nav, color, clip, onChange, tab, link, Text+Text (curr-01β¦07) |
concurrency-cargo-cult/ |
a DispatchQueue.main.async hop in async-aware code (curr-08) |
macos-26-5-deprecations/ |
a freshly-deprecated 26.5 surface β dropDestination, gesture renames, Font weight, accentColor (curr-09β¦12) |
hallucinated-api/ |
an invented name (curr-13) or a visionOS-only symbol on a Mac target (curr-14) |
gating/ |
a current-but-floored replacement used below the deployment target (route depth β availability-gating) |
New-folder rule: if a finding does not fit any existing context folder, create a new one under
swiftui-audits/api-currency/ with a lowercase-hyphen slug naming the sub-category, and note it in the
run's _index.md. Prefer an existing folder when the fit is reasonable; consistency across runs is a
hard requirement. Two runs over the same code produce structurally identical trees.
Reference routing
| File | Open when |
|---|---|
references/deprecations-and-renames.md |
any deprecated/renamed question β the full βββ catalog, deprecation dates, floors, the gating arm (curr-01β¦12) |
references/hallucinated-currency.md |
a name/existence question β the invented-name set + the visionOS-only trap, and the exit-3 corroboration (curr-13/14) |
references/source-directory.md |
step VERIFY β the Apple/WWDC/practitioner source map fetched via Sosumi |
lint/grep-tells.tsv + lint/ast-grep/curr-04-onchange-one-param.yml + lint/ast-grep/curr-06-inline-navlink-in-list.yml |
step LOCATE β this skill's declarative lint rule set fed to the shared runner (tier-1 grep tells + tier-2 structural ast-grep: curr-04-onchange-one-param.yml for the 1-param closure shape, curr-06-inline-navlink-in-list.yml for inline NavigationLink containment); edit here to tune detection |
Shared toolkit references (point in, never restate):
| Shared file | For |
|---|---|
<swiftui-plugin-root>/references/_shared/floors-master.md |
every floor/availability/deprecation value (the reconciled truth) |
<swiftui-plugin-root>/references/_shared/hallucination-blacklist.md |
the canonical invented-name list |
<swiftui-plugin-root>/references/_shared/macos-arm-gating.md |
the macOS-arm gating rule + wrong-arm failure |
<swiftui-plugin-root>/references/_shared/finding-schema.md |
the unified finding schema + frontmatter keys (incl. additive era) |
<swiftui-plugin-root>/references/_shared/fix-safety-protocol.md |
the fix-safety protocol (step 7) |
<swiftui-plugin-root>/references/_shared/sosumi-reference.md |
the Apple-doc spec fetch protocol (step 5 VERIFY) |
<swiftui-plugin-root>/references/_shared/swiftui-ctx-reference.md |
the practice-corpus CLI contract β lookup/deprecated/file --smart for the consensus shape + permalinked example (steps 5 VERIFY Β· 7 FIX) |
<swiftui-plugin-root>/references/_shared/cross-ref-graph.md |
seam ownership + cross_ref targets |
Detection accelerator
bash <swiftui-plugin-root>/scripts/swiftui-lint.sh --skill audit-swiftui-api-currency --dir <files-or-dir> [--json out.json] [--sarif out.sarif] β the toolkit's one shared hybrid lint engine, fed this
skill's declarative rules: tier-1 grep tells (lint/grep-tells.tsv, curr-01β¦14 flat-presence /
deprecation-string tells) + tier-2 ast-grep structural rules (lint/ast-grep/*.yml β curr-04
1-param onChange closure-shape, curr-06 inline NavigationLink inside a List/ForEach) that grep
cannot express. It runs a per-file parse probe (surfaces "did not fully parse" so a structural miss
can't look clean), emits unified JSON + SARIF, exits 2 on any hard-fail (curr-13/14) for a CI
gate, and degrades to grep-only with a notice if ast-grep is unreachable (npx --package @ast-grep/cli ast-grep; faster: brew install ast-grep). It only LOCATES β always READ each hit in
full before reporting (step 3). The thin scripts/currency-lint.sh is a pointer to this runner. Engine
- rule-file format + JSON/SARIF shape + safety rails:
<swiftui-plugin-root>/references/_shared/lint-architecture.md.
Install
Add Audit Swiftui API Currency to your client. Pick the one you use.
npx skills add yigitkonur/plugin-swiftuiInstalls every skill in the repository, then prompts for which to keep.
/plugin marketplace add yigitkonur/plugin-swiftuiAdds the repository as a plugin marketplace; install individual plugins with `/plugin install`.
git clone https://github.com/yigitkonur/plugin-swiftui
cp -r plugins/swiftui/skills/audit-swiftui-api-currency ~/.claude/skills/A skill is a plain directory. Copy it into `.claude/skills/` in a project or in your home directory.
Score
75 / 100
Good