analyze-code
CommandAnalyze code quality, identify issues, and suggest improvements.
Create or modify Prisma-based data models for Nimbalyst's DataModelLM visual editor
> /plugin marketplace add nimbalyst/nimbalyst> /plugin install nimbalyst-wiki@nimbalyst
description: Create or modify Prisma-based data models for Nimbalyst's DataModelLM visual editor allowed_tools: - Read - Write - Edit - Glob
Creates data model files compatible with Nimbalyst's DataModelLM visual editor. DataModelLM displays entity-relationship diagrams with a visual canvas for designing database schemas.
DataModelLM uses **Prisma schema format** with a special metadata comment header for viewport and layout information.
Every DataModelLM file MUST start with a `@nimbalyst` metadata comment on the first line:
// @nimbalyst {"viewport":{"x":0,"y":0,"zoom":1},"positions":{},"entityViewMode":"standard"}This metadata stores:
// @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())
}model User {
id Int @id @default(autoincrement())
posts Post[]
}
model Post {
id Int @id @default(autoincrement())
author User @relation(fields: [authorId], references: [id])
authorId Int
}model User {
id Int @id @default(autoincrement())
profile Profile?
}
model Profile {
id Int @id @default(autoincrement())
user User @relation(fields: [userId], references: [id])
userId Int @unique
}model Post {
id Int @id @default(autoincrement())
categories Category[]
}
model Category {
id Int @id @default(autoincrement())
posts Post[]
}model Post {
id Int @id @default(autoincrement())
categories CategoriesOnPosts[]
}
model Category {
id Int @id @default(autoincrement())
posts CategoriesOnPosts[]
}
model CategoriesOnPosts {
post Post @relation(fields: [postId], references: [id])
postId Int
category Category @relation(fields: [categoryId], references: [id])
categoryId Int
assignedAt DateTime @default(now())
@@id([postId, categoryId])
}model User {
id Int @id @default(autoincrement())
name String
followers User[] @relation("UserFollows")
following User[] @relation("UserFollows")
}Supported `datasource.provider` values:
1. **Always include the @nimbalyst header** - Required for the visual editor 2. **Use meaningful model names** - PascalCase, singular (e.g., `User` not `Users`) 3. **Include timestamps** - Add `createdAt` and `updatedAt` to most models 4. **Define explicit relations** - Always specify `@relation` with `fields` and `references` 5. **Use appropriate types** - Choose the most specific type for your data
When the user asks to create a data model:
1. **Understand the domain** - Ask about entities, their properties, and relationships 2. **Identify primary entities** - Start with core models (User, Product, Order, etc.) 3. **Map relationships** - Determine how entities relate (one-to-many, many-to-many) 4. **Choose field types** - Select appropriate Prisma types for each property 5. **Add constraints** - Include `@unique`, `@default`, and other attributes as needed 6. **Create the file** - Write to a `.prisma` file with the required header
**User**: "Create a data model for a blog"
**Response**: Create a file with User, Post, Comment, and Category models with appropriate relationships.
**User**: "Add a tags system to the blog"
**Response**: Add a Tag model and a many-to-many relationship with Post.
**User**: "I need a data model for an e-commerce site"
**Response**: Create models for User, Product, Category, Order, OrderItem, Cart, CartItem, Address, and Payment with appropriate relationships and fields.
Nimbalyst - The open-source visual workspace for Claude Code, Codex, and OpenCode. Run multiple coding agents in parallel, edit their work visually in markdown, mockups, and diagrams, and track tasks. Free, MIT-licensed desktop app for macOS, Windows, Linux, with mobile companion for iOS and Android.
Analyze code quality, identify issues, and suggest improvements.
Audit recent AI coding sessions to find repeated mistakes, speed losses, and missed Nimbalyst tool usage — then propose harness…
Triage pnpm audit findings and produce a prioritized, supply-chain-cautious package-update plan, then apply approved batches
Survey recently triaged GitHub issues, propose the ones safe to fix without a product decision, and fan the selected ones out to…
Gather details and draft an actionable bug report for developers.
Shortcut for "continue working" — pick the work in flight back up exactly where it stopped and keep going until it is done or…