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/validateCreation.js
View on GitHub/**
* validateCreation
*
* Verifies that a set of nodes exist and match expected structural properties.
* Designed to run immediately after a creation script to catch partial failures
* before proceeding to the next build phase.
*
* Each check specifies a node ID and any combination of expected properties.
* A check passes when all specified expectations are met; it fails (with a
* reason string) as soon as any expectation is violated.
*
* @param {Array<{
* nodeId: string,
* expectedChildCount?: number,
* expectedName?: string,
* expectedType?: NodeType
* }>} checks
* - `nodeId`: The Figma node ID to look up via figma.getNodeById.
* - `expectedChildCount`: If set, the node must have exactly this many direct children.
* Applies to any node with a `children` property (frames, component sets, etc.).
* - `expectedName`: If set, the node's `.name` must exactly match this string.
* - `expectedType`: If set, the node's `.type` must exactly match this string.
* @returns {{
* passed: string[],
* failed: Array<{nodeId: string, reason: string}>
* }}
* `passed`: Array of nodeIds that passed all checks.
* `failed`: Array of objects with the nodeId and a human-readable reason string.
*/
function validateCreation(checks) {
const passed = []
const failed = []
for (const check of checks) {
const node = figma.getNodeById(check.nodeId)
// Node must exist
if (!node) {
failed.push({
nodeId: check.nodeId,
reason: `Node not found. It may not have been created, or was deleted.`,
})
continue
}
const reasons = []
// Type check
if (check.expectedType !== undefined && node.type !== check.expectedType) {
reasons.push(`type is "${node.type}", expected "${check.expectedType}"`)
}
// Name check
if (check.expectedName !== undefined && node.name !== check.expectedName) {
reasons.push(`name is "${node.name}", expected "${check.expectedName}"`)
}
// Child count check
if (check.expectedChildCount !== undefined) {
if (!('children' in node)) {
reasons.push(
`node type "${node.type}" does not have children, but expectedChildCount=${check.expectedChildCount} was specified`,
)
} else {
const actualCount = node.children.length
if (actualCount !== check.expectedChildCount) {
reasons.push(`has ${actualCount} children, expected ${check.expectedChildCount}`)
}
}
}
if (reasons.length > 0) {
failed.push({
nodeId: check.nodeId,
reason: reasons.join('; '),
})
} else {
passed.push(check.nodeId)
}
}
return { passed, failed }
}
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 |