一键导入
kotlin-code-style
Guidelines and strict rules for Kotlin code formatting, specifically concerning imports, fully qualified names, and avoiding codebase pollution.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Guidelines and strict rules for Kotlin code formatting, specifically concerning imports, fully qualified names, and avoiding codebase pollution.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | Kotlin Code Style |
| description | Guidelines and strict rules for Kotlin code formatting, specifically concerning imports, fully qualified names, and avoiding codebase pollution. |
When developing or refactoring Kotlin code in Upnext, you MUST adhere to the following strict code style guidelines regarding classes and imports.
Always prefer utilizing standard import statements at the top of the file over inline fully qualified class names.
// BAD: Using the fully qualified name inline
viewModelScope.launch {
try {
repository.getData()
} catch (e: kotlinx.coroutines.CancellationException) {
throw e
}
}
import kotlinx.coroutines.CancellationException
// GOOD: Leveraging imports
viewModelScope.launch {
try {
repository.getData()
} catch (e: CancellationException) {
throw e
}
}
You may use fully qualified names only to resolve explicit naming collisions.
For example, if you are mapping between a network model and a domain model that share the same name, or if you are using kotlin.Result alongside a custom com.theupnextapp.domain.Result:
// ACCEPTABLE: Resolving collisions between two 'Result' types
fun mapResponse(): kotlin.Result<com.theupnextapp.domain.Result> { ... }
Our current version of Detekt does not have the UnnecessaryFullyQualifiedName rule natively available. Therefore, it is the agent's responsibility to proactively implement these checks and refrain from outputting fully qualified names in generated code.
Before proposing PRs or delivering a walkthrough, verify that you haven't lazily injected fully qualified paths into your Kotlin classes!
Best practices for Android instrumentation tests, Hilt testing, Mockito configuration, and test resilience patterns in Upnext.
Best practices for Type-Safe Navigation (Nav 3) and Adaptive Layouts in Upnext.
Strict guidelines and workflow for developing new features, ensuring quality, proper branching, UI/UX standards, and comprehensive testing in Upnext.
Expert capabilities for managing Upnext application releases, CI/CD pipelines, and versioning.
Core product design and development principles for Upnext, derived from competitive analysis of the official Trakt app's negative user feedback. Use this skill when proposing new features, designing UI/UX, or prioritizing the roadmap.
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications.