commerce-b2b-open-code…
Integrate Salesforce B2B Commerce open source components from GitHub into B2B Commerce stores. Use when users mention \"integrate open code components\",…
Migrate Lightning Web Components from SLDS 1 to SLDS 2 by running the SLDS linter and fixing violations. Use this skill whenever users mention SLDS 2, SLDS uplift, linter violations, LWC token migration, class overrides, hardcoded CSS values that need SLDS hook replacement, or
$ npx -y skills add forcedotcom/sf-skills --skill design-systems-slds2-migrate --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/design-systems-slds2-migrateContext preview
The summary Claude sees to decide when to auto-load this skill.
Migrate Lightning Web Components from SLDS 1 to SLDS 2 by running the SLDS linter and fixing violations. Use this skill whenever users mention SLDS 2, SLDS uplift, linter violations, LWC token migration, class overrides, hardcoded CSS values that need SLDS hook replacement, or
name: design-systems-slds2-migrate
description: "Migrate Lightning Web Components from SLDS 1 to SLDS 2 by running the SLDS linter and fixing violations. Use this skill whenever users mention SLDS 2, SLDS uplift, linter violations, LWC token migration, class overrides, hardcoded CSS values that need SLDS hook replacement, or styling hook selection. Covers all styling hook categories — color, spacing, sizing, typography, borders, radius, and shadows. Also use when users mention no-hardcoded-values, no-slds-class-overrides, lwc-to-slds-hooks, no-deprecated-tokens-slds1, or ask about SLDS component migration — even if they don't explicitly say \"uplift\" or \"migration\"."
metadata:
version: "1.0"
domains: ["Design Systems"]
cliTools:
- tool: ["npx"]
semver: ">=7.0.0"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.
---
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-slds1Four 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](references/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](references/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](references/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](references/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](references/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:
1. **CSS:** Rename `.slds-*` selector → `{componentName}-{sldsElementPart}` (camelCase) 2. **Markup:** Add the new class **alongside** the SLDS class — never remove the SLDS class
/* Before */ .slds-button { border-radius: 8px; }
/* After */ .myComponent-button { border-raThis repository provides a curated collection of Salesforce agent skills for building applications.
Repo: forcedotcom/sf-skills
Integrate Salesforce B2B Commerce open source components from GitHub into B2B Commerce stores. Use when users mention \"integrate open code components\",…
Replace OOTB (out-of-the-box) B2B Commerce components with open source equivalents in site metadata content.json files, or look up the equivalent open code…
Use this skill to diagnose and resolve what blocks a DevOps Center promotion of a work item's feature branch: Git merge conflicts and deployment failures.…
Use this skill to manage the full lifecycle of a DevOps Center pipeline — list all pipelines, get a single pipeline's details, create a new pipeline linked to…
Analyzes DevOps Center test failures and Code Analyzer violations in plain language — failure category, offending file/class/method/line, rule violated, fix…
Configures DevOps Center pipeline testing infrastructure: enables a test provider so its suites become available, re-syncs a configured provider to pull in new…