Agent Skills
› DetachHead/rebased
› code-style
code-style
GitHub定义 IntelliJ Kotlin/Java 代码规范,涵盖语言选择、Kotlin 惯用法及格式化规则,指导开发编写与审查时的代码风格。
Trigger Scenarios
编写新的 Kotlin 或 Java 文件
修改现有 Java 代码
审查代码格式与风格
Install
npx skills add DetachHead/rebased --skill code-style -g -y
SKILL.md
Frontmatter
{
"name": "code-style",
"description": "Apply IntelliJ Kotlin and Java code style when writing or reviewing."
}
Code Style
Follow the IntelliJ Coding Guidelines with these IntelliJ-specific rules.
Language
- ALWAYS use Kotlin for new files - Only use Java when modifying existing Java code
- Use idiomatic Kotlin: extension functions, data classes, null safety
- Mark experimental APIs with
@ApiStatus.Experimental - Build scripts Kotlin style: Follow
community/platform/build-scripts/kotlin-style-recommendations.mdfor build-scripts code:- Use
@JvmFieldfor internal data class fields - Use
.put()/.get()instead of[]operator - Use explicit
HashMap/HashSet/LinkedHashMapinstead ofmutableMapOf()/mutableSetOf()
- Use
Formatting
- Read every applicable
.editorconfigbefore you review or change formatting. - Use the effective
.editorconfigvalue for each setting. If no file defines a setting, use these defaults:- Indentation: 2 spaces (4 for Go files)
- Line length: 140 characters max
- Braces:
else,catch, andfinallyon new lines
- Only in
/rustroverdirectory you must always use standard Kotlin formatting rules with 4 spaces indentation.
Version History
-
2af32ff
Current 2026-09-22 01:02
新增格式化章节中关于读取并应用 .editorconfig 配置的说明。
- 1f8708d 2026-08-16 15:38


