ha-android-kotlin-style
Skill by home-assistant
Applies Home Assistant's Android Kotlin code style rules when writing or reviewing Kotlin. Covers constants, strong types, time, visibility, imports and KDoc. Aimed at contributors to Home Assistant's Android codebase.
Install ha-android-kotlin-style
Built from the published package, never by AI.
git clone --depth 1 https://github.com/home-assistant/android /tmp/android && mkdir -p ~/.claude/skills && cp -r /tmp/android/.agents/skills/ha-android-kotlin-style ~/.claude/skills/ha-android-kotlin-styleRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install ha-android-kotlin-style in Claude Code
git clone --depth 1 https://github.com/home-assistant/android /tmp/android && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/android/.agents/skills/ha-android-kotlin-style ~/.gemini/antigravity-cli/skills/ha-android-kotlin-styleAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install ha-android-kotlin-style in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
The ha-android-kotlin-style skill gives an AI assistant the Home Assistant Android team's Kotlin style rules. It covers when to use named constants, sealed types instead of strings or enums, and Duration and Instant instead of primitive time values. It also covers immutability, narrow visibility, import hygiene, and KDoc and comment conventions.
The skill is for writing or reviewing Kotlin code. It notes that KTLint enforces formatting through .editorconfig and gives a ktlintFormat command to run. Rationale is kept in linked Home Assistant contributor pages. The rules come with short Kotlin examples. It is aimed at developers working on Home Assistant's Android code and anyone reviewing it.
Written from the project's SKILL.md and checked against it.
What it can do
- ConstantsReplace magic numbers and strings with named constants placed near their usage.
- Strong typesUse sealed classes over enums or strings, and data classes instead of Pair or Triple.
- Time handlingUse Kotlin Duration and Instant, and inject a clock through Hilt instead of System.currentTimeMillis.
- Immutability and functionsStore data in immutable classes, keep functions small, and prefer composition over inheritance.
- VisibilityDefault to the narrowest visibility and check whether internal is enough before going public.
- ImportsAdd imports with their usage in the same edit and remove imports left unused after changes.
- KDoc and commentsRequire KDoc on public functions, avoid TODOs without an issue link, and use full HTTP links.
What you need
- Gradle project with KTLint configured
Try asking
- Review this Kotlin class for Home Assistant style issues.
- Replace the magic numbers in this file with named constants.
- Write short KDoc for this public function, focused on its contract.
Good to know
- Covers Kotlin style only, not architecture (see ha-android-architecture).
- Rationale lives in external Home Assistant contributor pages, not in the skill.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .agents/skills/ha-android-kotlin-style/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md5 KB
Alternatives to ha-android-kotlin-style
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
ha-android-kotlin-style: common questions
Does this skill enforce Kotlin formatting?
The source says KTLint enforces formatting through .editorconfig. The skill itself sets style rules for writing and reviewing Kotlin code.
When should Duration be used instead of a primitive?
The source says to use Kotlin Duration and Instant instead of primitive types for time. If a primitive is unavoidable, the unit should go in the name, such as THRESHOLD_MS.
Where can I read the full style rationale?
The source links to Home Assistant contributor pages for Android code style and best practices.
How do I install ha-android-kotlin-style?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is ha-android-kotlin-style free?
The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.
Is ha-android-kotlin-style safe to use?
It scores 82 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to ha-android-kotlin-style?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
