android-test-generator

Generate Kotlin unit tests for Android components from source classes.

3|Updated Sep 29, 2025
One-click install
npx skills add https://github.com/xtone/ai_development_tools --skill android-test-generator-xtone
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: android-test-generator
Source: https://github.com/xtone/ai_development_tools/tree/main/android_development/.claude/skills/android-test-generator
Command: npx skills add https://github.com/xtone/ai_development_tools --skill android-test-generator-xtone

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the generation of Kotlin unit tests for Android components by analyzing source code and selecting appropriate templates.

Core Features & Use Cases

  • UI layer test generation: Reducer, StateManager, Presenter, ViewModel (MVI/AAC)
  • Domain and Data support: UseCase, Repository, ApiService, Mapper
  • Automatic class-type detection and project-specific configuration to tailor tests to your architecture

Quick Start

Run the skill on a target Kotlin class to generate a complete test file. You can customize the output by editing knowledge/project-config.md and templates under templates/.

Frequently Asked Questions about android-test-generator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automatically generate Kotlin unit tests for Android ViewModel and UseCase classes?

You can automatically generate Kotlin unit tests for Android components by analyzing source classes and selecting appropriate templates. The tool detects class types like ViewModel, UseCase, and Repository to produce complete test files tailored to your architecture.

What Android architecture components are supported for unit test generation?

Unit test generation supports UI layers including Reducer, StateManager, Presenter, and ViewModel, alongside Domain layer UseCase and Data layer components like Repository, ApiService, and Mapper.

How do I configure mock strategies and testing libraries for generated Android unit tests?

You configure testing libraries and mock strategies by editing the local project configuration file. This setup allows the generator to tailor test outputs to your specific module settings and architectural requirements.

Does this unit test generator work with MockK for mocking Kotlin Android classes?

Yes, the unit test generator works with MockK. It uses project-specific configuration to define mock strategies, ensuring the generated Kotlin test code aligns with your chosen mocking framework.

Can I customize the templates used for generating Android unit test code?

Yes, you can customize test generation by editing the templates directory. The generator uses these supplied templates alongside your project configuration to output tests directly under the project's test directories.

What is the best way to generate unit tests for a Repository and ApiService in an Android project?

The best way is to run the generator directly on your target Kotlin classes. It automatically detects Data layer components like Repository and ApiService, applying the correct templates to output complete test files.