Back to Skills

reviewing-type-safety

verified

TypeScript type safety patterns and best practices for maximum type coverage. Use when reviewing TypeScript code for type issues, eliminating `any` types, or when user mentions type safety, 型安全, 型カバレッジ, strict mode.

View on GitHub

Marketplace

thkt-development-workflows

thkt/claude-config

Plugin

development-skills

Development Skills

Repository

thkt/claude-config
3stars

skills/reviewing-type-safety/SKILL.md

Last Verified

January 22, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/thkt/claude-config/blob/main/skills/reviewing-type-safety/SKILL.md -a claude-code --skill reviewing-type-safety

Installation paths:

Claude
.claude/skills/reviewing-type-safety/
Powered by add-skill CLI

Instructions

# Type Safety Review

## Detection

| ID  | Pattern                       | Fix                           |
| --- | ----------------------------- | ----------------------------- |
| TS1 | `any`                         | `unknown` + type guard        |
| TS1 | Implicit any                  | Explicit type annotation      |
| TS2 | `value as Type`               | Type guard function           |
| TS2 | `value!` (non-null assertion) | Explicit null check           |
| TS3 | `function fn(data)` (untyped) | `function fn(data: Type)`     |
| TS3 | Missing return type           | Explicit `: ReturnType`       |
| TS4 | `default:` without exhaustive | `default: assertNever(value)` |

## Criteria

Type coverage >= 95%. Any usage = 0. Strict mode all enabled.

## References

| Topic    | File                          |
| -------- | ----------------------------- |
| Coverage | `references/type-coverage.md` |
| Guards   | `references/type-guards.md`   |
| Strict   | `references/strict-mode.md`   |
| Result   | `references/result-type.md`   |

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
843 chars