Agent skill
crdt
Loro CRDT state management with loro-mirror. Use when working on files in src/lib/crdt/.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/crdt
SKILL.md
CRDT Guidelines
Critical: Draft-Style Mutations Only
// CORRECT - mutate in place
setState((state) => {
state.transactions[id] = transaction;
});
// WRONG - returning new objects breaks change tracking
setState((state) => ({
...state,
transactions: { ...state.transactions, [id]: transaction },
}));
Rules
- Import types from
schema.ts, don't redeclare - Soft deletes: Set
deletedAttimestamp, never remove from document - Use
crypto.randomUUID()for IDs,Date.now()for timestamps
Schema Pattern
export const entitySchema = schema.LoroMap({
id: schema.String({ required: true }),
// ... fields
deletedAt: schema.Number(), // 0 = not deleted, >0 = timestamp
});
React Hooks
useActiveTransactions()- excludes soft-deleteduseTransactions()- includes soft-deleteduseVaultAction()- for mutations
Sync
- Updates encrypted before leaving client
- Loro handles versioning via version vectors
- Conflicts: last-write-wins per field
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?