Install any skill in seconds. Free to start, no credit card required.
Get Started Free →A SwiftUI layout rulebook: 4-point spacing scale, container-based alignment, and three checks for off-grid values and misaligned views.
41% 95%+55 ptsof test cases passed
Passed 21 of 22 test cases with the skill, and 9 of 22 without it.
This test ran on v1. v2 is the current version and hasn’t been tested on gemini-3.8-flash yet.
3 of 3 safety checks passed
Not used yet
Agents guess numbers. A guessed .padding(13) looks almost right and
makes the whole app feel slightly off. This skill replaces guessing with
one scale and three checks that fail when something is off.
The template has everything in place: Sources/<App>/UI/Grid.swift and
tools/. For an app made before this skill, copy UI/Grid.swift,
tools/grid-lint.sh, and tools/check-layout.swift from the new-mac-app
skill's template, and the layout file line from its Snapshot.swift.
Space: xs 4, sm 8,
md 12, lg 16, xl 20, xxl 24, section 32. Raw numbers are
0, 1, 2, or a multiple of 4.Space.margin). Cards pad 16
(Space.lg). Related controls sit 8 apart, groups 20 to 24, sections 32.Form with .formStyle(.grouped), or
.columns for the Mac layout of right-aligned labels.Grid and GridRow.LabeledContent.HStack(alignment: .firstTextBaseline)..monospacedDigit(), trailing aligned.Label..controlSize, never from a fixed height..offset and .position move a view after layout, so nothing lines up
with it. Use them only for motion and drag previews, with
// grid: ok <why> on the line.Run it after every build that touched views:
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.