TypeScript規約

Enforce schema-first type definitions with Zod in TypeScript projects.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/sugar-cat7/ai-avatar-interview --skill typescript-sugar-cat7
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: TypeScript規約
Source: https://github.com/sugar-cat7/ai-avatar-interview/tree/main/.agent/skills/typescript-conventions
Command: npx skills add https://github.com/sugar-cat7/ai-avatar-interview --skill typescript-sugar-cat7

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

このスキルは、Zodを用いたスキーマファーストの型定義を推奨し、interface/typeの直接記述やasによる型アサーションを禁止することで、型安全性と保守性を向上させます。

Core Features & Use Cases

  • Schema-first typing: Zodスキーマを用いて型を定義し、コード全体で一貫した型安全性を促進します。
  • No direct interface/type declarations: interfaceやtypeを直接書くことを制限して、スキーマから型を導出する慣例を維持します。
  • No type assertions: asを用いた型アサーションを避け、すべての型検証をスキーマで実施します。

Quick Start

新しい型やスキーマを定義する際は、直接interface/typeを記述せず、Zodスキーマを用いて型を定義してください。

Frequently Asked Questions about TypeScript規約

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

FAQPage Schema
How do I enforce type safety in TypeScript using a schema-first approach?

Enforcing type safety with a schema-first approach means defining types via Zod schemas, preventing direct interface declarations and forbidden type assertions to maintain validated type definitions across codebases.

Why should I avoid direct interface and type declarations in TypeScript?

Avoiding direct interface and type declarations ensures all types derive from Zod schemas, maintaining consistent schema-first conventions and improving type safety and maintainability across your TypeScript project.

What is the best way to prevent type assertions in a TypeScript codebase?

Preventing type assertions is best achieved by replacing as keyword usage with Zod schema validations, enforcing all type checks through schemas to ensure consistent and validated type definitions.

Can I use Zod schemas to derive all TypeScript types instead of writing types manually?

Yes, using Zod schemas to derive TypeScript types prevents manual interface writing and type assertions, enforcing consistent schema-first conventions and validated type definitions across your codebase.

Does schema-first typing with Zod work for large TypeScript projects?

Schema-first typing with Zod works for large TypeScript projects by enforcing consistent, validated type definitions across codebases, restricting direct interface declarations and type assertions to maintain type safety.

When do I need schema-first conventions for TypeScript type safety?

You need schema-first conventions when you want to enforce type safety in TypeScript projects, preventing direct type declarations and type assertions by deriving all types from Zod schemas.