Kotlin Null Safety
Analyzes Kotlin code to identify potential null pointer exceptions and suggests safe coding practices.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add kotlin-null-safety npx -- -y @trustedskills/kotlin-null-safety
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"kotlin-null-safety": {
"command": "npx",
"args": [
"-y",
"@trustedskills/kotlin-null-safety"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
This skill analyzes Kotlin code for potential null pointer exceptions, a common source of errors in software development. It identifies locations where variables might be null and provides suggestions for implementing safer coding patterns, such as using nullable types (?) or the Elvis operator (?:). The goal is to improve code robustness and reduce runtime crashes related to unexpected null values.
When to use it
- Code Reviews: Integrate this skill into your code review process to proactively identify potential null safety issues before they reach production.
- Legacy Code Refactoring: Use the skill when refactoring older Kotlin codebases that may lack explicit null handling.
- New Feature Development: Apply it during development of new features to ensure null safety from the start.
- Debugging NullPointerExceptions: When encountering a
NullPointerException, use this skill to quickly pinpoint the root cause in your code.
Key capabilities
- Identifies potential null pointer exception locations.
- Suggests safe coding practices for handling nullable values.
- Analyzes Kotlin code.
- Provides recommendations for improved code robustness.
Example prompts
- "Analyze this function for null safety issues: [paste Kotlin function here]"
- "What are the potential null pointer risks in this class? [paste Kotlin class here]"
- "Suggest a safer way to handle this variable: [paste line of Kotlin code here]"
Tips & gotchas
The skill's effectiveness depends on the complexity and structure of the provided Kotlin code. For best results, provide complete functions or classes rather than isolated snippets.
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.