← ClaudeAtlas

flat-persistencelisted

Use when a flat-layered service reads or writes a datastore — its table definitions, its component-owned settings class, the repository class that owns each write's transaction and builds its statements, and where its migration history lives. Owns one data-access package per store named for its technology, the SQLAlchemy Core binding of `persistence`'s store-generic rules, application-minted time-ordered keys, the settings class and engine factory the process definition builds, and one migration directory per store at the distribution root, only where the service owns the schema. Transaction ownership, driver-error translation, constraint names, conflicts and ordering, batched writes, cursor reads and safe migrations are `persistence`'s. A hexagonal service's repository adapter behind a port is `hex-persistence`, in the `pyhouse-hex` plugin; the repository root hosting a data-access library several distributions share is `python-workspace`. - Also when asked for an upsert, an `ON CONFLICT` clause, a repositor
wntic/pyhouse · ★ 3 · AI & Automation · score 76
Install: claude install-skill wntic/pyhouse
# Flat Persistence — one package per store owns the data access The package a `flat-layered` service keeps its data access in — the *data access* role kind in that skill's import contract — named for the store's technology: `postgres/` for the relational store the templates bind. It holds the table definitions, the write path and the mapping from stored rows back to the service's own types. Where the service owns the store's schema, its migration history is data, not code, and sits at the distribution root under `migrations/` in a directory named for the same store. **Load `persistence` before writing any file below**; the templates satisfy its rules and do not restate them. It owns the store-generic obligations — the declared transaction owner, translation at this package's edge, generated constraint names, the pure row mapping, stored types, conflicts and ordering, deduplication left to the store, batched writes, paged reads, and migrations — and which of them bind, answered once there from the store's properties. This skill adds the flat family's shape around them — one package per store, its settings class and engine factory, the key policy and where the history lives — and binds all of it to one stack. Its own rules carry preconditions of the same kind. Rule 6 holds wherever the schema is versioned by migrations at all, rule 2 wherever the service mints keys, and the rest for any store. The default subject is **one distribution with one store**. **A service with a se