type-inference

type-inference is a cursor rule for Cursor from louisbrulenaudet/monorepo-template. It costs 0 tokens per session (420 once invoked), scanned A, original, Apache-2.0.

Rules for creating TypeScript types from Zod schemas, which describe and validate data structures. The schema remains the source of truth for data sent between parts of an application.

In plain words
What is it for?
They guide shared request, response, input, and message schemas and the placement and naming of their inferred TypeScript types.
Why use it?
They prevent the same data shape from being written twice and then drifting out of sync.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit They guide shared request, response, input, and message schemas and the placement and naming of their inferred TypeScript types.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/louisbrulenaudet/monorepo-template/type-inference
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/louisbrulenaudet/monorepo-template

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 type-inference

README.md
[![agentmods](https://agentmods.dev/badge/rules/louisbrulenaudet/monorepo-template/type-inference.svg)](https://agentmods.dev/rules/louisbrulenaudet/monorepo-template/type-inference)
Your own site
<a href="https://agentmods.dev/rules/louisbrulenaudet/monorepo-template/type-inference"><img src="https://agentmods.dev/badge/rules/louisbrulenaudet/monorepo-template/type-inference.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 420 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.
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.00000 $0.00420
Opus 5 $0.00000 $0.00210
Sonnet 5 $0.00000 $0.00084
Haiku 4.5 $0.00000 $0.00042

Measured 8d ago against content hash 89407dadaa98, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

type-inference 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 8d 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/rules/contracts/type-inference.mdc · 39 lines

What it actually says

Type Inference First

Derive TypeScript types from the source of truth. Do not hand-write interface / type aliases for shapes a Zod schema already defines. See contracts.mdc for where each schema belongs.

Zod file layout

  • Schema exports end in Schema / RequestSchema / ResponseSchema / InputSchema / PayloadSchema.
  • All inferred types sit at the bottom of the file, after every schema - never interleaved:
    export const ExampleInputSchema = z.object({ /* ... */ });
    
    export type ExampleInput = z.infer<typeof ExampleInputSchema>;
    
  • Never use a Type suffix on inferred exports (ExampleInputType is forbidden).
  • Shared constrained values live in @repo/enums-common as as const objects - not parallel string-literal unions or export enum.

Keep schemas lean

  • Constrained value members belong in z.enum(ValueSet) or z.enum([...] as const) from @repo/enums-common - do not also spell them out in .describe() prose.
  • Per-corpus planning guidance goes inline in the tool description and input .describe() text; there is no separate discovery catalog.

Do not

  • Duplicate HTTP/wire shapes in app-local interfaces.
  • Add types.ts files or parallel interfaces for shapes Zod or Drizzle already define.
  • Use a Type suffix on inferred exports (FooRequestType is forbidden).
  • Hand-write DB row types when a Drizzle table exists.

Allowed exceptions

  • App-local-only types that never cross a package boundary.
  • Mapping helpers between inferred types (e.g. output projection).
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. 8d ago First seen · 39 lines · 0 tokens per session scan A 89407dadaa98

Subscribe to this mod's changes

type-inference is a cursor rule published in the GitHub repository louisbrulenaudet/monorepo-template (19 stars, last pushed 7d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 420 tokens. 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.