Validate LWCs for Offline Use with Mobile Skills

Use the mobile-platform-offline-validate skill to run a structured offline-priming review over a Lightning web component (LWC). The skill checks the component against the Komaci offline static analyzer requirements for Salesforce Mobile App Plus and the Field Service mobile app, and produces a report of findings with code-level fixes.

Offline priming pre-builds the data graph that an LWC needs so that the component and its data are available when the device has limited or no connectivity. Certain code patterns block priming and prevent a component from working offline. Instead of requiring you to know each rule, this skill reads the authoritative reviewer references, inspects your component’s source, runs the Komaci ESLint analyzer, and reports each issue with a concrete fix.

In Agentforce Vibes, this skill is available out of the box. In other AI coding environments, install it by running npx skills add https://github.com/forcedotcom/sf-skills --skill mobile-platform-offline-validate. For installation details and environment requirements, see Install Mobile Skills.

Note

Use this skill when you:

  • Want a mobile offline review, a Komaci check, or an offline-priming audit on a specific LWC
  • Prepare a component to ship in Salesforce Mobile App Plus or the Field Service mobile app in offline mode
  • Investigate priming failures that the offline analyzer reports

What the Skill Reviews 

The skill reviews an LWC against three violation categories that block offline priming:

  • Conditional rendering directives: Occurrences of lwc:if, lwc:elseif, and lwc:else in HTML templates. The skill reports each occurrence with the exact if:true and if:false rewrite, including the nesting needed to preserve the original semantics.
  • Inline GraphQL in @wire: Each @wire that references a gql template literal directly, or through a top-level constant. The skill reports a finding that names a concrete getter and shows the rewritten @wire configuration.
  • Komaci ESLint rule violations: Issues that the @salesforce/eslint-plugin-lwc-graph-analyzer recommended ruleset detects, such as private wire properties, non-local reactive references, and getter side effects.

What the Skill Produces 

The skill produces a structured report that lists each finding with its source location, the reviewer or rule that flagged it, a description, and a suggested action. When you ask the skill to apply the fixes, it makes the code-level changes directly. If a remediation conflicts with the component’s non-offline behavior, the skill surfaces the conflict in a deferred list rather than silently rewriting the code.

Prerequisites 

To run the Komaci ESLint pass, the skill needs:

  • The component path to the LWC bundle, including access to the component’s JavaScript or TypeScript files and HTML templates.
  • A local Node.js and npm installation.
  • The @salesforce/eslint-plugin-lwc-graph-analyzer plugin resolvable from the working directory. The plugin is the canonical source of the Komaci rules. For details on installing and configuring the analyzer, see Validate Lightning Web Components for Offline Use.

The plugin’s bundle analyzer resolves the offline data graph from the component’s HTML templates, so keep the sibling HTML files next to the JavaScript file when the skill runs the analysis.

Example Prompts 

  • “Run a mobile offline review on this LWC.”
  • “Do a Komaci check on this component and fix the issues you find.”
  • “Audit this component for offline priming before I ship it in Salesforce Mobile App Plus.”

This skill focuses only on offline-priming compatibility. To build an LWC that uses native device features, such as the barcode scanner or biometrics, use the mobile-platform-native-capabilities-integrate skill instead.