BumpyClock/agent-templates / skills_archive/figma/figma-generate-library
figma-generate-library
VerifiedBuild/update Figma design systems: variables, tokens, components, theming.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 17.6 KB |
| references/code-connect-setup.md | markdown | 11.8 KB |
| references/component-creation.md | markdown | 38.4 KB |
| references/discovery-phase.md | markdown | 18.7 KB |
| references/documentation-creation.md | markdown | 27.4 KB |
| references/error-recovery.md | markdown | 21.3 KB |
| references/naming-conventions.md | markdown | 18.6 KB |
| references/token-creation.md | markdown | 34.3 KB |
| scripts/bindVariablesToComponent.js | script | 3.6 KB |
| scripts/cleanupOrphans.js | script | 3.6 KB |
| scripts/createComponentWithVariants.js | script | 4.8 KB |
| scripts/createDocumentationPage.js | script | 5.1 KB |
| scripts/createSemanticTokens.js | script | 3.8 KB |
| scripts/createVariableCollection.js | script | 1.7 KB |
| scripts/inspectFileStructure.js | script | 3.6 KB |
| scripts/rehydrateState.js | script | 2.9 KB |
| scripts/validateCreation.js | script | 2.7 KB |
scripts/rehydrateState.js
View on GitHub/**
* Scans the entire Figma file for nodes tagged with dsb_* pluginData
* and returns a complete state map for session recovery.
*
* Use this at the start of every new session, after context truncation,
* or when resuming an interrupted build.
*
* @param {string} runId - The run ID to filter by (optional — if omitted, returns ALL dsb-tagged nodes)
* @returns {{ runId: string, taggedNodes: Object<string, {nodeId: string, type: string, name: string, phase: string}>, variableCollections: Array, variables: Array, styles: Array }}
*/
async function rehydrateState(runId) {
const taggedNodes = {}
const variableCollections = []
const variables = []
const styles = []
// Scan all pages for dsb-tagged scene nodes
for (const page of figma.root.children) {
await figma.setCurrentPageAsync(page)
// Check the page itself
const pageRunId = page.getPluginData('dsb_run_id')
const pageKey = page.getPluginData('dsb_key')
if (pageKey && (!runId || pageRunId === runId)) {
taggedNodes[pageKey] = {
nodeId: page.id,
type: page.type,
name: page.name,
phase: page.getPluginData('dsb_phase') || 'unknown',
}
}
// Scan all descendants
page.findAll((node) => {
const nodeRunId = node.getPluginData('dsb_run_id')
const nodeKey = node.getPluginData('dsb_key')
if (nodeKey && (!runId || nodeRunId === runId)) {
taggedNodes[nodeKey] = {
nodeId: node.id,
type: node.type,
name: node.name,
phase: node.getPluginData('dsb_phase') || 'unknown',
}
}
return false // don't collect, just scan
})
}
// Inventory variable collections (variables don't support pluginData — use name-based lookup)
const collections = await figma.variables.getLocalVariableCollectionsAsync()
for (const coll of collections) {
variableCollections.push({
id: coll.id,
name: coll.name,
modes: coll.modes.map((m) => ({ modeId: m.modeId, name: m.name })),
variableCount: coll.variableIds.length,
})
}
// Inventory variables (name + collection for idempotency key)
const allVars = await figma.variables.getLocalVariablesAsync()
for (const v of allVars) {
variables.push({
id: v.id,
name: v.name,
collectionId: v.variableCollectionId,
resolvedType: v.resolvedType,
})
}
// Inventory styles
for (const s of figma.getLocalTextStyles()) {
styles.push({ id: s.id, name: s.name, type: 'TEXT' })
}
for (const s of figma.getLocalEffectStyles()) {
styles.push({ id: s.id, name: s.name, type: 'EFFECT' })
}
for (const s of figma.getLocalPaintStyles()) {
styles.push({ id: s.id, name: s.name, type: 'PAINT' })
}
return {
runId: runId || 'all',
taggedNodes,
taggedNodeCount: Object.keys(taggedNodes).length,
variableCollections,
variableCount: variables.length,
variables,
styleCount: styles.length,
styles,
}
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |