component-rules
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "component-rules" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-4f616e5010236fc0f855120682d419bf8af90f4d6172bc7047431a46e0533327. Verify the upstream source and version against https://github.com/senlindesign/claude2figma before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Component Rules (Figma): triggered when creating UI elements in Figma (e.g., “create card,” “build navigation,” “add block,” “make component”). Enforces library-first component lookup, correct auto-layout structure, and semantic node naming; binds visual properties (colors, text styles, spacing) following the figma-style-binding approach.
Introduction source: third_party · senlindesign · 0.0.1 Reference
SkillPi interpretation
- Tasks
- Triggers when building any UI element in Figma — 'create a card', 'build a nav', 'add a section', 'make a component'. Enforces library-first component lookup, correct Auto Layout structure, and semantic node naming. For visual property binding (colors, text styles, spacing values), defer to figma-style-binding.
- Testing
- Not tested
Browse files
Frontmatter
name: component-rules
description: "Triggers when building any UI element in Figma — 'create a card', 'build a nav', 'add a section', 'make a component'. Enforces library-first component lookup, correct Auto Layout structure, and semantic node naming. For visual property binding (colors, text styles, spacing values), defer to figma-style-binding."
disable-model-invocation: falseComponent Rules
Governs how Claude constructs UI in Figma. Supplements figma-generate-design. For visual property binding, defer to figma-style-binding.
Rule 1 — Library-first hierarchy
Before building anything, resolve the component source in this order:
1. search_design_system → importComponentByKeyAsync → createInstance()
2. Local file scan → createInstance()
3. Build from scratch — ONLY if nothing matches
Never rebuild primitives the DS provides: Button, Input, Checkbox, Toggle, Badge, Tag, Avatar, Icon, Tab, Breadcrumb, Toast, Alert, Spinner.
// Library import
const comp = await figma.importComponentByKeyAsync("key_from_search");
const instance = comp.createInstance();
parent.appendChild(instance);
// For component sets (variants)
const set = await figma.importComponentSetByKeyAsync("key");
const instance = set.defaultVariant.createInstance();
Rule 2 — Auto Layout
Every container must use Auto Layout. Property order matters:
- Set
layoutModeFIRST ("VERTICAL"or"HORIZONTAL") - Set
layoutSizingHorizontal/layoutSizingVerticalAFTERappendChild - Set
layoutModeBEFORE anysetBoundVariablecall
| Goal | primaryAxisSizing | counterAxisSizing | layoutSizingH | layoutSizingV |
|---|---|---|---|---|
| Hug both | AUTO | AUTO | HUG | HUG |
| Fixed card | FIXED | FIXED | FIXED | FIXED |
| Full-width section | AUTO | FIXED | FILL | HUG |
Rule 3 — Node naming
Name every node semantically with slash hierarchy. Never leave defaults.
Card / Container Card / Title Card / Body Card / Action Row
Hero / Background Nav / Link Group Button / Primary
Rule 4 — Incremental building
One section per use_figma call. Validate via screenshot after each step. Return all created/mutated node IDs:
return { created: { card: card.id, title: title.id } };Current listing version
0.0.1
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供 Figma UI 构建的标准化规则,解决设计系统一致性与开发效率的核心痛点
- 覆盖组件复用、自动布局、语义命名等高频刚需场景
Highlights
- 触发词精准覆盖 Figma UI 构建核心动作(create card/build nav/add section/make component)
- 边界清晰,无明显歧义或与其他 Skill 重叠
Highlights
- Phase/步骤清晰(Rule 1~4),每步有具体执行逻辑与代码示例
- 包含端到端示例与 frontmatter 完整,单文件长度合理
Highlights
- Figma API 使用规范明确(importComponentByKeyAsync/createInstance/setBoundVariable)
- 强调参数顺序与异常路径覆盖,不可逆操作有流程控制
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.