Cobalt — Mutations

Standardize data mutations across Zero custom mutators and Hono REST endpoints.

7|Updated Mar 15, 2026
One-click install
npx skills add https://github.com/Cobalt-Money/Cobalt --skill cobalt-mutations
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Cobalt — Mutations
Source: https://github.com/Cobalt-Money/Cobalt/tree/main/.agents/skills/cobalt/mutations
Command: npx skills add https://github.com/Cobalt-Money/Cobalt --skill cobalt-mutations

SYSTEM DOCUMENTATION & REQUIREMENTS

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.

Frequently Asked Questions about Cobalt — Mutations

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement optimistic UI updates without breaking server-side data consistency in a monorepo?

To implement optimistic UI updates while maintaining server-side data consistency, use a dual-lane strategy combining Zero custom mutators for instant web feedback with Hono REST endpoints for robust server-side validation. Both paths share the same underlying Drizzle mutation logic to guarantee data integrity.

What is the best way to standardize data mutations across web and mobile clients?

The best way to standardize data mutations across web and mobile clients is to define a unified architectural pattern using Zero custom mutators for web optimistic UI and Hono RPC endpoints for cross-platform writes. This enforces Zod validation and ownership-by-filter security constraints across all consumers.

How do I add a new data mutation that supports both instant web feedback and external webhooks?

To add a new data mutation supporting instant web feedback and external webhooks, implement a Zero mutator for the web client's optimistic UI and a corresponding Hono REST endpoint for webhook support. Both must adhere to the established Drizzle schema and Zod validation rules.

Does Zero support server-authoritative ownership checks to prevent unauthorized data modification?

Yes, Zero supports server-authoritative ownership checks by enforcing ZQL filters and Zod validation. This integration prevents unauthorized data modification by ensuring all custom mutators and REST endpoints respect ownership-by-filter security constraints defined in the Drizzle schema.

When should I use Zero custom mutators instead of Hono REST endpoints for data writes?

You should use Zero custom mutators when you need optimistic UI write paths for web clients, and Hono REST endpoints for non-optimistic writes, mobile applications, or external consumers. Both approaches share the same underlying Drizzle mutation logic for data consistency.

Why do my optimistic UI writes fail Zod validation on the server?

Optimistic UI writes fail Zod validation on the server when the client-side mutator payload does not adhere to the established Drizzle schema constraints. Ensure your Zero custom mutators and Hono REST endpoints share the exact same underlying Drizzle mutation logic and Zod validation schemas.