--- name: trpc-fullstack description: "tRPC Full-Stack workflow skill. Use this skill when the user needs Build end-to-end type-safe APIs with tRPC \u2014 routers, procedures, middleware, subscriptions, and Next.js/React integration patterns and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off." version: "0.0.1" category: backend tags: ["typescript", "trpc", "api", "fullstack", "nextjs", "react", "type-safety", "trpc-fullstack"] complexity: advanced risk: caution tools: ["cursor", "codex-cli", "claude-code", "gemini-cli", "opencode"] source: community author: "suhaibjanjua" date_added: "2026-04-15" date_updated: "2026-04-25" --- # tRPC Full-Stack ## Overview This public intake copy packages `plugins/antigravity-awesome-skills-claude/skills/trpc-fullstack` from `https://github.com/sickn33/antigravity-awesome-skills` into the native Omni Skills editorial shape without hiding its origin. Use it when the operator needs the upstream workflow, support files, and repository context to stay intact while the public validator and private enhancer continue their normal downstream flow. This intake keeps the copied upstream files intact and uses the `external_source` block in `metadata.json` plus `ORIGIN.md` as the provenance anchor for review. # tRPC Full-Stack Imported source sections that did not map cleanly to the public headings are still preserved below or in the support files. Notable imported sections: Core Concepts, How It Works, Security & Safety Notes, Common Pitfalls, Limitations. ## When to Use This Skill Use this section as the trigger filter. It should make the activation boundary explicit before the operator loads files, runs commands, or opens a pull request. - Use when building a TypeScript full-stack app (Next.js, Remix, Express + React) where the client and server share a single repo - Use when you want end-to-end type safety on API calls without REST/GraphQL schema overhead - Use when adding real-time features (subscriptions) to an existing tRPC setup - Use when designing multi-step middleware (auth, rate limiting, tenant scoping) on tRPC procedures - Use when migrating an existing REST/GraphQL API to tRPC incrementally - Use when the request clearly matches the imported source intent: Build end-to-end type-safe APIs with tRPC — routers, procedures, middleware, subscriptions, and Next.js/React integration patterns. ## Operating Table | Situation | Start here | Why it matters | | --- | --- | --- | | First-time use | `metadata.json` | Confirms repository, branch, commit, and imported path through the `external_source` block before touching the copied workflow | | Provenance review | `ORIGIN.md` | Gives reviewers a plain-language audit trail for the imported source | | Workflow execution | `SKILL.md` | Starts with the smallest copied file that materially changes execution | | Supporting context | `SKILL.md` | Adds the next most relevant copied source file without loading the entire package | | Handoff decision | `## Related Skills` | Helps the operator switch to a stronger native skill when the task drifts | ## Workflow This workflow is intentionally editorial and operational at the same time. It keeps the imported source useful to the operator while still satisfying the public intake standards that feed the downstream enhancer flow. 1. Confirm the user goal, the scope of the imported workflow, and whether this skill is still the right router for the task. 2. Read the overview and provenance files before loading any copied upstream support files. 3. Load only the references, examples, prompts, or scripts that materially change the outcome for the current request. 4. Execute the upstream workflow while keeping provenance and source boundaries explicit in the working notes. 5. Validate the result against the upstream expectations and the evidence you can point to in the copied files. 6. Escalate or hand off to a related skill when the work moves out of this imported workflow's center of gravity. 7. Before merge or closure, record what was used, what changed, and what the reviewer still needs to verify. ### Imported Workflow Notes #### Imported: Overview tRPC lets you build fully type-safe APIs without writing a schema or code-generation step. Your TypeScript types flow from the server router directly to the client — so every API call is autocompleted, validated at compile time, and refactoring-safe. Use this skill when building TypeScript monorepos, Next.js apps, or any project where the server and client share a codebase. #### Imported: Core Concepts ### Routers and Procedures A **router** groups related **procedures** (think: endpoints). Procedures are typed functions — `query` for reads, `mutation` for writes, `subscription` for real-time streams. ### Input Validation with Zod All procedure inputs are validated with Zod schemas. The validated, typed input is available in the procedure handler — no manual parsing. ### Context `context` is shared state passed to every procedure — auth session, database client, request headers, etc. It is built once per request in a context factory. **Important:** Next.js App Router and Pages Router require separate context factories because App Router handlers receive a fetch `Request`, not a Node.js `NextApiRequest`. ### Middleware Middleware chains run before a procedure. Use them for authentication, logging, and request enrichment. They can extend the context for downstream procedures. --- ## Examples ### Example 1: Ask for the upstream workflow directly ```text Use @trpc-fullstack to handle . Start from the copied upstream workflow, load only the files that change the outcome, and keep provenance visible in the answer. ``` **Explanation:** This is the safest starting point when the operator needs the imported workflow, but not the entire repository. ### Example 2: Ask for a provenance-grounded review ```text Review @trpc-fullstack against metadata.json and ORIGIN.md, then explain which copied upstream files you would load first and why. ``` **Explanation:** Use this before review or troubleshooting when you need a precise, auditable explanation of origin and file selection. ### Example 3: Narrow the copied support files before execution ```text Use @trpc-fullstack for . Load only the copied references, examples, or scripts that change the outcome, and name the files explicitly before proceeding. ``` **Explanation:** This keeps the skill aligned with progressive disclosure instead of loading the whole copied package by default. ### Example 4: Build a reviewer packet ```text Review @trpc-fullstack using the copied upstream files plus provenance, then summarize any gaps before merge. ``` **Explanation:** This is useful when the PR is waiting for human review and you want a repeatable audit packet. ### Imported Usage Notes #### Imported: Examples ### Example 1: Fetching Data in a Component ```typescript // components/PostList.tsx 'use client'; import { trpc } from '@/utils/trpc'; export function PostList() { const { data, isLoading, error } = trpc.post.list.useQuery({ limit: 10 }); if (isLoading) return

Loading…

; if (error) return

Error: {error.message}

; return ( ); } ``` ### Example 2: Mutation with Cache Invalidation ```typescript 'use client'; import { trpc } from '@/utils/trpc'; export function CreatePost() { const utils = trpc.useUtils(); const createPost = trpc.post.create.useMutation({ onSuccess: () => { // Invalidate and refetch the post list utils.post.list.invalidate(); }, }); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); const form = e.currentTarget; const data = new FormData(form); createPost.mutate({ title: data.get('title') as string, body: data.get('body') as string, }); form.reset(); }; return (