exploration-labs/typescript-code-review
Overview
This skill performs comprehensive code reviews for TypeScript projects with a focus on type safety, best practices, performance, security, and maintainability. I provide prioritized findings, concrete code examples, and clear remediation steps to reduce runtime bugs and improve developer experience. The output is organized into summary, critical issues, improvements, suggestions, and detailed findings.
How this skill works
I inspect provided TypeScript files and the project tsconfig.json, then run a structured checklist covering type safety, modern TypeScript features, code quality, performance, security, and tests. I flag critical type errors and security issues first, then report important maintainability and performance problems, and finish with suggestions and positive observations. Deliverables include severity-tagged findings, recommended fixes with code snippets, and tooling suggestions to automate future checks.
When to use it
- When you want a full code review of TypeScript files or a module
- Before merging a feature that affects runtime safety or security
- To improve compile-time guarantees and reduce implicit any usage
- When optimizing bundle size or identifying performance anti-patterns
- To prepare code for production by tightening tsconfig and adding tests
Best practices
- Enable strict TypeScript compiler options and verify tsconfig.json for recommended flags
- Prefer explicit return types and avoid implicit any or unsafe assertions
- Use modern features: optional chaining, nullish coalescing, utility types, and satisfies over assertions
- Keep functions small and single-responsibility; extract repeated logic to utilities
- Run automated checks: tsc --noEmit, ESLint with @typescript-eslint, Prettier, ts-prune, and madge
Example use cases
- Review one or more TypeScript files for type errors and unsafe assertions
- Audit a React+TypeScript component library for prop typing, hooks usage, and re-render issues
- Check Node.js TypeScript services for typed request handlers and secure environment variable usage
- Evaluate a project tsconfig.json and suggest stricter compiler options
- Produce a prioritized report before a production release highlighting security, performance, and testing gaps
FAQ
Provide the TypeScript files to review and, if available, the project's tsconfig.json and package.json; context about intended runtime or framework is helpful.
Do you run automated tools as part of the review?
I recommend and reference tools such as tsc --noEmit, ESLint, Prettier, ts-prune, depcheck, and madge. I can suggest exact commands and rules to add, but I do not execute them directly.
How are issues prioritized?
I prioritize by severity: critical issues (type errors, security vulnerabilities, runtime bugs), important improvements (performance, maintainability), then suggestions (style and modern syntax).