willyd61/nautobot-v2-custom-metrics-old/kotlin-quality
Claude Code and agent skill by willyd61/nautobot-v2-custom-metrics-old
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Kotlin code quality toolchain — detekt (static analysis with rule sets, baseline, custom rules), ktlint (formatter + linter for the Kotlin style guide), and Compose-specific lint rules. Covers Gradle integration (KMP-aware), pre-commit hooks, CI integration, baseline files for legacy code, and config patterns for production apps including Jetpack Compose specifics (detekt-compose-rules). USE WHEN: user mentions "detekt", "ktlint", "ktlint-gradle", "detekt-gradle", "kotlin static analysis", "kot…
Install
npx vskill@latest install willyd61/nautobot-v2-custom-metrics-old/kotlin-qualitySemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as willyd61/nautobot-v2-custom-metrics-old/kotlin-quality.
Kotlin Quality — detekt + ktlint
Deep Knowledge: Usemcp__documentation__fetch_docswith technology:detektorktlint.
Tool Comparison
| Tool | Purpose | |
|---|---|---|
| ktlint | Formatter + minimal linter — enforces Kotlin official style. Auto-fixes most issues. | |
| detekt | Comprehensive static analyzer — code smells, complexity, security, naming, magic numbers, performance, style. Highly configurable. | |
| Compose Rules (Twitter/Slack/Mrtn) | Compose-specific lint rules — composable naming, side-effects, parameter ordering. Plugs into both detekt and ktlint. | |
| Android Lint | Android-specific (resources, manifest, lifecycle). Run alongside, not replaced. |
Use both ktlint and detekt — complementary. ktlint for formatting, detekt for everything else.
Setup — ktlint (Gradle Plugin)
ktlint Configuration via .editorconfig
Setup — detekt
detekt.yml — Production Config
Baseline (For Legacy Code)
New issues fail CI; existing ones silently allowed. Reduce baseline over time.
Compose Rules
Twitter/Slack/Mrtn maintain Compose-specific lint rules:
Catches:
@Composablenot in PascalCase- Modifier parameter not first
remember { mutableStateOf() }instead ofby remember- Side effects outside
LaunchedEffect - Missing
keyinLazyColumn.items - Composable returning unit named like accessor
CI Integration — GitHub Actions
Pre-Commit Hook
Custom detekt Rules
Register via META-INF/services/io.gitlab.arturbosch.detekt.api.RuleSetProvider.
Wallet App Quality Checklist
For BHODL-style production:
- [ ]
ktlintCheckanddetektin CI - [ ] No baseline regressions (new issues block PR)
- [ ] Compose rules enabled (consistent composable patterns)
- [ ] No
println/Log.d(useKermit/Timber) - [ ] No
TODO/FIXMEin main code (use issue tracker) - [ ] Magic numbers explained or named constants
- [ ] Cyclomatic complexity ≤ 15 per function
- [ ] No
@Suppresswithout comment explaining why - [ ] All public types documented (KDoc)
- [ ] No platform types from Java interop without explicit nullability
- [ ] No
!!force-unwrap in main code (review usage)
detekt Rule Sets Cheat Sheet
| Rule set | Highlights | |
|---|---|---|
complexity | CyclomaticComplexMethod, LongMethod, LongParameterList, NestedBlockDepth | |
coroutines | RedundantSuspendModifier, GlobalCoroutineUsage | |
empty-blocks | EmptyFunctionBlock, EmptyCatchBlock | |
exceptions | TooGenericExceptionCaught, SwallowedException | |
naming | FunctionNaming, ClassNaming, VariableNaming | |
performance | ForEachOnRange, SpreadOperator | |
potential-bugs | EqualsAlwaysReturnsTrueOrFalse, HasPlatformType, NullableToStringCall | |
style | MagicNumber, ReturnCount, ThrowsCount, WildcardImport | |
formatting (via plugin) | All ktlint rules as detekt issues |
Anti-Patterns
| Anti-pattern | Why it's bad | Correct approach | |
|---|---|---|---|
| Skipping ktlint/detekt in CI | Style/quality drifts | Both in CI on every PR | |
autoCorrect = true in CI | Mutates code unexpectedly | Set false in CI; true only for pre-commit | |
| Massive baseline never reduced | Quality debt accumulates | Reduce baseline by ≥1 issue per PR rule | |
| Hardcoded suppressions everywhere | Defeats lint | Use baseline for legacy, fix new issues | |
Per-developer .editorconfig overrides | Inconsistent | Single root .editorconfig, no exceptions | |
| Skipping Compose rules in Compose project | Misses real bugs | Always enable Compose rules | |
MagicNumber rule disabled globally | Misses real magic numbers | Configure ignore list, don't disable | |
WildcardImport allowed | IDE auto-import noise | Disable wildcard imports project-wide | |
TooGenericExceptionCaught disabled | Hides bugs | Allow only with _ or ignore named param |
Troubleshooting
| Symptom | Cause | Fix | |
|---|---|---|---|
ktlint: line too long but config says 120 | Editorconfig override | Check nested .editorconfig | |
detekt: false positive on Composable | Compose rules not loaded | Add detekt-compose-rules plugin | |
| Slow detekt | Many files | parallel = true, exclude generated/build | |
| Baseline drift between branches | Auto-regenerated | Commit baseline manually | |
detekt-formatting and ktlint conflict | Same rules, different config | Pick one for each rule | |
KMP commonMain not analyzed | Source set config | Apply ktlint/detekt to all source sets | |
| Compose preview functions flagged as unused | @Preview lint exception missing | Configure excludeAnnotatedFunctions: ['Preview'] | |
MaxLineLength flagged inside string template | Hard to break | // ktlint-disable max-line-length or refactor | |
| KSP-generated code flagged | Excludes wrong | Add **/generated/** to excludes |
When NOT to Use This Skill
| Scenario | Use Instead | |
|---|---|---|
| Rust supply chain | quality/rust-supply-chain | |
| Generic vuln scanning across languages | quality/osv-scanner | |
| Java SpotBugs/Checkstyle | Java-specific quality skill | |
| TypeScript ESLint | TypeScript-specific | |
| Android Lint (manifest, resources) | Android Lint built-in | |
| Kotlin security-specific issues | security/kotlin-security | |
| KMP code patterns | mobile/kotlin-multiplatform |
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.mcp-servers/skill-loader/skills/quality/kotlin-quality/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/willyd61/nautobot-v2-custom-metrics-old/kotlin-quality)