Cross-platform offline-first data management
Configures cross-platform offline storage solutions like WatermelonDB and Realm with sync architectures.
npx claudepluginhub a5c-ai/babysitterThis skill inherits all available tools. When active, it can use any tool Claude has access to.
README.mdThis skill provides cross-platform offline-first data management capabilities. It enables configuration of WatermelonDB, Realm, MMKV, and other offline storage solutions with sync queue architectures.
bash - Execute package managers and build toolsread - Analyze storage configurations and schemaswrite - Generate models and sync logicedit - Update storage implementationsglob - Search for storage filesgrep - Search for patternsSchema Definition
Sync Engine
Object Schemas
Realm Sync
Offline-First Patterns
Conflict Resolution
offline-first-architecture.js - Offline patternsrest-api-integration.js - API syncgraphql-apollo-integration.js - GraphQL sync// database/schema.ts
import { appSchema, tableSchema } from '@nozbe/watermelondb';
export const schema = appSchema({
version: 1,
tables: [
tableSchema({
name: 'posts',
columns: [
{ name: 'title', type: 'string' },
{ name: 'body', type: 'string' },
{ name: 'is_published', type: 'boolean' },
{ name: 'author_id', type: 'string', isIndexed: true },
{ name: 'created_at', type: 'number' },
{ name: 'updated_at', type: 'number' },
],
}),
tableSchema({
name: 'comments',
columns: [
{ name: 'body', type: 'string' },
{ name: 'post_id', type: 'string', isIndexed: true },
{ name: 'author_id', type: 'string' },
{ name: 'created_at', type: 'number' },
],
}),
],
});
// database/models/Post.ts
import { Model, Q } from '@nozbe/watermelondb';
import { field, date, children, relation } from '@nozbe/watermelondb/decorators';
export class Post extends Model {
static table = 'posts';
static associations = {
comments: { type: 'has_many', foreignKey: 'post_id' },
author: { type: 'belongs_to', key: 'author_id' },
};
@field('title') title!: string;
@field('body') body!: string;
@field('is_published') isPublished!: boolean;
@field('author_id') authorId!: string;
@date('created_at') createdAt!: Date;
@date('updated_at') updatedAt!: Date;
@children('comments') comments!: Query<Comment>;
@relation('users', 'author_id') author!: Relation<User>;
}
// sync/SyncQueue.ts
interface SyncOperation {
id: string;
type: 'create' | 'update' | 'delete';
entity: string;
payload: any;
timestamp: number;
retryCount: number;
}
class SyncQueue {
private queue: SyncOperation[] = [];
private isProcessing = false;
async enqueue(operation: Omit<SyncOperation, 'id' | 'timestamp' | 'retryCount'>) {
const op: SyncOperation = {
...operation,
id: uuid(),
timestamp: Date.now(),
retryCount: 0,
};
this.queue.push(op);
await this.persistQueue();
this.processQueue();
}
private async processQueue() {
if (this.isProcessing || this.queue.length === 0) return;
const isOnline = await NetInfo.fetch().then(state => state.isConnected);
if (!isOnline) return;
this.isProcessing = true;
while (this.queue.length > 0) {
const operation = this.queue[0];
try {
await this.executeOperation(operation);
this.queue.shift();
await this.persistQueue();
} catch (error) {
operation.retryCount++;
if (operation.retryCount >= 3) {
this.queue.shift();
await this.logFailedOperation(operation, error);
}
break;
}
}
this.isProcessing = false;
}
private async executeOperation(operation: SyncOperation) {
switch (operation.type) {
case 'create':
return api.post(`/${operation.entity}`, operation.payload);
case 'update':
return api.put(`/${operation.entity}/${operation.payload.id}`, operation.payload);
case 'delete':
return api.delete(`/${operation.entity}/${operation.payload.id}`);
}
}
}
ios-persistence - iOS Core Dataandroid-room - Android Roomgraphql-mobile - GraphQL offlineActivates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.
Search, retrieve, and install Agent Skills from the prompts.chat registry using MCP tools. Use when the user asks to find skills, browse skill catalogs, install a skill for Claude, or extend Claude's capabilities with reusable AI agent components.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.