fsl-offline-architecture
Use this skill when designing FSL Mobile offline-first architecture: data priming strategy, priming limits, conflict resolution patterns, and sync failure handling. Trigger keywords: FSL offline priming, briefcase sync FSL, offline data limits, conflict resolution MERGE_ACCEPT_YOURS, ghost records FSL. NOT for LWC offline-and-mobile (generic LWC offline, covered by lwc/lwc-offline-and-mobile), standard Salesforce Mobile App offline, or Experience Cloud offline.
Best use case
fsl-offline-architecture is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Use this skill when designing FSL Mobile offline-first architecture: data priming strategy, priming limits, conflict resolution patterns, and sync failure handling. Trigger keywords: FSL offline priming, briefcase sync FSL, offline data limits, conflict resolution MERGE_ACCEPT_YOURS, ghost records FSL. NOT for LWC offline-and-mobile (generic LWC offline, covered by lwc/lwc-offline-and-mobile), standard Salesforce Mobile App offline, or Experience Cloud offline.
Teams using fsl-offline-architecture should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/fsl-offline-architecture/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How fsl-offline-architecture Compares
| Feature / Agent | fsl-offline-architecture | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Use this skill when designing FSL Mobile offline-first architecture: data priming strategy, priming limits, conflict resolution patterns, and sync failure handling. Trigger keywords: FSL offline priming, briefcase sync FSL, offline data limits, conflict resolution MERGE_ACCEPT_YOURS, ghost records FSL. NOT for LWC offline-and-mobile (generic LWC offline, covered by lwc/lwc-offline-and-mobile), standard Salesforce Mobile App offline, or Experience Cloud offline.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# FSL Offline Architecture
This skill activates when an architect needs to design the offline data strategy for FSL Mobile: how records are primed to the device before the work day, how conflicts are resolved when technicians sync after working offline, and how to handle FSL-specific offline constraints. FSL's offline model has hard limits, specific priming hierarchy, and conflict resolution behaviors that differ from generic Salesforce offline patterns.
---
## Before Starting
Gather this context before working on anything in this domain:
- Determine the expected number of parent Work Orders per technician per day and their child record depth (WOLI, Assets, Product). This drives priming volume calculation against the hard limits.
- Decide on conflict resolution strategy before go-live: MERGE_ACCEPT_YOURS (local device wins — default) or MERGE_FAIL_IF_CONFLICT (force manual resolution). This is a design decision, not a configuration option that can be changed post-deployment without impact.
- Understand connectivity patterns for the target deployment. Intermittent connectivity (cell coverage gaps, basements, industrial sites) drives the design toward larger priming windows and more aggressive prefetch.
- Confirm whether server-side automation (Apex triggers, validation rules) needs to fire at job completion or can be deferred to sync time.
---
## Core Concepts
### FSL Offline Priming Hierarchy
FSL Mobile primes (downloads) records to the device before the work day in a specific hierarchy:
```
ServiceResource (the technician)
└── ServiceAppointments (today's schedule + near-future)
└── WorkOrders
└── WorkOrderLineItems
└── Assets (if linked)
└── Related records (custom objects with lookups)
```
The priming engine traverses this hierarchy automatically. Records outside this hierarchy are not primed unless explicitly configured.
**Hard limits:**
- **1,000 page references** — Each related object traversal counts as a page reference. Exceeding 1,000 causes silent failure (not an error) — records beyond the limit are simply not primed.
- **50 records per related list** — Only the first 50 records of any related list are primed.
- **Recommended maximum:** 100 parent Work Orders with 10 child records each
These limits are per-device sync session, not per technician record count.
### Conflict Resolution
When a technician syncs after working offline, two conflict resolution strategies are available:
| Strategy | Behavior | When to Use |
|---|---|---|
| `MERGE_ACCEPT_YOURS` | Local device changes win | Default. Use when technician's field data should override office changes during offline period |
| `MERGE_FAIL_IF_CONFLICT` | Sync fails on conflict — requires manual resolution | Use when data accuracy is critical and offline/server versions cannot be auto-merged |
`MERGE_ACCEPT_YOURS` is the default and most common. It means if a dispatcher updated a Work Order status in Salesforce while a technician was offline updating the same record, the technician's version wins after sync. This can cause unexpected overwrites.
### Server-Side Logic Is Deferred to Sync
**Critical architectural constraint:** Apex triggers, validation rules, and workflow rules do NOT fire when a technician updates records offline. They fire when the device syncs with the server.
Design implications:
- Validation rules that prevent incomplete data cannot catch offline errors until sync
- Apex triggers that send notifications or create related records don't fire in real-time during offline work
- FSL logic (scheduling engine re-evaluation, status transitions) fires at sync time, not at the moment of offline change
Build post-sync validation logic that reviews records updated during offline sessions.
### Ghost Records
A "ghost record" is a record that was deleted on the server while a technician's device was offline. When the device syncs, the deleted record still appears on the device until `cleanResyncGhosts()` is called via the FSL Mobile SDK.
Ghost records can cause technicians to:
- See appointments that were cancelled
- Navigate to Work Orders that no longer exist
- Attempt status transitions on deleted records (which silently fail)
Ghost record cleanup should be triggered automatically after each sync session via an SDK integration point.
---
## Common Patterns
### Priming Volume Design
**When to use:** Before any FSL Mobile deployment, to verify the implementation stays within priming limits.
**How it works:**
1. Calculate: average WOs per technician per day × average WOLIs per WO × average related objects per WOLI
2. Compare to the 1,000 page reference limit
3. If near the limit: reduce priming depth by excluding non-essential related objects
4. Test with a production-sized data load in sandbox before go-live
Example: 10 WOs × 8 WOLIs × 5 related records = 400 page references (safe). 10 WOs × 20 WOLIs × 6 related records = 1,200 page references (exceeds limit — silent failure).
### Conflict Resolution Strategy Selection
**When to use:** Any FSL Mobile deployment — decision must be made before go-live.
**Decision criteria:**
- If dispatcher office updates to active appointments are rare: MERGE_ACCEPT_YOURS (default)
- If dispatchers frequently update appointments technicians are actively working: MERGE_FAIL_IF_CONFLICT + build a conflict resolution UI
- If regulatory requirements mandate field data accuracy: MERGE_FAIL_IF_CONFLICT
---
## Decision Guidance
| Situation | Recommended Approach | Reason |
|---|---|---|
| High record volume per technician | Stay under 100 WOs / 10 children each | Keeps page references under 1,000 |
| Dispatcher + technician concurrent edits | MERGE_FAIL_IF_CONFLICT + resolution UI | Prevents silent data overwrites |
| Field-first operations (technician data primary) | MERGE_ACCEPT_YOURS (default) | Technician's offline work takes precedence |
| Ghost records persisting | Trigger cleanResyncGhosts() after each sync | Only mechanism to remove ghost records |
| Validation rules needed at job completion | Accept sync-time firing; build post-sync review | VRs don't fire offline — architectural reality |
| Custom object needs offline access | Add to priming hierarchy via Briefcase configuration | Only primed objects are available offline |
---
## Recommended Workflow
1. **Calculate priming volume** — Estimate page references for the average technician's daily schedule. Confirm within 1,000 page reference limit.
2. **Define conflict resolution strategy** — Choose MERGE_ACCEPT_YOURS or MERGE_FAIL_IF_CONFLICT. Document the decision and its implications for operations team.
3. **Design ghost record cleanup** — Integrate `cleanResyncGhosts()` into the post-sync SDK workflow.
4. **Map server-side logic to sync events** — List all Apex triggers and validation rules that touch FSL objects. Document that they fire at sync, not offline. Add post-sync review steps where needed.
5. **Configure Briefcase priming** — Configure which objects and record sets are primed. Test with production-representative data volume in sandbox.
6. **Test offline scenarios** — Simulate a 4-hour full-offline session with concurrent server edits. Verify sync behavior, conflict resolution, and ghost record handling.
7. **Train dispatchers on offline behavior** — Dispatchers must understand that changes to a technician's records during an offline session may be overwritten on sync (MERGE_ACCEPT_YOURS) or require manual resolution (MERGE_FAIL_IF_CONFLICT).
---
## Review Checklist
- [ ] Priming volume calculated and confirmed under 1,000 page reference limit
- [ ] Conflict resolution strategy decided and documented
- [ ] Ghost record cleanup (`cleanResyncGhosts()`) triggered post-sync
- [ ] Server-side automation (triggers, VRs) impact of sync-time firing understood
- [ ] Briefcase priming configured and tested with production-representative data
- [ ] Offline + sync tested with concurrent server-side edits
- [ ] Dispatcher team trained on offline sync behavior
---
## Salesforce-Specific Gotchas
Non-obvious platform behaviors that cause real production problems:
1. **1,000 page reference limit causes silent failure** — Records beyond the limit are simply not primed. There is no error. Technicians discover missing data at the job site.
2. **Ghost records persist until cleanResyncGhosts() is explicitly called** — Deleted server records stay on device. Technicians see cancelled appointments as active until cleanup is triggered.
3. **Apex triggers and validation rules fire at sync — not during offline work** — Data errors that would be caught by VRs in online mode pass silently during offline work and only surface at sync.
4. **MERGE_ACCEPT_YOURS (default) overwrites server changes with device changes** — This is correct most of the time but can silently overwrite dispatch-center updates made while the technician was offline.
5. **50 records per related list hard limit** — Only the first 50 related records are primed. Work orders with more than 50 line items will have incomplete data on the device.
---
## Output Artifacts
| Artifact | Description |
|---|---|
| Priming volume analysis | Page reference calculation for average technician schedule |
| Conflict resolution design decision | Strategy choice and operational impact documentation |
| Offline scenario test plan | Test cases for offline work, sync, conflict, and ghost record scenarios |
---
## Related Skills
- apex/fsl-custom-actions-mobile — Custom LWC actions that operate in the offline FSL Mobile context
- architect/fsl-integration-patterns — Integration patterns that need to account for sync-time trigger firingRelated Skills
lwc-offline-and-mobile
Use when designing or reviewing Lightning Web Components for the Salesforce mobile app, mobile device capabilities, or offline-aware behavior. Triggers: 'lightning/mobileCapabilities', 'mobile lwc', 'offline lwc', 'supported mobile app only', 'barcode scanner availability'. NOT for Mobile SDK or fully native app architecture unless the decision is whether LWC in the Salesforce mobile app is sufficient.
lwc-mobile-offline-and-briefcase
Use when designing LWCs that must work offline in the standard Salesforce Mobile App, and when configuring Briefcase Builder rules to prime records onto user devices. Covers form-factor detection (`@salesforce/client/formFactor`), Lightning Data Service offline-cache behavior, Briefcase priming-rule design, conflict resolution on reconnect, and the legacy SmartStore / IndexedDB picture for context. Triggers: 'briefcase builder rule design', 'lwc not working offline', 'how do I prime records to user devices', 'sync conflict on reconnect', 'offline draft persistence in lwc'. NOT for Field Service Mobile offline priming (use admin/fsl-mobile-app-setup or architect/fsl-offline-architecture — FSL has its own priming pipeline). NOT for general LWC mobile container patterns / device APIs (use lwc/lwc-offline-and-mobile).
salesforce-files-architecture
Working with Salesforce Files at the data layer — `ContentVersion` (the binary content + version metadata), `ContentDocument` (the parent / shareable handle), `ContentDocumentLink` (the sharing / parent-record join), the 2 GB single-file size limit and the 10 MB feed-attached limit, the deprecated `Attachment` object, the `Document` object (Classic-only), and Files Connect for external file sources. Covers SOQL patterns to enumerate files attached to a record, Apex insert / link patterns, sharing implications of `ShareType` and `Visibility`, and the migration path from the legacy Attachment object. NOT for LWC file upload UI components (see lwc/lwc-file-upload-patterns), NOT for static-resource bundling (see lwc/static-resources).
nonprofit-data-architecture
Use this skill when designing or querying the NPSP data model — constituent 360, household accounts, giving history rollups, and program participation. Trigger keywords: NPSP data model, household account, constituent record, giving rollups, CRLP, program engagement, ServiceDelivery, npo02__ fields. NOT for standard data model design, Nonprofit Cloud (NPC) data model, FSC household groups, or platform data modeling outside the NPSP context.
wealth-management-architecture
Use this skill when designing or reviewing a Salesforce Financial Services Cloud (FSC) wealth management platform — covering advisor workspace configuration, client portal setup, portfolio data integration, Compliant Data Sharing, and FSC feature enablement decisions. NOT for investment product advice, financial planning calculations, or FSC Health Cloud configurations.
subscription-management-architecture
Use when designing or evaluating Salesforce CPQ subscription lifecycle architecture: amendment flow, renewal automation, co-termination design, or billing integration at the contract level. Trigger keywords: amendment architecture, renewal automation, co-termination design, subscription ledger, large-scale amendment, billing schedule, swap pattern, SBQQ__Subscription__c. NOT for billing setup, standard Salesforce contracts without CPQ, or Revenue Cloud advanced order management.
service-cloud-architecture
Use when designing a Service Cloud solution end-to-end: channel strategy (phone, email, chat, messaging, social), routing model (queue-based vs skills-based Omni-Channel), knowledge strategy, entitlement and SLA enforcement, Einstein Bot / Agentforce deflection, and integration points. Triggers: service cloud architecture, case routing design, omni-channel strategy, contact center design, channel strategy, knowledge deflection, service console architecture. NOT for individual feature configuration (use admin/case-management), NOT for Einstein Bot conversation design (use agentforce/einstein-bot-architecture), NOT for telephony CTI implementation details.
security-architecture-review
Use when conducting a dedicated security architecture review of a Salesforce org — assessing sharing model completeness, FLS/CRUD enforcement, Apex security patterns, exposed API surface, Connected App policies, and Shield readiness. Produces a structured findings report with severity ratings (Critical/High/Medium/Low) and a 20+ point review checklist. Triggers: security architecture review, org security posture, sharing model audit, FLS coverage review, Connected App security, Shield assessment, org security health deep-dive, HIPAA or PCI security controls Salesforce. NOT for implementing security fixes (use security/* skills). NOT for the Salesforce Security Health Check UI (use security-health-check skill). NOT for a full WAF review across all pillars (use well-architected-review).
salesforce-shield-architecture
Salesforce Shield as an architectural choice — Platform Encryption + Event Monitoring + Field Audit Trail as three SEPARATELY-LICENSED components, none of which ship in any standard edition. Covers BYOK vs Cache-Only Key Service (CCKM) tradeoffs, probabilistic vs deterministic encryption schemes, the field-type encryption blocklist (Formula, Roll-Up Summary, indexed External ID), Field Audit Trail's 10-year retention model, and why every Shield design starts with a license confirmation. NOT for individual feature setup steps (see security/platform-encryption, security/event-monitoring, security/field-audit-trail), NOT for compliance certification mapping (HIPAA / FedRAMP / PCI specifics).
sales-cloud-architecture
Use when designing or reviewing a Sales Cloud solution architecture covering process automation strategy, integration points, data model decisions, and scalability planning. Triggers: 'design a Sales Cloud architecture for enterprise org', 'Sales Cloud data model and automation strategy', 'how to architect Sales Cloud for high-volume pipeline management'. NOT for individual feature configuration (use admin/opportunity-management or admin/lead-management), NOT for CPQ-specific decisions (use architect/cpq-vs-standard-products-decision), NOT for integration implementation details (use architect/sales-cloud-integration-patterns).
revenue-cloud-architecture
Architecting on Salesforce Revenue Cloud (Revenue Lifecycle Management — RLM, the successor to CPQ-Plus + Billing). Covers the five RLM domains (Product Catalog & Pricing, Transaction Management, Contract Lifecycle Management, Order-to-Cash, Billing), the canonical data model (Product2 / PricebookEntry / Quote / Order / OrderItem / Contract / Asset / BillingSchedule / Invoice / LegalEntity), multi-entity scoping via LegalEntity, the RLM ↔ ERP integration patterns (CDC + MuleSoft preferred over point-to-point trigger callouts), and the disambiguation between native RLM and the legacy `blng__` Salesforce Billing managed package and `SBQQ__` CPQ classic. NOT for declarative CPQ classic config (see omnistudio/cpq-classic-config), NOT for Subscription Management billing patterns predating RLM (see architect/cpq-architecture-patterns).
payer-vs-provider-architecture
Use this skill when designing or evaluating a Health Cloud implementation to determine whether the org serves a payer (health insurer), a provider (care delivery organization), or both — and to derive the correct object model, PSL matrix, and feature activation accordingly. Triggers: 'should we use MemberPlan or ClinicalEncounter', 'payer vs provider Health Cloud', 'which Health Cloud objects does an insurer use', 'setting up a Health Cloud org for a hospital vs a health plan', 'Provider Relationship Management vs clinical provider'. NOT for individual feature implementation within an already-classified payer or provider org, and NOT for Salesforce Health Cloud implementations that are clearly a single deployment type with no cross-sector ambiguity.