install
source · Clone the upstream repo
git clone https://github.com/ComeOnOliver/skillshub
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ComeOnOliver/skillshub "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/pproenca/dot-skills/ts-google" ~/.claude/skills/comeonoliver-skillshub-ts-google && rm -rf "$T"
manifest:
skills/pproenca/dot-skills/ts-google/SKILL.mdsource content
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
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 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 | |
Quick Reference
1. Module Organization (CRITICAL)
- Use named exports over default exportsmodule-named-exports
- Avoid mutable exportsmodule-no-mutable-exports
- Use ES6 modules exclusivelymodule-es6-modules
- Avoid TypeScript namespacesmodule-no-namespaces
- Use relative paths for project importsmodule-import-paths
- Use import type for type-only importsmodule-import-type
- Minimize exported API surfacemodule-export-api-surface
2. Type Safety (CRITICAL)
- Never use the any typetypes-no-any
- Prefer interfaces over type aliases for objectstypes-prefer-interfaces
- Explicitly annotate structural typestypes-explicit-structural
- Handle nullable types correctlytypes-nullable-patterns
- Use consistent array type syntaxtypes-array-syntax
- Never use wrapper object typestypes-no-wrapper-types
- Prefer Map and Set over index signaturestypes-prefer-map-set
- Avoid empty object typetypes-no-empty-object
3. Class Design (HIGH)
- Use parameter properties for constructor assignmentclass-parameter-properties
- Mark properties readonly when never reassignedclass-readonly-properties
- Use TypeScript private over private fieldsclass-no-private-fields
- Avoid container classes with only static membersclass-no-static-containers
- Always use parentheses in constructor callsclass-constructor-parens
- Never manipulate prototypes directlyclass-no-prototype-manipulation
4. Function Patterns (HIGH)
- Prefer function declarations over expressionsfunc-declarations-over-expressions
- Use concise arrow function bodies appropriatelyfunc-arrow-concise-bodies
- Avoid rebinding thisfunc-avoid-this-rebinding
- Use rest parameters over argumentsfunc-rest-parameters
- Use correct generator function syntaxfunc-generator-syntax
- Use default parameters sparinglyfunc-default-parameters
5. Control Flow (MEDIUM-HIGH)
- Always use braces for control structurescontrol-always-use-braces
- Always use triple equalscontrol-triple-equals
- Prefer for-of over for-in for arrayscontrol-for-of-iteration
- Always include default case in switchcontrol-switch-default
- Avoid assignment in conditional expressionscontrol-no-assignment-in-condition
6. Error Handling (MEDIUM)
- Always throw Error instanceserror-throw-errors
- Type catch clause variables as unknownerror-catch-unknown
- Document empty catch blockserror-empty-catch-comments
- Avoid type and non-null assertionserror-avoid-assertions
7. Naming & Style (MEDIUM)
- Use correct identifier naming stylesnaming-identifier-styles
- Use descriptive namesnaming-descriptive-names
- Avoid decorative underscoresnaming-no-decorative-underscores
- No I prefix for interfacesnaming-no-interface-prefix
- Use CONSTANT_CASE for true constantsnaming-constants
8. Literals & Coercion (LOW-MEDIUM)
- Use single quotes for stringsliteral-single-quotes
- Use correct number literal formatsliteral-number-formats
- Use explicit type coercionliteral-explicit-coercion
- Avoid Array constructorliteral-array-constructor
How to Use
Read individual reference files for detailed explanations and code examples:
- Section definitions - Category structure and impact levels
- Rule template - Template for adding new rules
Reference Files
| File | Description |
|---|---|
| AGENTS.md | Complete compiled guide with all rules |
| references/_sections.md | Category definitions and ordering |
| assets/templates/_template.md | Template for new rules |
| metadata.json | Version and reference information |