test-driven-development

test-driven-development is a skill for Claude Code from GuillemRoca/agent-skills-android. It costs 46 tokens per session (2,147 once invoked), scanned A, original, MIT.

A testing guide based on test-driven development, or TDD: write a failing test, make it pass, then improve the code.

In plain words
What is it for?
Implementing features, fixing bugs, adding business logic, and refactoring code with JUnit 5, MockK, and Compose test rules.
Why use it?
It creates a test safety net while features and bug fixes are being built, making expected behaviour explicit before implementation.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the agent-skills-android plugin — 30 skills, 8 commands, 3 agents shipped together

Good fit Implementing features, fixing bugs, adding business logic, and refactoring code with JUnit 5, MockK, and Compose test rules.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/guillemroca/agent-skills-android/test-driven-development
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.

Any agent
npx skills add GuillemRoca/agent-skills-android --skill test-driven-development
Clone the repo
git clone --depth 1 https://github.com/GuillemRoca/agent-skills-android

Made for: Claude Code.

Or install agent-skills-android, the plugin that ships this one along with the rest of its 30 skills, 8 commands, 3 agents.

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 test-driven-development

README.md
[![agentmods](https://agentmods.dev/badge/skills/guillemroca/agent-skills-android/test-driven-development/github.svg)](https://agentmods.dev/skills/guillemroca/agent-skills-android/test-driven-development)
Your own site
<a href="https://agentmods.dev/skills/guillemroca/agent-skills-android/test-driven-development"><img src="https://agentmods.dev/badge/skills/guillemroca/agent-skills-android/test-driven-development/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for test-driven-development

Your own site · 80×15
<a href="https://agentmods.dev/skills/guillemroca/agent-skills-android/test-driven-development"><img src="https://agentmods.dev/badge/skills/guillemroca/agent-skills-android/test-driven-development.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,147 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00046 $0.02147
Opus 5.5 $0.00018 $0.00859
Sonnet 5.5 $0.00009 $0.00429
Haiku 4.5 $0.00005 $0.00215

Measured 1mo ago against content hash f230f7c2607b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

test-driven-development 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 1mo 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.

skills/test-driven-development/SKILL.md · 265 lines

How it starts

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

Test-Driven Development

Overview

Write tests before implementation. The Red-Green-Refactor cycle — write a failing test (RED), write minimal code to pass (GREEN), improve the code without changing behavior (REFACTOR) — produces code that is correct by construction and has comprehensive test coverage from the start.

When to Use

  • Implementing any new feature or behavior
  • Fixing any bug (use the Prove-It pattern)
  • Adding new business logic to ViewModels, use cases, or repositories
  • Before refactoring (establish a test safety net first)

Skip when: Purely cosmetic UI changes with no behavioral logic.

Core Process

Red-Green-Refactor Cycle

RED: Write a Failing Test
  1. Write the test first — describe what the code should do:
class TaskListViewModelTest {
    private val repository = mockk<TaskRepository>()
    private lateinit var viewModel: TaskListViewModel

    @Test
    fun `initial state is Loading`() {
        every { repository.getTasks() } returns flowOf(emptyList())

        viewModel = TaskListViewModel(GetTasksUseCase(repository))

        assertEquals(TaskListUiState.Loading, viewModel.uiState.value)
    }

    @Test
    fun `emits Success with tasks when repository returns data`() = runTest {
        val tasks = listOf(Task("1", "Buy groceries", false))
        every { repository.getTasks() } returns flowOf(tasks)

        viewModel = TaskListViewModel(GetTasksUseCase(repository))
        advanceUntilIdle()

        assertEquals(TaskListUiState.Success(tasks), viewModel.uiState.value)
    }

    @Test
    fun `emits Error when repository throws`() = runTest {
        every { repository.getTasks() } returns flow { throw IOException("Network error") }

        viewModel = TaskListViewModel(GetTasksUseCase(repository))
        advanceUntilIdle()

        val state = viewModel.uiState.value
        assertIs<TaskListUiState.Error>(state)
        assertEquals("Network error", state.message)
    }
}
  1. Run the test — it must fail (./gradlew test)
    • If it passes immediately, the test doesn't test what you think

Read the full file on GitHub · 265 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. 1mo ago First seen · 265 lines · 46 tokens per session scan A f230f7c2607b

Subscribe to this mod's changes

test-driven-development is a skill published in the GitHub repository GuillemRoca/agent-skills-android (3 stars, last pushed 17d ago), licensed MIT. It adds 46 tokens to every session and 2,147 once invoked, about $0.0002 per session on Opus 5.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-08-31.

Related

Other skills, from other repositories

skill-testing

AL test development patterns for Business Central. Use when creating test codeunits, writing Given/When/Then test procedures, using Library Assert, configuring test projects, or implementing TDD workflows.

javiarmesto/ALDC-AL-Development-Collection · 41 tokens

aldc

Use canonical ALDC architecture, implementation, TDD orchestration, review and specification workflows for AL / Business Central projects.

javiarmesto/ALDC-AL-Development-Collection · 27 tokens

conduct

AL Conductor Agent - Orchestrates Planning → Implementation → Review → Commit cycle for AL Development. Enforces TDD and quality gates for Business Central extensions. Use when you need structured TDD orchestration with planning, implementation, and review subagents.

javiarmesto/ALDC-AL-Development-Collection · 53 tokens

tdd-dev-cycle

A test-driven development workflow, meaning developers write automated tests for expected behavior before implementing the code. It defines stages for analysis, testing, development, verification, commits, and repeated fixes.

cafe3310/public-agent-skills · 38 tokens

tdd

Use when implementing features or fixes with test-driven development (TDD).

LuisUrrutia/skills · 17 tokens

obsidian-development

Expert guidance for the entire Obsidian plugin development lifecycle. Use this skill when building, testing, or releasing Obsidian plugins. It mandates TDD with Vitest, adherence to the Obsidian API, and automated CI/CD via GitHub Actions.

firstsun-dev/skills · 56 tokens