temporal-data
БесплатноБез исполняемых скриптовНе проверенSystem-time versioned (temporal) table patterns. Use when working with system_from/system_to columns, as-of queries, non-destructive updates, or temporal…
от motlin★ 20 звёзд на GitHubОб этом скилле
Temporal Data Patterns
This skill covers system time (transaction time) only. For valid time and bitemporal patterns, see the Liftwizard temporal docs and the Klass DSL.
Core Principles
- Immutability: writes are append-only, except for
system_to. - Contiguous timeline: a new row's
system_fromequals the old row'ssystem_to, forming an unbroken chain of versions per entity. - Far-future sentinel over NULL: use a far-future value (
9999-12-31 23:59:59.999, or253402300799999as epoch milliseconds) for open-ended records. This allows NOT NULL constraints, composite primary keys, and uniform queries. - Sub-second precision: store
system_fromandsystem_towith millisecond precision or finer. Two versions of one entity within the same unit of precision share asystem_fromand collide on the unique index, and upstream timestamps such as JavaScript'sDate.now()and Reladomo'sTIMESTAMPare already in milliseconds. Whole seconds are acceptable only when writes to one entity are guaranteed to be at least a second apart. - Deduplication: before a phase-out / phase-in, compare incoming data with the current row and leave it untouched if unchanged. Adjacent identical rows produce false changes in history queries and diffs.
- Universal: every table is temporal by default. Temporality sits outside the domain model, so rollback restores everything (data, settings, account state) to the same instant. The only exceptions are the two in Exceptions to universal temporality.
- No JSON columns: model every field as a typed column or child table, including upstream fields the app does not read yet. Unread fields point at unimplemented features.
- One timestamp per unit of work: the application takes the current UTC time once per logical unit of work and stamps every
system_from/system_toit writes with that identical value, even when the ORM splits the unit across several transactions (a self-referential hierarchy, a bulk update). The database does not issue timestamps. - No artificial ordering: two units may share a timestamp, and timestamps need not increase in commit order; units that take different amounts of time land out of order. Never bump a timestamp (for example
max(now, last + 1)) to make it unique or monotonic. - Never shift a timestamp to dodge a collision: when a write would give one entity two versions with the same
system_from, never add 1 ms, 1 ns or any other offset, and never use a clock that returnsmax(now, last + 1). A shifted timestamp records an instant at which nothing happened, breaks the rule thatsystem_fromis when the database learned the fact, and drifts ahead of the wall clock under bursts. A collision is information: either one logical change was split into several units of work (merge them into one), a caller or test wrote the same entity twice in one clock tick (fix the caller), or the encoding is too coarse (store finer precision). Let the unique index fail loudly until the cause is fixed.
Cost
Temporal tables are bigger than plain tables, but used well they are cheaper to keep in sync, because work scales with what changed rather than with how much data exists. Used badly, they cost far more. On stores that bill per row read or written, such as Cloudflare Durable Objects and D1, DynamoDB, Firestore and most serverless databases, that difference is the bill, and index rows usually count as rows written.
- Sync and catch up from a high watermark: ask for rows whose
system_from(orsystem_to, for phase-outs) is newer than the last one seen, as in thetemporal-data:temporal-cachingskill's global watermark. A run with nothing new reads an index range and writes nothing. Re-downloading or rescanning the full data set on a schedule to find changes costs every row, every run. - Deduplicate before writing: comparing incoming data with the current row and skipping unchanged records is what makes an unchanged sync write zero rows. Without it every sync rewrites the table and its indexes.
- No scratch tables per run: never insert a row per record into a working table (a seen-set, a staging copy) and delete it at the end. Each insert and delete is billed, along with every index row it touches. Derive what the run needs from the temporal rows or the source data, or keep it in memory.
- Scope every write and rescan to the unit of work: a batch rewrites only its own entities, never everything earlier batches already wrote.
- Make repeated failures cheap: a retry or failure path that rewrites the same rows with the same values (an error column, an attempt counter) multiplies by every attempt. Skip the write when nothing changed, and stop a schedule that only a manual action can fix.
- Index the current-row queries: queries filter on the sentinel, such as `system_to =
Установить temporal-data в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл temporal-data?
System-time versioned (temporal) table patterns. Use when working with system_from/system_to columns, as-of queries, non-destructive updates, or temporal migrations.
Как установить скилл temporal-data?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл temporal-data запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic