typescript · mindrally — скилл для Claude Code: что делает и как установить
Задаёт правила типизации и структуры кода на TypeScript для ассистента. Помогает писать функции короче 20 строк, заменять enums на maps и избегать any.
npx skills add Mindrally/skills --skill typescript -a claude-codeЧто делает typescript
Скилл инструктирует ИИ писать функциональный TypeScript без лишних классов и дублирования. Модель начинает предпочитать interface вместо type, запрещает тип any и заменяет enum на словари или литералы с as const. Файлы выстраиваются по чёткому порядку: сначала экспортируемый компонент, затем вспомогательные функции и типы.
Для логики задан паттерн RORO и короткие функции до 20 строк с ранними возвратами вместо глубокой вложенности. Простые операции до трёх строк оформляются стрелочными функциями, а сложная логика — именованными. Если класс всё же нужен, он ограничен 200 строками и 10 публичными методами.
Этот набор правил жёстко банит enum, поэтому в кодовой базе с легаси-перечислениями агент начнёт переписывать их на карты значений. Все публичные методы и экспорты скилл требует документировать через JSDoc.
Какие задачи решает
- избавиться от типа any в кодовой базе
- ограничить длину функций 20 строками через ранние возвраты
- заменить TypeScript enums на структуры maps с as const
- выстроить строгую структуру файлов и JSDoc для экспортов
Примеры запросов агенту
- Напиши сервис авторизации по правилам typescript со структурой RORO
- Сделай рефакторинг этого файла: убери enums и any, разбей длинные функции
- Создай модуль работы с корзиной с типами через interface и guard clauses
Как установить typescript
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill typescript -a claude-code2Вручную: положить файлы
~/.claude/skills/typescript/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/typescript/
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill typescript -a codex2Вручную: положить файлы
.agents/skills/typescript/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill typescript -a cursor2Вручную: положить файлы
.cursor/skills/typescript/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install Mindrally/skills typescript2Вручную: положить файлы
.github/skills/typescript/SKILL.md1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill typescript -a gemini-cli2Командой платформы
gemini skills install https://github.com/Mindrally/skills --path typescriptВручную: положить файлы
.devin/skills/typescript/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill typescript -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Из того же набора168
Другие версии typescript
Похожие
Рядом в теме «Языки программирования»
Все скиллы по теме «Языки программирования» →Вопросы о typescript
Как установить typescript в Claude Code?
Выполните команду npx skills add Mindrally/skills --skill typescript -a claude-code. Файлы скилла запишутся в ~/.claude/skills/typescript/SKILL.md.
Что делает скилл typescript?
Он настраивает модель на чистый функциональный TypeScript. Агент держит функции короче 20 строк, использует interface вместо type и проверяет аргументы через guard clauses.
Как скилл относится к enum в TypeScript?
Скилл запрещает использование enum. Вместо них он заставляет применять структуры maps и литеральные значения с директивой as const.
Исходный текст
SKILL.md · Apache-2.0
--- name: typescript description: Expert in TypeScript development with best practices for type safety and clean code metadata: maintainer: Mindrally source: https://github.com/Mindrally/skills --- # TypeScript You are an expert in TypeScript development with deep knowledge of type safety and modern JavaScript patterns. ## Core Principles ### Code Style & Structure - Write concise, technical TypeScript with accurate examples - Use functional and declarative programming patterns; avoid classes - Prefer iteration and modularization over code duplication - Use descriptive variable names with auxiliary verbs (e.g., `isLoading`, `hasError`) - Structure files: exported component, subcomponents, helpers, static content, types ### Naming Conventions - Use PascalCase for classes, types, and interfaces - Use camelCase for variables, functions, and methods - Use kebab-case for file and directory names - Use UPPERCASE for environment variables and constants - Prefix functions with verbs; use boolean prefixes like `is`, `has`, `can` ## TypeScript Usage - Use TypeScript for all code; prefer interfaces over types - Avoid `any` type; create precise type definitions - Use functional components with TypeScript interfaces - Avoid enums; use maps instead - Use `readonly` for immutable properties - Use `as const` for literal values ## Functions & Methods - Write short functions with single purpose (less than 20 lines) - Use arrow functions for simple operations (less than 3 lines) - Use named functions for complex logic - Implement early returns to avoid nested blocks - Use default parameters instead of null/undefined checks - Apply the RORO pattern: "Receive an Object, Return an Object" ## Data & Classes - Encapsulate data in composite types - Prefer immutability where possible - Follow SOLID principles - Prefer composition over inheritance - Keep classes under 200 lines with fewer than 10 public methods ## Error Handling - Use exceptions for unexpected errors - Implement proper error logging with context - Create custom error types for consistency - Use guard clauses for preconditions - Catch exceptions only to fix expected problems or add context ## Documentation - Use JSDoc for public classes and methods - Document all exports clearly - Provide usage examples when appropriate - Keep documentation concise and accurate
© Mindrally · Apache-2.0 · Mindrally/skills