Agent skill

Server TRPC Router Guide

by lobehub in lobehub/lobehub

Conventions for LobeHub's server tRPC routers: file locations, middleware that injects models into ctx, procedure patterns, aggregated detail endpoints and return shapes.

Custom licenceAuto-check passedBackend & APIs

Install Server TRPC Router Guide

skills CLI
$ npx skills add lobehub/lobehub --skill trpc-router -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install lobehub/lobehub trpc-router --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/lobehub/lobehub.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/trpc-router .claude/skills/trpc-router && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
trpc-router
GitHub stars
83k
Token cost
~904 tokens
SKILL.md length
144 words
Files
1
Skills in repo
50
Repo updated
First seen
Licence
Custom licence

At a glance

Conventions for LobeHub's server tRPC routers: file locations, middleware that injects models into ctx, procedure patterns, aggregated detail endpoints and return shapes.

  • Adding a new tRPC router or procedure to the server
  • SKILL.md covers File Location, Router Structure and Conventions
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Replacing per-procedure model construction with middleware

What it does

The skill covers routers under apps/server/src/routers/lambda, with helpers and schemas in sibling folders. The main rule is to inject models into ctx through middleware instead of constructing a new model inside every procedure, with an exception for cases such as a watchdog iterating over several users' tasks. Procedures use zod input schemas defined at the top of the file, and each router is exported as a fooRouter built with router().

For views that need related data, it recommends one aggregated detail procedure that fetches everything in parallel, so the CLI or frontend avoids many sequential requests. Other conventions are that queries return data with success true, mutations return data, a message and success true, TRPCError is re-thrown while other errors are logged and wrapped, procedures are alphabetical within the router, and log lines carry a prefix naming the domain and procedure.

When your agent uses it

  • Adding a new tRPC router or procedure to the server
  • Replacing per-procedure model construction with middleware
  • Building a detail endpoint that returns several related records at once

Example prompts

  • “Add a router for comments with find, create and delete procedures.”
  • “Refactor this router so the models come from ctx through middleware.”
  • “Create a single detail endpoint for tasks that loads its documents and topics in parallel.”

Requirements

  • A checkout of the LobeHub repository

What it can do on your machine

Read from SKILL.md and the folder at commit 35d442e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Server TRPC Router Guide loads about 904 tokens when it runs. Until then it costs about 24 tokens; SKILL.md has 144 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~24
When it runs · the whole SKILL.md, loaded when a task matches
~904

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

Its licence (Custom licence) doesn't allow us to republish the file, so here is its outline and opening line. It has 144 words (~904 tokens).

“Always use middleware to inject models into ctx instead of creating new Model(ctx.serverDB, ctx.userId) inside every procedure.”

— opening of SKILL.md by lobehub, Custom licence
name
trpc-router
user-invocable
false

Read the full SKILL.md on GitHub

Files

Just SKILL.md in .agents/skills/trpc-router of lobehub/lobehub.

Open the folder on GitHubat commit 35d442e

Compare with similar skills

Server TRPC Router Guide next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Server TRPC Router Guide compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Server TRPC Router Guide this skilllobehub/lobehub83k—~904Automated safety check: PassCustom licence
Node Backend Development Guidelinesdiet103/claude-code-infrastructure-showcase10k2 repos~2kAutomated safety check: PassMIT
Pangolin CRUD Endpointsfosrl/pangolin23k—~461Automated safety check: PassCustom licence
Backend Dev Guidelineslitefuse/litefuse1001 repos~5.8kAutomated safety check: PassCustom licence
Implementing API Patternsancoleman/ai-design-components526—~3kAutomated safety check: PassMIT
Typescript SecurityHoangNguyen0403/agent-skills-standard571—~817Automated safety check: NotesMIT

Similar skills

  • Node Backend Development Guidelines

    diet103/claude-code-infrastructure-showcase

    Sets layered architecture and coding rules for Node.js, Express and TypeScript microservices, covering routes, controllers, services, repositories, Prisma, Sentry and Zod.

    10k GitHub starsUsed in 2 repos~2k tokens
    Backend & APIsAuto-check passed
  • Use whenever asked to add, create, or scaffold a CRUD endpoint, router, or entity in this repo's server (create/list/get/update/delete handlers, new…

    23k GitHub stars~461 tokensUpdated today
    Backend & APIsAuto-check passed
  • Backend Dev Guidelines

    litefuse/litefuse

    Comprehensive backend development guide for Litefuse's Next.js 14/tRPC/Express/TypeScript monorepo.

    100 GitHub starsUsed in 1 repo~5.8k tokens
    Backend & APIsAuto-check passed
  • Implementing API Patterns

    ancoleman/ai-design-components

    API design and implementation across REST, GraphQL, gRPC, and tRPC patterns.

    526 GitHub stars~3k tokensUpdated 10 mo ago
    Backend & APIsAuto-check passed
  • Typescript Security

    HoangNguyen0403/agent-skills-standard

    Secure server-side TypeScript input, auth tokens, and injection boundaries.

    571 GitHub stars~817 tokensUpdated today
    DevelopmentAuto-check: notes
  • Nodejs Backend Patterns

    ever-works/ever-works

    Build production-ready Node.js backend services with Express/Fastify, implementing middleware patterns, error handling, authentication, database integration, and API design best practices.

    162 GitHub starsUsed in 18 repos~4k tokens
    Backend & APIsAuto-check passed

