test-driven-development

test-driven-development is a skill for Claude Code, Codex 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 CodeCodex

Part of the agent-skills-android plugin — 29 skills, 7 commands, 3 agents, 1 hook 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 skills/guillemroca/agent-skills-android/test-driven-development
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, Codex.

Or install agent-skills-android, the plugin that ships this one along with the rest of its 29 skills, 7 commands, 3 agents, 1 hook.

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.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.svg" alt="Measured on agentmods" 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. 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 $0.00046 $0.02147
Opus 5 $0.00023 $0.01073
Sonnet 5 $0.00009 $0.00429
Haiku 4.5 $0.00005 $0.00215

Measured 3d ago against content hash f230f7c2607b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 3d 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. 3d 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 (2 stars, last pushed 2mo ago), licensed MIT. It adds 46 tokens to every session and 2,147 once invoked, about $0.0002 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-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

tdd-dev-cycle

测试驱动开发 (TDD) 主干工作循环,包含分析、测试编写、开发、验证及带熔断的修复机制。.

cafe3310/public-agent-skills · 38 tokens

roblox-scrum-dev-story

Executes Roblox story implementation following a context-filled story spec file, using TDD, StyLua, Rojo, and the Roblox Studio MCP integration. Use when the user says "develop story [key]" or "implement the next story".

schmusch/roblox-ai-workflow · 56 tokens

roblox-tdd

Use to drive Roblox / Luau implementation via red-green-refactor cycles with TestEZ or Jest-Roblox. Use when the user says "TDD", "test-driven", "write the test first", "test it properly", before implementing any non-trivial Luau module, or any time disciplined coverage is needed before code lands.

schmusch/roblox-ai-workflow · 73 tokens

spec-kitty-mission-system

Understand how Spec Kitty missions work: the 4 built-in mission types, how they define workflows via step contracts and action indices, how missions and work packages relate, how templates are resolved through the 6-tier chain, and how doctrine artifacts (procedures, tactics, directives) compose mission behavior.…

Priivacy-ai/spec-kitty · 160 tokens

spec-kitty-git-workflow

Understand how Spec Kitty manages git: what git operations Python handles automatically, what agents must do manually, worktree lifecycle, auto-commit behavior, merge execution, and the safe-commit pattern. Triggers: "how does spec-kitty use git", "worktree management", "auto-commit", "who commits what", "git…

Priivacy-ai/spec-kitty · 125 tokens