kotlin-development
Skill275 starsChanged 53 days agoApache-2.0View on GitHub
Kotlin development guidelines with best practices for clean code, naming conventions, function design, and data handling
In this repository264 other files it gives its agents.
- accessibility-a11ySkill
- alpine-jsSkill
- analytics-data-analysisSkill
- android-developmentSkill
- angular-developmentSkill
- angularSkill
- anime-jsSkill
- anthropic-claude-developmentSkill
- api-developmentSkill
- apollo-graphqlSkill
- aspnet-coreSkill
- astroSkill
- auth0-authenticationSkill
- autogen-developmentSkill
- automl-hyperparameter-optimizationSkill
- aws-developmentSkill
- azureSkill
- backend-developmentSkill
- bash-scriptingSkill
- beautifulsoup-parsingSkill
- bitbucket-workflowSkill
- blazorSkill
- blender-python-addonSkill
- blockchainSkill
- bootstrapSkill
- business-central-developmentSkill
- cheerio-parsingSkill
- chrome-extension-developmentSkill
- ci-cd-best-practicesSkill
- clean-architectureSkill
- clean-codeSkill
- clerk-authenticationSkill
- cloudflare-developmentSkill
- computer-vision-opencvSkill
- convexSkill
- cppSkill
- c-sharpSkill
- cssSkill
- cypressSkill
- data-analysis-jupyterSkill
- data-analystSkill
- data-jupyter-pythonSkill
- deep-learning-pythonSkill
- deep-learning-pytorchSkill
- deep-learningSkill
- deno-typescriptSkill
- design-systemsSkill
- devopsSkill
- django-pythonSkill
- django-rest-api-developmentSkill
- dockerSkill
- dotnetSkill
- drizzle-ormSkill
- drupal-developmentSkill
- elasticsearch-best-practicesSkill
- electron-developmentSkill
- elixirSkill
- embedded-stm32Skill
- esbuild-bundlerSkill
- ethereumSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
31 rules. About 0 are common, 29 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈29
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Use English for all code and documentation
- Distinctive: line 14
Always declare the type of each variable and function
- Very specific: line 15
Avoid the any type; create necessary types instead
- Distinctive: line 16
No blank lines within function bodies
- Distinctive: line 27
Start each function with a verb (get, set, create, update, delete, etc.)
- Distinctive: line 28
Use complete words over abbreviations
- Distinctive: line 30
Avoid magic numbers; define constants instead
- Distinctive: line 36
Keep functions under 20 instructions
- Distinctive: line 41
Use verb-based naming that describes the action
- Distinctive: line 46
Use early returns to handle edge cases first
- Distinctive: line 49
Prefer arrow functions for simple operations.
- Distinctive: line 52
Use default parameters instead of null checks
- Distinctive: line 53
When functions have multiple parameters, consolidate them into objects (RO-RO pattern)
- Distinctive: line 54
Keep parameter lists short (max 3-4 parameters)
- Distinctive: line 59
Use data classes for data structures
- Distinctive: line 64
Prefer immutability for data
- Very specific: line 65
Use val for variables that don't change
- Distinctive: line 66
Use immutable collections when possible
- Distinctive: line 67
Create new instances instead of mutating existing ones
- Distinctive: line 72
Keep classes under 200 instructions
- Distinctive: line 79
Use interfaces for abstraction
- Distinctive: line 80
Keep classes focused on a single responsibility
- Distinctive: line 86
Don't use exceptions for control flow
- Distinctive: line 89
Add context before re-throwing
- Distinctive: line 92
Create custom exception types for domain-specific errors
- Distinctive: line 100
Write unit tests for all public functions
- Distinctive: line 101
Use test doubles (mocks, stubs, fakes) for dependencies
- Distinctive: line 106
Test user-facing behavior and scenarios
- Distinctive: line 107
Keep tests independent and repeatable
- Distinctive: line 112
Keep files focused and cohesive
- Distinctive: line 113
Use packages/modules to organize code by feature or layer
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

