본문으로 건너뛰기
cccskills
무료GitHub에 공개

google-ts-styleguide

Google TypeScript Style Guide reference for writing, reviewing, and refactoring TypeScript code. Use this skill whenever you are writing TypeScript code, reviewing TypeScript code, refactoring TypeScript, configuring ESLint or linter rules for TypeScript, or when the user asks about TypeScript coding conventions, naming conventions, type system best practices, or import/export patterns. Also trigger when the user mentions 'Google style', 'gts', 'TypeScript style guide', or asks 'how should I name this', 'should I use interface or type', 'how to handle null/undefined' in a TypeScript context. TypeScriptを書く・レビューする・リファクタリングする、ESLintの設定をする、「命名規則」「型の使い方」「import/exportのルール」「interfaceとtypeどっち」「anyを使っていい?」「nullチェックどうする」「Google式」「コーディング規約」「スタイルガイド」などの質問にも対応します。

TypeScriptのコードに関する質問や作業であれば積極的にこのスキルを使ってください。

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(6)

  • SKILL.md5.8 KB
  • references/comments-and-toolchain.md4.1 KB
  • references/language-features.md9.2 KB
  • references/naming.md4.1 KB
  • references/source-file-structure.md5.5 KB
  • references/type-system.md7.3 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Google TypeScript Style Guide Reference

Google TypeScript Style Guide に基づくコーディングリファレンスです。TypeScriptの実装・コードレビュー・リファクタリング・ESLint設定時に、Googleのコーディング規約に準拠するために使います。

How to use this reference

This guide is organized into topic-specific reference files. Read the relevant file based on the current task:

TopicFileWhen to read
File structure & imports/exportsreferences/source-file-structure.mdOrganizing files, import/export patterns, module structure
Language featuresreferences/language-features.mdVariables, arrays, objects, classes, functions, control flow, decorators
Naming conventionsreferences/naming.mdNaming variables, classes, constants, type parameters, files
Type systemreferences/type-system.mdType inference, null/undefined, any/unknown, interfaces vs types, generics
Comments & toolchainreferences/comments-and-toolchain.mdJSDoc, comments, @ts-ignore rules, conformance

Quick Reference: Most Common Rules

These are the rules that come up most frequently. For details, read the corresponding reference file.

Naming (see references/naming.md)

  • Classes/Interfaces/Types/Enums: UpperCamelCase
  • Variables/functions/methods/properties: lowerCamelCase
  • Global constants & enum values: CONSTANT_CASE
  • Treat acronyms as words: loadHttpUrl, not loadHTTPURL
  • No IMyInterface prefix for interfaces
  • No trailing/leading underscores for private members

Imports & Exports (see references/source-file-structure.md)

  • Use ES6 module syntax only (import/export), never require
  • Use named exports exclusively; avoid default exports
  • Use import type for type-only imports
  • Do not use namespace; use modules
  • No mutable exports (export let is prohibited)

Variables & Types (see references/language-features.md, references/type-system.md)

  • Use const by default, let when reassignment needed; never var
  • Use unknown over any; avoid any wherever possible
  • Prefer interface over type literal aliases
  • Simple arrays: T[]; complex element types: Array<{...}>
  • Prefer optional (field?) over | undefined

Functions & Classes (see references/language-features.md)

  • Prefer function declarations for named functions
  • Use arrow functions for callbacks, not function expressions
  • Mark never-reassigned properties as readonly
  • Use parameter properties in constructors
  • No #private fields; use TypeScript's private keyword

Control Flow (see references/language-features.md)

  • Always use ===/!== (exception: == null for null/undefined check)
  • Always use braces for control statements
  • Only throw Error instances
  • All switch must have default case
  • Explicitly end statements with semicolons (no ASI reliance)

ESLint/Linter Configuration Guide

When configuring ESLint or other linters for Google TypeScript style compliance, enforce these core rules:

Must enable:

  • @typescript-eslint/no-explicit-any - Discourage any usage
  • @typescript-eslint/explicit-module-boundary-types - Encourage explicit return types at module boundaries
  • @typescript-eslint/no-non-null-assertion - Discourage ! assertions
  • eqeqeq with smart option - Enforce ===/!== with == null exception
  • no-var - Forbid var
  • prefer-const - Prefer const over let when no reassignment
  • curly - Require braces for all control statements
  • @typescript-eslint/no-namespace - Forbid namespace
  • no-eval - Forbid eval()
  • no-debugger - Forbid debugger
  • @typescript-eslint/no-wrapper-object-types - Forbid String, Boolean, Number wrapper types
  • @typescript-eslint/consistent-type-imports - Enforce import type for type-only imports
  • no-restricted-syntax for WithStatement - Forbid with

Naming convention rules (@typescript-eslint/naming-convention):

  • UpperCamelCase for classes, interfaces, type aliases, enums, decorators
  • lowerCamelCase for variables, functions, methods, parameters, properties
  • CONSTANT_CASE for global constants and enum members
  • No leading/trailing underscores

Import/export rules:

  • no-restricted-exports or plugin rules to forbid default exports
  • @typescript-eslint/no-require-imports - Forbid require()

Additional recommended:

  • @typescript-eslint/prefer-for-of - Prefer for...of
  • @typescript-eslint/no-unnecessary-type-assertion - Remove unnecessary assertions
  • @typescript-eslint/prefer-optional-chain - Prefer optional chaining
  • @typescript-eslint/prefer-readonly - Prefer readonly for never-reassigned members

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Interactive English conversation practice partner for Japanese learners. Use this skill whenever the user wants to practice speaking English, role-play a real-life situation (hotel check-in, restaurant, airport, business meeting, technical discussion, code review, job interview, daily small talk, etc.), discuss a technical article in English, or asks how to phrase something naturally in English. Trigger on requests like 'let's practice English', 'I want to talk in English', 'role play', 'pretend you are a ___', 'discuss this article in English', 'how do I say X in English'. 英会話練習・ロールプレイ・英語表現の質問のためのスキル。「英会話したい」「英語で話そう」「ロールプレイ」「ホテルのチェックイン練習」「この記事について英語で話したい」「xxって英語でどう言う?」などのリクエストで起動する。ユーザーは音声入力で会話する想定。会話前に想定問答・頻出表現・単語を提示し、会話を開始、最後に添削まで行う。

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ouka-lab/Skills82026년 5월 4일 업데이트

Generate Zod v4 TypeScript schemas from OpenAPI (openapi.yaml / openapi.json) definitions. This skill exists because npm packages like openapi-zod-client do not support Zod v4 — Claude reads the YAML/JSON directly and writes the conversion. Use this skill whenever the user wants to convert OpenAPI/Swagger definitions to Zod schemas, generate TypeScript types from API specs, or create validation schemas from openapi.yaml. Trigger on keywords: 'openapi', 'swagger', 'zod', 'API schema', 'yaml to types', 'schema generation', 'validation generation'. OpenAPI定義からZodスキーマを生成するスキル。openapi.yamlから型を作りたい、APIスキーマをTypeScriptの型にしたい、Zodバリデーションを作りたい、といったリクエストで使う。「openapi」「swagger」「zod」「APIスキーマ」「yamlから型」「スキーマ生成」「バリデーション生成」などのキーワードが出たら積極的にこのスキルを使うこと。

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ouka-lab/Skills82026년 5월 4일 업데이트

ouka-lab의 스킬 모두 보기

이 스킬의 문제 신고