Migrates Lightning Web Components from SLDS 1 to SLDS 2 by running the SLDS linter and fixing violations across all styling hook categories.
Ships in sf-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Systematically migrate Lightning Web Components from SLDS 1 to SLDS 2 using the SLDS linter and structured guidance for fixing violations across all styling hook categories.
| Category | Hook Prefix | What It Replaces |
|---|---|---|
| Color | --slds-g-color-* | Hardcoded colors, --lwc-color* tokens |
| Spacing | --slds-g-spacing-* | Hardcoded margins, padding, gaps |
| Sizing | --slds-g-sizing-* | Hardcoded widths, heights, dimensions |
| Typography | --slds-g-font-* | Hardcoded font sizes, weights, line heights |
| Border/Radius | --slds-g-radius-border-*, --slds-g-sizing-border-* | Hardcoded border-radius, border-width |
| Shadow | --slds-g-shadow-* | Hardcoded box-shadow values |
Color hooks require the most judgment (context-dependent selection). Non-color hooks are mostly numbered scales with straightforward mappings.
.html for LWC, .cmp for Aura)1. **REQUIRED — ALWAYS run first:** npx @salesforce-ux/slds-linter@latest lint --fix . — NEVER skip this step. This handles simple violations automatically.
2. Review linter output -> Identify remaining manual fixes needed
3. Fix by violation type -> Use per-rule reference guides
4. Choose the right hook -> Context-first, inspect HTML before deciding
5. Validate -> Re-run linter and confirm zero errors
MANDATORY: This step is NOT optional.
npx @salesforce-ux/slds-linter@latest lint --fix .
The linter analyzes all CSS and markup files (.html for LWC, .cmp for Aura), auto-fixes simple violations, and reports remaining issues requiring manual intervention.
The linter reports violations in this format:
componentName.css
15:3 warning Overriding slds-button isn't supported. To differentiate SLDS and
custom classes, create a CSS class in your namespace.
Examples: myapp-input, myapp-button. slds/no-slds-class-overrides
23:5 error The '--lwc-colorBackground' design token is deprecated. Replace it with
the SLDS 2 styling hook and set the fallback to '--lwc-colorBackground'.
1. --slds-g-color-surface-2
2. --slds-g-color-surface-container-2 slds/lwc-token-to-slds-hook
30:8 warning Consider replacing the #ffffff static value with an SLDS 2 styling hook
that has a similar value:
1. --slds-g-color-surface-1
2. --slds-g-color-surface-container-1
3. --slds-g-color-on-accent-1
4. --slds-g-color-on-accent-2
5. --slds-g-color-on-accent-3 slds/no-hardcoded-values-slds2
31:15 error Consider removing t(fontSizeMedium) or replacing it with
var(--slds-g-font-size-base, var(--lwc-fontSizeMedium, 0.8125rem)).
Set the fallback to t(fontSizeMedium). For more info, see
Styling Hooks on lightningdesignsystem.com. slds/no-deprecated-tokens-slds1
Four violation types, each with its own fix approach (see Step 3).
Important: The linter flags all hardcoded values. Fix color, spacing, sizing, typography, border, and shadow values — but skip layout values (100%, auto, 0, inherit, none). See rule-no-hardcoded-values.md for the full fix-vs-skip triage table.
Each rule has a dedicated reference guide with full examples and decision logic:
| Violation Rule | Quick Summary | Reference |
|---|---|---|
slds/no-hardcoded-values-slds2 | Replace hardcoded values with SLDS hook + original as fallback | rule-no-hardcoded-values.md |
slds/lwc-token-to-slds-hook | Replace --lwc-* tokens with SLDS 2 hook, keep LWC token as fallback | rule-lwc-token-to-slds-hook.md |
slds/no-slds-class-overrides | Create component-prefixed class, add to markup alongside SLDS class | rule-no-slds-class-overrides.md |
slds/no-deprecated-tokens-slds1 | Replace legacy t()/token() syntax with SLDS 2 hook + LWC fallback | rule-no-deprecated-tokens-slds1.md |
Always include fallback values — var(--slds-g-hook, originalValue) where originalValue is the exact original from the source CSS.
Class overrides require changes to both CSS and markup (.html or .cmp). This is the most commonly missed step:
.slds-* selector → {componentName}-{sldsElementPart} (camelCase)/* Before */ .slds-button { border-radius: 8px; }
/* After */ .myComponent-button { border-radius: 8px; }
<!-- Markup: both classes --> <button class="slds-button myComponent-button">Click</button>
See rule-no-slds-class-overrides.md for descendant selectors, multi-class selectors, and naming conventions.
Color hooks require context-based selection. REQUIRED: When any violation involves a color property (color, background-color, background, fill, border-color), you MUST read color-hooks-decision-guide.md BEFORE choosing a hook. The linter lists possible hooks in no particular order — do NOT pick the first suggestion. The guide contains property-based rules that determine the correct hook.
Non-color hooks are simpler — match the CSS value to the numbered scale. See non-color-hooks-decision-guide.md for value-to-hook lookup tables covering spacing, sizing, typography, borders, radius, and shadows.
Linter feedback loop — repeat until zero errors:
1. npx @salesforce-ux/slds-linter@latest lint .
2. Review errors -> fix by type (Step 3)
3. Re-run linter
4. Repeat until output shows: 0 errors
.slds-* classes in CSS selectorsvar(--lwc-*) tokens without SLDS 2 replacementsspacing-medium)font-weight-bold)See migration-checklist.md for the full validation checklist.
Return the fully migrated CSS (and updated HTML markup where class overrides were fixed) with zero SLDS linter violations. All styling hooks must include fallback values preserving the original CSS values.
When a hardcoded value uses rgba() or transparency, use color-mix() with the SLDS hook to preserve opacity:
/* Before */
border-color: rgba(186, 5, 23, 0.7);
/* After — use oklab color space for perceptual consistency */
border-color: color-mix(in oklab, var(--slds-g-color-palette-red-40, rgb(181,54,45)), transparent 30%);
Formula: To achieve X% opacity, use (100 - X)% transparent in color-mix.
transparent 30%transparent 50%Use opaque rgb() as fallback (not rgba()) — color-mix handles the transparency.
When migrating t('calc(...)') or calc() with deprecated tokens:
/* Before — Aura t() with calc */
height: t('calc(' + lineHeightButton + ' + 2px)');
/* After — if calc is still needed */
height: calc(var(--lwc-lineHeightButton) + 2px);
/* After — if calc was unnecessary, simplify */
height: var(--lwc-lineHeightButton);
For calc() with --lwc-* tokens being replaced:
/* Before */
padding: calc(var(--lwc-spacingMedium) + 4px);
/* After */
padding: calc(var(--slds-g-spacing-4, var(--lwc-spacingMedium)) + 4px);
Tip: Often the calc() is unnecessary and can be simplified. Check if the result matches an existing hook value.
100%, 50%, 200px, 1.5, auto, 0, inherit, none, flex: 1 are structural/layout values. Do not replace them with hooks and do not remove them — they are not styling hook candidates-1. Pick the variant closest to the original. See color-hooks-decision-guide.mdspacing-medium, font-weight-bold, radius-large do NOT exist| Issue | Solution |
|---|---|
| Linter suggests 2+ color hook options | Inspect HTML context to determine element's semantic role — see color-hooks-decision-guide.md |
| Visual appearance changed after migration | Verify fallback values match originals; check surface vs container family |
| No hook available for hardcoded value | Leave unchanged; do not invent custom hook names |
Linter says "Remove the static value" for 100%, auto, etc. | Leave unchanged — these are layout values. Removing them breaks rendering. |
| CSS class naming errors | Use exact camelCase component name: myComponent-button, not MyComponent-button |
| Spacing/sizing doesn't match | Check value-to-hook mapping in non-color-hooks-decision-guide.md; verify spacing vs sizing usage |
Named hook not working (e.g., spacing-medium) | Named hooks don't exist — use numbered scale: spacing-4 for 16px, font-weight-7 for inline bold emphasis (not headings) |
| Component looks different in compact density | Use density-aware hooks (--slds-g-spacing-var-*) for components that adapt to density |
--lwc-* token replacement patternst()/token() Aura syntax replacement patternsreferences/color-hooks-decision-guide.md (opens in a new tab)references/common-patterns.md (opens in a new tab)references/examples.md (opens in a new tab)references/migration-checklist.md (opens in a new tab)references/non-color-hooks-decision-guide.md (opens in a new tab)references/rule-lwc-token-to-slds-hook.md (opens in a new tab)references/rule-no-deprecated-tokens-slds1.md (opens in a new tab)references/rule-no-hardcoded-values.md (opens in a new tab)references/rule-no-slds-class-overrides.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
/sf-skills:design-systems-slds2-migratefrom sf-skills
sf-skills@sf-skills-plugin is listed by ccmalcom/sf-skills-plugin — review the source before installing
npx claudepluginhub ccmalcom/sf-skills-plugin --plugin sf-skills266 skills in this plugin
/afcc-setup-coordinateOrchestrates end-to-end headless setup of Agentforce Contact Center (AFCC) on a Salesforce org. Scans the org first, presents a delta plan for approval, then sequentially provisions demo users, Omni-Channel base settings, a human queue with routing config and members, presence statuses, permission sets, a PSTN voice number, and an active PstnVoice MessagingChannel wired to the queue. Interactive at key decision points — never assumes country, number type, queue names, or user counts. TRIGGER: set up AFCC, configure Agentforce Contact Center, stand up voice contact center, AFCC migration setup, provision AFCC org headlessly./agentforce-architecture-analyzeDeclared architecture snapshot for one Agentforce agent: planner, topics, actions, flows, Apex, prompt templates, and NGA plugins. Renders a human-readable architecture document and Mermaid invocation graph from design-time metadata (not runtime audit rows). TRIGGER when user asks to describe, diagram, inventory, audit, document, or diff (e.g. v3 vs v5) the architecture / action tree / topic structure / tool inventory of a specific agent by agent API name in a specific org. DO NOT TRIGGER for runtime session traces, conversation transcripts, generation timings, or gateway audit chains — this skill reads design-time metadata only (use agentforce-d360-analyze for session traces).3 plugins ship this exact skill · first indexed Aug 23, 2026
Other plugins' skills for the same job