tdd-guide

tdd-guide is a skill for Claude Code, Codex from alexmond/jhelm. It costs 56 tokens per session (1,542 once invoked), scanned A, original, Apache-2.0.

A guide to test-driven development (TDD), where you write a failing test before the code, then make it pass and improve the design. It focuses on JUnit 5 tests for Java.

In plain words
What is it for?
Use it to create JUnit 5 tests, find coverage gaps with JaCoCo, or guide the red-green-refactor process for a new feature.
Why use it?
It helps reveal missing cases and weak tests instead of checking only whether existing tests pass. It also gives a consistent way to review test coverage.

Skill for Claude CodeCodex

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/alexmond/jhelm/tdd-guide
Any agent
npx skills add alexmond/jhelm --skill tdd-guide
Clone the repo
git clone --depth 1 https://github.com/alexmond/jhelm

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 tdd-guide

README.md
[![agentmods](https://agentmods.dev/badge/skills/alexmond/jhelm/tdd-guide.svg)](https://agentmods.dev/skills/alexmond/jhelm/tdd-guide)
Your own site
<a href="https://agentmods.dev/skills/alexmond/jhelm/tdd-guide"><img src="https://agentmods.dev/badge/skills/alexmond/jhelm/tdd-guide.svg" alt="Measured on agentmods" height="20"></a>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,542 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.00056 $0.01542
Opus 5 $0.00028 $0.00771
Sonnet 5 $0.00011 $0.00308
Haiku 4.5 $0.00006 $0.00154

Measured 4d ago against content hash fbae3628339b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

tdd-guide 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 4d 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.

.claude/skills/tdd-guide/SKILL.md · 207 lines

How it starts

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

TDD Guide

Test-driven development skill for generating tests, analyzing coverage, and guiding red-green-refactor workflows. Adapted from alirezarezvani/claude-skills for JUnit 5 and the jhelm project.


Workflows

Generate Tests from Code

  1. Provide source code (Java class or method)
  2. Target framework: JUnit 5 (org.junit.jupiter.api)
  3. Follow jhelm conventions:
    • Use Assertions (not AssertJ)
    • Use @TempDir for temporary files
    • Use @ParameterizedTest with @CsvSource or @MethodSource to avoid duplication
    • Prefer real test data over Mockito mocks
    • Mockito acceptable only for HTTP (CloseableHttpClient) and Kubernetes (KubeService)
  4. Validation: Tests compile and cover happy path, error cases, edge cases

Analyze Coverage Gaps

  1. Run JaCoCo: ./mvnw test (generates target/site/jacoco/jacoco.xml)
  2. Use /jacoco skill to analyze coverage by module
  3. Prioritize gaps:
    • P0: 0% covered classes with many lines (high impact)
    • P1: Partially covered classes with uncovered branches
    • P2: Low-risk utility classes
  4. Generate tests for P0 items first
  5. Target: 80% minimum coverage per module

TDD New Feature

  1. Write failing test first (RED)
  2. Run: ./mvnw test -Dtest=NewFeatureTest -pl <module>
  3. Implement minimal code to pass (GREEN)
  4. Run test again to confirm pass
  5. Refactor while keeping tests green (REFACTOR)
  6. Run ./mvnw validate to verify formatting + PMD + checkstyle

JUnit 5 Patterns for jhelm

Basic Test

@Test
void testChartLoadingFromDirectory() throws Exception {
	Chart chart = ChartLoader.load(Path.of("src/test/resources/test-charts/minimal"));
	assertEquals("minimal", chart.getMetadata().getName());
	assertNotNull(chart.getValues());
}

Parameterized Test (avoid duplication)

@ParameterizedTest
@CsvSource(delimiter = '|', value = {
	"upper     | hello | HELLO",
	"lower     | HELLO | hello",
	"title     | hello world | Hello World"
})
void testStringFunctions(String func, String input, String expected)
		throws IOException, TemplateException {
	assertEquals(expected, exec("{{ " + func + " \"" + input + "\" }}"));
}

Read the full file on GitHub · 207 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. 4d ago First seen · 207 lines · 56 tokens per session scan A fbae3628339b

Subscribe to this mod's changes

tdd-guide is a skill published in the GitHub repository alexmond/jhelm (4 stars, last pushed 11d ago), licensed Apache-2.0. It adds 56 tokens to every session and 1,542 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-08-31.