Code Review Data Model Skill
Table of Contents
1. When to use this skill
When you must assess a component's data model — its domain types, entity models, schemas, and kernel data structures — against the data-oriented design criteria: layout, value semantics, hot/cold split, batch access. Use before major data-model refactors, when onboarding to a component, or periodically to track data-model debt. It is the single-lens complement to the broad compass-code-review-component audit. For PR-delta reviews, use compass-code-review-pr.
2. How to use this skill
Identify the component(s). Components live under
projects/ores.<component>. To see all known components:./projects/ores.compass/compass.sh list --type component
- Classify the regimes. For each component, map its parts onto the three regimes in Data-Oriented Design in ORE Studio: numerical kernels (Regime 1), persisted domain data (Regime 2), wire and messaging (Regime 3). A component spans regimes; state which part is which and why. Document-shaped payloads sit outside the three regimes — the knowledge doc states the boundary.
Gather the data-model artefacts. Regime 2 review walks two surfaces, and the checklist states which surface each check applies to:
- The decision surface: the
modeling/*.orgentity, junction, and field-group models. Thelookup_entitymetatype is reserved but has no authored instances; do not hunt for lookup models. - The invariant surface: the domain C++ types codegen generates
from those models, and hand-written domain headers in the
corefacet.
Also gather, per regime: the SQL schema the entities map to (the
CREATE TABLEstatements underprojects/ores.sql/create/<component>/); repository and service signatures; and kernel entry points with their inner loops.- The decision surface: the
- Apply the matching checklists. The checklists live under
* Review criteriain the knowledge doc. Walk the Regime 1, 2, or 3 checklist for each classified part; on Regime 2, walk the decision checks per entity model and spot-check the invariant checks once per component. Mark checks outside a part's regime as not-applicable — never demand SoA of a CRUD entity, never accept a pointer graph inside a simulation kernel, and never force table-shaped or flat-message checks onto document-shaped payloads. - Apply the evidence rule. Hot-path claims need the loop structure, a profile, or a benchmark as evidence. Without evidence, record a layout risk as an opportunity, not a defect.
- Score and report. Per component: a 1-5 score per applicable regime using the scoring anchors in the knowledge doc, a findings table (severity, effort, mapped criterion), an overall data-model verdict, and a debt level of Low / Medium / High. Follow the report conventions in the knowledge doc.
- Summarise. Conclude with the per-component score table, the top 3-5 recommendations, and the overall debt level. This skill only reviews — filing remediation stories is a separate decision made through the backlog.
3. Recipes
- How do I show a doc by UUID? — to inspect the component's
component_overview.organd its modeling docs. - How do I find docs matching a pattern? — to enumerate a component's modeling files, tasks, and stories.
4. Reference
- Data-Oriented Design in ORE Studio — the criteria, regimes, and report conventions this skill applies.
- Code Review Checklist — the sibling criteria set for general component and PR review.
- compass-code-review-component — the broad whole-component audit this lens complements.