typescript

Enforce TypeScript type system conventions and strict mode for .ts/.tsx files.

19|Updated Jan 30, 2026
One-click install
npx skills add https://github.com/xobotyi/cc-foundry --skill typescript-xobotyi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript
Source: https://github.com/xobotyi/cc-foundry/tree/main/plugins/javascript/skills/typescript
Command: npx skills add https://github.com/xobotyi/cc-foundry --skill typescript-xobotyi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you write robust, type-safe TypeScript code by enforcing best practices, guiding you through complex type system features, and preventing common errors.

Core Features & Use Cases

  • Type Safety: Enforces strict mode, unknown over any, and proper type annotations.
  • Advanced Types: Provides guidance on generics, conditional types, mapped types, and discriminated unions.
  • Use Case: Refactoring a JavaScript codebase to TypeScript, ensuring type correctness, and leveraging advanced type patterns for better code maintainability and fewer runtime bugs.

Quick Start

Use the typescript skill to refactor the attached file 'user-profile.js' into idiomatic TypeScript.

Frequently Asked Questions about typescript

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

FAQPage Schema
How do I refactor JavaScript to TypeScript and ensure strict type safety?

To refactor JavaScript to TypeScript, enforce strict mode, replace `any` with `unknown`, and apply proper type annotations. This process ensures type correctness, leverages advanced type patterns, and reduces runtime bugs in your `.ts` or `.tsx` files.

What is the best way to use advanced TypeScript generics and conditional types?

Advanced TypeScript generics and conditional types are used to create flexible, reusable type definitions. By leveraging mapped types and discriminated unions, you guide complex type system features to enforce strict conventions and improve code maintainability.

Do I need JavaScript knowledge to use TypeScript for type-level programming?

Yes, you need fundamental JavaScript knowledge as a prerequisite. TypeScript enforces type system conventions on top of JavaScript constructs, so understanding the base language is required before applying strict mode and advanced type-level programming patterns.

How does TypeScript strict mode prevent common type errors in .ts files?

TypeScript strict mode prevents common type errors by enforcing explicit type annotations and rejecting implicit `any` types. It guides you to use `unknown` and discriminated unions, ensuring type correctness and catching potential runtime bugs during development.

When should I use unknown over any to enforce type safety in TypeScript?

You should use `unknown` over `any` when you want to enforce type safety without losing type checking. Unlike `any`, `unknown` requires explicit type narrowing before operations, preventing common errors and ensuring robust, type-safe TypeScript code.

How do I configure tsconfig for optimal TypeScript strict mode conventions?

Configuring `tsconfig` for strict mode involves enabling strict type checking options to enforce type safety. This setup guides the compiler to catch errors early, requiring proper type annotations and preventing implicit `any` usage in your `.ts` and `.tsx` files.