ha-android-concurrency
Skill by home-assistant
Guides Kotlin coroutine and threading decisions in the Home Assistant Android app. It covers scopes, dispatchers, shared state, Flow types and blocking-call review.
Install ha-android-concurrency
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-concurrency ~/.claude/skills/ha-android-concurrencyRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
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-concurrency ~/.gemini/antigravity-cli/skills/ha-android-concurrencyAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install ha-android-concurrency in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This agent skill gives guidance on Kotlin coroutines, Flows and threading for the Home Assistant Android app. It covers coroutine scope ownership and lifecycle, dispatcher choice, avoiding blocking calls, and thread-safe shared state. It also explains when to use StateFlow, SharedFlow or Channel.
It is aimed at developers writing or reviewing asynchronous code in that project. The skill sets rules such as using Mutex instead of synchronized, avoiding runBlocking, and never catching CancellationException. It points to the SuspendLazy helper in the :common module for lazy single initialization and to the ha-android-testing skill for test rules.
Written from the project's SKILL.md and checked against it.
What it can do
- Scope and lifecycle rulesTies coroutine scopes to Android lifecycles and states which object owns and cancels them.
- Dispatcher selectionExplains when to use Default, IO or Main and how to keep functions main-safe.
- Non-blocking concurrencyReplaces runBlocking and synchronized blocks with suspension and Mutex.
- Double-checked lockingShows a volatile field with a Mutex for single initialization and points to SuspendLazy.
- Flow type selectionExplains when to use StateFlow, SharedFlow or Channel for state and events.
- Concurrency testingRecommends runTest with TestDispatcher and refers to the ha-android-testing skill.
What you need
- Home Assistant Android codebase
- Kotlin Coroutines and Flow
Try asking
- Review this ViewModel for blocking calls and race conditions.
- Which Flow type should I use for a one-time navigation event?
- Make this lazy initialization thread-safe using a Mutex.
Good to know
- Targets the Home Assistant Android project and its :common module.
- Forbids runBlocking and synchronized blocks.
- Testing rules are in a separate skill, ha-android-testing.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .agents/skills/ha-android-concurrency/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-concurrency
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-concurrency: common questions
Does it allow synchronized blocks?
No. The skill forbids synchronized blocks and says to use Mutex or another non-blocking mechanism instead.
Can a child object cancel a shared coroutine scope?
No. The skill says a child object must never cancel a scope it does not own.
Should I catch CancellationException?
No. The skill says never to catch CancellationException so that coroutines cancel properly.
How do I install ha-android-concurrency?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is ha-android-concurrency free?
The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.
Is ha-android-concurrency 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-concurrency?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
