bitovi/ai-enablement-prompts/4-setup-structure
Claude Code and agent skill by bitovi/ai-enablement-prompts
- community
Checking that the SKILL.md file is still in the repository.
Subagent for figma-from-code Phase 2. Creates the Figma file page skeleton, foundations documentation frames, and container frames needed by later phases. Requires variable collections to already exist.
Install
npx vskill@latest install bitovi/ai-enablement-prompts/4-setup-structureSKILL.md
Skill: Setup File Structure (Phase 2)
Creates the Figma file page skeleton, foundations documentation frames, and container frames needed by later phases. Runs as a subagent dispatched by the orchestrator, or standalone to set up a fresh Figma file for a code-to-Figma rebuild.
When to Use
- When
figma-from-codeorchestrator reaches Phase 2 - Standalone to set up a fresh Figma file after variable collections exist
Prerequisites
- Variable collections (
Palette,Semantic,Spacing) must already exist in the file (Phase 1 complete) - Load
figma:figma-use(mandatory) before anyuse_figmacall
Required Inputs
| Input | Description | Source | |
|---|---|---|---|
fileKey | Figma file key | State ledger | |
existingPages | Pages already present in the Figma file | Phase 0a Figma inspection |
Placeholders like{skillRoot}resolve fromstate.json → config.
Output Files
| File | Contents | Consumed by | |
|---|---|---|---|
.temp/figma-from-code/structure-summary.json | All page and frame node IDs | Orchestrator (merges into state.json -> figmaNodes) |
Workflow
1. Create Pages
Rename/create pages in this exact order. If a page with the target name already appears in existingPages, skip its creation.
| Page Name | Purpose | |
|---|---|---|
🎨 Foundations | Color swatches, type specimens, spacing scale | |
📦 Components | All component sets (built in Phase 3) | |
📄 Screens | Assembled page screens (built in Phase 4) |
2. Build Foundations Page Content
On the 🎨 Foundations page, create three documentation frames stacked vertically with 80px gaps. All content is driven by the Figma variables created in Phase 1 — never hardcode color values.
Work in separate incremental use_figma calls (one per frame) to stay under the size limit. After each call, capture the returned node IDs and take an inline screenshot for verification.
Frame 1: Color Palette (y=0)
Name: Color Palette Width: 1200, height: auto Background: white, padding: 48px all sides Layout: VERTICAL, gap 40px
Building the palette dynamically:
- Query all variables in the
Palettecollection viafigma.variables.getLocalVariablesAsync() - Group by color family (the prefix before
/in the variable name, e.g.,gray,teal) - For each family, create a horizontal row:
- Scale label: Inter Semi Bold 12px,
#64748b, width 60px (family name) - One swatch per step (50→950): 40×40px rectangle, cornerRadius 6, filled with the bound Palette variable
- Tooltip text below showing the step number
Bind swatch fills to variables rather than hardcoding hex values:
Frame 2: Semantic Colors (y = Frame1.height + 80)
Name: Semantic Colors Width: 1200, height: auto Background: white, padding: 48px, layout: VERTICAL, gap: 32px
Building semantic swatches dynamically:
- Query all variables in the
Semanticcollection - Group by the token's first path segment (e.g.,
background,primary,border,sidebar) - For each group, create a horizontal row with a label and swatches
- Each swatch: 48×48px, cornerRadius 6, filled with the bound Semantic variable, label below (12px,
#64748b, truncated to 14 chars)
Frame 3: Spacing Scale (y = Frame2.y + Frame2.height + 80)
Name: Spacing Scale Width: 1200, height: auto Background: white, padding: 48px, layout: VERTICAL, gap: 20px
Title: "Spacing Scale" (Inter Bold 24px)
Two sub-sections side by side (horizontal layout):
Spacing: Query all spacing/* variables from the Spacing collection. For each value:
- Horizontal row: colored rectangle (width = value px, height 24px), label
spacing/{n} = {value}px(Inter Regular 13px,#334155)
Border Radius: Query all radius/* variables from the Spacing collection. For each value:
- Row: 32×32px white rectangle with border (
#e2e8f0), cornerRadius = value, labelradius/{name} = {value}px
3. Create Icons and Screens Container Frames
Create only the Icons frame (on the Components page) and the Screens container frame (on the Screens page). Tier frames are created on-demand at the start of each tier build in Phase 3.
4. Screenshot for Verification
Take a screenshot of the Foundations page and the Components page:
5. Write Summary
Write the page and container frame node IDs to the summary file:
Write to .temp/figma-from-code/structure-summary.json.
6. Report
Skip / Resume
Skip the entire phase if .temp/figma-from-code/structure-summary.json exists and all page IDs, iconsFrameId, and screensFrameId in the summary are verified to exist in Figma (use get_metadata or use_figma to check).
If the summary file exists but some node IDs are missing or invalid, create only the missing pages/frames (all steps are idempotent — skip creation of any page or frame that already exists).
Error Handling
| Scenario | Action | |
|---|---|---|
| Page/foundations frame creation fails | Report error; page creation is required for downstream phases | |
use_figma container frame fails | Retry once; if still failing, report which frames were created | |
| Pages already exist but frames don't | Create only the missing frames (idempotent) |
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/figma-from-code/skills/figma-from-code/4-setup-structure/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/bitovi/ai-enablement-prompts/4-setup-structure)