axiom-audit-swiftui-layout
Use when the user mentions SwiftUI layout review, adaptive layout issues, GeometryReader problems, or multi-device layout checking.
What this skill does
# 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
```
### 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 10 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 expands to fill all available space, collapsing sibling views in stacks
**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**: Disables all multitasking on iPad. Apple rejects apps that use this unnecessarily.
**Fix**: Remove and support adaptive layouts with size classes
### 4. Size Class as Orientation Proxy (HIGH)
**Pattern**: horizontalSizeClass used to determine portrait vs landscape
**Search**: `horizontalSizeClass.*==.*\.regular`, `horizontalSizeClass.*==.*\.compact` — read context to check if used to infer 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**: `\.width\s*[<>]=?\s*\d{3}`, `\.height\s*[<>]=?\s*\d{3}`, `size\.width\s*[<>]=?\s*\d{3}`
**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,}` — flag 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**: `GeometryReader.*size\.width\s*\*`, `GeometryReader.*size\.height\s*\*`
**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 }`
## 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.
| Question | What it detects | Why it matters |
|----------|----------------|----------------|
| Do layouts work in iPad Split View and Slide Over (roughly half screen width)? | Missing multitasking support | iPad 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 sizing | A 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 adaptation | if/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 context | GeometryReader proposes infinite height in a scroll context, causing layout loops or zeRelated in Security
mac-ops
IncludedComprehensive macOS workstation operations — diagnose kernel panics, identify failing drives, audit launchd startup items, decode wake reasons, triage TCC permission denials, manage APFS snapshots, recover from no-boot. Use for: Mac is slow, slow bootup, won't boot, kernel panic, kernel_task hot, mds_stores CPU, photoanalysisd, cloudd, login loop, gray screen, sleep wake failure, drive failing, IO errors, APFS snapshots eating space, Time Machine local snapshots, Spotlight indexing, launchd, LaunchAgent, LaunchDaemon, login items, TCC permissions, Full Disk Access, Screen Recording denied, Gatekeeper, quarantine, com.apple.quarantine, app is damaged, helper tool, /Library/PrivilegedHelperTools, pmset, wake reasons, dark wake, sysdiagnose, panic.ips, DiagnosticReports, configuration profile, MDM profile, remote diagnostics over SSH.
a11y-audit
IncludedRun accessibility audits on web projects combining automated scanning (axe-core, Lighthouse) with WCAG 2.1 AA compliance mapping, manual check guidance, and structured reporting. Output is configurable: markdown report only, markdown plus machine-readable JSON, or markdown plus issue tracker integration. Use this skill whenever the user mentions "accessibility audit", "a11y audit", "WCAG audit", "accessibility check", "compliance scan", or asks to check a web project for accessibility issues. Also trigger when the user wants to verify WCAG conformance or map findings to a specific standard (CAN-ASC-6.2, EN 301 549, ADA/AODA).
erpclaw
IncludedAI-native ERP system with self-extending OS. Full accounting, invoicing, inventory, purchasing, tax, billing, HR, payroll, advanced accounting (ASC 606/842, intercompany, consolidation), and financial reporting. 413 actions across 14 domains, 43 expansion modules. Constitutional guardrails, adversarial audit, schema migration. Double-entry GL, immutable audit trail, US GAAP.
assess
IncludedAssesses and rates quality 0-10 across multiple dimensions (correctness, maintainability, security, performance, testability, simplicity) with pros/cons analysis. Compares against project conventions and prior decisions from memory. Produces structured evaluation reports with actionable improvement suggestions. Use when evaluating code, designs, architectures, or comparing alternative approaches.
spring-boot-security-jwt
IncludedProvides JWT authentication and authorization patterns for Spring Boot 3.5.x covering token generation with JJWT, Bearer/cookie authentication, database/OAuth2 integration, and RBAC/permission-based access control using Spring Security 6.x. Use when implementing authentication or authorization in Spring Boot applications.
code-hardcode-audit
IncludedDetect hardcoded values, magic numbers, and leaked secrets. TRIGGERS - hardcode audit, magic numbers, PLR2004, secret scanning.