Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

typescript-strict-guard

БесплатноЗапускает вложенные скриптыНе проверен

Use when writing or reviewing TypeScript code. Enforces strict mode standards, explicit typing, and best practices. Prevents 'any' types, @ts-ignore comments…

aiskillstoreот aiskillstore★ 509 звёзд на GitHub

Об этом скилле

TypeScript Strict Mode Guardian

You are the TypeScript Strict Mode Guardian. Your mission is to ensure ZERO type errors in all TypeScript code before it's written. This skill contains comprehensive patterns and solutions for every TypeScript scenario.


Official Documentation

Always reference these official sources:


Quick Reference - Critical Rules

NEVER do these things:

❌ Use any type without explicit justification ❌ Use @ts-ignore comments (fix the underlying issue) ❌ Use ! non-null assertion (use type guards or optional chaining) ❌ Leave implicit any in function parameters ❌ Omit explicit return types on functions ❌ Use type assertions without runtime validation ❌ Commit code with console.log statements ❌ Bypass strict mode checks

ALWAYS do these things:

✅ Define explicit types for all function parameters and return values ✅ Use type guards to narrow unknown types ✅ Use optional chaining (?.) and nullish coalescing (??) ✅ Create interfaces for object shapes ✅ Use discriminated unions for variant types ✅ Validate external data with type guards ✅ Use utility types (Partial, Pick, Omit, etc.) appropriately ✅ Write tests for all type guards and validation functions


Complete Guide Index

This skill contains 9 comprehensive guides with 250+ code examples:

1. Strict Mode Violations

24 scenarios with before/after examples

  • Using any type (external APIs, event handlers, dynamic keys, array methods)
  • Using @ts-ignore (third-party issues, complex casting)
  • Non-null assertions (array find, DOM elements, optional chaining)
  • Missing return types (async functions, callbacks)
  • Implicit any parameters (destructured objects)
  • Type assertions without validation
  • Index signatures without bounds
  • Enum vs union types
  • Type vs interface choice
  • Const assertions
  • Satisfies operator
  • Template literal types
  • Conditional types
  • Mapped types
  • Intersection vs union
  • Never type usage
  • Unknown vs any

When to use: Before writing ANY TypeScript code, review this file for the specific pattern you need.

2. React TypeScript Patterns

13 sections covering ALL React patterns

  • Functional component props (basic, optional, with children)
  • Event handler typing (ALL event types: click, change, submit, keyboard, focus, mouse, drag, scroll, touch)
  • useState hook typing (basic state, arrays, objects, lazy initialization)
  • useRef hook typing (DOM elements, mutable values, callback refs)
  • useEffect and useLayoutEffect
  • useContext hook (typed context, custom hooks with guards)
  • Custom hooks (basic, generic, localStorage hook)
  • forwardRef typing
  • Higher-order components (HOC)
  • Render props pattern
  • Component composition (compound components)
  • Form handling (controlled forms, validation)
  • Server Components (Next.js 15 async components)

When to use: Writing ANY React component, hook, or pattern.

3. Third-Party Library Typing

16 scenarios for untyped libraries

  • Installing type definitions (@types packages)
  • Creating declaration files (.d.ts)
  • Augmenting existing types (Window, ProcessEnv, Express Request)
  • Typing untyped NPM packages
  • Typing JavaScript libraries
  • Typing CSS modules
  • Typing JSON files
  • Typing image imports
  • Typing global variables
  • Typing utility libraries (Lodash)
  • Typing browser APIs (experimental APIs)
  • Typing Node.js modules
  • Creating wrapper functions
  • Typing GraphQL operations
  • tsconfig.json configuration

When to use: Integrating ANY third-party library without types.

4. Type Guards Library

15 categories of reusable type guards

  • Primitive type guards (string, number, boolean, function, symbol, bigInt)
  • Object type guards (basic object, plain object, hasKeys, hasProperties)
  • Array type guards (isArray, isArrayOf, non-empty arrays, tuples)
  • Nullable type guards (isNotNull, isNotUndefined, isNotNullish, isDefined)
  • Instance type guards (Error, Date, RegExp, Promise, Map, Set)
  • Interface type guards (user, generic interface guard builder)
  • Discriminated union guards (Result type, Action types)
  • JSON type guards (isJSONValue, parseJSON safely)
  • Assertion functions (assertString, assertNumber, assertNotNull, gener
Полный SKILL.md на GitHub

Установить typescript-strict-guard в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Grep

Вложенные файлы

VERIFICATION_REPORT.mdasync-typing.mderror-handling-types.mdgeneric-patterns.mdreact-typescript-patterns.mdskill-report.jsonstrict-mode-violations.mdthird-party-typing.mdtype-guards-library.mdutility-types-guide.mdvalidate-types.py

FAQ

Что делает скилл typescript-strict-guard?

Use when writing or reviewing TypeScript code. Enforces strict mode standards, explicit typing, and best practices. Prevents 'any' types, @ts-ignore comments, and non-null assertions. This is a COMPREHENSIVE skill - consult the detailed guides before writing any TypeScript code.

Как установить скилл typescript-strict-guard?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл typescript-strict-guard запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить typescript-strict-guard с