Skip to content

forcedotcom/sf-skills / plugins/builder/mobile-development/skills/mobile-platform-offline-validate

mobile-platform-offline-validate

Flagged

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`).

FileKindSize
SKILL.mdskill md7.8 KB
references/grounding.mdmarkdown1.0 KB
references/inline-graphql.mdmarkdown2.8 KB
references/komaci-eslint.mdmarkdown7.6 KB
references/lwc-if.mdmarkdown3.2 KB
scripts/komaci.config.mjsscript579 B
scripts/package.jsonmanifest286 B
scripts/run-komaci.shexecutablescript2.3 KB

scripts/run-komaci.sh

View on GitHub
#!/usr/bin/env bash
#
# Komaci offline static analysis runner
#
# Runs @salesforce/eslint-plugin-lwc-graph-analyzer against an LWC bundle
# with the plugin's recommended ruleset and emits ESLint's JSON
# formatter output on stdout.
#
# The plugin's `bundleAnalyzer` processor expects the JS file to live
# next to its sibling HTML templates so the offline data graph can be
# resolved across the bundle.
#
# Plugin + ESLint versions are pinned in scripts/package.json and
# installed into scripts/node_modules on first run so the runner is
# isolated from whatever versions the host project happens to ship.
#
# Usage:
#   run-komaci.sh path/to/component.js
#
# Arguments:
#   $1  Path to the LWC component's JS file (required). The component's
#       sibling HTML templates must live in the same directory; the
#       plugin discovers them automatically via the bundle processor.
#
# Environment:
#   KOMACI_ESLINT_BIN   Override the eslint binary (default: scripts/node_modules/.bin/eslint)
#
# Output:
#   ESLint --format json on stdout. Non-zero exit if eslint reports
#   errors; the JSON is still emitted on stdout in either case.

set -euo pipefail

if [ $# -lt 1 ]; then
  echo "Usage: $0 path/to/component.js" >&2
  exit 2
fi

JS_PATH="$1"

if [ ! -f "$JS_PATH" ]; then
  echo "Error: $JS_PATH does not exist" >&2
  exit 2
fi

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
CONFIG_PATH="$SCRIPT_DIR/komaci.config.mjs"
PLUGIN_DIR="$SCRIPT_DIR/node_modules/@salesforce/eslint-plugin-lwc-graph-analyzer"

# Install the pinned ESLint + plugin versions on first run. We resolve
# them from SCRIPT_DIR so Node ESM picks up the right copy regardless
# of the caller's cwd or the host project's node_modules.
if [ ! -d "$PLUGIN_DIR" ]; then
  echo "Installing pinned Komaci runner deps in $SCRIPT_DIR ..." >&2
  (cd "$SCRIPT_DIR" && npm install --no-fund --no-save --silent) >&2
fi

ESLINT="${KOMACI_ESLINT_BIN:-$SCRIPT_DIR/node_modules/.bin/eslint}"

# Run eslint with the plugin's recommended config and emit JSON.
# `--no-config-lookup` ignores any host-project ESLint config so only
# the Komaci recommended ruleset applies; `--no-error-on-unmatched-pattern`
# avoids hard failure if the component path is empty.
$ESLINT \
  --no-config-lookup \
  --no-error-on-unmatched-pattern \
  --config "$CONFIG_PATH" \
  --format json \
  "$JS_PATH"
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall