بنقرة واحدة
typescript-code-review
// Perform comprehensive code reviews for TypeScript projects, analyzing type safety, best practices, performance, security, and code quality with actionable feedback
// Perform comprehensive code reviews for TypeScript projects, analyzing type safety, best practices, performance, security, and code quality with actionable feedback
Commit staged/unstaged changes and push to the remote branch in one step
Analyze code changes and generate Playwright E2E tests in anytype-desktop-suite. Run after implementing features or modifying editor/component behavior to ensure new functionality has test coverage.
Update README documentation in the folder of changed components/abstractions to reflect code changes — keeps docs lean, precise, and in sync
Audit SCSS and TSX files for dark mode issues — missing variable usage, hardcoded colors, icon gaps, selector misuse, and inline dark overrides outside the theme folder
Write and update release notes in whatsNew.ts with context-aware content generation
| name | typescript-code-review |
| description | Perform comprehensive code reviews for TypeScript projects, analyzing type safety, best practices, performance, security, and code quality with actionable feedback |
Perform thorough, professional code reviews for TypeScript code with focus on type safety, best practices, performance, security, and maintainability.
When reviewing TypeScript code, follow this structured approach:
tsconfig.json)strict: true in tsconfig.json and adherenceanyas keyword and non-null assertion operator)?.) and nullish coalescing (??)const over let, check for array/object mutations?. for nested property access?? over || for default valuesPartial, Pick, Omit, Record, etc. where appropriateas const for literal typessatisfies operator: Use instead of type assertions when validating typeseval usagenpm audit or checking dependenciesimport type for type-only importsOrganize 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]
[improved code]
[Repeat for each finding]
### 4. Code Review Guidelines
**Tone and Style**:
- Be constructive and specific, not vague or critical
- Explain the "why" behind recommendations
- Provide code examples for suggested changes
- Acknowledge good practices when present
- Use severity indicators (🔴 critical, 🟡 important, 🔵 suggestion)
**Prioritization**:
1. Critical: Security issues, type errors, runtime bugs
2. Important: Performance problems, maintainability issues, anti-patterns
3. Suggestions: Style improvements, modern syntax, optimizations
**Context Awareness**:
- Consider the project's maturity (prototype vs production)
- Respect existing patterns if consistent across codebase
- Note tradeoffs (e.g., performance vs readability)
- Reference the project's TypeScript configuration
### 5. Reference Files
For detailed guidance on specific topics, consult the reference files:
- `references/type-safety-checklist.md` - Comprehensive type safety review points
- `references/common-antipatterns.md` - TypeScript anti-patterns to avoid
- `references/security-checklist.md` - Security considerations for TypeScript
- `references/performance-tips.md` - Performance optimization strategies
Search references using Grep when encountering specific issues. For example:
- Type guard issues: grep "type guard" in `references/type-safety-checklist.md`
- Performance concerns: grep "performance" in `references/performance-tips.md`
### 6. TypeScript Configuration Review
When reviewing `tsconfig.json`, check for:
**Recommended strict settings**:
```json
{
"compilerOptions": {
"strict": true,
"noUncheckedIndexedAccess": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"exactOptionalPropertyTypes": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"noUnusedParameters": true
}
}
React + TypeScript:
useState, useEffect, useCallback, etc.)React.MouseEvent<HTMLButtonElement>)useRef<HTMLDivElement>(null))React.ReactNode vs React.ReactElement)Node.js + TypeScript:
Testing:
Suggest running these tools if not already in use:
tsc --noEmit for type checking@typescript-eslint/parser and recommended rulesUser: "Review this TypeScript file for issues"
Response Flow:
tsconfig.json in the projectActivate this skill when the user: