auto-layout-refactor — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited auto-layout-refactor (Agent Skill) and scored it 96/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 1 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 1 flagged
The text {match} tells the agent to skip the normal "ask the user first" gate. Used adversarially it removes the human-in-the-loop check before destructive or sensitive actions, turning a normally-gated agent into a fire-and-forget executor.
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Old Figma files are full of frames where every layer was dragged into position by hand. Nothing is stacked, nothing reflows, and editing one element shifts everything else. This skill takes those flat frames and turns them into proper auto-layout structures the designer can actually maintain — without redrawing the screen.
The skill always loads alongside figma-use, which covers the Plugin API rules required by use_figma. Load figma-use first.
Walks the current page of the open Figma file, finds every frame whose layoutMode === "NONE", and refactors each one bottom-up into auto-layout:
HORIZONTAL or VERTICAL per frame, and wraps any cluster that doesn't fit a clean axis into an intermediate frame.layoutMode, so Figma's auto-arrange doesn't scramble the visual order.FIXED on both axes, so the screen does not visibly reflow.| Task | Use this skill? |
|---|---|
| "This screen has no auto-layout" / "everything's free-positioned" | Yes |
| "Auto-layout this old file" | Yes |
| "Make this responsive" (on a flat layout) | Yes — refactor first, then the designer can switch sizing modes |
| "Build a new screen from this code" | No → figma-generate-design |
| "Make this into a reusable component" | No → figma-generate-library |
| "Check what's out of compliance with our DS" | No → audit-design-system |
The designer who built this skill chose these defaults deliberately:
"refactor-cluster" with layoutMode = "NONE", then continue the outer refactor treating that wrapper as one block.layoutSizingHorizontal = "FIXED" and layoutSizingVertical = "FIXED" on the refactored frame, locked to its measured pre-refactor width/height. Children inherit HUG unless they were already filling the frame.If the designer wants different behavior, treat it as a new variant of the skill, not a runtime question.
use_figma call).use_figma call to confirm the page name, top-level frame count, and how many of those frames have layoutMode === "NONE". Report that count to the designer before you start mutating anything.use_figma. The script is parameterized at the top — SNAP_TO_PX, WRAPPER_NAME, MIN_OVERLAP_RATIO — and is meant to be read by a designer, not just executed.get_screenshot of the page and compare against the pre-refactor state. The most common failure mode is z-order rearrangement of overlapping decorative layers — those are the cases the wrapper logic is meant to catch.These are baked into scripts/refactor.js. Listed here so the designer reading the skill can verify the behavior matches their mental model:
VERTICAL. If most children's X-ranges do not overlap with neighbors', it's HORIZONTAL. If both fail, it's a 2-D layout and gets the wrapper treatment per cluster."refactor-cluster" frame at the cluster's bounding box, with children re-parented and their x/y rebased to the wrapper's origin.frame.appendChild, before layoutMode is set. Without this, Figma keeps z-order and visual order diverges.width and height are captured before layoutMode is set, and re-applied after via frame.resize(w, h) followed by layoutSizingHorizontal = "FIXED" / layoutSizingVertical = "FIXED".COMPONENT_SET's internal variants — those need their own refactor strategy and are out of scope.layoutMode is set. The script reports any child that had a non-default constraint so the designer can decide whether to re-apply.TEXT node set to "fixed size" stays fixed; one set to "auto width" stays that way. The refactor is structural, not typographic.layoutMode = "GRID") are not produced. The script outputs HORIZONTAL, VERTICAL, or wrapper-of-rows-as-vertical. Grid mode requires explicit row/column counts the script can't reliably infer.See references/edge-cases.md for the full list of cases the algorithm explicitly handles or skips, and what the return value looks like for each.
After every refactor run, return this structure from the use_figma call so the designer can act on it:
return {
refactoredFrameIds: [...], // frames whose layoutMode was changed
wrappedClusterIds: [...], // new "refactor-cluster" frames created
snapWarnings: [...], // { nodeId, side, shiftPx } where snap moved something >2px
skippedFrames: [...], // { id, reason } — frames the script decided not to touch
overwrittenConstraints: [...] // { nodeId, original } — designer may want to re-apply
}Surface the counts to the designer in conversation, then offer a get_screenshot of any frame that appears in snapWarnings or overwrittenConstraints.
| File | Read when |
|---|---|
| references/algorithm.md | You need to understand or tune the row/column/cluster detection pass |
| references/edge-cases.md | The script flags a frame as skipped, or the designer reports a refactor that looks wrong |
| examples/before-after.md | You want to see a worked example of the algorithm on a small layout |
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.