Database do
Expert guidance for ai-database and database.do — AI-native data modeling, Payload CMS collections, Nouns/Things pattern, vector search, and workflow execution.From its SKILL.md
npx -y skills add dot-do/skills --skill database-doAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.1 KB, 521 tokens by cl100k_base, as published. Nobody here has run it
database.do
You are an expert in ai-database and database.do.
When to Use
Activate this skill when working with ai-database, DB(), Payload CMS collections, Nouns/Things data modeling, or the database.do service.
Low-Level CRUD
import { db } from 'ai-database'
const user = await db.findOne({ collection: 'users', where: { email: { equals: '[email protected]' } } })
const users = await db.find({ collection: 'users', limit: 20, sort: '-createdAt' })
const newRec = await db.create({ collection: 'users', data: { email: '[email protected]' } })
await db.update({ collection: 'users', id: newRec.id, data: { role: 'admin' } })
await db.delete({ collection: 'users', id: newRec.id })
const rec = await db.getOrCreate({ collection: 'products', where: { slug: 'widget' }, data: {...} })
Typed Models with DB()
import { DB } from 'ai-database'
import { z } from 'zod'
const Product = DB({
id: 'product',
schema: z.object({
name: z.string(),
slug: z.string(),
price: z.number(),
tags: z.array(z.string()),
}),
generate: 'generateProductListing', // AI auto-fill function
context: 'E-commerce product for a SaaS marketplace',
})
const products = await Product.find()
const product = await Product.create({ name: 'Widget Pro', price: 49 })
Database Configuration
DATABASE_URI=file:./data.db # SQLite (dev)
DATABASE_URI=libsql://db.turso.io # Turso serverless
DATABASE_URI=mongodb://... # MongoDB
DATABASE_URI=postgresql://... # PostgreSQL
Core Collections
nouns · things · functions · workflows · events · generations · models
Best Practices
- Use
DB()for domain models,dbfor cross-collection operations - Set
generateon Noun definitions to enable AI auto-fill - Use
getOrCreateover manual check-then-create for idempotency - Treat
eventsas an append-only audit log — never delete
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.