Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

typescript-code-review

БесплатноБез исполняемых скриптовНе проверен

Perform comprehensive code reviews for TypeScript projects, analyzing type safety, best practices, performance, security, and code quality with actionable…

anyprotoот anyproto★ 9 169 звёзд на GitHub

Об этом скилле

TypeScript Code Review Skill

Perform thorough, professional code reviews for TypeScript code with focus on type safety, best practices, performance, security, and maintainability.

Review Process

When reviewing TypeScript code, follow this structured approach:

1. Initial Assessment

  • Understand the code's purpose and context
  • Identify the scope (single file, module, feature, or entire codebase)
  • Note the TypeScript version and configuration (check tsconfig.json)
  • Review any relevant documentation or comments

2. Core Review Categories

Type Safety

  • Strict mode compliance: Verify strict: true in tsconfig.json and adherence
  • Type annotations: Check for proper type annotations, avoid implicit any
  • Type narrowing: Ensure proper use of type guards and narrowing
  • Generic types: Review generic usage for flexibility without sacrificing safety
  • Union and intersection types: Verify correct usage and handling
  • Type assertions: Flag unnecessary or dangerous type assertions (the as keyword and non-null assertion operator)
  • Null/undefined handling: Check for proper optional chaining (?.) and nullish coalescing (??)
  • Return types: Ensure all functions have explicit return types
  • Discriminated unions: Verify proper exhaustiveness checking

Code Quality & Best Practices

  • Naming conventions: Check for clear, descriptive names (camelCase for variables/functions, PascalCase for types/classes)
  • Function length: Flag functions longer than ~50 lines or with high complexity
  • Single responsibility: Ensure functions and classes have one clear purpose
  • DRY principle: Identify duplicate code that should be extracted
  • Magic numbers/strings: Flag hardcoded values that should be constants
  • Error handling: Review try-catch usage, error types, and error messages
  • Async/await: Check for proper async handling, avoid mixing callbacks/promises
  • Immutability: Prefer const over let, check for array/object mutations
  • Enums vs unions: Recommend const enums or union types over regular enums when appropriate

Modern TypeScript Features

  • Optional chaining: Suggest using ?. for nested property access
  • Nullish coalescing: Recommend ?? over || for default values
  • Template literal types: Check for opportunities to use template literals
  • Utility types: Suggest Partial, Pick, Omit, Record, etc. where appropriate
  • Const assertions: Recommend as const for literal types
  • Type predicates: Use for custom type guards
  • satisfies operator: Use instead of type assertions when validating types

Performance

  • Unnecessary re-renders: In React/frameworks, check for memo usage, dependency arrays
  • Large bundle imports: Flag entire library imports when tree-shaking is possible
  • Inefficient algorithms: Identify O(n²) or worse when better options exist
  • Memory leaks: Check for cleanup in event listeners, subscriptions, timers
  • Lazy loading: Suggest dynamic imports for large modules
  • Type calculation cost: Flag extremely complex type calculations that slow compilation

Security

  • Input validation: Ensure user input is validated and sanitized
  • XSS vulnerabilities: Check for unsafe HTML rendering or eval usage
  • Sensitive data: Flag hardcoded secrets, tokens, or passwords
  • Dependency vulnerabilities: Recommend running npm audit or checking dependencies
  • Type safety as security: Ensure types prevent security issues (e.g., SQL injection through tagged templates)

Testing & Maintainability

  • Test coverage: Note missing tests for critical paths
  • Type-only imports: Use import type for type-only imports
  • Circular dependencies: Flag circular imports
  • Barrel exports: Check for performance issues with index files
  • Documentation: Verify JSDoc comments for public APIs
  • Deprecation notices: Ensure deprecated code is properly marked

3. Output Structure

Organize the review with clear sections:

## Summary
[High-level overview: overall code quality, main concerns, highlights]

## Critical Issues 🔴
[Issues that must be fixed: type errors, security vulnerabilities, breaking bugs]

## Important Improvements 🟡
[Significant issues affecting maintainability, performance, or best practices]

## Suggestions 🔵
[Nice-to-have improvements, style preferences, optimizations]

## Positive Observations ✅
[What the code does well, good patterns to reinforce]

## Detailed Findings

### [Category 1: e.g., Type Safety]
**File**: `path/to/file.ts:line_number`
- **Issue**: [Description]
- **Current code**:
  ```typescript
  [code snippet]
  • Recommended:
    [improved code]
    
  • Reasoning: [Why this matters]

[Repeat for each finding]


### 4. Code Review Guidelines

**Tone and Style**:
- Be constructive and specific, not vague or critical
- Explain the "why" behind rec
Полный SKILL.md на GitHub

Установить typescript-code-review в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл typescript-code-review?

Perform comprehensive code reviews for TypeScript projects, analyzing type safety, best practices, performance, security, and code quality with actionable feedback

Как установить скилл typescript-code-review?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл typescript-code-review запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить typescript-code-review с