Enterprise TypeScript Auditor
Overview
This skill provides comprehensive code review capabilities for TypeScript and JavaScript codebases in enterprise environments. It combines automated analysis with expert-level assessment to identify type safety issues, architectural concerns, security vulnerabilities, and code quality problems.
Core Capabilities
Type Safety Analysis
- Strict TypeScript compliance checking
- Generic type usage validation
- Type inference optimization
- Union and intersection type correctness
- Branded types and nominal typing patterns
Architectural Review
- Component composition patterns
- Dependency injection assessment
- Module boundary enforcement
- Circular dependency detection
- Layered architecture validation
Security Assessment
Identify common vulnerabilities including:
- Injection vulnerabilities (SQL, NoSQL, command injection)
- Cross-site scripting (XSS) attack vectors
- Authentication and authorization flaws
- Sensitive data exposure risks
- XML external entity (XXE) vulnerabilities
- Insecure deserialization patterns
- Security misconfiguration issues
- Insufficient logging and monitoring
Code Quality Metrics
- Cyclomatic complexity analysis
- Code duplication detection
- Function length and nesting depth
- Variable and function naming conventions
- Comment quality and JSDoc completeness
- Test coverage assessment
- Dead code identification
Usage Guidelines
When reviewing code, focus on:
- Type correctness: Verify all type annotations are accurate and leverage TypeScript's type system effectively
- Readability: Ensure code is self-documenting with clear variable names and logical structure
- Maintainability: Assess whether the code will be easy to modify and extend
- Performance: Identify inefficient algorithms, unnecessary re-renders, or memory leaks
- Security: Flag potential vulnerabilities and insecure coding patterns
- Testing: Verify adequate test coverage and test quality
Review Process
- Initial Scan: Use Grep to identify changed files and analyze the scope of modifications
- Deep Analysis: Read each modified file to understand the full context of changes
- Pattern Matching: Check for common anti-patterns and code smells
- Dependency Review: Examine how changes affect the broader codebase
- Documentation: Verify that complex logic is properly documented
- Output: Provide actionable feedback with specific file locations and suggestions
Best Practices
- Always consider the broader architectural context when reviewing individual changes
- Prioritize feedback by severity: critical security issues, then bugs, then style/quality
- Provide constructive suggestions with code examples where appropriate
- Recognize good code patterns and highlight them as positive examples
- Consider backward compatibility implications for API changes
- Review error handling and edge case coverage
- Assess the impact on bundle size and runtime performance
Example Review Workflow
# Identify TypeScript/JavaScript files in the current diff
git diff --name-only HEAD | grep -E '\.(ts|tsx|js|jsx)$'
# Review each file systematically
# Check type definitions, component structure, and integration points
# Flag issues and provide specific recommendations
Integration with Development Workflow
This skill integrates seamlessly with pull request reviews, pre-commit checks, and continuous integration pipelines. Use it to maintain high code quality standards across your TypeScript and JavaScript codebase.