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\",…
Use when converting an existing JavaScript Lightning Web Component (.js, .html, .css) to TypeScript with full type annotations and a matching `.d.ts` file that exposes only the component's `@api` surface. TRIGGER when the user says \"convert LWC to TypeScript\", \"migrate LWC to
$ npx -y skills add forcedotcom/sf-skills --skill experience-lwc-typescript-migrate --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/experience-lwc-typescript-migrateContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when converting an existing JavaScript Lightning Web Component (.js, .html, .css) to TypeScript with full type annotations and a matching `.d.ts` file that exposes only the component's `@api` surface. TRIGGER when the user says \"convert LWC to TypeScript\", \"migrate LWC to
name: experience-lwc-typescript-migrate
description: "Use when converting an existing JavaScript Lightning Web Component (.js, .html, .css) to TypeScript with full type annotations and a matching `.d.ts` file that exposes only the component's `@api` surface. TRIGGER when the user says \"convert LWC to TypeScript\", \"migrate LWC to TS\", \"rename .js to .ts for this component\", \"add types to my LWC\", \"generate .d.ts for this LWC\", \"type-annotate @api properties\", or \"produce declare module 'c/componentName' definitions\". DO NOT TRIGGER when the user is authoring a brand-new LWC from scratch (use experience-lwc-generate), generating Jest tests for an existing LWC (use experience-lwc-generate), or migrating an Aura component to LWC."
metadata:
version: "1.0"
domains: ["Experience"]
relatedSkills:
- "experience-lwc-generate"
cliTools:
- tool: ["git"]
semver: ">=2.0.0"
- tool: ["jq"]
semver: ">=1.6"
- tool: ["tsc"]
semver: ">=4.0.0"<!-- adk-managed-skill -->
Convert a Lightning Web Component bundle from JavaScript to TypeScript. The deliverable is a fully-typed `.ts` implementation **plus** a `.d.ts` file that only exposes `@api` members (the public surface other LWCs consume).
`.js` to `.ts`.
external TypeScript host) can import it safely.
hasn't been properly typed yet.
pipeline or a standalone `tsc` step).
---
Open every file in the bundle:
componentName/ ├── componentName.js ├── componentName.html ├── componentName.css └── (possibly) __tests__/, __utam__/, existing .d.ts
Understand:
starting point, but validate against actual usage — JSDoc lies).
called internally?
git mv componentName/componentName.js componentName/componentName.ts
Repeat for any helper `.js` files in the bundle (unless they're already `.ts`). **Never** plain `mv` — that loses the history link TypeScript reviewers rely on.
Apply types in this priority order so you stop as soon as the public contract is solid:
1. **`@api` properties and methods first.** Generate JSDoc if it's missing, then translate JSDoc types to TS syntax (`string`, `number`, `boolean`, `Promise<T>`). Validate each JSDoc claim against the code before trusting it. 2. **Complex shapes become `interface` or `type` aliases** — not inline shapes repeated everywhere. 3. **Optional members use `?`** only when the value is genuinely allowed to be `undefined`. Do not sprinkle `?` defensively. 4. **Private/internal state** — still type it, but don't export the types. Use `private` for members that must never be touched by consumers. 5. **Event handlers** — prefer precise DOM event types:
is dispatched as a `MouseEvent` — including keyboard-activated clicks — so typing it as `PointerEvent` would let handlers rely on pointer-only fields (`pointerType`, `pressure`, etc.) that are undefined in those cases.
and other `pointer*` handlers where pointer-specific fields are actually meaningful.
6. **Async methods** always return `Promise<T>` — never bare `T`. 7. **Avoid `any`.** If you genuinely can't type something, use `unknown` and narrow with a type guard.
Load [[assets/type-patterns.ts|assets/type-patterns.ts]] as an inline example covering property types, method types, and event handler types.
Create `componentName.d.ts` next to the `.ts`. It must:
methods, no lifecycle hooks unless they are themselves `@api`.
`@default`, `@param`, `@returns` tags) directly above each declaration.
namespace if different).
Template: load [[assets/dts-template.ts|assets/dts-template.ts]] as the starting `.d.ts` shape.
If the component has **no** `@api` members, still produce the module declaration with a comment explaining there's no public surface — don't skip the file.
Resolve every error before calling it done; no `@ts-ignore` patches.
identical.
valid result, not a reason to skip. The script resolves the search paths from `sfdx-project.json`'s `packageDirectories` (or falls back to `<project-root>`), rejects any entry that escapes the project root, and performs the LWC-import search internally so the invocation is fully deterministic:
"<skill_dir>/scripts/find-consumers.sh" "<project-root>" "<com
This 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…