Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/holtwood/awesome-cursorrules-zhWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/holtwood/awesome-cursorrules-zh/kotlin-springboot-rules)<a href="https://agentmods.dev/rules/holtwood/awesome-cursorrules-zh/kotlin-springboot-rules"><img src="https://agentmods.dev/badge/rules/holtwood/awesome-cursorrules-zh/kotlin-springboot-rules.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.01826 |
| Opus 5 | $0.00000 | $0.00913 |
| Sonnet 5 | $0.00000 | $0.00365 |
| Haiku 4.5 | $0.00000 | $0.00183 |
Grade A, and why
kotlin-springboot-rules scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 101 lines — stays where its author put it; the contents beside it link to each section on GitHub.
项目结构与组织
- 将你的源代码分组到明确定义的包中,如 controller、service、repository 和 model,以分离关注点并提高可维护性。
- 组织你的文件系统,使每个目录都镜像 Kotlin 的包名(例如,将 com.myapp.users 放在 src/main/kotlin/com/myapp/users 下)。
- 每个 Kotlin 文件都以其包含的主要类或概念命名,以使代码库更易于导航和理解。
- 避免使用像 Utils.kt 这样模糊的文件名;相反,使用简洁且有意义的名称,以反映文件内容的目的。
- 将你的 Spring Boot 应用程序入口点放在根包中,并按层或功能组织子包,以帮助 Spring 高效地扫描和组织组件。
编码风格与约定
- 类和对象名使用 PascalCase,函数和变量名使用 camelCase,常量名使用 UPPER_SNAKE_CASE,以遵循 Kotlin 的命名约定并提高可读性。
- 默认使用
val声明变量,仅在需要可变性时才使用var,以促进更安全、更可预测的代码。val maxConnections = 10 // 不可变引用 var currentUsers = 0 // 可变的,如果可能,尽量避免 - 将变量的作用域限制在其实际使用的地方——函数内部或更小的代码块中——以避免意外误用,并使代码更易于遵循。
- 使用 4 空格缩进、在运算符和逗号周围使用适当的间距,以及编写简短、专注的函数来统一格式化你的代码,以提高清晰度和可维护性。
- 编写清晰且富有表现力的代码,而不是巧妙的单行代码;将复杂的逻辑分解为中间变量或命名良好的函数,以提高可读性。
- 为类、函数和变量使用描述性的名称以传达意图,并避免使用像 '-Manager' 或 '-Helper' 这样没有实际意义的模糊后缀。
- 保持属性的 getter 和 setter 简单且不含复杂逻辑;如果需要复杂的行为,请将其移至单独的方法中,以保持属性访问的可预测性。
地道的 Kotlin 用法
- 使用数据类(data class)定义 DTO 和实体,这样你就可以获得像
equals()和copy()这样的有用方法,而无需编写样板代码。 - 使用默认参数和命名参数替换重载的构造函数,以简化函数调用并使其更具表现力。
// Kotlin – 使用默认参数 fun createConnection(host: String, secure: Boolean = true) { … } createConnection("example.com") // 使用默认的 secure=true createConnection(host = "test.com", secure = false) // 使用命名参数以提高清晰度 - 使用
when表达式代替冗长的if-else链,以编写更清晰、更易读的条件逻辑,从而清楚地处理每种情况。 - 创建扩展函数而不是工具类,以更自然、更易读的方式为现有类型添加可重用行为。
fun String.capitalizeFirst(): String = replaceFirstChar { it.uppercaseChar() } println("kotlin".capitalizeFirst()) // 打印 "Kotlin" - 使用作用域函数如
apply、let、also、run和with来减少重复,并清晰地表达对象配置或空安全操作。 - 仅在必要时将变量声明为可空,并使用安全调用运算符(
?.)和 Elvis 运算符(?:)来处理它们,以避免运行时崩溃。 - 避免使用非空断言(
!!),而是提供回退值或显式的空检查,以编写更安全、更可预测的代码。 - 立即处理来自 Java API 的平台类型,通过将它们显式转换为
String或String?,以避免在你的 Kotlin 代码中传播可空性的不确定性。 - 使用 Kotlin 的函数式集合操作如
filter、map和forEach代替手动循环,以编写简洁且富有表现力的数据转换逻辑。// 命令式方法 val activeUsers = mutableListOf<User>() for (user in users) { if (user.isActive) activeUsers.add(user) } // 地道的函数式方法 val activeUsers = users.filter { it.isActive } - 当逻辑清晰时,将简单函数转换为单表达式函数,以消除不必要的语法并提高代码的简洁性。
fun toDto(entity: User) = UserDto(name = entity.name, email = entity.email) - 使用字符串模板(
$var或${expression})构建字符串,而不是使用拼接,并使用三引号字符串处理干净的多行文本。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 7d ago First seen · 101 lines · 0 tokens per session scan A 0e719ad1b952
kotlin-springboot-rules is a cursor rule published in the GitHub repository holtwood/awesome-cursorrules-zh (232 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,826 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
kotlin-ktor-development-cursorrules-prompt-file
Cursor rules for Kotlin development with Ktor integration.
kotlin-springboot-best-practices-cursorrules-prompt-file
Cursor rules for Kotlin Springboot Best Practices.
python-django-best-practices-cursorrules-prompt-fi
Cursor rules for Python Django development with best practices.
laravel-php-83-cursorrules-prompt-file
Cursor rules for Laravel development with PHP 8.3 integration.
telegram-bot-general
Project-wide conventions for Telegram Bot library.
10-backend-fastapi
FastAPI backend rules.