Skip to content
Skills Library
Programming · Planning

adaptive-architecture

/adaptive-architecture

Design systems that evolve and work offline (Local-First, WASM, CRDTs). Use when: local-first, offline-first, crdt, automerge, yjs, wasm, webassembly, edge ai, resiliency.

Repository
gabbe ↗
Licence
CC-BY-4.0
Last repository change
24.10.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 24.10.2026, without references to retired models or APIs.

Licence

CC-BY-4.0, otwarta.

What it does and when to use it

Design systems that evolve and work offline (Local-First, WASM, CRDTs). Use when: local-first, offline-first, crdt, automerge, yjs, wasm, webassembly, edge ai, resiliency.

Original author description

Design systems that evolve and work offline (Local-First, WASM, CRDTs). Use when: local-first, offline-first, crdt, automerge, yjs, wasm, webassembly, edge ai, resiliency.

How it works

  1. Goal
  2. Capabilities
  3. Steps
  4. Deliverables
  5. Security & Guardrails
Original SKILL.md headings · 45 lines, 481 words
SKILL.md preview
---
name: adaptive-architecture
description: "Design systems that evolve and work offline (Local-First, WASM, CRDTs). Use when: local-first, offline-first, crdt, automerge, yjs, wasm, webassembly, edge ai, resiliency."
license: CC-BY-SA-4.0
metadata:
  source: "agents/skills/architecture/adaptive-architecture.skill.md"
  tags: "architecture"
  core: "false"
  context_cost: "medium"
---
# Adaptive Architecture Skill

## Goal
To build systems that are robust, responsive, and respectful of user data ownership.

## Capabilities

### 1. Local-First (The New Standard)
-   **CRDTs**: Conflict-free Replicated Data Types for automatic syncing (Automerge/Yjs).
-   **Sync Engines**: Replicache, ElectricSQL, PouchDB.
-   **Philosophy**: The *client* is the source of truth. The *server* is just a backup/relay.

### 2. Emerging Runtimes (WASM)
-   **Universal Compute**: Run the same Rust/Go code on Server, Browser, and IoT Edge.
-   **Sandboxing**: Securely run untrusted plugins (Extensibility).
-   **WASI**: WebAssembly System Interface for "Write Once, Run Anywhere" (really).

### 3. Edge AI Offloading
-   **Hybrid Inference**: Run small models (SLMs) on-device (latency/privacy) and large models (LLMs) in cloud.
-   **TensorFlow Lite / ONNX**: Optimizing models for mobile/edge.

## Steps
1.  **Data Ownership**: Give users their data (SQLite on device).
2.  **Optimistic UI**: UI updates immediately. Sync happens in background.
3.  **Conflict Resolution**: Use CRDTs to mathematically guarantee convergence.

## Deliverables
-   `sync-strategy.md`: Choice of CRDT vs Last-Write-Wins.
-   `wasm-plugin.rs`: Template for a WASM extension.
-   `local-db.schema`: Schema for client-side SQLite.

## Security & Guardrails

### 1. Skill Security (Adaptive Architecture)
- **CRDT Poisoning Defense**: When agents design Local-First applications, they must mandate cryptographic signing for all CRDT (Conflict-free Replicated Data Type) operations. If an offline client's operations are merged without signature verification, a compromised local device could inject malicious state changes that replicate across the entire network.
- **WASM Sandbox Escape Identification**: The agent must treat WebAssembly (WASM) not as a perfect security boundary, but as a defense-in-depth layer. Any architecture utilizing WASI must explicitly define the minimal required capability grants (e.g., denying arbitrary filesystem access to WASM plugins).

### 2. System Integration Security
- **Data Residency & Local-First**: If the system handles regulated data (HIPAA, GDPR), the agent must heavily scrutinize the offline-first design. Storing full SQLite replicas on untrusted user devices (phones, laptops) bypasses central data loss prevention (DLP) controls. The architecture must enforce aggressive local data expiration and mandatory on-device encryption at rest (e.g., SQLCipher).
- **Edge AI Prompt Leakage**: When offloading inference to the Edge (SLMs), the architecture must not rely on sensitive, system-level prompts or API keys that are transmitted to the local device. The agent must verify that the Edge AI component only processes localized, sandboxed logic without exposing central intellectual property.

### 3. LLM & Agent Guardrails
- **Offline Mode Hallucination**: The LLM might confidently propose an offline-first architecture for operations that inherently require synchronous, central validation (e.g., financial ledger transactions). The agent must aggressively push back against applying CRDTs or Local-First patterns to strong-consistency domains, preventing "double-spend" vulnerabilities by design.
- **Complexity Bias**: The agent must counter its own bias towards proposing complex, modern patterns (WASM + CRDTs + Edge AI) for simple problems. It must enforce a "Simplicity Veto" if the NFRs do not explicitly demand extreme disconnection tolerance, thereby reducing the overall attack surface.

Versions

The database has no other skills named adaptive-architecture.

Database snapshot: 13.11.2026 · package version f0c32aafa675 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 95architecture-crdts
    Use this skill when the user says 'CRDT', 'real-time collaboration', 'collaborative editing', 'Yjs', 'Automerge', 'local-first', 'offline sync with merge', 'conflict-free merge', 'operational transformation vs CRDT'. Designs replicated data that merges without coordination:…
  • 95wasm
    WebAssembly (WASM) integration, WASI, component model, Rust/Go to WASM compilation. Use when implementing WASM modules, browser/edge compute, or polyglot runtime.
  • 100yjs
    Apply Epicenter’s Yjs 14 patterns for row documents, transactions, persistence, and synchronization. Use when working with `@y/y`, CRDTs, collaborative editing, awareness, or Yjs storage and providers.
  • 90role-mobile:offline-first
    Expert guidance on offline-first mobile architecture — local database sync (WatermelonDB, Realm, Hive, SQLite), conflict resolution strategies (last-write-wins, CRDT), optimistic UI patterns, background sync (WorkManager, BGTaskScheduler), and connectivity detection. Use when…
  • 100flutter-wasm-web
    Use when building, optimizing, and deploying Flutter Web applications targeting WebAssembly (Wasm-GC) with modern JS interop.
  • 100yjs
    Yjs is a high-performance CRDT (Conflict-free Replicated Data Type) framework for building collaborative applications: shared types whose concurrent edits merge automatically. Use when a user asks to add real-time collaborative editing, shared cursors and presence, offline-first…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.