test-driven-development

test-driven-development is a skill for Claude Code, Codex from rabee-elkholy/android-harness-kit. It costs 47 tokens per session (572 once invoked), scanned A, original, MIT.

A guide to test-driven development, or TDD, a method where a failing automated test is written before the code that should make it pass. It follows a repeatable red, green, and refactor cycle.

In plain words
What is it for?
Developing business logic, use cases, repositories, and view models, as well as reproducing and fixing bugs with focused tests and verified implementation changes.
Why use it?
Writing implementation first can leave requirements unclear or bugs untested. TDD makes the expected behavior explicit and checks the fix at each stage.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python .agents/scripts/run_gradle_task.py :app:testDebugUnitTest --tests "com.package.FeatureTest.testName".

Good fit Developing business logic, use cases, repositories, and view models, as well as reproducing and fixing bugs with focused tests and verified implementation changes.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/rabee-elkholy/android-harness-kit
agentmods
npx agentmods add skills/rabee-elkholy/android-harness-kit/test-driven-development

Made for: Claude Code, Codex.

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/rabee-elkholy/android-harness-kit/test-driven-development/github.svg)](https://agentmods.dev/skills/rabee-elkholy/android-harness-kit/test-driven-development)
Your own site
<a href="https://agentmods.dev/skills/rabee-elkholy/android-harness-kit/test-driven-development"><img src="https://agentmods.dev/badge/skills/rabee-elkholy/android-harness-kit/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/rabee-elkholy/android-harness-kit/test-driven-development"><img src="https://agentmods.dev/badge/skills/rabee-elkholy/android-harness-kit/test-driven-development.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 572 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.00047 $0.00572
Opus 5.5 $0.00019 $0.00229
Sonnet 5.5 $0.00009 $0.00114
Haiku 4.5 $0.00005 $0.00057

Measured 1mo ago against content hash de138d0bd65a, 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.

agents/skills/test-driven-development/SKILL.md · 46 lines

How it starts

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

Test-Driven Development (TDD) Skill

1. Core Principle: Red-Green-Refactor

Production code is only written in response to a failing test that defines its requirements or reproduces a defect.


2. Four-Phase TDD Protocol

Phase 1: RED (Write the Failing Test)

  • Author a concise, focused unit test in src/test/java/.../*Test.kt.
  • Test names must clearly describe the scenario and expected outcome (e.g. loginViewModel_invalidPassword_emitsValidationError()).
  • Capture both happy paths and boundary/error cases.

Phase 2: PROVE FAILURE (Empirical Verification)

  • Execute the targeted unit test task:
    python .agents/scripts/run_gradle_task.py :app:testDebugUnitTest --tests "com.package.FeatureTest.testName"
    
  • Verify that the test fails for the expected assertion reason (not due to a compilation failure or configuration error).

Phase 3: GREEN (Minimal Implementation)

  • Write the minimal amount of production code required to make the failing test pass.
  • Re-run the targeted test to verify BUILD SUCCESSFUL and test pass.

Phase 4: REFACTOR & HARDEN

  • Improve code readability, remove duplication, and extract reusable helpers.
  • Ensure strict adherence to Shift-Left Quality Invariants:
    1. Single-source StateFlow unidirectional data flow.
    2. Zero inline FQCNs.
    3. Zero synchronous I/O on Dispatchers.Main.
    4. Proper Coroutine cancellation and dispatcher handling (StandardTestDispatcher with advanceUntilIdle()).

3. Test Quality Invariants (Mandatory for Pre-Review Gate)

  1. Assertion Depth: Every @Test method must have at least $\ge 2$ meaningful assertions (assertEquals, assertTrue, assertNull). Trivial checks (assertTrue(true)) are strictly prohibited.
  2. Coroutines & Turbine: Use runTest with StandardTestDispatcher or app.cash.turbine:turbine for testing Flows and Channels.
  3. Mock Isolation: Use pure Fakes or explicit coEvery/every definitions with relaxed = false for critical domain assertions. Never leak mock state across tests; reset in @After.
  4. Zero Placeholder Tests: Never commit empty test stubs or TODO() test bodies.

Read the full file on GitHub · 46 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 · 46 lines · 47 tokens per session scan A de138d0bd65a

Subscribe to this mod's changes

test-driven-development is a skill published in the GitHub repository rabee-elkholy/android-harness-kit (3 stars, last pushed 1mo ago), licensed MIT. It adds 47 tokens to every session and 572 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.