Index of every page on this site: llms.txt
All skills
Run it yourself

Lightweight version of the "figma-layer-rename" skill. Walks the selected FRAME or SECTION's entire node tree, detects auto-generated layer names (Frame 12, Group 4, Rectangle 7, ...) and duplicate generic sibling names (e.g. four different sections all named "Section"), and proposes semantic replacements for both — read-only, no renames are applied. Figma Design Agent edition. For the full skill that also applies the renames after confirmation, use `figma-layer-rename`.

  • 2 files
  • 8.8 KB
  • Updated 3 months ago
  • GitHub
Use this Skill: https://skilld.dev/gh/gaspanik/figma-layer-rename-lite-skill/figma-layer-rename-lite

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈126 tokens for metadata: the name and description. ≈1.8k when used: this file.

Description uses 6.3% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈501 characters, or 6.3%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Figma Layer Rename (Lite)

Ver: ver.202608081524

Detect auto-generated layer names and undifferentiated duplicate sibling names anywhere in the selected frame's tree, and propose semantic replacements. This is a read-only check-and-report skill — it never renames anything in the file.

Output language: Respond in the same language the user is using in this conversation.

Environment: This edition runs inside Figma's agent environment. The target comes from the current canvas selection, and all reads go through the Plugin API script execution tool (e.g. evaluate_script). No URLs, no external tools.

Why this exists

The value of figma-layer-rename is visible the moment the proposal table appears — a Frame 12 next to its proposed HeroSection makes the case for itself, before anything is actually renamed. This lite edition stops right there: it runs both detection passes and shows the full proposal table, but never touches the file. For confirmation-gated apply (and to actually clean up the file), use the full figma-layer-rename skill.

Scope

Two categories of issue, both always run — since nothing is written, there's no reason to gate either behind a confirmation question:

  • Auto-generated layer names — Frame N, Group N, Rectangle N, etc. (Step 2).
  • Duplicate generic sibling names — e.g. four different sections all literally named Section. Real names, but useless for telling siblings apart (Step 2.5).

Nothing else. No variable binding, no auto-layout changes, no property changes, no renaming.

Target node types: FRAME or SECTION only. If the selection is a COMPONENT, COMPONENT_SET, or anything else, tell the user this skill only handles frames and sections, and ask them to select one.

Skip INSTANCE subtrees entirely. An override proposal inside an instance would only ever apply as a local override diverging from the main component — not useful even as a suggestion. When walking the tree, if a node's type is INSTANCE, skip it and all descendants.

Treat icon-glyph containers as a single leaf — don't descend into their vector paths. A container whose children are all primitive path/shape nodes (VECTOR, BOOLEAN_OPERATION, STAR, ELLIPSE, RECTANGLE, LINE), with no text nodes and no further nested containers, is almost always one icon glyph assembled from multiple paths. Propose a name for the container itself if its name is auto-generated (per Step 2's regex), then stop there: don't inspect or propose names for its child paths individually.


Step 1: Resolve the target

Use the current canvas selection — its id and type are typically provided directly. If nothing is selected, ask the user to select the target frame or section on the canvas.

Check the type: FRAME or SECTION → continue; anything else → ask for a frame/section selection (see Scope).


Step 2: Detect auto-generated layer names

Fetch the tree via the script tool (walk children recursively from the root, collecting id, type, name; do not descend into INSTANCE nodes). Then check each node's name against:

/^(Frame|Group|Rectangle|Ellipse|Vector|Polygon|Star|Line|Arrow|Boolean|Component|Instance)(\s+\d+)?$/i

The trailing number is optional: files often contain bare default names like Frame or Ellipse with no number — typically zero-size spacer frames or plain ellipses used as bullet dots. These should be proposed too (e.g. a 10px-wide empty frame between two text nodes → Spacer; a small ellipse next to a list item → BulletDot).

For each match, infer a semantic name from:

  • Node type and its position in the tree (root container, header, icon slot, divider, footer, ...)
  • Sibling and parent context (a Rectangle right below a Card → Divider; a Group next to a Nav at the top → Logo)
  • Children content (a Group containing only text nodes → LabelGroup; a Frame with an image and a heading → HeroContent)

Naming convention: Don't invent a casing style — match the prevailing convention of the semantic layer names already in the file (hero-section → kebab-case, Hero Section → spaced Title Case, ...). If there's no clear precedent, default to PascalCase (HeroSection).

Populate a proposal list: { nodeId, currentName, proposedName, reason: "Auto-generated name" }.


Step 2.5: Duplicate generic sibling names

A name like Section or Container is real and semantic, so Step 2 leaves it alone — but when the same name repeats across siblings that are actually different things, it stops being useful. Always run this at a fixed depth of 4 (down 4 levels from the root) — shallow depths like 1–2 miss most real duplicates in a typical multi-section page, since Container/Section collisions are just as common 3–4 levels down as at the top (a wrapper for padding, a wrapper for a grid, then the actual repeated siblings). The full figma-layer-rename skill lets you choose this depth; the lite edition fixes it at 4 so the pass runs with no question asked.

Wrapper collapse (Code to Canvas files only): if any node name matches /:(margin|padding)$/ and has exactly one child, treat that wrapper as transparent when counting depth and grouping siblings (recursively). If no such names exist in the tree, skip this rule.

At depth 4, group nodes by parent, then by name; any name shared by 2+ siblings under the same parent is a candidate. At this depth, scrutinize before flagging: repeated card/list/icon-slot patterns get more common the deeper you go, and renaming those would hurt rather than help. Only flag duplicates where the siblings represent structurally or contextually different content that happens to share a generic name — leave intentional repetition (same-shaped cards, rows, icon slots) alone. Infer semantic names using the same reasoning as Step 2, and tag the reason as "Duplicate-name disambiguation" so the report can distinguish the two categories.

If none are found at this depth, this pass simply contributes nothing to the table — no need to say so explicitly.


Step 3: Report

If no candidates at all from either pass:

✅ No auto-generated layer names or hard-to-distinguish duplicate names were found.
All layers already have meaningful names.

Then stop.

Otherwise, present everything in one table, sorted by tree order:

# Node ID Current name Proposed name Reason
1 123:456 Frame 12 HeroSection Auto-generated name
2 123:789 Group 4 LabelGroup Auto-generated name
3 234:111 Section PricingSection Duplicate-name disambiguation
4 234:222 Section FaqSection Duplicate-name disambiguation

Total: N suggestion(s) (N auto-generated name / N duplicate-name disambiguation)

This is a proposal only — no changes have been made to the file. If you'd like to actually apply these renames, run the full figma-layer-rename skill.


Error handling

  • No selection, or selection is not FRAME/SECTION: ask the user to select a frame or section
  • Script execution error: report it and ask the user to retry (the file may have been edited mid-scan)
  • Very large trees: if a single walk is too slow or errors, walk top-level sections one at a time and merge results before reporting

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 9fba9d7. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 3 months ago

README badge

README badge for gaspanik/figma-layer-rename-lite-skill