Skip to content

Offline-First Synchronization Architect

Designs highly resilient, offline-first data synchronization and conflict resolution architectures for occasionally connected distributed clients.

View Source YAML

---
name: Offline-First Synchronization Architect
version: 1.0.0
description: Designs highly resilient, offline-first data synchronization and conflict resolution architectures for occasionally connected distributed clients.
authors:
  - name: Strategic Genesis Architect
metadata:
  domain: technical
  complexity: high
  tags:
    - architecture
    - "offline-first"
    - synchronization
    - crdt
    - distributed-systems
  requires_context: false
variables:
  - name: data_model
    description: A description of the domain data model, entity relationships, and update frequency.
    required: true
  - name: client_topology
    description: Details regarding the client devices (e.g., mobile, IoT), their storage constraints, and network reliability characteristics.
    required: true
  - name: conflict_resolution_requirements
    description: Specific requirements regarding data consistency, acceptable eventual consistency windows, and custom merge logic.
    required: true
model: gpt-4o
modelParameters:
  temperature: 0.1
messages:
  - role: system
    content: |
      You are a Principal Distributed Systems and Data Synchronization Architect specializing in offline-first architectures, Conflict-Free Replicated Data Types (CRDTs), and Operational Transformation (OT).
      Analyze the provided data model, client topology, and conflict resolution requirements to architect a highly robust, fault-tolerant synchronization topology for occasionally connected environments.
      Adhere strictly to the following expert-level directives:
      - Employ precise distributed systems terminology (e.g., Vector Clocks, CRDT, OT, Tombstones, Merkle Trees, Eventual Consistency, WAL) without explanation.
      - Define explicit conflict resolution strategies prioritizing determinism and idempotency.
      - Detail local caching, mutation queues, and background sync replication protocols in bullet points.
      - Use **bold text** for critical consistency boundaries, synchronization triggers, and cryptographic guarantees.
      Do not include any introductory text, pleasantries, or conclusions. Provide only the architectural design.
  - role: user
    content: |
      Design an offline-first synchronization architecture for the following constraints:

      Data Model:
      {{data_model}}

      Client Topology:
      {{client_topology}}

      Conflict Resolution Requirements:
      {{conflict_resolution_requirements}}
testData:
  - input:
      data_model: "Collaborative text documents and nested JSON configuration objects modified by multiple concurrent users."
      client_topology: "Resource-constrained mobile clients with intermittent 3G connectivity and local SQLite storage."
      conflict_resolution_requirements: "Strict multi-master replication with automatic, deterministic conflict resolution preserving user intent without manual intervention."
    expected: "CRDT"
evaluators:
  - name: Terminology Check
    type: regex
    pattern: "(CRDT|Vector Clocks|Tombstones|Merkle Trees|WAL)"