AgentSkillsCN

ts-google

Google TypeScript 风格指南——用于编写整洁、一致、类型安全的代码。在编写、审查或重构 TypeScript 代码时,应使用此技能。适用于涉及 TypeScript 文件、类型注解、模块导入、类设计,以及代码风格决策的任务。

SKILL.md
--- frontmatter
name: ts-google
description: Google TypeScript style guide for writing clean, consistent, type-safe code. This skill should be used when writing, reviewing, or refactoring TypeScript code. Triggers on TypeScript files, type annotations, module imports, class design, and code style decisions.

Google TypeScript Best Practices

Comprehensive TypeScript style guide based on Google's internal standards, designed for AI agents and LLMs. Contains 45 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.

When to Apply

Reference these guidelines when:

  • Writing new TypeScript code
  • Organizing modules and imports
  • Designing type annotations and interfaces
  • Creating classes and functions
  • Reviewing code for style consistency
  • Refactoring existing TypeScript code

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Module OrganizationCRITICALmodule-
2Type SafetyCRITICALtypes-
3Class DesignHIGHclass-
4Function PatternsHIGHfunc-
5Control FlowMEDIUM-HIGHcontrol-
6Error HandlingMEDIUMerror-
7Naming & StyleMEDIUMnaming-
8Literals & CoercionLOW-MEDIUMliteral-

Quick Reference

1. Module Organization (CRITICAL)

2. Type Safety (CRITICAL)

3. Class Design (HIGH)

4. Function Patterns (HIGH)

5. Control Flow (MEDIUM-HIGH)

6. Error Handling (MEDIUM)

7. Naming & Style (MEDIUM)

8. Literals & Coercion (LOW-MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

Reference Files

FileDescription
AGENTS.mdComplete compiled guide with all rules
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules
metadata.jsonVersion and reference information