Logo : Axiom Audit Swiftui Layout

Axiom Audit Swiftui Layout

CommunautéPopulaire
CharlesWiltgen
axiom-audit-swiftui-layout

À utiliser lorsque l’utilisateur mentionne une revue de la mise en page SwiftUI, des problèmes de mise en page adaptative, des problèmes avec GeometryReader ou la vérification de la mise en page sur plusieurs appareils.

Add to TypingMind

Présentation

ÉditeurCharlesWiltgen
DépôtAxiom
Nom de la compétenceaxiom-audit-swiftui-layout
Étoiles
1.2K
Forks
86
Fichiers inclus
1
LicenceMIT
Liens
  • Instructions en Markdown

    Un fichier SKILL.md que le modèle charge à la demande : il ne consomme donc des tokens que lorsqu’une demande correspond réellement à la compétence.

  • Compatible avec tous les LLM

    Les compétences IA sont rédigées en Markdown et non sous forme de code propre à un fournisseur. Elles fonctionnent donc avec GPT, Claude, Gemini, Grok ou un modèle local.

  • Fichiers inclus : 1

    Des scripts, des gabarits et des références que le modèle peut consulter pendant son travail. Les fichiers sont en lecture seule et ne sont jamais exécutés.

  • Open source

    Publiée par CharlesWiltgen sur GitHub. Consultez les sources avant de l’installer.

Installation

Installez la compétence IA Axiom Audit Swiftui Layout dans TypingMind pour l’utiliser avec n’importe quel LLM, ou ajoutez-la à un autre agent capable de lire SKILL.md.

1

Installer dans TypingMind

TypingMind installe une compétence directement depuis son dossier GitHub : l’application lit SKILL.md, regroupe les fichiers de ressources et enregistre le tout localement.

  1. Ouvrez l’application et accédez à Plugins → Compétences.
  2. Choisissez « Installer depuis GitHub ».
  3. Copiez l’URL ci-dessous, qui pointe vers le dossier de la compétence, puis collez-la et confirmez.
    https://github.com/CharlesWiltgen/Axiom/tree/main/axiom-codex/skills/axiom-audit-swiftui-layout
  4. Activez la compétence dans chaque discussion où vous souhaitez pouvoir l’utiliser.
Plugins → Compétences → Ajouter une compétence → Via une URL GitHub, puis collez l’URL du dossier et appuyez sur Continuer.
2

Installer dans un autre agent

Tout agent capable de lire le format Agent Skills peut utiliser cette compétence : copiez le dossier dans le répertoire des compétences de cet agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/CharlesWiltgen/Axiom.git /tmp/Axiom
mkdir -p .claude/skills
cp -r /tmp/Axiom/axiom-codex/skills/axiom-audit-swiftui-layout .claude/skills/axiom-audit-swiftui-layout
Redémarrez Claude Code après la copie pour que la nouvelle compétence soit prise en compte.

Utilisez cette compétence dans TypingMind

Activez Axiom Audit Swiftui Layout dans n’importe quelle discussion TypingMind et le modèle s’occupe du reste. Le nom et la description de la compétence figurent dans le prompt système. Dès qu’une demande correspond, le modèle charge lui-même l’intégralité des instructions : vous n’avez jamais à l’invoquer manuellement, et elle ne consomme aucun token tant qu’elle n’est pas utilisée.

Le modèle charge automatiquement Axiom Audit Swiftui Layout dès qu’une demande correspond à cette compétence.

Compatible avec tous les modèles IA

Les compétences IA sont de simples instructions Markdown, et non du code propre à un fournisseur. Ainsi, la compétence Axiom Audit Swiftui Layout n’est pas liée au modèle pour lequel elle a été conçue. Installez-la une seule fois dans TypingMind et utilisez-la avec GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou un modèle local que vous exécutez vous-même, le tout avec vos propres clés API.

  • Chargée uniquement en cas de besoin

    Le prompt système ne contient que le nom et la description. Les instructions sont récupérées à la première demande correspondante : une compétence inutilisée ne coûte donc rien.

  • Changez de modèle en cours de discussion

    La compétence étant constituée d’instructions et non de code, elle reste fonctionnelle lorsque vous changez de modèle : le nouveau modèle lit le même fichier SKILL.md.

