datamodellm — Claude Code skill: Prisma schema modeling
Lets the agent draft database schemas in Prisma format for the DataModelLM visual editor. Useful when you want an ERD or a data model before writing code.
npx skills add nimbalyst/nimbalyst --skill datamodellm -a claude-codeWhat datamodellm does
The skill teaches an agent to produce .prisma files that the DataModelLM editor from Nimbalyst can open. That editor draws an entity-relationship diagram on a canvas while keeping the source as plain Prisma text. The agent writes and edits the models; you look at the picture.
Every file has to open with a metadata comment, // @nimbalyst {...}, holding canvas settings and entity positions. Skip that line and the editor shows nothing. After it comes ordinary Prisma: a datasource db block with a provider and url = env("DATABASE_URL"), then the models. The skill covers scalar types such as Int, String, DateTime and Json, the ? and [] modifiers, and attributes like @id, @unique, @default, @updatedAt, @relation.
Three relationship shapes get their own sections: one-to-many, one-to-one, and implicit many-to-many. Explicit relations need @relation with fields and references; leave it out and no line appears between the entities. Keep the file in the project root, or in models/ or schema/.
What it helps with
- design a database schema before the first migration
- draw an entity-relationship diagram for existing tables
- write Prisma models from scratch
- wire entities together with
@relation - add
createdAtandupdatedAtto every model
Example prompts for the agent
- Create
schema.prismawith User and Post models linked one-to-many - Add a Profile model with a one-to-one relation to User
- Check that every model has an
@idand anupdatedAttimestamp
How to install datamodellm
1Skills CLI (Vercel)
npx skills add nimbalyst/nimbalyst --skill datamodellm -a claude-code2Manually: put the files in place
~/.claude/skills/datamodellm/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/datamodellm/
1Skills CLI (Vercel)
npx skills add nimbalyst/nimbalyst --skill datamodellm -a codex2Manually: put the files in place
.agents/skills/datamodellm/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add nimbalyst/nimbalyst --skill datamodellm -a cursor2Manually: put the files in place
.cursor/skills/datamodellm/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install nimbalyst/nimbalyst datamodellm2Manually: put the files in place
.github/skills/datamodellm/SKILL.md1Skills CLI (Vercel)
npx skills add nimbalyst/nimbalyst --skill datamodellm -a gemini-cli2Platform CLI
gemini skills install https://github.com/nimbalyst/nimbalyst --path packages/extensions/datamodellm/claude-plugin/skills/datamodellmManually: put the files in place
.devin/skills/datamodellm/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add nimbalyst/nimbalyst --skill datamodellm -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about datamodellm
How do I install datamodellm in Claude Code?
Run npx skills add nimbalyst/nimbalyst --skill datamodellm -a claude-code. The skill lands at ~/.claude/skills/datamodellm/SKILL.md.
What does datamodellm do?
It helps an agent write Prisma database schemas for the DataModelLM visual editor, which renders them as an entity-relationship diagram.
How is a DataModelLM file different from a plain Prisma schema?
The first line must be a // @nimbalyst comment with canvas settings. Without it the visual editor will not open the schema.
Source text
SKILL.md · MIT
---
name: datamodellm
description: Create visual data models for database schemas using Nimbalyst's DataModelLM editor. Use when the user wants to design a data model, database schema, entity relationship diagram, or Prisma schema.
---
# DataModelLM - Visual Data Modeling
DataModelLM is Nimbalyst's visual editor for creating database schemas using Prisma format. It displays entity-relationship diagrams with a visual canvas.
## When to Use DataModelLM
- Designing database schemas
- Creating entity relationship diagrams (ERDs)
- Planning data models for applications
- Working with Prisma schemas
- Any visual data modeling task
## File Format
- **Extension**: `.prisma`
- **Format**: Prisma schema with special metadata header
- **Location**: Any directory (commonly workspace root or `models/`, `schema/`)
### Required Header
Every DataModelLM file MUST start with a `@nimbalyst` metadata comment:
```prisma
// @nimbalyst {"viewport":{"x":0,"y":0,"zoom":1},"positions":{},"entityViewMode":"standard"}
```
### Basic Structure
```prisma
// @nimbalyst {"viewport":{"x":0,"y":0,"zoom":1},"positions":{},"entityViewMode":"standard"}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {
id Int @id @default(autoincrement())
email String @unique
name String?
posts Post[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Post {
id Int @id @default(autoincrement())
title String
content String?
published Boolean @default(false)
author User @relation(fields: [authorId], references: [id])
authorId Int
createdAt DateTime @default(now())
}
```
## Supported Types
### Scalar Types
- `Int`, `BigInt`, `Float`, `Decimal`
- `String`, `Boolean`
- `DateTime`, `Json`, `Bytes`
### Modifiers
- `?` - Optional field
- `[]` - Array/list
### Attributes
- `@id` - Primary key
- `@unique` - Unique constraint
- `@default(value)` - Default value
- `@updatedAt` - Auto-update timestamp
- `@relation` - Define relationships
## Relationship Patterns
### One-to-Many
```prisma
model User {
posts Post[]
}
model Post {
author User @relation(fields: [authorId], references: [id])
authorId Int
}
```
### One-to-One
```prisma
model User {
profile Profile?
}
model Profile {
user User @relation(fields: [userId], references: [id])
userId Int @unique
}
```
### Many-to-Many (Implicit)
```prisma
model Post {
categories Category[]
}
model Category {
posts Post[]
}
```
## Best Practices
1. **Always include the @nimbalyst header** - Required for visual editor
2. **Use meaningful model names** - PascalCase, singular (User not Users)
3. **Include timestamps** - Add createdAt and updatedAt to most models
4. **Define explicit relations** - Always specify @relation with fields and references
© nimbalyst · MIT · nimbalyst/nimbalyst