Category
型安全・バリデーション(TypeScript / Zod)の実践ガイド
型安全は「方針」で終わらせず、コンパイラとCIで強制してこそ価値が出ます。tsconfigの厳格化、any/as/enumの排除、境界でのZodによる parse、NeverErrorでの網羅性、ブランド型、E2Eの型一致、モノレポの型カバレッジ——不正な状態を表現不能にし、チームが速く変更し続けても壊れない規律を扱います。
6 articles in total
Foundational guide
Foundational guide (start here)
Production TypeScript Type-Safety Discipline: Banning any, Guarding Boundaries with Zod, and Forcing Exhaustiveness with NeverError
A practical guide to not letting type safety end as a 'policy.' Explained with real production code: strict-family tsconfig, banning any/as/enum, SSoT design parsing the boundary with Zod, forcing exhaustiveness with NeverError, satisfies, branded types, and type coverage in CI.
Related practical articles
- TypeScript型安全テストアーキテクチャ設計個人開発
Implementing Statutory Calculations in TypeScript: Japan's Unemployment Benefit Logic as Pure Functions, Revision Tables, and Tests Built from Official Worked Examples
A design guide to implementing Japan's unemployment insurance (basic allowance) calculation as pure TypeScript functions: why the official formulas are rewritten as integer ratios, how to hold caps that change every August, how to turn the government's published worked examples into test fixtures, and how to keep user input out of analytics — using code from a live app.
27 min read - モノレポTypeScriptアーキテクチャ設計CI/CD型安全
Designing a Type-Safe Monorepo with pnpm + Turborepo: Kill Drift with catalog, Make the Shared Domain Type the Single Source of Truth
An implementation guide to designing a production TypeScript monorepo with pnpm workspaces + Turborepo. Explained with real code: pinning dependency versions with catalog, turbo.json's task pipeline and caching, making the Zod shared-domain package the single source of truth, CI-enforcing type coverage, and detecting schema drift.
22 min read - TypeScriptフロントエンドアーキテクチャ設計Next.jsセキュリティ
TypeScript type-level programming in practice [2026 edition] — erase illegal states with types and support production quality
A complete guide that explains TypeScript's type-level programming narrowed to the range that 'works in practice.' With real code it shows practical techniques to eliminate illegal states with types while keeping readability and compile speed — discriminated unions and exhaustiveness checking (NeverError), satisfies, branded types, template literal types, mapped types, conditional types, NoInfer, and type testing.
8 min read - TypeScriptZodバリデーション型安全Next.js
Zod 4 Practical Guide [Latest 2026] — TypeScript Type-Safe Schema Validation, Boundary Validation, React Hook Form / Environment Variables / JSON Schema Integration
A practical guide faithful to the latest official documentation (Zod 4 / zod@4.x). From top-level string formats (z.email etc.), the unified error parameter, treeifyError/prettifyError/flattenError, z.toJSONSchema, metadata, to Zod Mini—it explains 'when, where, and how to use' with production-quality code examples. Also covers applications to React Hook Form, environment variables, API boundaries, and LLM structured output.
19 min read - Next.jsTypeScriptGoOpenAPIアーキテクチャ設計
Implementing 'End-to-End Type Safety' with Next.js 16 × Go × OpenAPI: The Complete Practice of Contract-First Architecture
A contract-first architecture connecting a Next.js 16 App Router and a Go backend with OpenAPI 3.1, guaranteeing client⇄server consistency at build time. Explained at production-operation level, all the way through Problem Details, Full Jitter backoff, the Circuit Breaker, OpenTelemetry propagation, and infrastructure definition with Terraform.
27 min read