New to Claude Skills? Learn how to install them →

forcedotcom on GitHub

LWC Mobile Offline Review

OfficialFree

Analyze Lightning Web Components for offline compatibility.

Get this skill

Free · Opens the source repo

What LWC Mobile Offline Review does

The LWC Mobile Offline Review skill enables developers to assess the compatibility of Lightning Web Components (LWCs) with offline functionality in Salesforce Mobile App Plus and Field Service Mobile App. By utilizing the Komaci offline static analyzer, this skill provides a structured review process that identifies issues and offers code-level fixes necessary for compliance with offline priming requirements. The skill is particularly useful for developers preparing components for offline use or investigating reported priming failures.

To use this skill, developers must provide the component path, ensuring access to the associated JavaScript/TypeScript and HTML templates. The review process involves several steps: scoping the review to identify the relevant component files, reading grounding and per-reviewer references to understand the violation categories, and applying specific rules for inline GraphQL queries and conditional rendering using lwc:if, lwc:elseif, and lwc:else. Additionally, the skill runs the Komaci ESLint analyzer to check for violations against the recommended ruleset, generating a detailed report of findings and suggested actions.

This skill is essential for any developer working with LWCs who needs to ensure their components are ready for offline scenarios. By automating the analysis and providing actionable insights, it helps streamline the development process and reduces the risk of errors when deploying to mobile environments. The report generated by the skill serves as an auditable reference for compliance, making it easier to track and resolve issues.

However, it’s important to note that this skill is not intended for generic LWC code reviews or for building components that utilize native mobile capabilities. Developers should use appropriate domain-specific skills for those purposes. Overall, the LWC Mobile Offline Review skill is a targeted tool that enhances the reliability of mobile applications built on the Salesforce platform.

When to use it

Use this skill when preparing an LWC for offline deployment or when investigating offline priming issues.

When not to use it

Do not use this skill for general LWC code reviews or when building components with native mobile capabilities.

What you can build with it

Preparing for Offline Deployment

Use the skill to ensure your LWC is compliant with offline requirements before deployment in Salesforce Mobile App Plus.

Investigating Priming Failures

Run the skill to identify issues when the offline analyzer reports priming failures for your component.

Ensuring Compliance for New Components

Utilize this skill during the development process to validate new LWCs against offline compatibility standards.

How to install LWC Mobile Offline Review

View source

1. Install with the skills CLI

npx skills add forcedotcom/sf-skills/mobile-platform-offline-validate --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by forcedotcom

Reviewing LWC Mobile Offline

Run a structured offline-priming compliance pass over a Lightning Web Component, producing a report of issues found and code-level fixes to bring the component into compliance with Komaci's static analysis requirements for the Salesforce Mobile App Plus and Field Service Mobile App.

When to Use

  • The user asks for a "mobile offline review", "Komaci check", or "offline priming audit" on a specific LWC.
  • Preparing a component to ship in Salesforce Mobile App Plus or Field Service Mobile App offline mode.
  • Investigating priming failures reported by the offline analyzer.

Do NOT use this skill for:

  • Building an LWC that uses native mobile capabilities (barcode scanner, biometrics, location, etc.) — use mobile-platform-native-capabilities-integrate.
  • Generic LWC code review — use the appropriate domain skill (reviewing-lws-security, reviewing-lwc-rtl, accessibility-code-review).

Prerequisites

  • Component path (LWC bundle under modules/…).
  • Access to the component's JS/TS and HTML templates.
  • Local Node + npm; ability to run npx eslint with the @salesforce/eslint-plugin-lwc-graph-analyzer plugin.

Knowledge Base

Mobile Offline Grounding explains the three violation categories and why each blocks offline priming. Read it before judging. The per-reviewer references below are the source of truth for the rules and remediations:

Workflow

Step 1 — Scope the review

Identify the component bundle: .html, .js/.ts. CSS and meta files are not in scope for offline priming. If the bundle has multiple HTML templates, all are reviewed.

Step 2 — Read the grounding and per-reviewer references

Read Mobile Offline Grounding and the three per-reviewer references end-to-end before judging. Cite the specific reviewer when emitting each finding so the report is auditable.

Step 3 — lwc:if / lwc:elseif / lwc:else (HTML)

Walk every .html file in the bundle and apply the rules in lwc:if Reviewer. For each occurrence of lwc:if={…}, lwc:elseif={…}, or lwc:else, emit a finding with the exact if:true / if:false rewrite — including the nesting required to preserve lwc:elseif and lwc:else semantics.

Step 4 — Inline GraphQL in @wire (JS)

Walk every .js/.ts file in the bundle and apply the rules in Inline GraphQL Reviewer. For each @wire that references a gql template literal directly (or via a top-level constant), emit a finding that names a concrete getter and shows the rewritten @wire configuration.

Step 5 — Komaci ESLint pass (JS)

Run the Komaci ESLint analyzer over the bundle's JS file using the bundled script. It applies the @salesforce/eslint-plugin-lwc-graph-analyzer recommended ruleset with the bundleAnalyzer processor enabled.

scripts/run-komaci.sh path/to/component.js

The script requires @salesforce/eslint-plugin-lwc-graph-analyzer to be resolvable from the working directory, and the component's sibling HTML templates must live next to the JS file (the plugin's bundleAnalyzer processor uses them to resolve the offline data graph). Output is ESLint --format json on stdout.

For each messages[*] entry in the output, group by ruleId and look up the per-rule remediation in Komaci ESLint Reviewer. Emit a finding per (rule, line) pair with the exact remediation text from the reference; do not invent new advice. See the reference for the manual npx eslint ... invocation if the script is unavailable in the runtime environment.

Step 6 — Produce the report

Emit a report in this shape:

## Mobile Offline (Komaci priming)
- <reviewer> — <file>:<startLine>:<startColumn>-<endLine>:<endColumn> — <type>
  Description: <verbatim from the reviewer reference>
  Intent analysis: <verbatim from the reviewer reference>
  Suggested action: <verbatim from the reviewer reference>
  Code: |
    <source snippet from startLine through endLine, optional but
     recommended when the violation spans multiple lines>
  Applied: yes/no

## Summary
- <n> issues found; <m> fixed; <k> deferred (with reason)

For Komaci ESLint findings, take startLine/startColumn/endLine/ endColumn from the ESLint message's line/column/endLine/endColumn. For Inline GraphQL and lwc:if findings, supply the line/column range you observed in the source. If endLine/endColumn are not available for a finding, fall back to <file>:<startLine> and omit the trailing range.

Cite the reviewer (Inline GraphQL / lwc:if / Komaci ESLint rule id) on every finding.

Step 7 — Apply fixes

Apply the remediations directly when the user asked for fixes. If a remediation conflicts with the component's behavior outside offline (e.g. the developer relies on lwc:elseif for readability and the user is not yet shipping to mobile offline), surface the conflict in the deferred list rather than silently rewriting.

Verification Checklist

  • Every lwc:if / lwc:elseif / lwc:else flagged or absent.
  • Every @wire referencing gql checked; inline queries extracted to a getter.
  • Komaci ESLint analyzer was actually run; findings cite real rule ids, not invented ones.
  • Each finding cites the originating reviewer or rule id.
  • No remediation outside the three categories above (other concerns belong to other skills).

Troubleshooting

  • npx eslint cannot find the plugin — install @salesforce/eslint-plugin-lwc-graph-analyzer in the workspace, or use a pinned local install path. The plugin is the canonical source of Komaci rules.
  • bundleAnalyzer related errors — the recommended config drives the bundle processor; do not strip it. The processor expects sibling HTML files to be discoverable. If running on a stripped-down JS file, supply the matching HTML in the temp directory.
  • No findings for a component you expect to fail — confirm the recommended ruleset is applied (not just bundleAnalyzer with empty rules). Some rules require the HTML to be present alongside the JS.
  • Findings duplicate lwc:if from the dedicated reviewer — the Komaci plugin does not check templates; the lwc:if check is HTML-only and comes from Step 3. Findings from Step 5 are JS-only.

Frequently asked questions about LWC Mobile Offline Review

Similar skills