What problem does it solve?
Apps that already run Prisma need durable storage for TanStack AI chat threads, runs, interrupts, and metadata, but writing the four store implementations by hand is error-prone around idempotency, BigInt timestamps, and JSON serialization.
Core Features & Use Cases
- Schema Generation: Adds four models (ChatThread, ChatRun, ChatInterrupt, ChatMetadata) to the app's existing schema.prisma with correct indexes and BigInt timestamp columns.
- Store Implementation: Writes a single chat-persistence.ts implementing MessageStore, RunStore, InterruptStore, and MetadataStore against the app's existing PrismaClient singleton.
- Idempotency & Edge Cases: Handles upsert-with-empty-update semantics, updateMany no-op patches, explicit-undefined field clearing, and structured RunError columns.
- Use Case: A Next.js app using Prisma and TanStack AI needs resumable chat runs; this Skill produces the persistence file, schema additions, route wiring with withPersistence, and a conformance test using runPersistenceConformance.
Quick Start
Add Prisma-backed chat persistence to my app by generating the schema models and chat-persistence.ts against my existing PrismaClient.