Agent skill · software engineering · aiskillstore

add-malli-schemas

Efficiently add Malli schemas to API endpoints in the Metabase codebase with proper patterns, validation timing, and error handling

Why this skill is useful

Provides specific patterns and validation techniques for integrating Malli schemas into Metabase API endpoints that the AI wouldn't reliably generate on its own.

What it needs

About 6k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.

What this skill does

Add Malli Schemas to API Endpoints This skill helps you efficiently and uniformly add Malli schemas to API endpoints in the Metabase codebase. Reference Files (Best Examples) src/metabase/warehouses/api.clj - Most comprehensive schemas, custom error messages src/metabase/apikeys/api.clj - Excellent response schemas src/metabase/collections/api.clj - Great named schema patterns src/metabase/timeline/api/timeline.clj - Clean, simple examples Quick Checklist When adding Malli schemas to an endpoint: [ ] Route params have schemas [ ] Query params have schemas with :optional true and :default where appropriate [ ] Request body has a schema (for POST/PUT) [ ] Response schema is defined (using :- after route string) [ ] Use existing schema types from ms namespace when possible [ ] Consider creating named schemas for reusable or complex types [ ] Add contextual error messages for validation failures Basic Structure Complete Endpoint Example Common Schema Patterns 1. Route Params (the 5 in api/user/id/5) 2. Query Params (the sort+asc pair in api/users?sort=asc) 3. Body Params (the contents of a request body. Almost always decoded from json into edn) 4. The Raw Request map Of the 4 arguments, deprioritize usage of the raw request unless necessary. Route Params Always required, typically just a map with an ID: For multiple route params: Query Params Add properties for {:optional true ...} and :default values: Request Body (POST/PUT) Response Schemas Simple inline response: Named schema for reuse: Common Schema Types From metabase.util.malli.schema (aliased as ms) Prefer the schemas in the ms/ namespace, since they work better with our api infrastructure. For example use ms/PositiveInt instead of pos-int?. IMPORTANT: For response schemas, use :any for temporal fields, not ms/TemporalString! Response schemas validate BEFORE JSON serialization, so they see Java Time objects. Built-in Malli Types Avoid using sequence schemas unless completely necessary. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills aiskillstore/add-malli-schemas

View the source on GitHub

Browse the @skills marketplace