Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

layout

Skill by rshankras

Guides SwiftUI layout beyond basic stacks, covering the Layout protocol, grid choices, custom containers and lazy-stack scrolling performance. It is for iOS and macOS developers building custom layouts or fixing scroll issues.

  • Score 79
  • 926 stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install layout

Built from the published package, never by AI.

git clone --depth 1 https://github.com/rshankras/claude-code-apple-skills /tmp/claude-code-apple-skills && mkdir -p ~/.claude/skills && cp -r /tmp/claude-code-apple-skills/skills/swiftui/layout ~/.claude/skills/layout

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install layout in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

The layout skill gives an AI assistant guidance on SwiftUI layout beyond basic stacks. It covers the Layout protocol and when it beats GeometryReader, how to choose between Grid and lazy grids, and how to build custom containers that accept ForEach, sections and container values.

It also sets out lazy-stack and ScrollView performance rules, including what breaks laziness, prefetch discipline and scroll APIs for snapping, paging and programmatic scrolling. It is aimed at developers building custom layouts or containers, fixing lazy-stack jank or memory growth, or wiring scrolling. Reviews are returned as a table of symptom, rule violated and fix. Identity and data-flow questions are routed to a related skill, swiftui/data-flow.

Written from the project's SKILL.md and checked against it.

What it can do

  • Custom Layout protocolMeasures subviews and feeds measurements back into layout, such as equal-width buttons.
  • Grid decisionsCompares Grid, LazyVGrid and LazyHGrid, and ViewThatFits for choosing an arrangement.
  • Custom containersBuilds containers that accept ForEach, conditionals and sections, using declared and resolved children.
  • Container valuesSets per-child customization on containers and reads it via subview.containerValues.
  • Lazy stack rulesLists rules such as one subview per ForEach element and setting up state in init, not onAppear.
  • Scroll state rulesAdvises on scroll visibility triggers, row state hoisting and scrollTransition frame limits.
  • Scroll API mapMaps snapping, paging, scroll position binding, scrollTo and scroll-linked effects to their APIs.
  • Layout review outputReturns a review as a Symptom, Rule violated, Fix table, checking the one-subview rule first.

Try asking

  • Make these buttons equal width using a custom SwiftUI Layout
  • Review my LazyVStack for jank and show the fix as a table
  • Help me add snapping paging to a horizontal ScrollView with scrollTo

Good to know

  • Identity and data-flow questions are handled by the related swiftui/data-flow skill.
  • Caching in custom layouts is recommended only after Instruments shows layout cost.

Security check

B
  • Allowed to use Write, Edit without limitsIn SKILL.md

Checked automatically: skills/swiftui/layout/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

Allowed tools: ReadWriteEditGlobGrep

Alternatives to layout

All alternatives →
openclaw-github-repo-commandersickn33
94

Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.

AAA Skill 50k
gradiogradio-app
94

Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.

AAA Skill 44k
hig-components-menussickn33
94

Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.

AAA Skill 50k
fastapi-templateswshobson
94

Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.

AAA Skill 43k
appfunctionsandroid
94

Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.

AAA Skill 11k
agent-qa-authoringsickn33
94

Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.

AAA Skill 50k

Compare with openclaw-github-repo-commander, gradio or hig-components-menus

layout: common questions

When should I use a custom Layout instead of GeometryReader?

The source says to use a custom Layout when you must measure subviews and feed that measurement back into layout, since GeometryReader only measures its container and cannot influence the layout engine.

Why does my lazy stack cause jank or memory growth?

The source says the most common cause is an if statement inside a ForEach row, which forces off-screen views and their state to stay alive. It recommends checking the one-subview-per-element rule first.

How do I scroll to an item programmatically in SwiftUI?

The source describes a ScrollPosition with scrollTo(id:), which works for unloaded targets when IDs map to stable one-subview elements. Snapping uses scrollTargetLayout with scrollTargetBehavior.

How do I install layout?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is layout free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is layout safe to use?

It scores 79 of 100. Grades: maintenance A, licence A, quality A. Security check: grade B (allowed to use write, edit without limits). Review the code before you install. How grades work.

What are alternatives to layout?

Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.

layout Install

Add to stack

Loading.