CursorKotlinGeneral AI
Kotlin Ktor Development Rules
- Follow **SOLID**, **DRY**, **KISS**, and **YAGNI** principles
.cursorrules
## Instruction to developer: save this file as .cursorrules and place it on the root project directory
## Core Principles
- Follow **SOLID**, **DRY**, **KISS**, and **YAGNI** principles
- Adhere to **OWASP** security best practices
- Break tasks into smallest units and solve problems step-by-step
## Technology Stack
- **Framework**: Kotlin Ktor with Kotlin 2.1.20+
- **JDK**: 21 (LTS)
- **Build**: Gradle with Kotlin DSL
- **Dependencies**: Ktor Server Core/Netty, kotlinx.serialization, Exposed, HikariCP, kotlin-logging, Koin, Kotest
## Application Structure (Feature-Based)
- **Organize by business features, not technical layers**
- Each feature is self-contained with all related components
- Promotes modularity, reusability, and better team collaboration
- Makes codebase easier to navigate and maintain
- Enables parallel development on different features
```
src/main/kotlin/com/company/app/
├── common/ # Shared utilities, extensions
├── config/ # Application configuration, DI
└── features/
├── auth/ # Feature directory
│ ├── models/
│ ├── repositories/
│ ├── services/
│ └── routes/
└── users/ # Another feature
├── ...
```
Test structure mirrors the feature-based organization:
```
src/test/kotlin/com/company/app/
├── common/
└── features/
├── auth/
│ ├── models/How to use with Cursor
Create a `.cursorrules` file in your project root and paste these rules. Cursor reads this automatically on every AI interaction.
#cursor#kotlin#ai-coding-rules
Related Rules
Python Cursor Rules
CursorPython
Best Cursor AI coding rules for Python development. Enforce type hints, PEP 8, Pythonic patterns, and modern Python best practices in your .cursorrules file.
Code Style
python · type-hintsCopy Ready
TypeScript Cursor Rules
CursorTypeScript
Cursor rules for TypeScript: enforce strict mode, eliminate any types, and write type-safe code with these .cursorrules configurations.
Code Style
typescript · strictCopy Ready
React Cursor Rules
CursorReact
Cursor rules for React: component patterns, hooks best practices, performance optimization, and clean state management conventions.
Architecture
react · hooksCopy Ready
Next.js Cursor Rules
CursorNext.js
Cursor rules for Next.js App Router: server components, data fetching, routing, and deployment best practices.
Architecture
nextjs · app-routerCopy Ready