clean-typescript

Enforce explicit typing in TypeScript code reviews and refactoring.

Updated Apr 12, 2026
One-click install
npx skills add https://github.com/Mohamedghaly140/sg-shop-web --skill clean-typescript-mohamedghaly140
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-typescript
Source: https://github.com/Mohamedghaly140/sg-shop-web/tree/main/.claude/skills/clean-typescript
Command: npx skills add https://github.com/Mohamedghaly140/sg-shop-web --skill clean-typescript-mohamedghaly140

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TypeScript code often becomes unclear and error-prone when types are weak or implicit. This guide promotes explicit, readable types to reduce bugs and cognitive load.

Core Features & Use Cases

  • Explicit typing: Prefer readable type aliases and interfaces over clever generics to clarify intent.
  • Safe patterns: Avoid any and unsafe assertions; use unknown when necessary and narrow types with guards.
  • API design: Keep public shapes small and composable; enforce explicit return types and predictable APIs.
  • Use Case: Refactor a data-processing module to introduce interfaces and strict types, improving testability and maintainability.

Quick Start

Audit a TypeScript module and replace loose types with explicit, readable types to reduce bugs.

Frequently Asked Questions about clean-typescript

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

FAQPage Schema
How do I enforce explicit typing in TypeScript to reduce bugs?

Enforce explicit typing in TypeScript by replacing implicit any types with readable type aliases and interfaces, requiring explicit return types, and using unknown with type guards for safer null handling. This reduces bugs caused by unclear interfaces.

What is the best way to refactor a TypeScript module for better type safety?

The best way to refactor a TypeScript module for type safety is to introduce strict types, replace loose types with explicit interfaces, and enforce predictable APIs. This improves testability and maintainability across data-processing modules.

How does safe null handling work with TypeScript interfaces?

Safe null handling with TypeScript interfaces works by avoiding unsafe assertions and any types. Instead, use unknown when necessary and narrow types with guards to enforce explicit return types and predictable public API shapes.

Should I use type aliases or clever generics for public TypeScript APIs?

For public TypeScript APIs, you should use readable type aliases and interfaces over clever generics. Keeping public shapes small and composable clarifies intent and enforces explicit return types for safer module interactions.

Can I apply strict TypeScript patterns during code reviews and onboarding?

Yes, you can apply strict TypeScript patterns during code reviews, refactoring, and onboarding. Guiding teams to adopt explicit typing and safer patterns across modules reduces cognitive load and prevents errors caused by implicit any.