What problem does it solve?
This skill provides a unified architectural pattern for handling data mutations in the Cobalt codebase, ensuring consistency between optimistic web UI updates and server-side data integrity.
Core Features & Use Cases
- Dual-Lane Mutation Strategy: Defines when to use Zero custom mutators for optimistic UI and when to use REST (Hono RPC) endpoints for non-optimistic or cross-platform writes.
- Ownership and Validation: Enforces server-authoritative ownership checks via ZQL filters and Zod validation to prevent unauthorized data modification.
- Use Case: When adding a new feature like deleting a chat, this skill guides you to implement a Zero mutator for instant web feedback and a corresponding REST endpoint for mobile and webhook support, both sharing the same underlying Drizzle mutation logic.
Quick Start
Use the Cobalt Mutations skill to generate a new mutator for the transactions domain that handles optimistic UI updates and server-side validation.