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:
- Do not hand-code the layer.
- Raise a sprint story: "Implement codegen profile for {layer}."
- Reference Entity lifecycle§"Codegen gaps" for what the profile must cover.
- Link the story to the entity task before marking the layer done.
- 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:
- Tests: invoke unit-test-writer for domain, repository, and service layers.
- Diagrams: invoke plantuml-class-modeler and plantuml-er-modeler.
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
- ORE Studio Codegen — model schema, profile catalogue,
run_generator.shusage. - Entity lifecycle — complete file checklist; links to every layer skill and pattern doc.
- Qt menu and toolbar patterns — plugin wiring required for step 3.