mcpField
T
trpc

trpc

github.com/pproencaDevelopment22266 installsUpdated 12w ago
Repository

About trpc

A reference skill for agents writing or reviewing tRPC v11 code. It catalogs version-specific decisions and pitfalls across React integration, migrations, routing, transport, SSR, and subscriptions.

Key features

  1. 01tRPC v11 API guidance
  2. 02v10-to-v11 migration notes
  3. 03Router and procedure patterns
  4. 04Error and validation guidance
  5. 05Transport and batching cautions
  6. 06SSR and subscription patterns

Use cases

  1. 01Reviewing tRPC v11 code
  2. 02Migrating projects from tRPC v10
  3. 03Adding uploads or subscriptions
  4. 04Troubleshooting prefetch and batching issues

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/pproenca/dot-skills --skill trpc

After installing, type/trpcin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

AGENTS.md
metadata.json
assets/templates/
_template.md
references/
_sections.md
client-derive-query-keys.md
client-invalidate-with-query-filters.md
client-subscription-options.md
client-tanstack-integration.md
err-format-standard-schema-issues.md
err-nullish-cursor.md
err-output-strips-fields.md
err-set-isdev-explicitly.md
link-cap-batch-size.md
link-default-to-httpbatchlink.md
link-endpoint-matches-mount-path.md
link-gate-cache-headers.md
link-read-batch-headers-from-oplist.md
link-route-subscriptions-separately.md
link-scope-body-parsers.md
link-transformer-on-terminating-links.md
mig-await-get-raw-input.md
mig-formdata-is-native.md
mig-renamed-type-exports.md
mig-typescript-version-floor.md
proc-concat-over-standalone-middleware.md
proc-input-before-use.md
proc-merge-only-object-inputs.md
proc-narrow-ctx-in-middleware.md
proc-single-trpc-instance.md
rsc-dehydrate-pending-queries.md

Details

From the project README

tRPC v11

The decisions tRPC forces and how to settle them, written so an agent applies them while writing or reviewing code. Every rule names the wrong default it corrects; there is no rule for what the model already gets right.

Pinned to tRPC v11, verified against 11.18.0 (2026-06-17). There is no v12 — but several APIs here carry @deprecated … will be removed in v12 and still ship today. Peers: typescript >=5.7.2, @tanstack/react-query ^5.80.3, react >=18.2.0.

When to Apply

Use this skill when:

  • Code imports initTRPC, createTRPCContext, createTRPCOptionsProxy, createTRPCReact, createTRPCClient, httpBatchLink, httpSubscriptionLink, splitLink, fetchRequestHandler, createCallerFactory, or TRPCError — or defines procedures with .input() / .output() / .use() / .query() / .mutation() / .subscription()
  • The user says "everything types as any", "invalidation isn't working", "contextMap[utilName] is not a function", "the transformer property moved", "414 / 413 on the dashboard", "subscriptions won't connect", "the prefetch isn't hydrating", or "it 404s every procedure"
  • Migrating a codebase from tRPC v10, or reviewing tRPC code written against v10-era examples — the highest-yield moment, because the recommended React client changed and stale code often still compiles
  • Adding the first subscription, the first file upload, or the first RSC prefetch to an existing router — each crosses into a surface where v11 replaced the v10 approach outright
  • Reviewing a batched client as the app grows, where the uncapped defaults turn into intermittent production failures

This skill is NOT for:

  • General TanStack Query semantics — cache lifetimes, retry, useMutation ergonomics (→ tanstack-query)
  • Authoring or migrating the Zod schemas used as validators (→ zod)
  • Next.js App Router routing, streaming, or caching beyond the tRPC handler (→ nextjs)
  • General TypeScript narrowing and generics (→ typescript)

Rule Categories

#CategoryPrefixCovers
1React Client Surfaceclient-Which integration, options factories, query keys, invalidation, subscribing
2v10 → v11 Driftmig-Renamed, removed, and lazily-materialized APIs; peer-version floors
3Router & Procedure Constructionproc-Instance identity, builder order, context narrowing, input merging
4Error & Validation Semanticserr-What surfaces, what leaks, which error class
5Links, Transport & Serializationlink-Link chain, batching limits, transformers, adapters, caching
6SSR, RSC & Server-Side Callsrsc-Prefetch and hydration, QueryClient lifetime, caller misuse
7Subscriptions & Streamingsub-Async generators over SSE, auth, keepalive, backlog races

Quick Reference

1. React Client Surface
2. v10 → v11 Drift
3. Router & Procedure Construction
4. Error & Validation Semantics
  • err-format-standard-schema-issues — Parser dispatch is ordered, so a Zod-only errorFormatter returns null for Valibot / Effect (StandardSchemaV1Error) and for ArkType (ArkErrors)
  • err-output-strips-fields — .output() returns the parsed value, so it strips unknown keys; its failure is a 500, not a 4xx
  • err-nullish-cursor — .optional() cursors 400 only after an invalidate; use .nullish()
  • err-set-isdev-explicitly — Without an explicit isDev, edge runtimes ship error.data.stack to every client
5. Links, Transport & Serialization
6. SSR, RSC & Server-Side Calls
7. Subscriptions & Streaming

How to Use

Read a reference file when its decision comes up. Each rule names the wrong default it corrects, then shows the canonical way — with an incorrect/correct contrast only where the wrong way is a real trap.

Two shortcuts worth taking first:

  • Reviewing or migrating existing tRPC code? Start with client- and mig-. Stale code frequently still compiles, so nothing points you at these; they are what everything else inherits.

  • Hardening something already working? The security-shaped rules are link-gate-cache-headers, rsc-query-client-per-request, err-set-isdev-explicitly, proc-input-before-use, and sub-keep-credentials-out-of-urls.

  • Section definitions — category structure and ordering rationale

  • Rule template — for adding new rules

  • AGENTS.md — auto-built table of contents across all rules

Related Skills

  • tanstack-query — The query layer tRPC's React client now delegates to; owns cache semantics this skill assumes
  • zod — Validator authoring and Zod 4 drift, including the .flatten() → z.treeifyError() change this skill only points at
  • typescript — General type-level work beyond tRPC's inference surface

Comments

Markdown supported