kotlin-development
БесплатноБез исполняемых скриптовНе проверенKotlin development guidelines with best practices for clean code, naming conventions, function design, and data handling
от Mindrally★ 323 звезды на GitHubОб этом скилле
Kotlin Development Best Practices
General Principles
- Use English for all code and documentation
- Always declare the type of each variable and function
- Avoid the
anytype; create necessary types instead - No blank lines within function bodies
Naming Conventions
Case Standards
- PascalCase: Classes, interfaces, enums
- camelCase: Variables, functions, methods, parameters
- UPPERCASE: Environment variables, constants
- underscores_case: Files and directories
Naming Guidelines
- Start each function with a verb (get, set, create, update, delete, etc.)
- Use complete words over abbreviations
- Allowed abbreviations: API, URL, i/j for loops, err, ctx, req/res/next
- Avoid magic numbers; define constants instead
- Boolean variables use prefixes:
isLoading,hasError,canDelete
Function Design
Size and Responsibility
- Keep functions under 20 instructions
- Each function should have a single responsibility
- Extract logic into utility functions when complexity increases
Naming Functions
- Use verb-based naming that describes the action
- Prefix boolean-returning functions with
is,has, orcan - Prefix void functions with action verbs like
execute,save,send
Reducing Nesting
- Use early returns to handle edge cases first
- Extract nested logic into separate functions
- Employ higher-order functions (map, filter, reduce) to minimize loops
- Prefer arrow functions for simple operations; use named functions otherwise
Parameters
- Use default parameters instead of null checks
- When functions have multiple parameters, consolidate them into objects (RO-RO pattern)
- Keep parameter lists short (max 3-4 parameters)
Data Handling
Data Classes
- Use data classes for data structures
- Encapsulate primitive types in composite types when they represent domain concepts
- Validate data internally within data classes
Immutability
- Prefer immutability for data
- Use
valfor variables that don't change - Use immutable collections when possible
- Create new instances instead of mutating existing ones
Classes and Objects
Size Guidelines
- Keep classes under 200 instructions
- Limit to fewer than 10 public methods
- Limit to fewer than 10 properties
Design Principles
- Follow SOLID principles
- Favor composition over inheritance
- Use interfaces for abstraction
- Keep classes focused on a single responsibility
Exception Handling
When to Use Exceptions
- Reserve exceptions for truly unexpected errors
- Don't use exceptions for control flow
- Catch exceptions only to:
- Fix an anticipated issue
- Add context before re-throwing
Best Practices
- Create custom exception types for domain-specific errors
- Include meaningful error messages
- Log exceptions at appropriate levels
Testing
Unit Tests
- Follow Arrange-Act-Assert convention
- Write unit tests for all public functions
- Use test doubles (mocks, stubs, fakes) for dependencies
- Name tests descriptively to document behavior
Acceptance Tests
- Follow Given-When-Then convention
- Test user-facing behavior and scenarios
- Keep tests independent and repeatable
Code Organization
- Group related functionality together
- Keep files focused and cohesive
- Use packages/modules to organize code by feature or layer
- Maintain consistent file structure across the project
Установить kotlin-development в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл kotlin-development?
Kotlin development guidelines with best practices for clean code, naming conventions, function design, and data handling
Как установить скилл kotlin-development?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл kotlin-development запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic