How this skill is triggered — by the user, by Claude, or both
Slash command
/cf-saas-stack:databaseThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Database schemas use Drizzle ORM with SQLite. All schema definitions are in `app/db/schema.ts`.
Database schemas use Drizzle ORM with SQLite. All schema definitions are in app/db/schema.ts.
import { sql } from "drizzle-orm";
import { sqliteTable, text, integer } from "drizzle-orm/sqlite-core";
export const myTable = sqliteTable("my_table", {
id: text("id").primaryKey(),
name: text("name").notNull(),
description: text("description"),
email: text("email").notNull().unique(),
isActive: integer("is_active", { mode: "boolean" }).default(false).notNull(),
status: text("status", { enum: ["pending", "active", "completed"] }).default("pending").notNull(),
counter: integer("counter").default(0).notNull(),
metadata: text("metadata", { mode: "json" }).$type<{ key?: string; value?: number; }>(),
userId: text("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
createdAt: integer("created_at", { mode: "timestamp_ms" })
.default(sql`(cast(unixepoch('subsecond') * 1000 as integer))`)
.notNull(),
updatedAt: integer("updated_at", { mode: "timestamp_ms" })
.default(sql`(cast(unixepoch('subsecond') * 1000 as integer))`)
.$onUpdate(() => new Date())
.notNull(),
});
export type MyTable = typeof myTable.$inferSelect;
export type InsertMyTable = typeof myTable.$inferInsert;
createdAt: integer("created_at", { mode: "timestamp_ms" })
.default(sql`(cast(unixepoch('subsecond') * 1000 as integer))`)
.notNull(),
updatedAt: integer("updated_at", { mode: "timestamp_ms" })
.default(sql`(cast(unixepoch('subsecond') * 1000 as integer))`)
.$onUpdate(() => new Date())
.notNull(),
Use integer with mode: "boolean":
isEnabled: integer("is_enabled", { mode: "boolean" }).default(false).notNull(),
Use text with enum option:
status: text("status", { enum: ["pending", "active", "completed"] }).default("pending").notNull(),
Use text with mode: "json" and .$type<T>():
settings: text("settings", { mode: "json" }).$type<{ notifications?: boolean; theme?: "light" | "dark"; }>(),
Always specify onDelete behavior:
userId: text("user_id").references(() => user.id, { onDelete: "cascade" }),
organizationId: text("organization_id").references(() => organization.id, { onDelete: "set null" }),
snake_case in SQLsnake_case in SQLcamelCasebun run db:generate
bun run db:migrate:local
npx claudepluginhub casper-studios/casper-marketplace --plugin cf-saas-stackDefines Drizzle ORM schemas with pgTable/mysqlTable/sqliteTable, column types, indexes, and constraints for new projects.
Generates Drizzle ORM schemas for Cloudflare D1 databases with correct D1-specific patterns (no BOOLEAN/DATETIME, 100 bound param limit, JSON as TEXT).
Scaffolds Drizzle ORM + SQLite boilerplate: config, singleton client, per-table schema with relations, CRUD repositories, and drizzle-zod validators for three SQLite drivers.