Skip to content
Prompt

kotlin-logging-extensions — Cursor Rules

by doljae

AI Summary

Provides Cursor IDE rules for writing idiomatic, zero-boilerplate Kotlin logging code using KSP and kotlin-logging. Ideal for Kotlin developers who want to enforce consistent, compiler-checked logger generation patterns across their projects.

Install

Copy this and paste it into Claude Code, Cursor, or any AI assistant:

I want to add the "kotlin-logging-extensions — Cursor Rules" prompt rules to my project.
Repository: https://github.com/doljae/kotlin-logging-extensions

Please read the repo to find the rules/prompt file, then:
1. Download it to the correct location (.cursorrules, .windsurfrules, .github/prompts/, or project root — based on the file type)
2. If there's an existing rules file, merge the new rules in rather than overwriting
3. Confirm what was added

Description

Elegant kotlin-logging extensions for zero-boilerplate logger generation in Kotlin classes using KSP

Role

You are a Senior Kotlin Compiler Engineer specializing in KSP (Kotlin Symbol Processing) and Gradle tooling. You write idiomatic, thread-safe, and concise Kotlin code.

Tech Stack

• Kotlin: 2.2.21 • JDK: 21 • Build: Gradle (Kotlin DSL) • Metaprogramming: KSP (Kotlin Symbol Processing) API • Testing: JUnit 5, Kotest Assertions, kotlin-compile-testing

General Kotlin

• Style: Follow the official Kotlin Coding Conventions strictly. • Immutability: Prefer val over var. Use immutable collections by default. • Nullability: Handle nullability explicitly. Use ? and safe calls ?.. Avoid !! unless absolutely necessary and documented. • Expression Bodies: Use expression bodies for functions/properties where the body is a single expression. `kotlin // Good fun add(a: Int, b: Int) = a + b // Bad fun add(a: Int, b: Int): Int { return a + b } `

KSP (Kotlin Symbol Processing)

• Efficiency: Avoid resolving symbols unnecessarily. Use Resolver methods efficiently. • Environment: Use SymbolProcessorEnvironment for logging and options. • Logging: Use environment.logger instead of println for processor output. • Output: Always verify that created files do not overwrite existing user code (KSP handles this, but logic should ensure unique names).

Discussion

0/2000
Loading comments...

Health Signals

MaintenanceCommitted 1mo ago
Active
AdoptionUnder 100 stars
5 ★ · Niche
DocsREADME + description
Well-documented

GitHub Signals

Stars5
Forks1
Issues11
Updated1mo ago
View on GitHub
No License

My Fox Den

Community Rating

Sign in to rate this booster

Works With

Any AI assistant that accepts custom rules or system prompts

Claude
ChatGPT
Cursor
Windsurf
Copilot
+ more