reviewing-lwc-mobile-offline
forcedotcom/sf-skills
Review Lightning Web Components for Salesforce Mobile App offline compatibility using Komaci static analysis.
What is reviewing-lwc-mobile-offline?
Analyzes LWCs for mobile offline priming compliance, checking inline GraphQL queries, lwc:if directives, and ESLint rule violations. Use this when validating components for Salesforce Mobile App Plus or Field Service Mobile App offline mode, or investigating priming failures.
- Detects inline GraphQL queries in @wire configurations that block offline priming
- Identifies lwc:if/lwc:elseif/lwc:else directives incompatible with offline data graphs
- Runs Komaci ESLint analyzer to flag private wire properties, non-local reactive references, and getter side-effects
- Produces code-level fixes with exact remediation steps for each violation
- Groups findings by reviewer category (Inline GraphQL, lwc:if, ESLint rule) with source citations
- Generates structured report with line/column ranges and applied/deferred status
How to install reviewing-lwc-mobile-offline
npx skills add https://github.com/forcedotcom/sf-skills --skill reviewing-lwc-mobile-offline- Component path (LWC bundle under modules/…)
- Access to component JS/TS and HTML templates
- Local Node + npm environment
- @salesforce/eslint-plugin-lwc-graph-analyzer installed and resolvable
- Sibling HTML templates discoverable next to JS file for bundleAnalyzer processor
How to use reviewing-lwc-mobile-offline
- 1.Identify the LWC bundle (.html, .js/.ts files) to review
- 2.Read Mobile Offline Grounding and the three per-reviewer references (Inline GraphQL, lwc:if, Komaci ESLint)
- 3.Walk HTML templates and apply lwc:if/lwc:elseif/lwc:else rules, emitting findings with exact if:true/if:false rewrites
- 4.Walk JS/TS files and check @wire decorators for inline gql template literals, extracting to getters
- 5.Run Komaci ESLint analyzer: scripts/run-komaci.sh path/to/component.js (or manual npx eslint invocation)
- 6.Group ESLint findings by ruleId and look up remediations in Komaci ESLint Reviewer reference
- 7.Produce report with findings grouped by reviewer, including file:line:column, description, intent, and suggested action
- 8.Apply fixes directly or defer conflicts with non-offline behavior to the deferred list
Use cases
- Preparing an LWC for offline deployment to Salesforce Mobile App Plus
- Auditing existing components for offline priming failures before mobile release
- Investigating offline data graph errors reported by the analyzer
- Validating LWC compliance against @salesforce/eslint-plugin-lwc-graph-analyzer recommended ruleset
- Remediating components that fail offline priming in Field Service Mobile App
- Salesforce mobile developers shipping to offline-enabled mobile apps
- LWC developers preparing components for Salesforce Mobile App Plus
- Field Service Mobile App component authors
- Teams auditing offline priming compliance before production release
reviewing-lwc-mobile-offline FAQ
Use this skill only for mobile offline compatibility checks (Komaci priming). For generic LWC code review, security, RTL, or accessibility, use the appropriate domain skill.
Do not use this skill. Use the using-mobile-native-capabilities skill instead, which handles native mobile features.
It applies the @salesforce/eslint-plugin-lwc-graph-analyzer recommended ruleset with bundleAnalyzer processor enabled, flagging private wire properties, non-local reactive references, and getter side-effects that block offline data graph priming.
Yes. Use manual npx eslint invocation with the plugin and bundleAnalyzer processor. The script is a convenience wrapper; the plugin is the canonical source of Komaci rules.
Surface the conflict in the deferred list rather than silently rewriting. The developer may prioritize readability or non-offline functionality over immediate offline compliance.
Full instructions (SKILL.md)
Source of truth, from forcedotcom/sf-skills.
name: reviewing-lwc-mobile-offline
description: "Review a Lightning Web Component for mobile offline compatibility — the Komaci offline static analyzer that pre-primes the data graph for Salesforce Mobile App Plus and Field Service Mobile App. Produces a finding list with code-level fixes covering inline GraphQL queries in @wire configurations, modern lwc:if / lwc:elseif / lwc:else directives, and Komaci ESLint rule violations (private wire properties, non-local reactive references, getter side-effects). Use when the user asks for a "mobile offline review", "Komaci check", "offline priming audit", "offline priming failure", or "offline data graph error", or to validate an LWC against the @salesforce/eslint-plugin-lwc-graph-analyzer recommended ruleset. Do not use for generic LWC code review (use an appropriate domain review skill) or for building LWCs with native mobile capabilities (use using-mobile-native-capabilities)."
metadata:
version: "1.0"
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
using-mobile-native-capabilities. - 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 eslintwith the@salesforce/eslint-plugin-lwc-graph-analyzerplugin.
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:
- Inline GraphQL wire configuration: Inline GraphQL Reviewer
lwc:ifconditional rendering compatibility: lwc:if Reviewer- Komaci ESLint static analysis: Komaci ESLint Reviewer
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:elseflagged or absent. - Every
@wirereferencinggqlchecked; 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 eslintcannot find the plugin — install@salesforce/eslint-plugin-lwc-graph-analyzerin the workspace, or use a pinned local install path. The plugin is the canonical source of Komaci rules.bundleAnalyzerrelated 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
bundleAnalyzerwith empty rules). Some rules require the HTML to be present alongside the JS. - Findings duplicate
lwc:iffrom the dedicated reviewer — the Komaci plugin does not check templates; thelwc:ifcheck is HTML-only and comes from Step 3. Findings from Step 5 are JS-only.
Related skills
More from forcedotcom/sf-skills and the wider catalog.

running-apex-tests
Run Apex tests, analyze coverage, and fix failures with structured test-fix loops.

running-code-analyzer
Scan Salesforce code for security, performance, and quality violations across all engines (PMD, ESLint, CPD, RetireJS, Flow, SFGE, ApexGuru).

searching-media
Route and execute media searches across Salesforce CMS, Data 360, and other sources.

segmenting-datacloud
Create, publish, and troubleshoot Salesforce Data Cloud segments and calculated insights.

switching-org
Switch the active Salesforce org for CLI commands using the Salesforce CLI.

testing-agentforce
Write, run, and analyze structured test suites for Agentforce agents.