More from lobehub/lobehub

All 50 skills in this repo
  • Builds single-file interactive HTML prototypes rendered with the real LobeHub UI components and written as production-style React, so they can later be split into files.

    83k GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Verifies a delivery end to end by driving the real product on a CLI, web, desktop or iOS Simulator surface, capturing evidence and publishing a round with the lh CLI.

    83k GitHub stars~9.7k tokensUpdated today
    Auto-check passed
  • Git Worktree Cleanup

    lobehub/lobehub

    Audits stale Git worktrees and branches with a bundled script, classifies each one, and deletes only after you approve the exact candidates.

    83k GitHub stars~2.8k tokensUpdated today
    Auto-check passed
  • Maintains LobeHub's model-backed alint rule set: writing rules, removing false positives against real code, deciding warn versus error and tracking token cost.

    83k GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Guides building LobeHub builtin agent tools, from the manifest and execution runtime to executors, chat UI renders and registry wiring.

    83k GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • Explains how LobeHub client code fetches data through services, SWR store hooks and cache keys, and when to avoid useEffect fetching or duplicated state.

    83k GitHub stars~1.7k tokensUpdated today
    Auto-check passed

Categories

Questions about Server TRPC Router Guide

What does Server TRPC Router Guide do?

Conventions for LobeHub's server tRPC routers: file locations, middleware that injects models into ctx, procedure patterns, aggregated detail endpoints and return shapes. The skill covers routers under apps/server/src/routers/lambda, with helpers and schemas in sibling folders. The main rule is to inject models into ctx through middleware instead of constructing a new model inside every procedure, with an exception for cases such as a watchdog iterating over several users' tasks.

When should I use Server TRPC Router Guide?

Server TRPC Router Guide fits situations like: adding a new tRPC router or procedure to the server; replacing per-procedure model construction with middleware; building a detail endpoint that returns several related records at once.

How do I install Server TRPC Router Guide in Claude Code?

Run `npx skills add lobehub/lobehub --skill trpc-router -a claude-code`. Or copy the skill folder (.agents/skills/trpc-router in lobehub/lobehub) into .claude/skills/trpc-router in your project. Claude Code loads it when a task matches its description.

How do I install Server TRPC Router Guide in Codex?

Run `npx skills add lobehub/lobehub --skill trpc-router -a codex`. Or copy the skill folder (.agents/skills/trpc-router in lobehub/lobehub) into .agents/skills/trpc-router in your project. Codex loads it when a task matches its description.

Can I use Server TRPC Router Guide in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add lobehub/lobehub --skill trpc-router -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/trpc-router, .gemini/skills/trpc-router, .github/skills/trpc-router and .opencode/skills/trpc-router in your project.

What does Server TRPC Router Guide need to run?

SKILL.md names no scripts, command-line tools or credentials: Server TRPC Router Guide is instructions for the agent only. Our summary lists: A checkout of the LobeHub repository.

Does Server TRPC Router Guide access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Server TRPC Router Guide safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Server TRPC Router Guide use?

Server TRPC Router Guide has a licence file (the repository's licence) that doesn't match a standard licence. Read it on GitHub before reusing the skill.

How many tokens does Server TRPC Router Guide use?

About 904 tokens (SKILL.md is roughly 3.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Server TRPC Router Guide?

Skills that share tags, products or a category with Server TRPC Router Guide: Node Backend Development Guidelines (diet103/claude-code-infrastructure-showcase, 10k stars), Pangolin CRUD Endpoints (fosrl/pangolin, 23k stars), Backend Dev Guidelines (litefuse/litefuse, 100 stars) and Implementing API Patterns (ancoleman/ai-design-components, 526 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Server TRPC Router Guide?

lobehub (a GitHub organization) maintains it in lobehub/lobehub, which has 83,074 GitHub stars. The repository holds 50 skills in this directory. The repository was last updated on October 9, 2026.

Source: lobehub/lobehub on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.