convex-return-validators

Guide Convex developers on when to apply return validators.

5|1|Updated May 31, 2026
One-click install
npx skills add https://github.com/waynesutton/teleprompter --skill convex-return-validators
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convex-return-validators
Source: https://github.com/waynesutton/teleprompter/tree/main/.cursor/skills/convex-return-validators
Command: npx skills add https://github.com/waynesutton/teleprompter --skill convex-return-validators

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Convex developers often struggle with knowing when to apply return validators and how to reason about runtime contract enforcement. This skill provides guidance on best practices for using returns validators in Convex functions to improve type safety without adding unnecessary boilerplate.

Core Features & Use Cases

  • Clarifies when to use or avoid return validators in queries, mutations, and actions.
  • Explains how validators interact with runtime contracts, static codegen, OpenAPI generation, and external data.
  • Provides practical examples and decision framework for common Convex development scenarios.

Quick Start

Decide if a returns validator is needed for a Convex function and implement it only when runtime contract enforcement is required.

Frequently Asked Questions about convex-return-validators

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

FAQPage Schema
When do I need return validators in Convex functions?

Use return validators in Convex functions only when an exact runtime contract is necessary, preferring TypeScript types and inference by default to avoid unnecessary boilerplate.

How do return validators affect static codegen and OpenAPI generation in Convex?

Return validators impact component codegen, static codegen, and OpenAPI generation by enforcing strict runtime contracts, ensuring that generated types and external interfaces match the actual function outputs.

What is the best way to handle type safety for unvalidated external data in Convex?

For unvalidated external data or AI-generated code, apply return validators to enforce strict runtime contracts, ensuring data integrity when consuming unpredictable inputs outside your internal TypeScript types.

Should I use return validators or shared validators for Convex queries?

Prefer shared validators and Doc/WithoutSystemFields for Convex queries when runtime validation is not required, utilizing return validators only for exact runtime contract enforcement.

Can I rely on TypeScript inference instead of runtime validation for Convex mutations?

Yes, rely on TypeScript inference by default for Convex mutations to maintain type safety without boilerplate, adding returns validators only when explicit runtime contract enforcement is required.