typescript-code-review
БесплатноБез исполняемых скриптовНе проверенPerform comprehensive code reviews for TypeScript projects, analyzing type safety, best practices, performance, security, and code quality with actionable…
от 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: truein 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
askeyword 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
constoverlet, 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 constfor literal types - Type predicates: Use for custom type guards
satisfiesoperator: 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
evalusage - Sensitive data: Flag hardcoded secrets, tokens, or passwords
- Dependency vulnerabilities: Recommend running
npm auditor 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 typefor 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
Установить 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), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic