kotlin-style

Installation
SKILL.md

1. Class Layout & Order

To maintain readability, all Kotlin classes MUST follow this declaration order:

  1. Properties and Initializer Blocks: Grouped by visibility and purpose.
  2. Secondary Constructors: Following the primary constructor.
  3. Public/Internal Functions: The entry points and public API of the class.
  4. Private Functions: Helper methods and implementation details. These MUST be situated after all public functions to keep the API at the top.
  5. Companion Object: MUST be situated at the very end of the class, just before the closing brace.

The Step-down Rule

Organize functions so that they can be read as a narrative from top to bottom. A high-level function should be followed by the lower-level private functions it calls. If a private function is shared by multiple public ones, place it at the very bottom of the function block.

2. Naming Conventions

  • Classes/Objects: PascalCase (e.g., RemoteConfigMapper).
  • Functions/Properties: lowerCamelCase (e.g., mapToThreshold).
  • Descriptive over Brief: Prioritize readability over brevity. Avoid abbreviations that obscure meaning. Property names MUST be descriptive and start with a lowercase letter (e.g., use medium instead of m, extraSmall instead of xs).
  • Constants: UPPER_SNAKE_CASE (e.g., DEFAULT_THRESHOLD).
Installs
8
First Seen
11 days ago
kotlin-style — albertmartorell1975/android-ai-workflow-foundation