markdown-site: Skill for Cursor

.cursor/skills/convex-return-validators/SKILL.md

convex-return-validators is a skill for Cursor from waynesutton/markdown-site. It costs 144 tokens per session (2,106 once invoked), scanned A, original, MIT.

A guide for deciding when Convex functions should validate the values they return. Convex is a backend platform, and a return validator checks that a function's output has the expected shape at runtime.

In plain words
What is it for?
It helps choose and write return validators for Convex queries, mutations, and actions. It also explains when ordinary TypeScript types and inferred types are sufficient.
Why use it?
It avoids adding extra validation everywhere while still supporting exact runtime contracts where they matter. This can catch unexpected output instead of allowing it to pass silently.

Skill for Cursor

Written for Cursor: installed under .cursor/.

This is waynesutton/markdown-site's own configuration. It tells Cursor how to work on markdown-site itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything markdown-site configures →

Reuse

Borrowing it

Nothing to install: this file belongs to waynesutton/markdown-site. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/waynesutton/markdown-site/main/.cursor/skills/convex-return-validators/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/waynesutton/markdown-site

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for convex-return-validators

README.md
[![agentmods](https://agentmods.dev/badge/skills/waynesutton/markdown-site/convex-return-validators/github.svg)](https://agentmods.dev/skills/waynesutton/markdown-site/convex-return-validators)
Your own site
<a href="https://agentmods.dev/skills/waynesutton/markdown-site/convex-return-validators"><img src="https://agentmods.dev/badge/skills/waynesutton/markdown-site/convex-return-validators/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for convex-return-validators

Your own site · 80×15
<a href="https://agentmods.dev/skills/waynesutton/markdown-site/convex-return-validators"><img src="https://agentmods.dev/badge/skills/waynesutton/markdown-site/convex-return-validators.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 144 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,106 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00144 $0.02106
Opus 5.5 $0.00058 $0.00842
Sonnet 5.5 $0.00029 $0.00421
Haiku 4.5 $0.00014 $0.00211

Measured 1mo ago against content hash dc5187f72df1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

convex-return-validators scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/skills/convex-return-validators/SKILL.md · 190 lines

How it starts

The opening of the file, as written. The whole thing — 190 lines — stays where its author put it; the contents beside it link to each section on GitHub.

When to and when not to use return validators in Convex

Convex recently updated its guidance on return validators. The old rule was "always add a returns validator." The new guidance is: prefer simple TypeScript types and inference by default. Use returns: when you actually want Convex to enforce an exact runtime contract.

Return validators aren't bad. The word "always" was doing damage.

What is a return validator?

Convex lets you validate arguments coming into a function using args and return values going out using returns. A return validator declares the return shape, and Convex checks it at runtime.

import { query } from "./_generated/server";
import { v } from "convex/values";

export const getUserPreview = query({
  args: { userId: v.id("users") },
  returns: v.object({
    name: v.string(),
  }),
  handler: async (ctx, { userId }) => {
    const user = await ctx.db.get(userId);
    if (!user) throw new Error("User not found");
    return { name: user.name };
  },
});

If the returned value doesn't match, you get a runtime error instead of silently returning unexpected data. Object validators don't allow extra properties — returning extra fields will fail validation at runtime.

Why the old "always" rule existed

The original motivation was more about TypeScript pain than runtime correctness. Convex projects can hit circular type problems because functions reference generated api or internal objects, and those references become part of the generated types. Types reference types reference types until TypeScript gives up.

The thinking: if the model always declared return validators, it would reduce reliance on inferred return types and break the cycle. In practice, it only helps in specific circumstances.

Why "always" causes problems

In real codebases, and especially in agentic AI workflows, the "always" rule creates predictable failure modes:

Verbosity and copy-paste fragility

LLMs don't reuse validators. They copy-paste shapes inline. You end up with return validators like this on every function:

Read the full file on GitHub · 190 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 190 lines · 144 tokens per session scan A dc5187f72df1

Subscribe to this mod's changes

convex-return-validators is a skill published in the GitHub repository waynesutton/markdown-site (627 stars, last pushed 5mo ago), licensed MIT. It adds 144 tokens to every session and 2,106 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.