andershi666/lobehub-hr-demo/trpc-router
Claude Code and agent skill by andershi666/lobehub-hr-demo
- community
Checking that the SKILL.md file is still in the repository.
TRPC router development guide. Use when creating or modifying TRPC routers (src/server/routers/**), adding procedures, or working with server-side API endpoints. Triggers on TRPC router creation, procedure implementation, or API endpoint tasks.
Install
npx vskill@latest install andershi666/lobehub-hr-demo/trpc-routerSKILL.md
The same SKILL.md was published earlier as yyc-cube/yyc3-knowledge-base/trpc-router.
TRPC Router Guide
File Location
- Routers:
src/server/routers/lambda/<domain>.ts - Helpers:
src/server/routers/lambda/_helpers/ - Schemas:
src/server/routers/lambda/_schema/
Router Structure
Imports
Middleware: Inject Models into ctx
Always use middleware to inject models into `ctx` instead of creating new Model(ctx.serverDB, ctx.userId) inside every procedure.
Then use ctx.fooModel in procedures:
Exception: When a model needs a different userId (e.g., watchdog iterating over multiple users' tasks), create it inline.
Procedure Pattern
Aggregated Detail Endpoint
For views that need multiple related data, create a single detail procedure that fetches everything in parallel:
This avoids the CLI or frontend making N sequential requests.
Conventions
- Return shape:
{ data, success: true }for queries,{ data?, message, success: true }for mutations - Error handling: re-throw
TRPCError, wrap others withconsole.error+ newTRPCError - Input validation: use
zodschemas, define at file top - Router name:
export const fooRouter = router({ ... }) - Procedure names: alphabetical order within the router object
- Log prefix:
[domain:procedure]format, e.g.[task:create]
Security
- Security scanPassed, 98 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckinglobehub/.agents/skills/trpc-router/SKILL.md
Popularity
- Repository stars
- 1
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/andershi666/lobehub-hr-demo/trpc-router)