arch-scaffold-entity

Scaffolds a new entity with type, table, migration, storage, manager, router, and tests in Python.

89|10|Updated Sep 15, 2026
One-click install
npx skills add https://github.com/baristaze/swe_guidelines --skill arch-scaffold-entity-baristaze
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: arch-scaffold-entity
Source: https://github.com/baristaze/swe_guidelines/tree/main/skills/arch-scaffold-entity
Command: npx skills add https://github.com/baristaze/swe_guidelines --skill arch-scaffold-entity-baristaze

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Adding a new entity to a multi-tenant Python service requires touching a dozen files across the object model, storage, network, and test layers, and any missed convention (row-level security, outbox rows, tenancy scope) breaks the architecture. This Skill generates the complete, convention-compliant entity stack in one pass. ## Core Features & Use Cases - Full-stack entity generation: Creates the frozen type, ORM table, SQL migration with row-level security policy, Postgres and in-memory storage implementations, manager operations, wire types, and router. - Tenancy and role awareness: Supports system, org, identity, and dual tenancy scopes plus core, activity, queue, and admin database roles, wiring the correct policies and outbox handoff for each. - Contract-driven tests: Generates storage contract cases run against both memory and Postgres impls, including cross-tenant isolation, unique-key collisions, and optimistic-concurrency races. - Use Case: Run it with inventory Warehouse address:str timezone:str to scaffold a Warehouse entity end to end, then verify with make migrate-check and make openapi. ## Quick Start Ask the assistant to add a new entity to a namespace, for example: scaffold an entity named Warehouse with fields address and timezone in the inventory namespace.

Frequently Asked Questions about arch-scaffold-entity

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new entity to a multi-tenant Python service?▼

Invoke the scaffold with a namespace, entity name, and typed fields, such as `inventory Warehouse address:str`. It generates the frozen type, table, migration, storage impls, manager, router, and tests in dependency order.

How to scaffold row-level security policies for Postgres tables?▼

The generated migration creates the table with ENABLE and FORCE ROW LEVEL SECURITY plus a policy matching the declared tenancy scope. Org scope policies rest on org_id, identity scope on identity_id, and system scope gets no policy.

What tenancy scopes does the entity scaffold support?▼

Four scopes are supported: org (default), identity, both, and system. The scope decides the table mixin, the policy column, and the tenant parameters on every storage method.

Does the scaffold handle optimistic concurrency with versioning?▼

Yes. For Trackable entities where concurrent edits matter, it adds a version field, compare-and-set writes with expected_version, PreconditionFailed on stale versions, and ETag/If-Match handling on the PATCH route.

When should an entity use the activity role instead of core?▼

Use the activity role for append-only records that never cross a role boundary. They get an append method, no outbox row, no update or delete operations, and compose FeedIdentifiableMixin.