moai-lang-typescript

Write type-safe TypeScript APIs with tRPC and Zod in Next.js 16.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/binee108/PasteTrader --skill moai-lang-typescript-binee108
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: moai-lang-typescript
Source: https://github.com/binee108/PasteTrader/tree/main/.claude/skills/moai-lang-typescript
Command: npx skills add https://github.com/binee108/PasteTrader --skill moai-lang-typescript-binee108

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers craft robust TypeScript-powered React/Next.js applications by providing a structured approach to type-safety, API design, and modern TypeScript patterns.

Core Features & Use Cases

  • Type-safe APIs with tRPC: End-to-end type safety for client-server communication.
  • Zod validation: Centralized schema validation across front-end and back-end.
  • Next.js 16 App Router patterns: Server Components, Server Actions, and routing strategies.
  • Modern TS patterns: Satisfies operator, deferred module evaluation, and decorators to improve correctness and ergonomics.
  • Use Case: Build a type-safe dashboard with typed API, validation, and server/client boundaries.

Quick Start

Create a new Next.js 16 project with TypeScript, install TypeScript 5.9 and the tRPC + Zod tools, scaffold a minimal typed API and a consuming React component, and run the dev server to see compile-time type checks in action.

Frequently Asked Questions about moai-lang-typescript

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build type-safe APIs with tRPC in a Next.js App Router project?

Type-safe APIs with tRPC in Next.js are built by defining procedures with Zod input validation, ensuring end-to-end type inference from server to client without manual type synchronization.

What is the best way to validate data across front-end and back-end in React?

Validating data across front-end and back-end in React is best handled by defining Zod schemas centrally. This ensures consistent validation and allows TypeScript to infer matching types automatically.

Does TypeScript 5.9 work with Next.js 16 server actions and client boundaries?

Yes, TypeScript 5.9 works with Next.js 16 server actions by using the satisfies operator to enforce correct server and client component boundaries, ensuring safe data passing without type mismatches.

When do I need the satisfies operator in modern TypeScript React apps?

You need the satisfies operator in TypeScript React apps when you want to ensure an expression matches a specific type while preserving its narrow literal types. This prevents accidental widening of configuration objects or API responses.

How to manage server and client component patterns in Next.js 16 App Router?

Managing Next.js 16 App Router patterns involves structuring Server Components for data fetching and using Server Actions for mutations. You enforce boundaries using TypeScript 5.9 and deferred module evaluation for optimized loading.

Why use Zod with tRPC for end-to-end type safety?

Using Zod with tRPC provides end-to-end type safety by validating API inputs on the server and inferring the exact output shape. This guarantees your React client receives data that strictly matches your runtime validation rules.