Constructive Blueprints
Declarative schema provisioning — define complete domain schemas as portable JSONB documents that compile into PostgreSQL tables, relations, security policies, and modules.
When to Apply
Use this skill when:
- Defining a blueprint (tables, fields, relations, policies, entity types)
- Working with blueprint templates and the template marketplace
- Choosing a current backend module preset (
auth:hardened, b2b:storage, or full)
- Understanding Merkle-style definition hashing for deduplication and provenance
- Using
construct_blueprint() or copy_template_to_blueprint()
Core Concepts
Two-Layer Model
blueprint_template — shareable marketplace recipe. Immutable definition + metadata.
blueprint — owned, executable instance scoped to a database. Created from a template via copy_template_to_blueprint() or authored directly.
Blueprint Definition Format
The definition JSONB contains:
entity_types[] — Phase 0 entity provisioning (channels, teams, data rooms)
storage — Phase 0.5 app-level storage config
tables[] with nodes[], fields[], policies[] (using $type discriminators)
relations[] — inter-table relationships
achievements[] — gamification levels and rewards
limit_caps_defaults — per-scope default caps
membership_types[] — scope configurations (app, org, custom)
See blueprint-definition-format.md for the full spec.
Construction Lifecycle
blueprint.definition (JSONB)
→ construct_blueprint()
→ Phase 0: entity_type_provision (entity_types[])
→ Phase 0.5: storage provisioning
→ Phase 1: secure_table_provision (tables[] with nodes/fields/policies)
→ Phase 2: relation_provision (relations[])
→ Phase 3: post-processing (achievements, limits, jobs)
Merkle Hashing
definition_hash — Merkle root of the entire blueprint definition
table_hashes — per-table UUIDv5 hashes for structural comparison
- Backend-computed via trigger using
uuid_generate_v5(uuid_ns_url(), jsonb::text)
- Enables deduplication, provenance tracking, and structural diffing
Module Presets
Constructive DB owns the backend module arrays for three supported presets. Resolve the current preset through its provisioning mechanism; do not copy module closure into a skill or application brief.
| Preset |
Shape |
auth:hardened |
Hardened authentication and app access |
b2b:storage |
Hardened auth plus organizations and storage infrastructure |
full |
Complete reference capability set |
The canonical source lives in constructive-db/packages/node-type-registry/src/module-presets/. Blocks maps these backend profiles to frontend preset roots, but frontend installation remains a separate decision owned by constructive-blocks.
A preset names the modules a database installs. The content seeded into them — a trust ladder, a limit baseline — is requested separately as an option on a module entry (["events_module", { "trust_ladder": "humanity" }]), and no shipped preset requests one today.
See module-presets.md for the full preset catalog and the content presets.
Node Type Registry
The node type registry defines all node types available in blueprint definitions:
- Data nodes — field generators:
DataId, DataTimestamps, DataDirectOwner, DataEntityMembership, DataOwnershipInEntity, DataMemberOwner, DataI18n, DataPublishable, DataGenerated (stored or PG18 virtual generated columns via generation_type)
- Search nodes —
SearchUnified, SearchVector, SearchFullText
- Process nodes —
ProcessFileEmbedding, ProcessImageEmbedding, ProcessChunks
- Job nodes —
JobTrigger
- Event nodes —
EventTracker, EventReferral
- Guard nodes —
GuardStepUp
- Limit nodes — eight enforce, track, and warning nodes, including
LimitEnforceCounter, LimitTrackUsage, and LimitWarningRate
- Security nodes — 25 registry-selectable Authz nodes, including the
AuthzColumnSecurity write guard; the platform-applied AuthzHumanOnly mechanism is documented separately (see constructive-security)
See node-type-registry.md for the full catalog.
References
Cross-References
1---2name: constructive-blueprints3description: Define Constructive schemas declaratively with blueprints, templates, node types, definition hashes, and current backend module presets. Use when creating or copying a blueprint, choosing auth:hardened, b2b:storage, or full backend provisioning, or working with blueprint definitions and the node type registry.4---56# Constructive Blueprints78Declarative schema provisioning — define complete domain schemas as portable JSONB documents that compile into PostgreSQL tables, relations, security policies, and modules.910## When to Apply1112Use this skill when:13- Defining a blueprint (tables, fields, relations, policies, entity types)14- Working with blueprint templates and the template marketplace15- Choosing a current backend module preset (`auth:hardened`, `b2b:storage`, or `full`)16- Understanding Merkle-style definition hashing for deduplication and provenance17- Using `construct_blueprint()` or `copy_template_to_blueprint()`1819## Core Concepts2021### Two-Layer Model2223- **`blueprint_template`** — shareable marketplace recipe. Immutable definition + metadata.24- **`blueprint`** — owned, executable instance scoped to a database. Created from a template via `copy_template_to_blueprint()` or authored directly.2526### Blueprint Definition Format2728The `definition` JSONB contains:29- `entity_types[]` — Phase 0 entity provisioning (channels, teams, data rooms)30- `storage` — Phase 0.5 app-level storage config31- `tables[]` with `nodes[]`, `fields[]`, `policies[]` (using `$type` discriminators)32- `relations[]` — inter-table relationships33- `achievements[]` — gamification levels and rewards34- `limit_caps_defaults` — per-scope default caps35- `membership_types[]` — scope configurations (app, org, custom)3637See [blueprint-definition-format.md](./references/blueprint-definition-format.md) for the full spec.3839### Construction Lifecycle4041```42blueprint.definition (JSONB)43 → construct_blueprint()44 → Phase 0: entity_type_provision (entity_types[])45 → Phase 0.5: storage provisioning46 → Phase 1: secure_table_provision (tables[] with nodes/fields/policies)47 → Phase 2: relation_provision (relations[])48 → Phase 3: post-processing (achievements, limits, jobs)49```5051### Merkle Hashing5253- `definition_hash` — Merkle root of the entire blueprint definition54- `table_hashes` — per-table UUIDv5 hashes for structural comparison55- Backend-computed via trigger using `uuid_generate_v5(uuid_ns_url(), jsonb::text)`56- Enables deduplication, provenance tracking, and structural diffing5758### Module Presets5960Constructive DB owns the backend module arrays for three supported presets. Resolve the current preset through its provisioning mechanism; do not copy module closure into a skill or application brief.6162| Preset | Shape |63|--------|-------|64| `auth:hardened` | Hardened authentication and app access |65| `b2b:storage` | Hardened auth plus organizations and storage infrastructure |66| `full` | Complete reference capability set |6768The canonical source lives in `constructive-db/packages/node-type-registry/src/module-presets/`. Blocks maps these backend profiles to frontend preset roots, but frontend installation remains a separate decision owned by [`constructive-blocks`](../constructive-blocks/SKILL.md).6970A preset names the *modules* a database installs. The *content* seeded into them — a trust ladder, a limit baseline — is requested separately as an option on a module entry (`["events_module", { "trust_ladder": "humanity" }]`), and no shipped preset requests one today.7172See [module-presets.md](./references/module-presets.md) for the full preset catalog and the content presets.7374### Node Type Registry7576The node type registry defines all node types available in blueprint definitions:7778- **Data nodes** — field generators: `DataId`, `DataTimestamps`, `DataDirectOwner`, `DataEntityMembership`, `DataOwnershipInEntity`, `DataMemberOwner`, `DataI18n`, `DataPublishable`, `DataGenerated` (stored or PG18 virtual generated columns via `generation_type`)79- **Search nodes** — `SearchUnified`, `SearchVector`, `SearchFullText`80- **Process nodes** — `ProcessFileEmbedding`, `ProcessImageEmbedding`, `ProcessChunks`81- **Job nodes** — `JobTrigger`82- **Event nodes** — `EventTracker`, `EventReferral`83- **Guard nodes** — `GuardStepUp`84- **Limit nodes** — eight enforce, track, and warning nodes, including `LimitEnforceCounter`, `LimitTrackUsage`, and `LimitWarningRate`85- **Security nodes** — 25 registry-selectable Authz nodes, including the `AuthzColumnSecurity` write guard; the platform-applied `AuthzHumanOnly` mechanism is documented separately (see `constructive-security`)8687See [node-type-registry.md](./references/node-type-registry.md) for the full catalog.8889## References9091| File | Content |92|------|---------|93| [blueprint-definition-format.md](./references/blueprint-definition-format.md) | Full definition spec with examples |94| [blueprints.md](./references/blueprints.md) | System reference — templates, construction, hashing |95| [module-presets.md](./references/module-presets.md) | Preset catalog, shape, and per-module rationale |96| [node-type-registry.md](./references/node-type-registry.md) | All node type families and their config shapes |9798## Cross-References99100- **Security policies on tables:** [`constructive-security`](../constructive-security/SKILL.md)101- **Entity types in blueprints:** [`constructive-entities`](../constructive-entities/SKILL.md)102- **Data modeling (tables, fields, relations):** [`constructive-data-modeling`](../constructive-data-modeling/SKILL.md)103- **Search nodes detail:** [`constructive-search`](../constructive-search/SKILL.md)104- **Job nodes detail:** [`constructive-jobs`](../constructive-jobs/SKILL.md)105- **Event nodes detail:** [`constructive-events`](../constructive-events/SKILL.md)106- **Frontend preset and feature-pack installation:** [`constructive-blocks`](../constructive-blocks/SKILL.md)