Codegen Add Entity

Table of Contents

When to use this skill

When the user asks to "add a new entity", "create entity X", or any equivalent. A regular ORE Studio entity requires all layers listed below — skipping any layer requires explicit user approval. This skill orchestrates the sub-skills in dependency order via TaskCreate tasks.

How to use this skill

Step 1 — Confirm or create the JSON model

Confirm a model file exists in projects/ores.codegen/models/{component}/{entity}_domain_entity.json (or *_junction.json for association tables). If it does not exist, create it before proceeding. See ORE Studio Codegen for the model schema.

Step 2 — Create one task per layer

Use TaskCreate to register a task for each layer. Execute them in the order shown. Do not skip a layer unless the user explicitly says it is out of scope for this entity.

# Layer Sub-skill Codegen
1 Domain · SQL · repository · service · protocol · generator domain-type-creator --profile all
2 Qt UI (model, windows, dialogs, controller) qt-entity-creator --profile qt
3 Qt plugin wiring (menus, toolbar) qt-entity-creator §wiring see Qt menu and toolbar patterns
4 HTTP REST endpoints http-entity-creator ❌ GAP
5 CLI commands cli-entity-creator ❌ GAP
6 Shell REPL commands shell-entity-creator ❌ GAP
7 Wt web UI wt-entity-creator ❌ GAP

Step 3 — Gap protocol

When a layer is marked ❌ GAP:

  1. Do not hand-code the layer.
  2. Raise a sprint story: "Implement codegen profile for {layer}."
  3. Reference Entity lifecycle§"Codegen gaps" for what the profile must cover.
  4. Link the story to the entity task before marking the layer done.
  5. Once the profile exists, regenerate and discard any hand-written interim code.

Until the gap is resolved the layer is incomplete. The entity is not "done" while gap layers remain open.

Step 4 — Tests and diagrams

After all layer tasks are green, create two more tasks:

Step 5 — PR strategy

Each layer produces one or more PRs (see the layer skill for PR titles and phase boundaries). Use feature-branch-manager between phases and pr-manager to open each PR.

Recipes

  • Entity lifecycle — canonical file checklist, template inventory, layer diagram.

Reference

Emacs 29.1 (Org mode 9.6.6)