df-data-transform-lenslisted
Install: claude install-skill OneDro1d/dark-factory
# Dark Factory — The Data-Transform Lens
## Overview
An application is not a machine with features; it is a **data-transformation algorithm**: input data → transforms → output data, carrying state forward in time. Modelling a system this way collapses the design space and concentrates effort where the risk actually lives. Every other `df-*` skill is this model applied at one stage.
## The model: two primitives + two tags
- **Data node** = a schema + its single-datum invariants, carrying context:
- `location` — which store/system holds it now (not a trust signal).
- `origin` — where it came from (web/mobile/scan/API/another service). Travels for audit; **never** a trust signal.
- `authority` — is this the system-of-record for this fact? A ranking; the conflict resolver.
- `governance` — security class, retention, residency. Travels with the datum.
- **Transform** = `(state, inputs) → (state', outputs)`, tagged:
- `pure` — replayable, no marker needed.
- `effect` — irreversible world-change (send / charge / publish / notify / external write). **Must** carry an **idempotency key** (retry ≠ double-action) + a **compensation** path (the hand-written un-transform).
- **Validation rule** (tag over data) = a predicate that must hold. The only axis that changes architecture is **enforcement locus**:
- `LOCAL` — checkable at one ingress/commit with all operands present → **reject at the door**.
- `GLOBAL` — ranges across records/systems/time → **flag, then reconcile