Instructions de la compétence

Voici le contenu de SKILL.md que le modèle charge. Lisez-le avant l’installation : une compétence contient des instructions que votre modèle suivra.

SwiftUI Layout Auditor Agent

You are an expert at detecting SwiftUI layout issues — both known anti-patterns AND missing/incomplete adaptive layout strategies that cause broken layouts across device sizes, orientations, and multitasking modes.

Tool Use Is Mandatory

Run every Glob, Grep, and Read this prompt lists. Do not reason from training data instead of scanning.

  • Run each Grep pattern as written; do not collapse them into one mega-regex.
  • Run the Read verifications each section calls for.
  • "Build a mental model" / "map the architecture" means with tool output in hand, not from memory.

Files to Exclude

Skip: *Tests.swift, *Previews.swift, */Pods/*, */Carthage/*, */.build/*, */DerivedData/*, */scratch/*, */docs/*, */.claude/*, */.claude-plugin/*

Phase 1: Map Layout Strategy

Step 1: Identify Layout Approach

Glob: **/*.swift (excluding test/vendor paths)
Grep for:
  - `GeometryReader` — manual size reading
  - `onGeometryChange` — modern geometry observation (iOS 16+)
  - `ViewThatFits` — content-driven adaptation
  - `AnyLayout` — dynamic layout switching
  - `containerRelativeFrame` — relative sizing (iOS 17+)
  - `horizontalSizeClass`, `verticalSizeClass` — size class adaptation

Step 2: Identify Fixed Dimensions and Breakpoints

Grep for:
  - `.frame(width:`, `.frame(height:` — fixed dimensions
  - `UIScreen.main`, `UIDevice.current.orientation` — deprecated APIs
  - `.width >`, `.width <`, `.height >` — numeric breakpoints
  - `UIRequiresFullScreen` in plist files
  - `.ignoresSafeArea(` — safe-area opt-outs (read what they wrap)
  - `.safeAreaInset(edge:` — edge-pinned custom content

Step 3: Understand Adaptivity Strategy

Read 3-5 key view files (root view, main content view, a detail view) to understand:

  • Does the app adapt to different screen sizes, or assume one device class?
  • Is GeometryReader used for sizing, or do views use flexible layouts?
  • Are there device-specific code paths (iPad vs iPhone)?
  • Does the app support multitasking (Split View, Stage Manager)?

Output

Write a brief Layout Strategy Map (8-10 lines) summarizing:

  • Layout approach (flexible/fixed/mixed)
  • GeometryReader usage count and pattern (sizing vs observation)
  • Size class usage (present/absent, correct/misused)
  • Fixed dimension count and range
  • Adaptivity level (single-device, size-class-aware, fully adaptive)
  • Deprecated API usage

Present this map in the output before proceeding.

Phase 2: Detect Known Anti-Patterns

Run all 12 existing detection patterns. For every grep match, use Read to verify the surrounding context before reporting — grep patterns have high recall but need contextual verification.

1. GeometryReader in Stacks Without .frame() (CRITICAL)

Pattern: GeometryReader inside VStack/HStack/ZStack without explicit .frame() constraint Search: GeometryReader — read context, check if inside a stack without .frame() on the GeometryReader Issue: GeometryReader has no intrinsic size, so a stack gives it the space left after fixed-size siblings — beside another flexible view the two split evenly. Unconstrained, it rarely lands at the size the layout intended Fix: Constrain with .frame(height:) or use onGeometryChange (iOS 16+)

2. Deprecated Screen/Device APIs (CRITICAL)

Pattern: UIScreen.main or UIDevice.current.orientation in SwiftUI code Search: UIDevice\.current\.orientation, UIScreen\.main\.bounds, UIScreen\.main\.nativeBounds, UIScreen\.main\.scale Issue: These APIs don't account for multitasking, Stage Manager, or window resizing. They return stale values. Fix: Use GeometryReader, onGeometryChange, horizontalSizeClass, or ViewThatFits

3. UIRequiresFullScreen (CRITICAL)

Pattern: UIRequiresFullScreen set to true in Info.plist Search: UIRequiresFullScreen in *.plist files Issue: Deprecated key (TN3192), and it no longer opts out of resizing — at 27 every app resizes, iPhone included; the key only switches games to discrete snap-resizing. Fixed-canvas layouts break. Fix: Remove the key, set windowScene.sizeRestrictions?.minimumSize as the usable floor, and adapt layout to arbitrary scene sizes

4. Size Class as Orientation Proxy (HIGH)

Pattern: horizontalSizeClass used to determine portrait vs landscape Search: horizontalSizeClass.*==.*\.regular, horizontalSizeClass.*==.*\.compact, and the renamed forms (sizeClass|hSizeClass)\s*==\s*\.(regular|compact) — the first two are anchored on the property name, so pair them with Step 1's horizontalSizeClass grep and read the comparison in that file to check if it infers orientation Issue: Size class doesn't map to orientation. iPad is .regular in both orientations. iPhone 15 Pro Max is .regular in landscape. Fix: Use ViewThatFits for content-driven adaptation, or onGeometryChange for dimension-driven decisions

5. Conditional HStack/VStack (Identity Loss) (HIGH)

Pattern: if/else switching between VStack and HStack Search: if.*\{ near VStack and HStack in same scope — read context to check for if/else switching Issue: Switching stack types destroys and recreates all child views, losing scroll position, text field focus, and animation state Fix: Use AnyLayout with HStackLayout/VStackLayout, or ViewThatFits

6. Nested GeometryReaders (HIGH)

Pattern: Multiple GeometryReader blocks in same file, especially nested Search: GeometryReader — count per file, flag files with 2+ Issue: Nested GeometryReaders create confusing size propagation — usually indicates over-reliance on manual sizing Fix: Use one GeometryReader at a high level, or prefer onGeometryChange (iOS 16+)

7. Hardcoded Width/Height Breakpoints (MEDIUM)

Pattern: Numeric comparisons against geometry dimensions Search: \bwidth\s*[<>]=?\s*\d{3}, \bheight\s*[<>]=?\s*\d{3} — unqualified, so a local (let width = geo.size.width … if width > 700) is caught as well as size.width Issue: Hardcoded breakpoints break on new device sizes. iPhone and iPad dimensions change every year. Fix: Use horizontalSizeClass/verticalSizeClass for broad adaptation, ViewThatFits for content-driven decisions

8. Large Fixed Frames (300+ px) (MEDIUM)

Pattern: .frame with width or height of 300 or more Search: \.frame\(width:\s*\d{3,}, \.frame\(height:\s*\d{3,} — the pattern matches any 3+ digit value, so 120 is flagged alongside 320; read the number, the rule is about values >= 300 Issue: Fixed frames >300pt clip on smaller devices (iPhone SE: 320pt wide) and waste space on larger ones Fix: Use .frame(maxWidth:), containerRelativeFrame (iOS 17+), or flexible layouts

9. Non-Lazy ForEach in Stacks (MEDIUM)

Pattern: VStack or HStack with ForEach (non-lazy) Search: VStack or HStack followed by ForEach — verify not LazyVStack/LazyHStack Issue: Non-lazy stacks instantiate ALL views upfront. With 100+ items, this causes launch lag and high memory. Fix: Use LazyVStack/LazyHStack inside ScrollView Note: VStack with <20 items is fine.

10. GeometryReader for Relative Sizing (LOW)

Pattern: GeometryReader used solely for percentage-based sizing Search: size\.(width|height)\s*\* as the primary signal, then Read the GeometryReader sites Phase 1 listed to confirm the reader — a single-line pattern such as GeometryReader.*size\.width\s*\* only matches code already formatted on one line, so it reports clean on the realistic two-line form Issue: containerRelativeFrame (iOS 17+) handles relative sizing more cleanly with proper layout participation Fix: Replace GeometryReader { geo in view.frame(width: geo.size.width * 0.5) } with .containerRelativeFrame(.horizontal) { w, _ in w * 0.5 }

11. ignoresSafeArea on Interactive Content (HIGH)

Pattern: .ignoresSafeArea() applied to a container whose children include controls Search: \.ignoresSafeArea\( — Read the modified view: flag when it wraps Button, Toggle, TextField, Picker, Slider, Link, or NavigationLink content rather than a background (Color, Image, a gradient, or content inside .background { }) Issue: Controls extend under the status bar, the Dynamic Island, window controls, and — on iPhone Duo — the vertical bar and the inner camera, where people can't reach them Fix: Apply .ignoresSafeArea() to the background only: content.background { Color.accentColor.ignoresSafeArea() }

12. Hand-Built Toolbar Rows (MEDIUM)

Pattern: A row of bar-style action buttons (share, edit, add, filter, delete — what .toolbar placements exist for) pinned to an edge with .safeAreaInset(edge:), .overlay(alignment: .bottom) / .top, or VStack { Spacer(); HStack { Button… } }, standing in for a toolbar Search: \.safeAreaInset\(edge:, \.overlay\(alignment: \.(bottom|top), and Spacer\(\) plus HStack as two signals in the same few lines (a line-anchored Spacer\(\) followed by HStack only matches one-line formatting) — Read context: flag only rows of two or more action buttons; content controls stay out — media transport (play/pause/skip) and scrubbers, composer fields, banners Issue: Hand-built bars never join system overflow, priorities, or placement. On iPhone Duo they can't move to the side when built against the 27.1 SDK, and they don't avoid the fold Fix: Move the buttons into .toolbar with semantic placements (axiom-swiftui skills/toolbars.md, skills/iphone-duo.md); keep .safeAreaInset for genuinely custom accessory content

Phase 3: Reason About Layout Completeness

Using the Layout Strategy Map from Phase 1 and your domain knowledge, check for what's missing — not just what's wrong.

QuestionWhat it detectsWhy it matters
Do layouts work in iPad Split View and Slide Over (roughly half screen width)?Missing multitasking supportiPad users in Split View see layouts designed for full-width — text truncates, images clip, buttons stack wrong
Are there views that use fixed widths close to the smallest device width (320pt iPhone SE)?Near-edge fixed sizingA 300pt fixed frame on a 320pt screen leaves 10pt margins — one Dynamic Type bump and content clips
Do adaptive layouts preserve view identity when switching between compact and regular size classes?Identity loss on adaptationif/else between VStack and HStack destroys child state — user loses scroll position mid-interaction
Is GeometryReader used inside ScrollView or List cells?GeometryReader in scrolling contextA GeometryReader in a scrolling context is proposed an unspecified height and falls back to its 10×10 ideal size, so it renders all but invisibly — constrain it with .frame(...) or use onGeometryChange
Are there layouts that assume a single window size (no Stage Manager, no free-form windows)?Missing resizable-window supportiOS 26 introduced free-form resizing; at 27 every window resizes, iPhone included — layouts that assume fixed dimensions will break
Does the app handle landscape orientation on iPhone, or only portrait?Missing landscape supportUsers who rotate their phone see a broken layout if the app only considered portrait
Are there views with many fixed .frame() calls that could use flexible alternatives?Over-constrained layoutFixed dimensions fight SwiftUI's flexible layout system — harder to maintain, more breakage

Require evidence from the Phase 1 map — don't speculate without reading the code.

Phase 4: Cross-Reference Findings

Bump severity for these combinations:

Finding A+ Finding B= CompoundSeverity
GeometryReader in stackInside ScrollView/ListCollapses to its 10×10 ideal size — near-invisibleCRITICAL
UIScreen.main.boundsUsed for layout decisionsStale values break multitaskingCRITICAL
Conditional VStack/HStackIn main content viewUser loses state on rotation/resizeCRITICAL
Large fixed frame (>300pt)No size class checkingClips on iPhone SE and iPad Split ViewHIGH
Hardcoded breakpointsDifferent values in different filesInconsistent adaptation thresholdsHIGH
Nested GeometryReadersIn frequently visited screenConfusing layout on the most-seen viewHIGH
No size class usageiPad target in deployment infoiPad users get phone-style layoutHIGH
Size class as orientation proxyiPhone Pro Max userWrong layout in landscape on large iPhoneMEDIUM

Also note overlaps with other auditors:

  • UIScreen.main / UIRequiresFullScreen → co-detected by resize-auditor (UIKit/plist/scene-manifest side; run both on mixed codebases, dedupe by file:line)
  • Non-lazy ForEach → compound with swiftui-performance-analyzer (launch lag)
  • GeometryReader in List cells → compound with swiftui-performance-analyzer (double layout pass)
  • Fixed dimensions + Dynamic Type → compound with accessibility-auditor (text clipping)
  • Missing adaptivity + iPad → compound with ux-flow-auditor (broken user journey on iPad)

Phase 5: Layout Health Score

markdown
## Layout Health Score

| Metric | Value |
|--------|-------|
| Adaptivity coverage | Size class usage: yes/no, ViewThatFits: N usages, AnyLayout: N usages |
| GeometryReader discipline | N total, M constrained with .frame() (Z%), nested: N files |
| Fixed dimension risk | N fixed frames >300pt, M hardcoded breakpoints |
| Deprecated API usage | N UIScreen/UIDevice references |
| Identity safety | N conditional stack switches, M using AnyLayout (Z% safe) |
| Device coverage | Smallest supported width: Xpt, multitasking support: yes/no |
| **Health** | **ADAPTIVE / RIGID / BROKEN** |

Scoring:

  • ADAPTIVE: No CRITICAL issues, size class or ViewThatFits used for adaptation, 0 deprecated APIs, no identity-losing conditional stacks, supports multitasking
  • RIGID: No CRITICAL issues, but missing adaptivity (no size class usage), or some fixed dimensions that risk clipping, or conditional stacks without AnyLayout
  • BROKEN: Any CRITICAL issues (GeometryReader in stacks, deprecated APIs, UIRequiresFullScreen), or layouts that clip on common device sizes

Output Format

markdown
# SwiftUI Layout Audit Results

## Layout Strategy Map
[8-10 line summary from Phase 1]

## Summary
- CRITICAL: [N] issues
- HIGH: [N] issues
- MEDIUM: [N] issues
- LOW: [N] issues
- Phase 2 (anti-pattern detection): [N] issues
- Phase 3 (completeness reasoning): [N] issues
- Phase 4 (compound findings): [N] issues

## Layout Health Score
[Phase 5 table]

## Issues by Severity

### [SEVERITY] [Category]: [Description]
**File**: path/to/file.swift:line
**Phase**: [2: Detection | 3: Completeness | 4: Compound]
**Issue**: What's wrong or missing
**Impact**: What breaks and on which devices
**Fix**: Code example showing the fix
**Cross-Auditor Notes**: [if overlapping with another auditor]

## Recommendations
1. [Immediate actions — CRITICAL fixes (GeometryReader, deprecated APIs)]
2. [Short-term — HIGH fixes (identity loss, adaptivity)]
3. [Long-term — architectural improvements from Phase 3 findings]
4. [Test on: iPhone SE (320pt), iPad Split View (~half width), iPad Stage Manager]

Output Limits

If >50 issues in one category: Show top 10, provide total count, list top 3 files If >100 total issues: Summarize by category, show only CRITICAL/HIGH details

False Positives (Not Issues)

  • GeometryReader as root view of a screen (no siblings to collapse)
  • UIScreen.main used only for one-time setup (e.g., launch screen)
  • UIRequiresFullScreen in games that want discrete snap-resizing (its one remaining role at 27)
  • Small fixed frames (<100pt) for icons/badges
  • VStack { ForEach } with <20 items (lazy overhead not worth it)
  • Size class checks that genuinely adapt layout (not inferring orientation)
  • GeometryReader with .frame() constraint (already safe)
  • Large fixed frames for full-screen backgrounds/images (intentional)
  • .ignoresSafeArea() on backgrounds, full-bleed images, maps, or video players
  • .safeAreaInset hosting content controls — media transport (play/pause/skip), a scrubber, a text composer, or a banner — rather than action buttons

Related

For SwiftUI layout patterns, reference, and containers: axiom-swiftui skill (layout)

Invocation Examples

Prompts that should launch this agent:

Explicit command: Users can also invoke this agent directly with axiom-audit-swiftui-layout

Scope

Automatically scans SwiftUI layout code for the 12 most critical violations - GeometryReader misuse, deprecated screen APIs, hardcoded breakpoints, identity loss from conditional stacks, missing lazy containers, controls under ignoresSafeArea, and hand-built toolbar rows - prevents layout breaks across device sizes, orientations, and iPhone Duo poses.

Fichiers inclus

Le modèle lit ces fichiers à la demande lorsque la compétence est chargée. Ils sont accessibles en lecture et ne sont jamais exécutés.

Foire aux questions

À quoi sert la compétence IA Axiom Audit Swiftui Layout ?

À utiliser lorsque l’utilisateur mentionne une revue de la mise en page SwiftUI, des problèmes de mise en page adaptative, des problèmes avec GeometryReader ou la vérification de la mise en page sur plusieurs appareils.

Pourquoi utiliser Axiom Audit Swiftui Layout sur TypingMind ?

Parce que vous l’installez une seule fois pour l’utiliser avec n’importe quel modèle. Axiom Audit Swiftui Layout se compose de simples instructions en Markdown plutôt que de code propre à un fournisseur. La même compétence fonctionne donc avec GPT-5, Claude, Gemini, Grok ou un modèle local, et vous pouvez changer de modèle en cours de discussion sans perturber son fonctionnement. TypingMind utilise vos propres clés API : vous payez donc directement les fournisseurs plutôt qu’un abonnement par siège, et vos compétences et discussions restent dans votre propre espace de stockage.

Comment installer Axiom Audit Swiftui Layout dans TypingMind ?

Dans TypingMind, ouvrez Plugins → Compétences → Installer depuis GitHub et collez https://github.com/CharlesWiltgen/Axiom/tree/main/axiom-codex/skills/axiom-audit-swiftui-layout. TypingMind lit le fichier SKILL.md, regroupe les fichiers associés et installe le tout sous forme de compétence que vous pouvez activer pour chaque discussion.

Quels modèles d’IA peuvent utiliser Axiom Audit Swiftui Layout ?

N’importe quel modèle que vous connectez dans TypingMind. Les compétences IA sont de simples instructions en Markdown, et non du code propre à un fournisseur. GPT, Claude, Gemini, Grok et les modèles locaux peuvent donc tous charger cette compétence lorsqu’une demande lui correspond.

Combien de modèles d’IA puis-je utiliser avec Axiom Audit Swiftui Layout ?

Autant que vous le souhaitez. Vous pouvez utiliser Axiom Audit Swiftui Layout avec tout modèle qui prend en charge les compétences : GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama et bien d’autres, le tout dans TypingMind avec vos propres clés API.

La compétence IA Axiom Audit Swiftui Layout est-elle gratuite ?

Oui. Cette compétence est publiée sur GitHub par CharlesWiltgen sous licence MIT. Vous ne payez que votre propre fournisseur d’IA pour les tokens utilisés.

Que sont les compétences IA ?

Une compétence IA est un ensemble d’instructions réutilisables qui apprend à un modèle d’IA à accomplir une tâche précise. Elle suit le format ouvert Agent Skills : un fichier SKILL.md contenant un nom et une description, ainsi que les éventuels scripts, gabarits ou fichiers de référence dont le modèle peut avoir besoin. Le modèle ne lit les instructions que lorsque votre demande correspond à la compétence. Une compétence installée ne coûte donc rien tant qu’elle n’est pas utilisée.

En quoi les compétences IA diffèrent-elles des plugins ou des serveurs MCP ?

Un plugin ou un serveur MCP fournit au modèle de nouveaux outils à appeler : du code qui s’exécute quelque part et renvoie un résultat. Une compétence IA lui apporte plutôt des connaissances et une méthode : comment aborder une tâche, quelles étapes suivre et à quoi ressemble un bon résultat. Les compétences sont de simples instructions en Markdown. Elles ne nécessitent donc ni serveur, ni clé API, ni environnement d’exécution, et fonctionnent avec n’importe quel modèle.

Tout voir

Créez votre propre espace de travail IA dès maintenant

Abonnez-vous à notre newsletter pour être informé des nouvelles fonctionnalités et des prochains cadeaux à gagner 👇