Skip to main content
rule

typescript-llm-tech-stack-cursorrules-prompt-file — Cursor rule

Cursor rule for TypeScript projects integrating LLM stacks. Enforces functional programming, type aliases over interfaces, and strict library conventions.

Install into Cursor · Manually: put the files in place All methods and platforms ↓
.cursor/rules/typescript-llm-tech-stack-cursorrules-prompt-file.mdc
Open on GitHub

What typescript-llm-tech-stack-cursorrules-prompt-file does

The rule instructs Cursor to generate functional TypeScript code with immutable data structures, pure functions, and type aliases instead of interfaces. It enforces kebab-case for file naming, camelCase for functions, and ALL_CAPS for constants. Arrow functions and const declarations take priority over reassigned variables.

The prompt establishes specific library choices: schema validation using zod (^3.23.8), HTTP networking with axios (^1.7.5) interceptors, and ID creation via uuid (^10.0.0) v4. It also covers js-yaml (^4.1.0), mime-types (^2.1.35), and node-gyp (^10.2.0) build requirements. Every asynchronous routine must rely on async/await rather than raw promises.

Codebases heavily reliant on object-oriented class hierarchies will clash directly with this rule's bias toward pure functions.

What it helps with

  • enforce functional TypeScript conventions and pure functions
  • validate incoming data payloads with Zod schemas
  • configure Axios HTTP interceptors for API error handling
  • standardize file naming and project directory structure

Example prompts for the agent

  • Build an API client module using Axios with request interceptors and Zod response validation
  • Write a utility function to parse YAML configs into type-safe TypeScript types
  • Generate a session token service utilizing UUID v4 identifiers

How to install typescript-llm-tech-stack-cursorrules-prompt-file

Manually: put the files in place

.cursor/rules/typescript-llm-tech-stack-cursorrules-prompt-file.mdc

Frontmatter: description, globs, alwaysApply

Step by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules

Questions about typescript-llm-tech-stack-cursorrules-prompt-file

How do I install typescript-llm-tech-stack-cursorrules-prompt-file in Cursor?

Save the rule contents into .cursor/rules/typescript-llm-tech-stack-cursorrules-prompt-file.mdc inside your project root.

What coding style does this rule enforce?

It prioritizes functional programming over classes, type aliases over interfaces, and immutable data handling.

Which dependencies does the configuration specify?

The rule explicitly references axios (^1.7.5), zod (^3.23.8), uuid (^10.0.0), js-yaml (^4.1.0), mime-types (^2.1.35), and node-gyp (^10.2.0).

Source text

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

Similar IDE rules

All IDE rules for Programming languages →

From the same set234

The whole set →
typescript-nodejs-nextjs-ai-cursorrules-prompt-fil This rule steers Cursor toward concrete code or direct explanations for TypeScript, Node.js, and Next.js projects with AI integration. ★ 41,024repo stars typescript-nextjs-supabase-cursorrules-prompt-file A Cursor rule that keeps TypeScript work on Next.js App Router and Supabase consistent: server components first, Shadcn UI, Tailwind. ★ 41,024repo stars typescript-nextjs-react-cursorrules-prompt-file Configures Cursor for TypeScript, Next.js 14 App Router, React, and Tailwind. Useful when building frontend interfaces with Vercel AI SDK streaming. ★ 41,024repo stars typescript-nextjs-cursorrules-prompt-file This rule sets coding conventions for TypeScript and Next.js App Router, with guidance for React and Daisy UI with Tailwind. Use it to steer Cursor toward those patterns in a project. ★ 41,024repo stars typescript-expo-jest-detox-cursorrules-prompt-file A Cursor rule that points the assistant at TypeScript, React Native, Expo and mobile UI work. Useful when your app runs on Expo and you test it with Jest and Detox. ★ 41,024repo stars typescript-code-convention-cursorrules-prompt-file A Cursor rule that pins down TypeScript code style for Next.js App Router, React, Expo, tRPC and Tailwind projects. Useful when the agent writes code inconsistently. ★ 41,024repo stars typescript-clasp-cursorrules-prompt-file Instructs Cursor to write TypeScript for Google Apps Script with clasp, focusing on pseudocode planning, batching API calls, and interface-first typing. ★ 41,024repo stars toss-style-design-system This Cursor rule guides the agent toward restrained product interfaces with clear hierarchy, grayscale structure, and limited accent color. Use it when editing UI components or styles. ★ 41,024repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor