Hub rules-trpc

rules-trpc

v4 public Verified

tRPC

tRPC is a framework for building end-to-end typesafe APIs without code generation. These rules govern procedure definition safety, input validation, and API best practices for AI agents.

@sigmashakeinc 3 pulls 5 rules published Apr 8, 2026 synced Oct 11, 2026 sigmashakeinc/rules/rulesets/rules-trpc →
Severity
1 error 4 warn 0 info
demo.cast
tRPC is a framework for building end-to-end typesafe APIs without code generation. These rules govern procedure definition safety, input validation, and API best practices for AI agents.

Rules index

5 governance rules

Indexed from the repository's .rules files, grouped by technology. Expand any rule to read the raw source.

trpc

trpc-block-unsafe-patterns warning ask

Potentially unsafe pattern detected in trpc code: "unstable_concat". Review the use case — this may indicate a security risk, a deprecated API, or a misconfiguration. Confirm the write is intentional.

Rule source requires an active Pro or Enterprise subscription.
trpc-force-updated-api warning log

You are using an outdated API for trpc. Please upgrade to the newer API.

Rule source requires an active Pro or Enterprise subscription.
trpc-no-appRouter-exposed-without-auth-middleware warning log

RISK: Exposing a tRPC router via createNextApiHandler or fetchRequestHandler without a createContext that attaches session/auth info means auth middleware has no context to check — all procedures effectively run unauthenticated. FIX: always pass a createContext factory that reads the session (e.g., getServerSession) and surfaced it to protectedProcedure middleware.

Rule source requires an active Pro or Enterprise subscription.
trpc-no-mutation-without-input-validation error log

RISK: A tRPC mutation with no input schema accepts any caller-supplied payload without validation — every field is implicitly 'any', enabling injection of unexpected types, objects, or oversized payloads (CWE-20). FIX: always define an 'input: z.object({...})' schema so Zod validates and strips unknown keys before the handler runs.

Rule source requires an active Pro or Enterprise subscription.
trpc-no-public-procedure-sensitive-data warning log

RISK: Using publicProcedure (unauthenticated) for operations that modify data, access user records, or handle secrets bypasses authentication entirely — any unauthenticated caller can invoke these. FIX: use a protectedProcedure (with middleware that verifies a session/JWT) for any write or sensitive-read operation.

Rule source requires an active Pro or Enterprise subscription.

Version metadata

Published metadata

The hash-locked record of this published ruleset. When source contents change, the maintainer resyncs and the version bumps.

Version
v4
Published
Apr 8, 2026
Source commits
0
Synced
Oct 11, 2026
Hash
6cace1d062ae21a713f8e0656553993d57784c31e71a3bf97d85891daac85edd
Signature
Verified (publisher key)
Tested with
claude-code@current
Plan
Starter (free)
Visibility
Public

Source history

Recent commits

Latest commits touching rulesets/rules-trpc/.sigmashake/rules in sigmashakeinc/rules/rulesets/rules-trpc. The published version only bumps when a maintainer resyncs.

No commit history available.