data-modeling
Skill3 starsChanged 29 days agoMITView on GitHub
Use when the app needs to store or read data — records, a database, entities, CRUD, lists, "save/remember X", or per-user data with row-level security. This app's data layer is Rayfin's: you declare entities as TypeScript classes with decorators in packages/data/src/, register them in the schema, and read/write them through the typed rayfin-client. Covers: defining an @entity, field decorators, registering it, per-entity access with @role, owner-only row-level security, and the client query/mutation API. Triggers: data, database, model, entity, schema, table, record, CRUD, create, read, update, delete, list, store, save, persist, per-user, row-level security, RLS, access control, ownership.
19 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- AtulPurohit/Antigravity-Awesome-Skillstheir own version, first seen Nov 29, 2026
- TheArcForge/hades-plugintheir own version, first seen Nov 16, 2026
- nisarth/claude-skills-storetheir own version, first seen Nov 8, 2026
- getditto/agent-skillstheir own version, first seen Nov 8, 2026
- SWEStash/swe-workflow-skillstheir own version, first seen Nov 8, 2026
- timmywheels/skillstheir own version, first seen Nov 1, 2026
Used with
Projects with it also use containerization, incident-response and 5 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
mmondoraSkillcontainerization
Docker best practices for cloud-native applications. Multi-stage builds, distroless images, security scanning, non-root users, Cloud Run orchestration. Use when writing Dockerfiles, configuring container builds, or deploying to Cloud Run/GKE.
Also in 3 projects that use this
AnthropicSkillincident-response
Run an incident response workflow — triage, communicate, and write postmortem. Trigger with "we have an incident", "production is down", an alert that needs severity assessment, a status update mid-incident, or when writing a blameless postmortem after resolution.
Also in 7 projects that use this
OpenAISkillobservability
Vercel Observability expert guidance — Drains (logs, traces, speed insights, web analytics), Web Analytics, Speed Insights, runtime logs, custom events, OpenTelemetry integration, and monitoring dashboards. Use when instrumenting, debugging, or optimizing application performance and user experience on Vercel.
Also in 6 projects that use this
MicrosoftSkillaccessibility
Consolidated accessibility skill entrypoint for WCAG 2.2, ARIA Authoring Practices, cognitive accessibility, Section 508, EN 301 549, design intent verification, and the Accessibility Planner workflow.
Also in 5 projects that use this
MicrosoftSkillapi-design
Guide for designing and documenting RESTful APIs. Use when asked to design an API, create endpoints, or document an API.
Also in 8 projects that use this
AnthropicSkilldocumentation
Write and maintain technical documentation. Trigger with "write docs for", "document this", "create a README", "write a runbook", "onboarding guide", or when the user needs help with any form of technical writing — API docs, architecture docs, or operational runbooks.
Also in 3 projects that use this
Other versions19 projects use a version of this.
Word for word · 1
- microsoft/rayfin★ 646100% same
Edited · 1
- microsoft/awesome-rayfin★ 11622% same
Wrote their own version · 17
- nimadorostkar/Claude-Skills-collection★ 41same name
- jdm4pku/RE-Skills★ 26same name
- khuynh22/agent-dev-team★ 9same name
- AtulPurohit/Antigravity-Awesome-Skills★ 6same name
- getditto/agent-skills★ 4same name
- MartinOlivero/saas-builder★ 4same name
- TheArcForge/hades-plugin★ 3same name
- bjornjee/skills★ 2same name
- mmondora/claude-skills★ 1same name
- nisarth/claude-skills-store★ 1same name
7 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository21 other files it gives its agents.
- src/home-loan-desk/AGENTS.mdAGENTS.md
- export-self-guidedSkill
- lab-instructionsSkill
- lab-vm-updateSkill
- check-setupSkill
- lab-checkpointSkill
- analyticsSkill
- app-deploymentSkill
- app-designSkill
- app-validationSkill
- capability-routerSkill
- connectorsSkill
- crud-uiSkill
- dax-authoringSkill
- external-api-workflowsSkill
- fabric-data-agentSkill
- fabric-sdkSkill
- functions-capabilitySkill
- query-designSkill
- schema-discoverySkill
- visualsSkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 3 are distinctive, and 7 are very specific to this project.
0
Common
Most of the 16 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 39
Read known-limitations.md before you design entities.
- Very specific: line 62
Keep that boundary intact and follow the installed rayfin-guide/assets/docs/auth/ pages for additional service-specific requirements.
- Distinctive: line 64
Do not replace an authentication failure with anonymous access or block the entire app because it is outside the Fabric portal.
- Very specific: line 70
Start from the seeded Item.ts — rename it and change the fields.
- Very specific: line 72
When the real model replaces the example, remove the unused starter Item runtime entity, its packages/data/src/index.ts registration, and …
- Distinctive: line 87
Add every entity, including join entities, to both packages:
- Very specific: line 136
Read rayfin-guide/assets/docs/data/permissions.md for the decorator, the typed policy DSL, the supported claims, logical composition, and …
- Distinctive: line 141
Keep authentication and authorization on the data operations that require them.
- Very specific: line 145
Stable features only: Use @authenticated / @role('authenticated', …).
- Very specific: line 151
Read app-deployment and follow the installed, version-matched CLI guide.
“Common” is measured: kept by at least 6 in 10 of the 16 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Data modeling — entities, schema, and row-level security
This app persists data with Rayfin data. You define entities as decorated
TypeScript classes under packages/data/src/, register them in
packages/data/src/index.ts, define their isomorphic contracts in
packages/shared/src/index.ts, and read/write them with the typed client from
packages/frontend/src/lib/rayfin-client.ts (await getRayfinClient()).
Read the docs first — they ship in the packages
Rayfin's data rules are owned by the installed packages, not by this skill. Decorators, field options, relationships, permissions, the query API and the platform's constraints all move between releases. Read them from disk:
| You need… | Read |
@entity, every field decorator, and their options | node_modules/@microsoft/rayfin-core/assets/docs/decorators.md |
Permissions end to end — @role, the policy DSL, claims, include / exclude | node_modules/@microsoft/rayfin-guide/assets/docs/data/permissions.md |
The @anonymous / @authenticated shorthands | node_modules/@microsoft/rayfin-core/assets/docs/permissions.md |
| Entity authoring end to end, relationships, schema registration | node_modules/@microsoft/rayfin-guide/assets/docs/data/overview.md |
| Reading and writing with the client | node_modules/@microsoft/rayfin-guide/assets/docs/data/graphql.md |
| Paging, cursors, text-field nullability | node_modules/@microsoft/rayfin-data/assets/docs/index.md |
| Constraints that will bite you — text length, FK naming, many-to-many, dialect | node_modules/@microsoft/rayfin-guide/assets/docs/known-limitations.md |
Read known-limitations.md before you design entities. It is short, and it
is where the platform tells you what it will not do.
Everything below is about this template — what it turns on, where files go, and how its build is wired. For anything about Rayfin itself, use the table.
Step 1 — turn the data service on
The base template keeps the data service off, because a dashboard over a
semantic model does not need a database. Turn it on for an app that needs
persistence:
npm run pack:add -- data-modelingThat flips data.enabled in rayfin/rayfin.yml and plants a starter entity in
packages/data/src/Item.ts, registered in packages/data/src/index.ts, with its
isomorphic contract in packages/shared/src/index.ts.
Re-applying is safe: it keeps files you have edited, and --force-seeds is the
explicit way back to the pack's version.
The template authenticates before rendering app content through its dynamic auth provider and gate.
Keep that boundary intact and follow the installed rayfin-guide/assets/docs/auth/ pages for additional service-specific requirements.
Preserve server-side entity permissions and row-level security.
Do not replace an authentication failure with anonymous access or block the entire app because it is outside the Fabric portal.
Step 2 — write entity files
One file per entity under packages/data/src/, for example
packages/data/src/Note.ts.
Start from the seeded Item.ts — rename it and change the fields.
Editing a working entity is more reliable than writing one from nothing.
When the real model replaces the example, remove the unused starter Item
runtime entity, its packages/data/src/index.ts registration, and its
packages/shared/src/index.ts contract so it does not become user-visible.
@microsoft/rayfin-core, @microsoft/rayfin-data and @microsoft/rayfin-client
are already pinned in the base app — nothing to install.
For the decorator set, field options, relationship syntax, FK naming and the
many-to-many rule, read rayfin-core/assets/docs/decorators.md and
rayfin-guide/assets/docs/data/overview.md, then known-limitations.md.
Step 3 — register entities in this template's schema
packages/data/src/index.ts starts with the seeded Item registration, while
packages/shared/src/index.ts owns its isomorphic record contract and schema
type map.
Add every entity, including join entities, to both packages:
// packages/shared/src/index.ts
export interface NoteRecord {
id: number;
title: string;
}
export type UniversalAppSchema = {
Note: NoteRecord;
};
// packages/data/src/index.ts
import { Note } from './Note.js';
export const schema = [Note];The client's generic type comes from
UniversalAppSchema(already referenced bypackages/frontend/src/lib/rayfin-client.ts), so add every entity to both theschemaarray: one registered in the array but missing from the type is reachable at runtime and invisible to the compiler.Type-check with
tsc -b, nevertsc --noEmit. The workspace packages are referenced TypeScript projects, and the frontend client imports the shared schema type, so a baretsc --noEmitfails withTS6305until the referenced project has been built. Runnpm run typecheckfor the real referenced-project check.npm run buildusestsc -b --noCheckfor speed and does not prove the entity types are correct.
Step 4 — read and write
The query chain, mutations, findById, filtering and paging are documented in
rayfin-guide/assets/docs/data/graphql.md and
rayfin-data/assets/docs/index.md. Use await getRayfinClient() from
packages/frontend/src/lib/rayfin-client.ts inside an async query or mutation; that helper is this template's;
the API it returns
is the package's.
For the interface over your entities — optimistic updates, forms, and the
loading / empty / error states — read crud-ui, which ships the kit.
Step 5 — per-user data
"Each person sees only their own …" is a server-side @role policy, never a
filter in the UI. A client-side filter still leaves the rows fetchable.
Read rayfin-guide/assets/docs/data/permissions.md for the decorator, the typed
policy DSL, the supported claims, logical composition, and field visibility — it
is the fullest treatment. rayfin-core/assets/docs/permissions.md adds the
@anonymous / @authenticated shorthands, owner-field typing, and owner
stamping.
Keep authentication and authorization on the data operations that require them.
Notes
- Stable features only. Use
@authenticated/@role('authenticated', …). Anonymous data access on Fabric requires a tenant admin switch — seerayfin-guide/assets/docs/data/overview.md. If asked for public data, say so and use authenticated access. - Deploying ships the data model. A schema change migrates on the next
deploy.
Read
app-deploymentand follow the installed, version-matched CLI guide.
<!--
MAINTAINERS: this skill owns *this template* — the data service toggle, the
workspace schema shape, the tsc -b build note, and the auth pairing. It does not own
Rayfin.
Rayfin's own rules are read at runtime from the installed packages' docs
(`rayfinDocs.dir`, today `assets/docs`), so they cannot drift from the version a
generated app actually has. That replaces the previous arrangement, where this
file hand-mirrored rules from the CLI's bundled `skill:rayfin` and had to be
diffed against it on every CLI bump. Drift under that arrangement had already
shipped once: bare `@text()` appeared in every example here while the
authoritative rule required an explicit `max` on MSSQL.
-->Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

