review-type-safety

Identify type-safety issues in TypeScript code during reviews.

4|1|Updated Jan 11, 2026
One-click install
npx skills add https://github.com/doodledood/codex-workflow --skill review-type-safety
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: review-type-safety
Source: https://github.com/doodledood/codex-workflow/tree/main/skills/review-type-safety
Command: npx skills add https://github.com/doodledood/codex-workflow --skill review-type-safety

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Audit TypeScript/typed code for type safety issues, identifying holes that could lead to runtime bugs and missed guarantees, and providing structured guidance to strengthen the type system.

Core Features & Use Cases

  • Guided type-safety review: Detect missing type guards, unsafe any/unknown usage, and risky discriminated unions.
  • Scope-aware analysis: Focuses on explicitly provided paths or diffs against a base branch, reducing noise in large repos.
  • Actionable reporting: Produces clear findings with severity, rationale, and concrete improvement suggestions.

Quick Start

Run a targeted review on the specified TS files to surface type-safety gaps.

Frequently Asked Questions about review-type-safety

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit TypeScript code for type safety issues during a code review?

To audit TypeScript code for type safety, run a targeted review on specified file paths or branch diffs to surface unsafe any/unknown usage, missing type guards, and unchecked discriminated unions. This generates structured findings with severity levels and concrete improvement suggestions.

What are common type safety issues in TypeScript that lead to runtime bugs?

Common type safety issues in TypeScript include the use of unsafe any or unknown types, missing type guards for runtime validation, and unchecked discriminated unions. Identifying these holes during static analysis strengthens compile-time guarantees and prevents runtime crashes.

Can I run a type safety review on a specific git diff instead of the entire repository?

Yes, you can run a type safety review on a specific git diff. The analysis is scope-aware, allowing you to focus on explicitly provided file paths or changes against a base branch, which reduces noise in large repositories by only reporting relevant type holes.

How do type guards and discriminated unions improve TypeScript static analysis?

Type guards and discriminated unions improve TypeScript static analysis by enabling the compiler to narrow types safely at runtime. Auditing code for missing type guards and unchecked discriminated unions ensures type safety holes are caught early, providing stronger compile-time guarantees.

Does this TypeScript type safety audit require any strict compiler configurations?

The type safety audit focuses on TypeScript projects with strictness considerations, flagging risky patterns like any or unknown usage. While no specific dependencies are required, enabling strict compiler options in your project enhances the effectiveness of the static analysis findings.

What is the best way to fix unsafe any and unknown types in TypeScript?

The best way to fix unsafe any and unknown types in TypeScript is to replace them with explicit, narrowed types using type guards or discriminated unions. The audit provides actionable reporting with rationale and concrete improvement suggestions to resolve these type holes.