بنقرة واحدة
crdt
Loro CRDT state management with loro-mirror. Use when working on files in src/lib/crdt/.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Loro CRDT state management with loro-mirror. Use when working on files in src/lib/crdt/.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
UI component patterns for React 19, shadcn/ui, and Tailwind. Use when working on files in src/components/.
Playwright E2E testing patterns. Use when working on files in tests/e2e/.
CSV and OFX transaction import parsing. Use when working on files in src/lib/import/.
Real-time sync with Supabase, Loro CRDT, and IndexedDB. Use when working on files in src/lib/sync/.
tRPC v11 API layer with Zod and Ed25519 auth. Use when working on files in src/server/.
Client-side cryptography with libsodium. Use when working on files in src/lib/crypto/.
| name | crdt |
| description | Loro CRDT state management with loro-mirror. Use when working on files in src/lib/crdt/. |
// 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 }
}));
schema.ts, don't redeclaredeletedAt = Temporal.Now.instant(), never remove from documentundefined deletedAt means "not deleted" (falsy check: if (!entity.deletedAt))crypto.randomUUID() for IDs, Temporal.Now.instant() for timestampsrich-schema.ts transforms)Schema fields use richSchema.* helpers that apply bidirectional transforms between CRDT primitives
and domain types. The richSchema factory methods must be generic over O extends SchemaOptions to
preserve required: false optionality.
| richSchema helper | CRDT primitive | Domain type |
|---|---|---|
richSchema.PlainDate() | string | Temporal.PlainDate |
richSchema.Instant() | number | Temporal.Instant |
richSchema.MoneyMinorUnits() | number | MoneyMinorUnits |
richSchema.Percentage() | number | Percentage |
richSchema.CurrencyCode() | string | CurrencyCode |
richSchema.StringEnum(values) | string | Union literal type |
export const entitySchema = schema.LoroMap({
id: schema.String({ required: true }),
name: schema.String({ required: true }),
// Optional fields use { required: false } — value type becomes T | undefined
deletedAt: richSchema.Instant({ required: false })
});
useActiveTransactions() - excludes soft-deleteduseTransactions() - includes soft-deleteduseVaultAction() - for mutations