create-unit-test
Create and run unit tests following the project's architecture and guidelines (Robolectric, naming, location).
Best use case
create-unit-test is best used when you need a repeatable AI agent workflow instead of a one-off prompt. It is especially useful for teams working in multi. Create and run unit tests following the project's architecture and guidelines (Robolectric, naming, location).
Create and run unit tests following the project's architecture and guidelines (Robolectric, naming, location).
Users should expect a more consistent workflow output, faster repeated execution, and less time spent rewriting prompts from scratch.
Practical example
Example input
Use the "create-unit-test" skill to help with this workflow task. Context: Create and run unit tests following the project's architecture and guidelines (Robolectric, naming, location).
Example output
A structured workflow result with clearer steps, more consistent formatting, and an output that is easier to reuse in the next run.
When to use this skill
- Use this skill when you want a reusable workflow rather than writing the same prompt again and again.
When not to use this skill
- Do not use this when you only need a one-off answer and do not need a reusable workflow.
- Do not use it if you cannot install or maintain the related files, repository context, or supporting tools.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/create-unit-test/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How create-unit-test Compares
| Feature / Agent | create-unit-test | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Create and run unit tests following the project's architecture and guidelines (Robolectric, naming, location).
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Create Unit Test
This skill guides the creation of unit tests to ensuring consistency and correctness.
## Workflow
1. **Analyze and Plan**:
* **Goal**: Understand what needs testing.
* **Action**: Examine the source code.
* **Action**: Identify "happy path" cases (core functionality).
* **Action**: Identify "error cases" and "edge cases" based on likelihood.
* **Action**: Do **not** suggest implementation details unless asked; focus on behavior.
2. **Setup Test File**:
* **Naming**: `[OriginalClassName]Test.kt`.
* **Location**: `[module]/src/test/java/[package/path]/`.
* **Runner**: If testing Android components, you **MUST** use Robolectric.
* **Mocking**: Prefer creating **Fakes** over Mocks or patches. Use Mocks only if Fakes are too complex.
3. **Implement Tests**:
* Write clear, descriptive test methods.
* Follow the "Arrange-Act-Assert" pattern.
* Ensure all resources (strings, themes) are properly mocked or provided via Robolectric.
4. **Run Tests**:
* **Command**: `./gradlew :[module]:testDebugUnitTest`
* **Example**: `./gradlew :database:testDebugUnitTest`
* **Tip**: Before any commit, run `./gradlew testDebugUnitTest` to ensure everything passes.
5. **Handle Failures**:
* **Goal**: Diagnose and fix issues.
* **Action**: If a test fails, locate the full error report.
* **Path**: `[module]/build/test-results/testDebugUnitTest/TEST-[package.name.TestClassName].xml`.
* **Example**: `app/build/test-results/testDebugUnitTest/TEST-com.anysoftkeyboard.janus.app.MainActivityTest.xml`.
## Guidelines
- **Consistency**: Always place tests in the `test` source set, not `androidTest` (unless specifically writing instrumentation tests, which is rare for this skill).
- **Reliability**: Avoid flaky tests. Ensure deterministic behavior.Related Skills
create-adaptable-composable
Create a library-grade Vue composable that accepts maybe-reactive inputs (MaybeRef / MaybeRefOrGetter) so callers can pass a plain value, ref, or getter. Normalize inputs with toValue()/toRef() inside reactive effects (watch/watchEffect) to keep behavior predictable and reactive. Use this skill when user asks for creating adaptable or reusable composables.
testing-strategies
Design comprehensive testing strategies for software quality assurance. Use when planning test coverage, implementing test pyramids, or setting up testing infrastructure. Handles unit testing, integration testing, E2E testing, TDD, and testing best practices.
backend-testing
Write comprehensive backend tests including unit tests, integration tests, and API tests. Use when testing REST APIs, database operations, authentication flows, or business logic. Handles Jest, Pytest, Mocha, testing strategies, mocking, and test coverage.
ralph-tui-create-json
Convert PRDs to prd.json format for ralph-tui execution. Creates JSON task files with user stories, acceptance criteria, and dependencies. Triggers on: create prd.json, convert to json, ralph json, create json tasks.
ralph-tui-create-beads
Convert PRDs to beads for ralph-tui execution. Creates an epic with child beads for each user story. Use when you have a PRD and want to use ralph-tui with beads as the task source. Triggers on: create beads, convert prd to beads, beads for ralph, ralph beads.
ralph-tui-create-beads-rust
Convert PRDs to beads for ralph-tui execution using beads-rust (br CLI). Creates an epic with child beads for each user story. Use when you have a PRD and want to use ralph-tui with beads-rust as the task source. Triggers on: create beads, convert prd to beads, beads for ralph, ralph beads, br beads.
qa-test-planner
Generate comprehensive test plans, manual test cases, regression test suites, and bug reports for QA engineers. Includes Figma MCP integration for design validation.
game-test-case-generator
基于需求文档(xls/csv)生成专业游戏测试用例,支持完整用例和快速测试点两种模式。当用户提到"游戏测试"、"测试用例生成"、"需求转测试用例"、上传需求文档或原型时使用此技能。
wordpress-penetration-testing
This skill should be used when the user asks to "pentest WordPress sites", "scan WordPress for vulnerabilities", "enumerate WordPress users, themes, or plugins", "exploit WordPress vulnerabilities", or "use WPScan". It provides comprehensive WordPress security assessment methodologies.
web3-testing
Test smart contracts comprehensively using Hardhat and Foundry with unit tests, integration tests, and mainnet forking. Use when testing Solidity contracts, setting up blockchain test suites, or validating DeFi protocols.
web-security-testing
Web application security testing workflow for OWASP Top 10 vulnerabilities including injection, XSS, authentication flaws, and access control issues.
unity-ecs-patterns
Master Unity ECS (Entity Component System) with DOTS, Jobs, and Burst for high-performance game development. Use when building data-oriented games, optimizing performance, or working with large entity counts.