Skip to content

TypeScript LLM Tech Stack .cursorrules prompt file

Author: Raphael Mansuy

What you can build

Multi-Provider LLM Integration Platform: An online service allowing developers to seamlessly integrate and manage multiple LLM providers. It provides a unified API, enabling easy switching between providers and ensuring optimal utilization of various LLM features.TypeScript Functional Utility Library: A comprehensive library that offers utility functions, type aliases, and generics to enhance functional programming in TypeScript. It promotes immutability and composability, making it easier to write clean, maintainable code.Error Handling and Logging Framework: A framework specifically designed for enhancing error handling and logging in TypeScript applications. It incorporates custom error types and provides decorators for easy integration into existing codebases.Async Workflow Management Tool: A tool aimed at simplifying the management of asynchronous operations using async/await patterns. It offers advanced features like retry logic, timeout management, and race conditions detection.Developer Delight API Library: A library focused on creating delightful developer experiences through intuitive and highly composable APIs. It includes modules for common tasks like HTTP requests, data validation, and file operations.Type-Safe YAML Editor: An application that allows users to edit YAML files in a type-safe manner, leveraging the capabilities of js-yaml and TypeScript's strict type system to prevent common errors in configuration files.Mime-Type Management Service: A web service that offers advanced MIME type detection and mapping features, leveraging mime-types library to enhance file handling and content negotiation in web applications.UUID Management and Generation App: An application that provides advanced features for UUID generation and management, utilizing uuid library to ensure unique identifiers across distributed systems.Zod Schema Repository: A platform that hosts reusable zod schemas for common data validation use-cases, enabling developers to share and access validated and tested schemas for rapid application development.TypeScript Documentation Generator: A tool that automates the generation of comprehensive documentation for TypeScript projects, including examples and up-to-date information, by utilizing JSDoc comments and README files.

Benefits

Synopsis

Developers can leverage this prompt to create a well-structured TypeScript codebase for multi-provider LLM architectures with robust documentation, type safety, and efficient asynchronous operations.

Overview of .cursorrules prompt

The .cursorrules file outlines guidelines and best practices for a software engineer and product manager with expertise in multi-provider architectures for Large Language Models (LLMs) and functional programming in TypeScript. It emphasizes coding standards, including naming conventions, file organization, and code style, advocating for the use of TypeScript's features like type aliases and generics. The file stresses the importance of the Single Responsibility Principle, dependency injection, error handling, and comprehensive unit testing. It also highlights documentation practices using JSDoc and the effective use of specific libraries (e.g., axios, js-yaml, mime-types, node-gyp, uuid, and zod) to enhance functionality and maintainability.

.cursorrules Content

json
## 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

Released under the MIT License.