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

references/inline-graphql.md

View on GitHub
# Inline GraphQL Wire Configuration

## Framework for the analysis

The Komaci offline static analysis engine requires GraphQL queries to be **extracted from `@wire` adapter configurations into separate getter methods** for proper offline data priming. Inline GraphQL query strings within `@wire` adapter calls prevent the static analysis engine from understanding and optimizing data dependencies for offline scenarios.

**FOCUS:** Only report improper usage of GraphQL queries and variables accessed outside of a component getter function. Do not provide feedback on any other adapter use.

Key points to consider:

- GraphQL queries and variables MUST be accessed from a getter function within the component class.
- GraphQL queries MUST NOT be inlined in the wire adapter configuration object.
- GraphQL variables MUST NOT be inlined in the wire adapter configuration object.
- GraphQL queries MUST NOT be defined as top-level constants.
- GraphQL variables MUST NOT be defined as top-level constants.
- If the query is already in a getter function, do not provide feedback.
- If the component does not use GraphQL, does not import GraphQL, does not use `@wire`, or does not contain a query in a `gql` template literal, do not provide feedback or analyze further.

## Request

Review the JavaScript files for `@wire` decorators with inline GraphQL queries:

1. Identify `@wire` decorators that use GraphQL wire adapters.
2. Look for literal GraphQL query strings within the wire configuration objects.
3. Check for template literals or string literals containing GraphQL syntax.
4. Analyze the complexity and reusability of the inline queries.
5. Determine appropriate getter method names for extracted queries.
6. Validate that extraction will not break existing functionality.
7. Report each violation with specific refactoring guidance.

For each violation, provide a strong suggested action that names a concrete getter — e.g. _"The query MUST be extracted into a getter function called `fooQuery` and accessed by the config `@wire(graphql, { query: '$fooQuery' })`."_

Rules to follow:

- If no action is required, return an empty list. Do not return null or any other value — return an empty array.
- Keep issues concise; avoid duplicated issues or unnecessary analysis for things that are not real violations.
- Stick to the instructions for the specific reviewer in scope. Issues outside that scope will be analyzed by other reviewers.
- For each violation, provide:
  - The exact violation type as defined by the reviewer in scope.
  - A description of why it is a problem in the context of mobile offline priming.
  - An intent analysis explaining what the developer likely intended.
  - A suggested action with concrete code-level remediation.
- Do not make assumptions about other components that may be referenced.
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