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 Liquid Glass?
name: audit-swiftui-liquid-glass description: Audit macOS SwiftUI liquid glass 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 Liquid Glass
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 Liquid Glass goes wrong on a macOS 26 (Tahoe) target: hallucinated names, wrong-layer placement, glass-on-glass, missing containers, missing/wrong availability gates, scroll-edge traps, re-glassed free chrome, and broken morphs. Findings are written to disk in the toolkit's unified schema; certain mechanical defects are fixed under the fix-safety protocol. This is never a from-scratch glass generator.
Liquid Glass is the toolkit's highest API-hallucination domain (the API shipped at WWDC25, after most training data). Be suspicious wherever AI wrote glass code.
Boundary / seam note (stay in lane)
- AppKit
NSGlassEffectView/NSGlassEffectContainerVieware out of scope. If audited code reaches for an AppKit glass surface, note it in one line and point to the futureaudit-appkit-liquid-glassskill β do not audit AppKit glass here. - Materials (
.ultraThinMaterialetc.) and Dark-Mode contrast belong toaudit-swiftui-appearance-colorβ except where a material is the pre-26 fallback for a gated glass call (that stays here). - The blanket "is every OS-floored API gated" sweep belongs to
audit-swiftui-availability-gating; this skill owns glass gating in depth and defers non-glass gating there.
The three non-negotiable design rules
- Navigation layer only β never content. Glass goes on toolbars/floating controls/sidebars, never on rows, cells, cards, text, images, charts, or full-screen backgrounds.
- Never glass-on-glass. Glass can't sample glass; one glass layer over plain content.
- Group siblings in a
GlassEffectContainer. Ungrouped siblings sample independently β mismatched blur/tint, extra render passes, no morphing.
The placement test: remove the element β lost the ability to navigate/act β navigation layer
(glass OK); lost information β content (glass wrong). Full reasoning + the placement-map artifact:
references/design-rules-and-placement.md.
Defect index (glass-01 β¦ glass-18)
id Β· tell Β· severity Β· fix Β· open reference. Severities: hard-fail (build break / never-correct),
warning (compiles but non-native), advisory (judgment / perf). auto = mechanical single-answer
fix; flag = show the β
, dev applies.
| id | One-line tell | Sev | Fix | Reference |
|---|---|---|---|---|
| glass-01 | .glassBackground() / .liquidGlass() / LiquidGlassView / .material(.glass) / .background(.glass) |
hard-fail | auto | glass-api-surface.md |
| glass-02 | .glassBackgroundEffect() on a Mac target (visionOS-only) |
hard-fail | auto | glass-api-surface.md |
| glass-03 | .glassEffect() on content β List/ForEach/Table row, card, Text, Image |
warning | flag | design-rules-and-placement.md |
| glass-04 | two+ .glassEffect( nested/stacked (glass-on-glass) |
warning | flag | design-rules-and-placement.md |
| glass-05 | two+ sibling glass in one stack, no GlassEffectContainer |
warning | flag | design-rules-and-placement.md |
| glass-06 | a glass symbol ungated under a deployment target < macOS 26 | warning | flag | availability-gating-glass.md |
| glass-07 | #available(iOS 26, *) gating glass in a macOS target (wrong arm) |
warning | auto | availability-gating-glass.md |
| glass-08 | .regular and .clear mixed in one group |
warning | flag | design-rules-and-placement.md |
| glass-09 | two+ .tint( / .glassProminent among sibling glass (tint spam) |
warning | flag | design-rules-and-placement.md |
| glass-10 | .glassEffect() hand-applied to auto-adopting chrome (toolbar/sidebar/sheet) |
warning | flag | chrome-and-scroll-edges.md |
| glass-11 | leftover .toolbarBackground(.visible) / .toolbarColorScheme(_:) blocks glass |
warning | auto | chrome-and-scroll-edges.md |
| glass-12 | TextEditor in a NavigationSplitView detail β opaque toolbar |
warning | flag | chrome-and-scroll-edges.md |
| glass-13 | .glassEffect() + .background(.ultraThinMaterial) (double transparency) |
advisory | flag | chrome-and-scroll-edges.md |
| glass-14 | hand-rolled glass button instead of .buttonStyle(.glass) |
advisory | flag | design-rules-and-placement.md |
| glass-15 | Tab(...) adopted, selection on @State not @SceneStorage |
advisory | flag | migration-and-morphing.md |
| glass-16 | backward-compat LabelStyle kept at a macOS-26 floor |
advisory | auto | migration-and-morphing.md |
| glass-17 | glassEffectID morph missing a condition (container / namespace / animation / conditional render) |
advisory | flag | migration-and-morphing.md |
| glass-18 | glassEffectUnion siblings differ in shape / variant / tint |
advisory | flag | migration-and-morphing.md |
Three claims are UNVERIFIED β carry as advisory with the flag, never assert as fact (each is
flagged in its reference + becomes source: verify against Xcode 26 SDK): the macOS scroll-edge
default style (.hard-vs-.soft); the constrained-TextEditor opaque-toolbar pitfall
(glass-12); the double-transparency crash (glass-13).
The real API, at a glance
Real (exist on macOS 26.0+): glassEffect(_:in:), GlassEffectContainer, .buttonStyle(.glass) /
.glassProminent, Glass + .regular / .clear / .identity / .interactive(_:) / .tint(_:),
glassEffectID(_:in:), glassEffectUnion(id:namespace:), glassEffectTransition(_:),
backgroundExtensionEffect(), scrollEdgeEffectStyle(_:for:), scrollEdgeEffectHidden(_:for:),
ToolbarContent.sharedBackgroundVisibility(_:). Glass.interactive(_:) is macOS 26.0+ and
pointer-driven on the Mac β NOT iOS-only; never flag it as invented or iOS-only.
Hallucinated (never exist): .glassBackground(), .liquidGlass(), LiquidGlassView,
.material(.glass), .background(.glass), GlassContainer, .buttonStyle(.liquidGlass).
Real-but-platform-wrong: .glassBackgroundEffect() (visionOS-only).
β Correct (grounded in shipping macOS-26 code, not a placeholder)
The corpus consensus shape for glassEffect is (_, in:) (62% of real call sites; next is (in:)
at 17%). The canonical example below is the highest-authority real macOS-26 call site
(sindresorhus/Gifski, 8.4kβ
) β verbatim from swiftui-ctx file ex_9ebe1b2ae8 --smart:
// Button("Open") { β¦ }
// .buttonStyle(.glass) // free glass on the control
VStack { β¦ }
.padding(.horizontal)
.glassEffect(.clear, in: .rect(cornerRadius: 56)) // consensus (_:in:) shape, gated implicitly by a macOS-26 floor
.background { Image(.background).resizable().opacity(0.3) }
- Real call site (permalink): https://github.com/sindresorhus/Gifski/blob/7f873856e2acd8b52e6681dee3aec31e6cab23e4/Gifski/StartScreen.swift#L28
- Apple spec (Sosumi
doc:): https://sosumi.ai/documentation/swiftui/view/glasseffect(_:in:) β confirmsmacOS 26.0+, matchingfloors-master.md.
Signatures, floors, and the full βββ
rewrites: references/glass-api-surface.md. 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 8-step audit workflow (execute verbatim)
- ORIENT.
tree/findthe SwiftUI sources. Read the deployment target (project.pbxprojMACOSX_DEPLOYMENT_TARGET, orPackage.swiftplatforms:). It is load-bearing: glass-06/07 fire only when the floor is below macOS 26. Record it. - LOCATE. Run the shared hybrid lint runner:
bash <swiftui-plugin-root>/scripts/swiftui-lint.sh --skill audit-swiftui-liquid-glass --dir <sources> --json /tmp/glass.json --sarif /tmp/glass.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 not-in-container/glass-on-glass/wrong-arm rules 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. Container nesting, cross-line ownership, and gate scope are invisible to grep. Build a per-file inventory: each glassed view + navigation-or-content (placement test) + its container + its gate.
- DETECT. Apply the index. Assign each candidate a confidence; report a finding only at 100%
certainty (e.g. a hallucinated name, an
iOSgate arm, an ungated symbol under a <26 floor). - VERIFY. For anything β€ ~70% confidence (a symbol you're unsure exists, a floor you can't place, a
behavior claim), run both evidence sources. (a) Practice β
bash <swiftui-plugin-root>/scripts/swiftui-ctx lookup <api> --json(andswiftui-ctx deprecated <api>for a currency/deprecation rule): 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 finding β 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 the three UNVERIFIED items asadvisorywithsource: verify against Xcode 26 SDKβ never as fact. - 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(glass-01/02/07/11/16), 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 and still saysmacOS 26.0. If a fix introduced a new tell (e.g. aglassEffectyou added now needs a gate), loop that file back to DETECT.
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 set
(glass-01/02/07/11/16); 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/liquid-glass/<context>/NN-slug.md(one finding per file, zero-padded, ordered). Per-run index:swiftui-audits/liquid-glass/_index.md. domain: liquid-glass. Frontmatter is the canonical schema;fix_modeisautofor glass-01/02/07/11/16, elseflag-only.availabilityreads fromfloors-master.md.sourceis an Apple URL + access date (fetched via Sosumi) orverify against Xcode 26 SDK.
Starter <context> folders (file here whenβ¦):
<context> |
File a finding here when⦠|
|---|---|
hallucinated-api/ |
a name doesn't exist on macOS (glass-01) or a visionOS-only symbol on a Mac target (glass-02) |
design-rules-navigation-layer/ |
glass sits on content β rows, cells, cards, text, images, charts, fields, backgrounds (glass-03) |
glass-on-glass/ |
glass is stacked on glass (glass-04) |
container-grouping/ |
sibling glass lacks a GlassEffectContainer, or a morph/union is mis-wired (glass-05, glass-17, glass-18) |
availability-gating/ |
a glass symbol is ungated under a <26 floor, or gated on the iOS arm (glass-06, glass-07) |
scroll-edge-effects/ |
the TextEditor opaque-toolbar trap or a scroll-edge legibility issue (glass-12) |
chrome-auto-adoption/ |
free chrome is re-glassed, leftovers block glass, or variant/tint discipline breaks (glass-08, glass-09, glass-10, glass-11, glass-14) |
migration/ |
Tab/@SceneStorage restoration, the auto-removable LabelStyle, or double-transparency (glass-13, glass-15, glass-16) |
New-folder rule: if a finding does not fit any existing context folder, create a new one under
swiftui-audits/liquid-glass/ 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.
Go-beyond artifact (optional):
swiftui-audits/liquid-glass/_placement-map.mdclassifying every glassed view asnavigation/contentwith a container-coverage score β seereferences/design-rules-and-placement.md.
Reference routing
| File | Open when |
|---|---|
references/glass-api-surface.md |
a name/signature/existence question β the real allow-list + hallucination βββ (glass-01/02) |
references/design-rules-and-placement.md |
placement, glass-on-glass, container grouping, variant/tint, hand-rolled buttons (glass-03/04/05/08/09/14) + the placement map |
references/availability-gating-glass.md |
glass gating depth, the wrong-arm trap, the pre-26 fallback choice (glass-06/07) |
references/chrome-and-scroll-edges.md |
auto-adoption, leftover-override removal, scroll edges, the TextEditor trap, double transparency (glass-10/11/12/13) |
references/migration-and-morphing.md |
Tab/@SceneStorage, @available(obsoleted:26) LabelStyle, morph/union wiring (glass-15/16/17/18) |
references/source-directory.md |
step VERIFY β the Apple/WWDC/practitioner source map fetched via Sosumi |
lint/grep-tells.tsv + lint/ast-grep/*.yml |
step LOCATE β this skill's declarative lint rule set fed to the shared runner (tier-1 grep tells + tier-2 structural ast-grep); 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 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 |
<swiftui-plugin-root>/references/_shared/fix-safety-protocol.md |
the 8-point 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-liquid-glass --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, glass-01/02/03/06/07/08/09/11/12/13/15/16/17/18)
- tier-2 ast-grep structural rules (
lint/ast-grep/*.ymlβ glass-04 glass-on-glass, glass-05 not-in-container, glass-07 wrong-arm gate-scope) 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 (glass-01/02/06/07) 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 legacyscripts/glass-lint.shis now a thin 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 Liquid Glass 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-liquid-glass ~/.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