---
id: TASK-118.3
title: Add multiplayer sync to rswag (collaborative swag design)
status: Done
assignee: []
created_date: '2026-03-16 00:05'
updated_date: '2026-03-16 00:50'
labels:
  - multiplayer
  - tier-2
milestone: Multiplayer Everything
dependencies: []
parent_task_id: TASK-118
priority: low
---

## Description

<!-- SECTION:DESCRIPTION:BEGIN -->
rswag is a client-side design canvas. Add Automerge sync so multiple space members can collaborate on swag designs.

## New files:
- `modules/rswag/schemas.ts` — SwagDoc with designs, assets, selectedTemplate
- `modules/rswag/local-first-client.ts` — CRUD: saveDesign, updateCanvas, addAsset

## Schema design:
```
SwagDoc {
  meta: { module: 'swag', collection: 'designs', version: 1 }
  designs: Record<string, { id, name, templateId, canvasState: string, createdBy, updatedAt }>
  activeDesignId: string
}
```

## Component updates:
- Init local-first client on connectedCallback
- Debounced save of canvas state changes
- Live cursor/selection indicators for collaborators (stretch)
<!-- SECTION:DESCRIPTION:END -->

## Acceptance Criteria
<!-- AC:BEGIN -->
- [ ] #1 Design state syncs between participants in real-time
- [ ] #2 Canvas changes debounced and saved via Automerge
- [ ] #3 Design list shared across space members
- [ ] #4 Demo mode works locally
<!-- AC:END -->

## Implementation Notes

<!-- SECTION:NOTES:BEGIN -->
schemas.ts + local-first-client.ts created
<!-- SECTION:NOTES:END -->
