constructive-history
Installation
SKILL.md
Constructive History
Per-row version history at every layer — database trigger, GraphQL API, and SDK. Two pieces compose:
DataHistory— a blueprint node that creates an append-only<table>_historycompanion. Every INSERT/UPDATE/DELETE on the source row appends a version row via anAFTERtrigger (NEW-append: INSERT/UPDATE store the new row, DELETE stores a tombstone). The history table copies the source columns as plain nullable columns with no keys or constraints, plus arecorded_attimestamp and ahistory_opmarker. Optionally range-partitioned byrecorded_at(pg_partman) with a retention window so history is kept for a while — not forever.graphile-history— the PostGraphile v5 plugin that discovers@history-tagged tables and adds version reads (history,versionAt,versionsBetween) and arestore<Table>Versionmutation, all enforced under the caller's RLS.
When to Apply
Use this skill when:
- Adding an audit/version log to a table (who-changed-what-when)
- Querying a row as it looked at a past instant (point-in-time / as-of reads)
- Listing every version of a row within a time window
- Rolling a row back to a previous version (restore/revert)
- Configuring history retention / partitioning so old versions age out