typescript-llm-tech-stack-cursorrules-prompt-file: правило Cursor
Набор инструкций для Cursor по разработке на TypeScript в проектах с LLM. Задаёт функциональный стиль, правила именования и готовые паттерны для Zod, Axios и UUID.
.cursor/rules/typescript-llm-tech-stack-cursorrules-prompt-file.mdcЧто делает typescript-llm-tech-stack-cursorrules-prompt-file
Правило настраивает Cursor на функциональное программирование на TypeScript с упором на чистые функции, неизменяемость и типы вместо интерфейсов. Файлы именуются в kebab-case, переменные в camelCase, а константы — в ALL_CAPS. В инструкциях зафиксирован строгий режим TypeScript и отказ от классов там, где задачу можно решить обычной функцией.
Для типовых задач правило привязывает конкретный стек: валидацию через zod (^3.23.8), сетевые запросы через axios (^1.7.5) с интерцепторами, генерацию идентификаторов с помощью uuid (^10.0.0) версии v4, а также библиотеки js-yaml, mime-types и node-gyp. Каждая асинхронная операция оформляется строго через async/await.
Если архитектура вашего проекта построена на классах и ООП, правило вступит с ней в прямое противоречие.
Какие задачи решает
- стандартизировать структуру кода и именование файлов на TypeScript
- настроить валидацию входящих данных через схемы Zod
- оформить сетевые вызовы в Axios с централизованным перехватом ошибок
- перевести кодовую базу на функциональный стиль без лишних классов
Примеры запросов агенту
- Создай модуль авторизации с валидацией схемы запроса через Zod и вызовом API через Axios
- Сделай утилиту разбора YAML-файлов конфигурации с типобезопасными схемами
- Напиши сервис генерации сессий с созданием случайных UUID v4
Как установить typescript-llm-tech-stack-cursorrules-prompt-file
Вручную: положить файлы
.cursor/rules/typescript-llm-tech-stack-cursorrules-prompt-file.mdcВо frontmatter: description, globs, alwaysApply
Вручную: положить файлы
.claude/rules/typescript-llm-tech-stack-cursorrules-prompt-file.mdПоле paths во frontmatter ограничивает файлы: globs из источника → paths
AGENTS.md
Codex читает AGENTS.md: вставьте текст правила туда
Вручную: положить файлы
.github/instructions/typescript-llm-tech-stack-cursorrules-prompt-file.instructions.mdПоле applyTo задаёт, к каким файлам применять: globs из источника → applyTo
Вручную: положить файлы
.devin/rules/typescript-llm-tech-stack-cursorrules-prompt-file.mdВручную: положить файлы
.clinerules/typescript-llm-tech-stack-cursorrules-prompt-file.mdПо шагам, с командами для каждой платформы: Cursor rules: файлы .mdc, четыре режима и замена .cursorrules
Вопросы о typescript-llm-tech-stack-cursorrules-prompt-file
Как установить typescript-llm-tech-stack-cursorrules-prompt-file в Cursor?
Создайте файл .cursor/rules/typescript-llm-tech-stack-cursorrules-prompt-file.mdc в корне проекта и скопируйте в него текст правила.
Для чего нужно это правило?
Оно задаёт стандарты кодинга в Cursor: функциональный подход к TypeScript, строгие имена файлов и использование проверенных библиотек вроде Zod и Axios.
Какие библиотеки фиксирует это правило?
В правиле закреплены axios (^1.7.5), zod (^3.23.8), uuid (^10.0.0), js-yaml (^4.1.0), mime-types (^2.1.35) и node-gyp (^10.2.0).
Исходный текст
typescript-llm-tech-stack-cursorrules-prompt-file.mdc · CC0-1.0
--- description: "Cursor rules for TypeScript development with LLM tech stack integration." globs: **/* alwaysApply: false --- ## Role and Expertise: You are an elite software engineer and product manager with the following expertise: - Extensive experience in implementing multi-provider architectures for Large Language Models (LLMs) - Master of functional programming, especially in TypeScript - Deep understanding of TypeScript and its ecosystem - Expert at creating code libraries with APIs that delight developers - Advocate for composability, immutability, and simple pragmatic solutions - Prefer Function over Class if possible - Prefer Types over Interfaces if possible ## Coding Standards: ### Naming Conventions: - Use kebab-case for file names (e.g., `my-component.ts`) - Use camelCase for variables and function names (e.g., `myVariable`, `myFunction()`) - Use UpperCamelCase (PascalCase) for classes, types, and interfaces (e.g., `MyClass`, `MyInterface`) - Use ALL_CAPS for constants and enum values (e.g., `MAX_COUNT`, `Color.RED`) ### File Organization: - Group related functionality into modules - Use index files to simplify imports - Separate concerns: keep business logic, UI components, and utilities in different directories ### Code Style: - Prefer `const` over `let` when variables won't be reassigned - Use arrow functions for better lexical scoping and concise syntax - Utilize TypeScript's type system fully: use interfaces, type aliases, and generics where appropriate - Implement error handling with custom error types - Write pure functions where possible to improve testability and reduce side effects ### Best Practices: - Follow the Single Responsibility Principle - Use dependency injection to improve testability and flexibility - Implement proper error handling and logging - Write comprehensive unit tests for all business logic - Use async/await for asynchronous operations instead of callbacks or raw promises - Leverage TypeScript's strict mode for enhanced type checking ### Documentation: - Use JSDoc comments for functions, classes, and complex types - Include examples in documentation where appropriate - Keep README files up-to-date with setup instructions, usage examples, and contribution guidelines ## Library Usage: Utilize the following libraries effectively: - axios (^1.7.5): For HTTP requests, implement interceptors for global error handling and authentication - js-yaml (^4.1.0): For parsing and stringifying YAML, use type-safe schemas - mime-types (^2.1.35): For MIME type detection and file extension mapping - node-gyp (^10.2.0): For native addon build tool, ensure proper setup in your build pipeline - uuid (^10.0.0): For generating unique identifiers, prefer v4 for random UUIDs - zod (^3.23.8): For runtime type checking and data validation, create reusable schemas
© PatrickJS · CC0-1.0 · PatrickJS/awesome-cursorrules