agentleFS
Ghost7802Ghost7802/awesome-api-skills/skills/trpc/SKILL.md

trpc

Skill13 starsChanged 26 days agoMITView on GitHub

End-to-end typesafe APIs made easy.

  • Installs packages

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this when your agent works with trpc — structured patterns beat pasted docs and prevent common hallucinations.

    line 42

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

tRPC Skill

End-to-end typesafe APIs made easy.

Ecosystem Graph

graph LR
  trpc["tRPC"]
  trpc -- "works well with" --> nextjs
  trpc -- "works well with" --> react

Quick Start

tRPC allows you to easily build & consume fully typesafe APIs without schemas or code generation. It relies on TypeScript inference to share types between your server and client.

npm install @trpc/server @trpc/client @trpc/react-query @tanstack/react-query zod

Production Patterns

Input Validation

tRPC strongly integrates with Zod. Always define an .input(z.object({...})) schema for your mutations. tRPC will automatically reject invalid payloads before your resolver function ever executes.

Architecture & Scaling

Routers and Procedures

Group your endpoints into sub-routers (e.g., userRouter, postRouter) and merge them into an appRouter. This prevents your primary router file from becoming unmaintainable.

Error Recovery

Throw TRPCError with specific codes (e.g., UNAUTHORIZED, NOT_FOUND). On the client, React Query will automatically catch these and expose them via the error object.

Security Notes

Implement a protectedProcedure middleware. Extract the session from the context (ctx), verify it, and throw a TRPCError if invalid. Use this procedure for all secure endpoints instead of the standard publicProcedure.

Relationships

Works Well With: nextjs, react

References

Why use this skill

Use this when your agent works with trpc — structured patterns beat pasted docs and prevent common hallucinations.

AI pitfalls

  • Referencing CLI flags or config keys that do not exist
  • Using outdated major versions of tools
  • Skipping lockfile or version pinning in examples

Production checklist

  • Secrets in environment variables, not source code
  • Error handling and logging in place
  • Rate limits and timeouts configured

Related skills

  • nextjs — works well with
  • react — works well with

Last Verified: 2026-07-02

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.