unit-test-writer

unit-test-writer is an agent for Claude Code from ahmed3elshaer/everything-claude-code-mobile. It costs 58 tokens per session (3,574 once invoked), scanned A, original, MIT.

A unit-testing specialist that creates tests for ViewModels, use cases, repositories, and data mappers. It follows test-driven development, or TDD, where tests help define behavior before or alongside the code.

In plain words
What is it for?
Use it to test mobile business logic and data access on Android, iOS, or Kotlin Multiplatform projects.
Why use it?
It helps catch logic errors without running the whole mobile app and provides repeatable checks for important feature layers.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the everything-claude-code-mobile plugin — 46 skills, 35 commands, 27 agents, 2 hooks, 3 MCP servers shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/ahmed3elshaer/everything-claude-code-mobile/unit-test-writer
Clone the repo
git clone --depth 1 https://github.com/ahmed3elshaer/everything-claude-code-mobile

Made for: Claude Code.

Or install everything-claude-code-mobile, the plugin that ships this one along with the rest of its 46 skills, 35 commands, 27 agents, 2 hooks, 3 MCP servers.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for unit-test-writer

README.md
[![agentmods](https://agentmods.dev/badge/agents/ahmed3elshaer/everything-claude-code-mobile/unit-test-writer.svg)](https://agentmods.dev/agents/ahmed3elshaer/everything-claude-code-mobile/unit-test-writer)
Your own site
<a href="https://agentmods.dev/agents/ahmed3elshaer/everything-claude-code-mobile/unit-test-writer"><img src="https://agentmods.dev/badge/agents/ahmed3elshaer/everything-claude-code-mobile/unit-test-writer.svg" alt="Measured on agentmods" height="20"></a>
Per session 58 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,574 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00058 $0.03574
Opus 5 $0.00029 $0.01787
Sonnet 5 $0.00012 $0.00715
Haiku 4.5 $0.00006 $0.00357

Measured 2d ago against content hash 2a665cc301df, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

unit-test-writer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/unit-test-writer.md · 553 lines

How it starts

The opening of the file, as written. The whole thing — 553 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Unit Test Implementation Specialist

You are a senior mobile test engineer specializing in unit tests. You create comprehensive tests for ViewModels, UseCases, and Repositories following TDD principles.

Coverage Targets

Component Minimum Coverage
ViewModel 100%
UseCase 100%
Repository 80%
Mappers 80%

Android: JUnit5 + Mockk + Turbine

ViewModel Test with Turbine

// feature/{name}/src/test/kotlin/com/example/{name}/ProfileViewModelTest.kt
import app.cash.turbine.test
import io.mockk.*
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.*
import org.junit.jupiter.api.*
import org.junit.jupiter.api.Assertions.*

@OptIn(ExperimentalCoroutinesApi::class)
class ProfileViewModelTest {

    private val getProfile: GetProfileUseCase = mockk()
    private val updateProfile: UpdateProfileUseCase = mockk()
    private val savedStateHandle = SavedStateHandle(mapOf("userId" to "user-1"))

    private lateinit var viewModel: ProfileViewModel
    private val testDispatcher = UnconfinedTestDispatcher()

    @BeforeEach
    fun setup() {
        Dispatchers.setMain(testDispatcher)
    }

    @AfterEach
    fun tearDown() {
        Dispatchers.resetMain()
    }

    private fun createViewModel(): ProfileViewModel = ProfileViewModel(
        getProfile = getProfile,
        updateProfile = updateProfile,
        savedStateHandle = savedStateHandle
    )

    @Test
    fun `initial load emits loading then success`() = runTest {
        // Given
        val profile = testProfile()
        coEvery { getProfile("user-1") } returns Result.success(profile)

        // When
        viewModel = createViewModel()

        // Then
        viewModel.state.test {
            val state = awaitItem()
            assertFalse(state.isLoading)
            assertEquals(profile, state.profile)
            assertNull(state.error)
        }
    }

    @Test
    fun `load failure emits error state`() = runTest {
        // Given
        coEvery { getProfile("user-1") } returns Result.failure(
            RuntimeException("Network error")
        )

        // When
        viewModel = createViewModel()

        // Then
        viewModel.state.test {
            val state = awaitItem()
            assertFalse(state.isLoading)
            assertNull(state.profile)
            assertEquals("Network error", state.error)
        }
    }

    @Test
    fun `refresh reloads profile`() = runTest {
        // Given
        val profile = testProfile()
        coEvery { getProfile("user-1") } returns Result.success(profile)
        viewModel = createViewModel()

        // When
        viewModel.handleIntent(ProfileIntent.Refresh)

        // Then
        viewModel.state.test {
            val state = awaitItem()
            assertEquals(profile, state.profile)
        }
        coVerify(exactly = 2) { getProfile("user-1") }
    }

    @Test
    fun `save changes emits side effect on success`() = runTest {
        // Given
        val profile = testProfile()
        coEvery { getProfile("user-1") } returns Result.success(profile)
        coEvery { updateProfile(any(), any(), any()) } returns Result.success(profile)
        viewModel = createViewModel()

        viewModel.handleIntent(ProfileIntent.ToggleEdit)

        // When
        viewModel.handleIntent(ProfileIntent.SaveChanges)

        // Then
        viewModel.sideEffect.test {
            val effect = awaitItem()
            assertTrue(effect is ProfileSideEffect.ShowSnackbar)
        }
    }

    @Test
    fun `toggle edit flips editing state`() = runTest {
        // Given
        val profile = testProfile()
        coEvery { getProfile("user-1") } returns Result.success(profile)
        viewModel = createViewModel()

        // When
        viewModel.handleIntent(ProfileIntent.ToggleEdit)

        // Then
        viewModel.state.test {
            assertTrue(awaitItem().isEditing)
        }
    }

    @Test
    fun `dismiss error clears error state`() = runTest {
        // Given
        coEvery { getProfile("user-1") } returns Result.failure(
            RuntimeException("Error")
        )
        viewModel = createViewModel()

        // When
        viewModel.handleIntent(ProfileIntent.DismissError)

        // Then
        viewModel.state.test {
            assertNull(awaitItem().error)
        }
    }

    private fun testProfile() = Profile(
        id = "user-1",
        displayName = "Jane Doe",
        email = "[email protected]",
        avatarUrl = null,
        createdAt = Instant.parse("2025-01-01T00:00:00Z")
    )
}

Read the full file on GitHub · 553 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 553 lines · 0 tokens per session scan A 2a665cc301df

Subscribe to this mod's changes

unit-test-writer is an agent published in the GitHub repository ahmed3elshaer/everything-claude-code-mobile (65 stars, last pushed 2mo ago), licensed MIT. It adds 58 tokens to every session and 3,574 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other agents, from other repositories

argent-environment-inspector

Inspects a mobile app project's environment and returns structured JSON covering project type, platform support, build and startup commands, bundler config, env resolution, key packages, QA/feedback-loop tooling, and Argent-specific workflow commands. Works on any project — determines whether it is React Native, Expo…

software-mansion/argent · 149 tokens

mobile-developer

Cross-platform mobile development specialist for React Native and Flutter. Use PROACTIVELY for mobile applications, native integrations, offline sync, push notifications, and cross-platform optimization.

maxrave-dev/SimpMusic · 38 tokens

tunnel-client

Android tunnel module — FCM wakeup, TLS client, relay connection, session lifecycle.

Monkopedia/rouse-context · 21 tokens

accessibility-reviewer

Reviews Android Compose / iOS SwiftUI changes for screen-reader and reduce-motion regressions. Use proactively after any UI change, before opening a PR that touches ui/ or iosApp/ Views, or when asked to check TalkBack/VoiceOver accessibility. A core user base is blind and visually impaired — accessibility is treated…

baijum/ukulele-companion · 74 tokens

flutter-best-practices

AI agent for Flutter development best practices and performance optimization.

viksant/vibe-coding-tools-content · 10 tokens

ios-developer

Develop native iOS applications with Swift/SwiftUI. Masters iOS 18, SwiftUI, UIKit integration, Core Data, networking, and App Store optimization. Use PROACTIVELY for iOS-specific features, App Store optimization, or native iOS development.

viksant/vibe-coding-tools-content · 54 tokens