SuperAPI AI Directory

kotlin-backend-conventions

Coding & development

View repository

Updated 10-16 08:51

About this skill

Kotlin backend standards

Applicable scenarios

  • Writing or refactoring BK-CI Kotlin backend code
  • Handling Kotlin file structure, formatting, and naming conventions
  • Adjusting function design, object creation, null safety, and collection usage
  • Determining whether a piece of Kotlin code complies with project conventions

Not applicable scenarios

  • Only general backend layering or service ownership determination
  • Only Spring Boot configuration and framework usage
  • Only unit test writing, not involving Kotlin language conventions

Quick guidance

  1. This skill focuses on BK-CI Kotlin code conventions and does not replace backend layering, API design, or Spring Boot architecture skills.
  2. Kotlin standards suggestions are divided into three parts:
    • File structure, formatting, and imports:reference/1-file-format-import.md
    • Naming, function design, and object invocation:reference/2-naming-function-design.md
    • Null safety, collections, and BK-CI project conventions:reference/3-null-safety-project-practice.md
  3. Rules that can be delegated to formatting tools and static checks should not be repeated and expanded in the main skill.
  4. Project-specific high-value conventions should be prioritized, such as line width, named parameters, prohibiting wildcard imports, and avoiding direct calls with fully qualified class paths.
  5. If the question has shifted to backend service layering, also look at backend-microservice-development. If the question shifts to Spring Boot framework usage, then look at the corresponding framework standards later.

High-signal rules

  • The focus of Kotlin standards is readability, consistency, and low ambiguity, rather than using every language feature to the fullest
  • Project-specific conventions should take precedence over generalized tutorial-style knowledge
  • Language standards are suitable for being loaded on demand as a skill, and not suitable for staying resident in every session as a long rule

Key pitfalls

  • Cramming general Kotlin tutorial content into the rule layer as-is
  • Remembering only formatting without looking at BK-CI project-specific constraints
  • Mixing language standards, backend architecture standards, and Spring Boot usage into one large document

Further reading

  • File structure, formatting, and imports:reference/1-file-format-import.md
  • Naming, function design, and object invocation:reference/2-naming-function-design.md
  • Null safety, collections, and BK-CI project conventions:reference/3-null-safety-project-practice.md
  • If you are changing backend layering: also look at backend-microservice-development
  • If you are writing tests: also look at unit-testing