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★ 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:
- TypeScript 5.6 Documentation - Official TypeScript handbook
- TypeScript Handbook - Complete language reference
- React TypeScript Cheatsheet - React-specific patterns
- React 19 TypeScript Guide - Official React TypeScript guide
- DefinitelyTyped - Type definitions repository
- TypeScript Deep Dive - Advanced TypeScript patterns
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
anytype (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
Установить typescript-strict-guard в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadGrepВложенные файлы
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 запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic