automerge-swift-codable

Encode and decode Swift Codable models into Automerge documents.

Updated Mar 21, 2026
One-click install
npx skills add https://github.com/sitapix/automerge-swift-skills --skill automerge-swift-codable
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: automerge-swift-codable
Source: https://github.com/sitapix/automerge-swift-skills/tree/main/skills/automerge-swift-codable
Command: npx skills add https://github.com/sitapix/automerge-swift-skills --skill automerge-swift-codable

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Codable encoding/decoding of Swift models to Automerge documents, bridging high-level Codable usage with the core API and providing options for AutomergeText, Counter, and schema strategies.

Core Features & Use Cases

  • AutomergeEncoder/AutomergeDecoder integration for encoding and decoding Swift models.
  • Use AutomergeText for collaborative text fields and Counter for concurrent counters.
  • Guidance for choosing between Codable layer vs core API and adopting hybrid patterns for performance.

Quick Start

Define your Swift models as Codable and use AutomergeEncoder to encode them into a document, then decode with AutomergeDecoder to read back.

Frequently Asked Questions about automerge-swift-codable

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I encode and decode Swift Codable models to Automerge documents?

To encode and decode Swift Codable models to Automerge documents, you use AutomergeEncoder to write models into a document and AutomergeDecoder to read them back, bridging high-level Codable usage with the core API.

Can I use AutomergeText and Counter types with Swift Codable models?

Yes, you can use AutomergeText for collaborative text fields and Counter for concurrent counters when encoding Swift Codable models, integrating these specific Automerge types directly within your schema strategies.

What is the difference between using the Codable layer and the core API in Automerge?

The Codable layer bridges high-level Swift model serialization to Automerge documents, whereas the core API provides lower-level direct access. You can adopt hybrid patterns between them to optimize for performance and schema evolution.

How do I persist and sync complex Codable models across sessions and devices in Swift?

You persist and sync complex Codable models across sessions and devices by applying AutomergeEncoder and AutomergeDecoder to encode your Swift data structures directly into Automerge documents for synchronization.

When should I choose a hybrid pattern between Codable and the core API for Automerge?

You should choose a hybrid pattern between Codable and the core API when you need to balance high-level Codable model encoding with performance optimizations that require direct core API workflows within Automerge documents.

Does the Automerge Swift Codable layer support schema evolution for complex models?

Yes, the Automerge Swift Codable layer supports schema evolution by providing options for schema strategies, allowing your complex Codable models to evolve while being encoded and decoded within Automerge documents.