Skip to main content
skill CX Codex

mobile-platform-offline-validate — Claude Code Skill

Audits Lightning Web Components for Komaci offline priming compatibility in Salesforce mobile apps and generates code-level fixes.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add forcedotcom/sf-skills --skill mobile-platform-offline-validate -a claude-code
Open on GitHub

What mobile-platform-offline-validate does

The skill runs static compliance checks on Lightning Web Component bundles for Komaci data graph priming in Salesforce Mobile App Plus and Field Service Mobile App. In HTML templates, it flags lwc:if and lwc:else directives, translating them into compatible if:true and if:false structures. In JS and TS files, it spots inline GraphQL queries inside @wire configurations and extracts them into dedicated getters.

A complete validation pass requires a local setup with npm (9.0.0 or higher) and eslint (8.0.0 or higher). The helper script scripts/run-komaci.sh runs the linter with the bundleAnalyzer processor to check for private wire properties and getter side effects.

The static graph analysis fails immediately if @salesforce/eslint-plugin-lwc-graph-analyzer cannot be resolved in your working directory. This tool is built specifically for offline priming rules, so it does not replace general LWC reviews or native device capability setups.

What it helps with

  • convert modern lwc:if directives into legacy template conditionals
  • extract inline GraphQL queries from @wire configurations into getters
  • detect private wire properties and getter side-effects via Komaci ESLint rules
  • resolve data graph priming failures in Salesforce Mobile App Plus components

Example prompts for the agent

  • Run a mobile offline review on the modules/c/offlineAccountCard component.
  • Check this LWC for Komaci offline priming failures before deploying to Field Service.
  • Audit modules/c/workOrderSummary against the Komaci graph analyzer rules.

How to install mobile-platform-offline-validate

1Skills CLI (Vercel)

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

2Manually: put the files in place

~/.claude/skills/mobile-platform-offline-validate/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/mobile-platform-offline-validate/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about mobile-platform-offline-validate

How do I install mobile-platform-offline-validate in Claude Code?

Run npx skills add forcedotcom/sf-skills --skill mobile-platform-offline-validate -a claude-code.

What does mobile-platform-offline-validate do?

It audits Lightning Web Components for compatibility with Salesforce offline data priming. It inspects HTML conditionals, checks @wire GraphQL queries, and runs ESLint static analysis to locate graph errors.

What prerequisites are required to run this skill?

You need npm and npx version 9.0.0 or higher, eslint version 8.0.0 or higher, and the @salesforce/eslint-plugin-lwc-graph-analyzer package installed in the working directory.

Source text

SKILL.md · Apache-2.0
---
name: mobile-platform-offline-validate
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 `mobile-platform-native-capabilities-integrate`)."
metadata:
  version: "1.0"
  domains: ["Mobile"]
  relatedSkills:
    - "mobile-platform-native-capabilities-integrate"
  cliTools:
    - tool: ["eslint"]
      semver: ">=8.0.0"
    - tool: ["npm"]
      semver: ">=9.0.0"
    - tool: ["npx"]
      semver: ">=9.0.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 `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](references/grounding.md) 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](references/inline-graphql.md)
- `lwc:if` conditional rendering compatibility: [lwc:if Reviewer](references/lwc-if.md)
- Komaci ESLint static analysis: [Komaci ESLint Reviewer](references/komaci-eslint.md)

## 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](references/grounding.md) 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](references/lwc-if.md). 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](references/inline-graphql.md). 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.

```bash
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](references/komaci-eslint.md). 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:

```text
## 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.

© forcedotcom · Apache-2.0 · forcedotcom/sf-skills

Similar skills

Everything for Mobile →

From the same set167

omnistudio-omniscript-generate This skill builds and validates OmniScripts for guided, multi-step processes using Integration Procedures and Data Mappers. Use it for forms with branching logic and data flow. CX Codex +1 4,800installs omnistudio-datamapper-generate A skill that builds and reviews OmniStudio Data Mapper configs: Extract, Transform, Load and Turbo Extract, scored out of 100. Useful when mapping Salesforce object fields. CX Codex +1 4,800installs dx-code-analyzer-custom-rule-create Build custom Salesforce Code Analyzer rules for Regex, PMD, and ESLint. Use it when project standards require custom pattern bans or metadata XML governance. CX Codex +1 4,800installs commerce-b2b-store-create Walks you through creating a Commerce B2B store in Salesforce and pulls the generated storefront metadata into your repo. Useful when a storefront has to come out of an existing store. CX Codex +1 4,700installs mobile-platform-native-capabilities-integrate Guides an agent through building Salesforce LWCs that use native mobile features such as scanning, location, NFC, and payments. Use it for lightning/mobileCapabilities work. CX Codex +1 4,700installs commerce-b2b-open-code-components-replace Replaces out-of-the-box B2B Commerce components with open source equivalents in site metadata content.json. Or just reports the mappings when you don't want files touched. CX Codex +1 4,600installs commerce-b2b-open-code-components-integrate Pulls Salesforce B2B Commerce open source components from GitHub into a store's site metadata so they show up in the Experience Builder palette. CX Codex +1 4,600installs platform-policy-rule-generate Writes PolicyRuleDefinition and PolicyRuleDefinitionSet metadata XML for Salesforce Data Cloud: schema, category tree and pre-deploy checks. CX Codex +1 4,100installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor