apply-color-variables
Skill3 starsChanged 9 months agoMITView on GitHub
Apply existing Figma Color variables from a specified Variables collection to hard-coded colors in the current selection, page, or file. Use when colors are not bound to collection variables and should be standardized to the design system.
In this repository62 other files it gives its agents.
- AGENTS.mdAGENTS.md
- accessibility-auditSkill
- affinity-mappingSkill
- animation-consistency-checkSkill
- base-ui-primitive-compositionSkill
- branch-review-summarySkill
- brand-kit-asset-generatorSkill
- build-from-prdSkill
- build-primitiveSkill
- code-connect-mapperSkill
- color-token-format-normalizerSkill
- comment-triageSkill
- competitive-teardownSkill
- component-auditSkill
- component-naming-syncSkill
- container-layout-normalizerSkill
- content-inventorySkill
- content-tone-reviewSkill
- cva-variant-generatorSkill
- deck-from-outlineSkill
- design-brief-generatorSkill
- design-change-diffSkill
- design-critSkill
- design-first-ui-promptingSkill
- design-tokens-syncSkill
- dev-handoff-prepSkill
- figma-skill-routerSkill
- figma-to-code-componentSkill
- file-cleanupSkill
- follow-ds-guidelinesSkill
- handoff-summarySkill
- heuristic-evaluationSkill
- improve-uiSkill
- journey-map-builderSkill
- layoutSkill
- legacy-styles-to-variablesSkill
- library-health-reportSkill
- localization-readinessSkill
- microcopy-generatorSkill
- motion-spec-generatorSkill
- naming-convention-enforcerSkill
- persona-builderSkill
- plugin-widget-recommenderSkill
- polishSkill
- prototype-from-flowSkill
- prototype-qaSkill
- rename-layers-batchSkill
- responsive-breakpoint-checkSkill
- screenshot-to-componentSkill
- semantic-color-auditSkill
- shadcn-component-structureSkill
- shadcn-theme-variablesSkill
- site-launch-checklistSkill
- spacing-scale-enforcerSkill
- states-completeness-checkSkill
- sticky-synthesisSkill
- tailwind-class-order-checkSkill
- token-tailwind-theme-syncSkill
- variable-driven-prototypeSkill
- visual-consistency-checkSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
30 rules. About 0 are common, 28 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈28
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use this skill to replace hard-coded colors in a Figma file with existing Color variables from the chosen Variables collection.
- Distinctive: line 13
Use this skill when the user asks to:
- Distinctive: line 19
Do not use this skill to create, rename, delete, or change variables.
- Distinctive: line 22
If the user does not specify details, use these defaults:
- Distinctive: line 26
Variable creation: never create new variables
- Distinctive: line 30
Ask a short question before editing if any of these are unclear and materially affect the result:
- Distinctive: line 32
Should the work apply to the selection, current page, or entire file?
- Distinctive: line 33
Should matching be exact only, or may near matches be used?
- Distinctive: line 34
If the file uses modes such as Light and Dark, which mode should be used for matching?
- Distinctive: line 36
If the likely answer is obvious from the file context, proceed and state the assumption in the final summary.
- Distinctive: line 39
Use only existing Color variables.
- Distinctive: line 42
Leave any color that is already bound to a variable unchanged unless it is bound to the wrong collection and the user explicitly asked to …
- Distinctive: line 43
Do not replace variables with paint styles unless the user explicitly asks for styles.
- Distinctive: line 44
Do not approximate colors unless the user explicitly allows near-match replacement.
- Distinctive: line 45
Do not change opacity, blend mode, stroke width, effect blur, or any non-color property.
- Distinctive: line 56
If scanning the entire file could be large or risky, tell the user what scope you are using before applying changes.
- Very specific: line 65
Prefer semantic variables when there are duplicates.
- Distinctive: line 85
Use exact RGBA matching by default.
- Distinctive: line 86
If multiple variables match, choose the best candidate using this priority:
- Distinctive: line 91
if still ambiguous, do not guess.
- Distinctive: line 97
Keep the visual appearance unchanged after binding.
- Distinctive: line 98
If a variable has modes, bind the variable itself rather than hard-coding a mode value.
- Distinctive: line 106
Check representative examples: fill, stroke, text, and effect color if present.
- Distinctive: line 130
Images: do not attempt to alter bitmap/image colors.
- Distinctive: line 131
Remote libraries: use available library variables if they are enabled and accessible.
- Distinctive: line 132
Detached or legacy components: update only the eligible color properties.
- Very specific: line 133
Different opacity: treat opacity as part of the color match.
- Distinctive: line 134
Near matches: only use near matches when explicitly allowed by the user.
- Distinctive: line 137
Stop and ask the user before editing if:
- Distinctive: line 138
no Color variable collection is available
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Apply existing Color variables
Purpose
Use this skill to replace hard-coded colors in a Figma file with existing Color variables from the chosen Variables collection. The goal is to make fills, strokes, text colors, and effect colors use the design system’s variable collection instead of raw color values.
When to use
Use this skill when the user asks to:
- apply existing Color variables to colors that are not using variables
- convert raw hex/RGB colors to variables
- clean up a Figma file so colors use the team’s Variables collection
- audit a design for unbound colors and bind them to existing variables
Do not use this skill to create, rename, delete, or change variables.
Default behavior
If the user does not specify details, use these defaults:
- Scope: current selection; if nothing is selected, use the current page
- Variable source: any available collection that clearly contains Color variables, prioritizing a collection named
Colors,Colour,Primitives,Semantic,Theme, or similar - Matching rule: exact color matches only
- Variable creation: never create new variables
- Unmatched colors: report them instead of changing them
Clarify only when necessary
Ask a short question before editing if any of these are unclear and materially affect the result:
- Which Variables collection should be used?
- Should the work apply to the selection, current page, or entire file?
- Should matching be exact only, or may near matches be used?
- If the file uses modes such as Light and Dark, which mode should be used for matching?
If the likely answer is obvious from the file context, proceed and state the assumption in the final summary.
Operating rules
- Use only existing Color variables.
- Bind colors to variables; do not simply copy variable values as raw colors.
- Preserve layout, layer structure, names, constraints, variants, component relationships, and non-color styling.
- Leave any color that is already bound to a variable unchanged unless it is bound to the wrong collection and the user explicitly asked to normalize collections.
- Do not replace variables with paint styles unless the user explicitly asks for styles.
- Do not approximate colors unless the user explicitly allows near-match replacement.
- Do not change opacity, blend mode, stroke width, effect blur, or any non-color property.
Step-by-step process
1. Identify the target scope
Determine whether to scan:
- the current selection
- the current page
- the entire file
- a specific frame, section, component, or page named by the user
If scanning the entire file could be large or risky, tell the user what scope you are using before applying changes.
2. Build the Color variable map
From the target Variables collection or collections:
- List all variables of type Color.
- Resolve their values for the relevant mode or modes.
- Normalize each variable value into comparable RGBA values.
- Record each variable’s name, collection, mode, and resolved color.
Prefer semantic variables when there are duplicates. For example, prefer Semantic / Background / Primary over Primitive / Blue / 500 when both match and the semantic variable appears intended for UI usage.
3. Scan for unbound color properties
Within the target scope, inspect color-bearing properties, including where supported:
- fills
- strokes
- text fills
- effect colors, such as shadows
- component and instance properties that expose color values
For each property, classify it as:
- Already variable-bound — leave unchanged
- Hard-coded and matchable — candidate for variable binding
- Hard-coded and unmatched — report only
- Unsupported or ambiguous — report only
4. Match hard-coded colors to variables
For every hard-coded color:
- Normalize the color and opacity to RGBA.
- Compare it against the Color variable map.
- Use exact RGBA matching by default.
- If multiple variables match, choose the best candidate using this priority:
- variable from the user-specified collection
- semantic token over primitive/raw token
- token name that matches the layer/property context
- shorter, cleaner, more current-looking token name
- if still ambiguous, do not guess; report the ambiguity
5. Apply bindings
For every confident match:
- Bind the color property to the matched existing Color variable.
- Preserve the property’s non-color settings.
- Keep the visual appearance unchanged after binding.
- If a variable has modes, bind the variable itself rather than hard-coding a mode value.
6. Validate the result
After applying changes:
- Re-scan the same scope.
- Confirm that matched hard-coded colors are now variable-bound.
- Confirm unmatched colors were not changed.
- Confirm visible appearance is unchanged except for variable binding.
- Check representative examples: fill, stroke, text, and effect color if present.
Final response format
Return a concise summary with these sections:
Updated
- Number of layers or nodes checked
- Number of color properties changed from hard-coded values to Color variables
- Number of properties already using variables
Unmatched colors
List hard-coded colors that could not be mapped to an existing variable. Group by color value and include where they appear.
Example:
#F24E1Eat 80% opacity — 3 uses:Button / Icon,Alert / Border,Badge / Fill
Ambiguities
List cases where multiple variables matched and no confident choice was possible, or state that there were none.
Assumptions
State any assumptions made, such as scope, collection, or mode.
Edge cases
- Gradients: bind variable-supported gradient stops only if Figma supports variable binding for that property. Otherwise report them.
- Images: do not attempt to alter bitmap/image colors.
- Remote libraries: use available library variables if they are enabled and accessible. If not accessible, report that the variable source is unavailable.
- Detached or legacy components: update only the eligible color properties; do not restructure components.
- Different opacity: treat opacity as part of the color match.
#000000at 40% is not the same as#000000at 100%. - Near matches: only use near matches when explicitly allowed by the user. When allowed, report every near match separately from exact matches.
Hard stop conditions
Stop and ask the user before editing if:
- no Color variable collection is available
- multiple likely collections exist and choosing the wrong one would be risky
- the user requested near matching but gave no tolerance or rule
- the requested change would require creating or modifying variables
- applying the change would affect a very large scope and the user did not explicitly request that scope
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

