Agent skill

Test Driven Generation

by ArabelaTso in ArabelaTso/Skills-4-SE

Generate implementation code that passes existing unit tests.

Apache-2.0Auto-check passedTesting & QA

Install Test Driven Generation

skills CLI
$ npx skills add ArabelaTso/Skills-4-SE --skill test-driven-generation -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ArabelaTso/Skills-4-SE test-driven-generation --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/test-driven-generation .claude/skills/test-driven-generation && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
test-driven-generation
GitHub stars
253
Token cost
~1.1k tokens
SKILL.md length
447 words
Files
1
Skills in repo
150
Repo updated
First seen
Licence
Apache-2.0

At a glance

Generate implementation code that passes existing unit tests.

  • Works in 5 steps: Analyze Tests → Generate Implementation → Run Tests → …
  • The user provides test files (Python pytest/unittest
  • SKILL.md covers Workflow, Best Practices, Example Session and Language-Specific Notes
  • Calls pytest, python and mvn

What it does

Test Driven Generation is an agent skill from ArabelaTso/Skills-4-SE. Generate implementation code that passes existing unit tests. Use when the user provides test files (Python pytest/unittest, Java JUnit/TestNG) and asks Claude to implement the code to make those tests pass. Supports full TDD workflow - analyzing tests, generating implementation, running tests, debugging failures, and iterating until all tests pass.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Unit testing and Test-driven development. It works with Java, Python, JUnit and pytest. The repository describes itself as: A curated list of 180+ useful Claude Skills for Software Engineering and resources for customizing AI for SE workflows. The licence is Apache-2.0.

When your agent uses it

  • The user provides test files (Python pytest/unittest
  • Java JUnit/TestNG) and asks Claude to implement the code to make those tests pass

Example prompts

  • “/test-driven-generation”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Analyze Tests
  2. Generate Implementation
  3. Run Tests
  4. Debug Failures
  5. Iterate

What it can do on your machine

Read from SKILL.md and the folder at commit 4f38503. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pytest
    • python
    • mvn
    • gradle
    • javac
    • java

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Test Driven Generation loads about 1.1k tokens when it runs. Until then it costs about 94 tokens; SKILL.md has 447 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~94
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ArabelaTso/Skills-4-SE at commit 4f38503, republished under its Apache-2.0 licence (© ArabelaTso). 447 words, ~1,136 tokens.

Download SKILL.mdSave it as .claude/skills/test-driven-generation/SKILL.md (or your agent's skills folder).
name
test-driven-generation
description
Generate implementation code that passes existing unit tests. Use when the user provides test files (Python pytest/unittest, Java JUnit/TestNG) and asks Claude to implement the code to make those tests pass. Supports full TDD workflow - analyzing tests, generating implementation, running tests, debugging failures, and iterating until all tests pass.

Test-Driven Generation

Generate implementation code that satisfies existing unit tests through an iterative test-driven development workflow.

Workflow

1. Analyze Tests

Read and understand the provided test file(s):

  • Identify what functions/classes/methods need to be implemented
  • Extract input/output expectations from assertions
  • Note edge cases, error conditions, and special behaviors
  • Understand dependencies and imports
2. Generate Implementation

Create implementation code that should satisfy the tests:

For Python:

  • Match the exact function/class signatures expected by tests
  • Implement logic to satisfy assertions
  • Handle all tested edge cases
  • Add necessary imports and dependencies

For Java:

  • Match exact method signatures and return types
  • Implement logic within the correct class structure
  • Handle exceptions as tested
  • Add required imports and annotations
3. Run Tests

Execute the test suite to verify the implementation:

Python:

bash
pytest <test_file>.py -v
# or
python -m unittest <test_file>.py -v

Java:

bash
mvn test
# or
gradle test
# or for single test file
javac <TestFile>.java && java org.junit.runner.JUnitCore <TestFile>
4. Debug Failures

If tests fail, analyze the failure output:

  • Read the assertion error messages carefully
  • Identify which specific test cases are failing
  • Understand what the test expected vs. what was returned
  • Locate the bug in the implementation
5. Iterate

Fix the implementation based on failure analysis:

  • Update the code to handle the failing case
  • Re-run tests to verify the fix
  • Repeat until all tests pass

Best Practices

Code Quality
  • Write clean, readable implementation code
  • Use descriptive variable names
  • Add comments for complex logic
  • Follow language conventions (PEP 8 for Python, Java naming conventions)
Test Understanding
  • Read ALL test cases before implementing
  • Don't assume - verify exact expected behavior from assertions
  • Pay attention to parametrized tests and edge cases
  • Check test fixtures and setup methods for context
Debugging Strategy
  • Start with the first failing test
  • Fix one test at a time when possible
  • After each fix, run the full suite to catch regressions
  • If stuck, re-read the test to verify understanding
Show full SKILL.md (162 more words)Show less
Common Pitfalls
  • Type mismatches: Ensure return types match exactly (e.g., int vs float, List vs array)
  • Off-by-one errors: Carefully check boundary conditions
  • Null/None handling: Implement null checks if tests verify null behavior
  • Exception types: Raise/throw the exact exception type the test expects
  • Mutable state: Reset state between test runs if using class-level variables

Example Session

User provides test_calculator.py:

python
import pytest
from calculator import Calculator

def test_add():
    calc = Calculator()
    assert calc.add(2, 3) == 5
    assert calc.add(-1, 1) == 0

def test_divide():
    calc = Calculator()
    assert calc.divide(10, 2) == 5
    with pytest.raises(ValueError):
        calc.divide(10, 0)

Step 1: Analyze - need Calculator class with add() and divide() methods, divide should raise ValueError on zero

Step 2: Generate calculator.py:

python
class Calculator:
    def add(self, a, b):
        return a + b

    def divide(self, a, b):
        if b == 0:
            raise ValueError("Cannot divide by zero")
        return a / b

Step 3: Run pytest test_calculator.py -v

Step 4: If failure occurs, read error and identify issue

Step 5: Fix and re-run until passing

Language-Specific Notes

Python
  • Use type hints when test imports suggest them
  • Match pytest vs unittest assertion styles
  • Check for setUp/tearDown or fixtures that provide context
  • Watch for @pytest.mark.parametrize for multiple test cases
Java
  • Match access modifiers (public/private/protected)
  • Implement interfaces if tests verify interface compliance
  • Use correct exception handling (throws vs try-catch)
  • Check for @Before/@After setup methods
  • Watch for @ParameterizedTest annotations

© ArabelaTso, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/test-driven-generation of ArabelaTso/Skills-4-SE.

Open the folder on GitHubat commit 4f38503

Compare with similar skills

Test Driven Generation next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Test Driven Generation compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Test Driven Generation this skillArabelaTso/Skills-4-SE253—~1.1kAutomated safety check: PassApache-2.0
TDD GuideLeoYeAI/openclaw-master-skills2.2k—~1.4kAutomated safety check: PassMIT
Test Analysis Extensionsmicrosoft/testfx1k2 repos~1.1kAutomated safety check: PassMIT
TDD Guidealirezarezvani/claude-skills28k—~3.4kAutomated safety check: PassMIT
TDD GuideaAAaqwq/AGI-Super-Team1052 repos~1.1kAutomated safety check: PassMIT
Python Testingaffaan-m/ECC275k6 repos~4.7kAutomated safety check: PassMIT

Similar skills

  • TDD Guide

    LeoYeAI/openclaw-master-skills

    Test-driven development skill for writing unit tests, generating test fixtures and mocks, analyzing coverage gaps, and guiding red-green-refactor workflows across Jest, Pytest, JUnit, Vitest, and…

    2.2k GitHub stars~1.4k tokensUpdated 2 mo ago
    Testing & QAAuto-check passed
  • Test Analysis Extensions

    microsoft/testfx

    Official

    Provides file paths to language-specific reference files for the test ANALYSIS skills (assertion-quality, test-anti-patterns, test-gap-analysis, test-smell-detection, test-tagging).

    1k GitHub starsUsed in 2 repos~1.1k tokens
    Testing & QAAuto-check passed
  • TDD Guide

    alirezarezvani/claude-skills

    Test-driven development skill for writing unit tests, generating test fixtures and mocks, analyzing coverage gaps, and guiding red-green-refactor workflows across Jest, Pytest, JUnit, Vitest, and…

    28k GitHub stars~3.4k tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • TDD Guide

    aAAaqwq/AGI-Super-Team

    Test-driven development workflow with test generation, coverage analysis, and multi-framework support

    105 GitHub starsUsed in 2 repos~1.1k tokens
    Testing & QAAuto-check passed
  • Python Testing

    affaan-m/ECC

    Python testing strategies using pytest, TDD methodology, fixtures, mocking, parametrization, and coverage requirements.

    275k GitHub starsUsed in 6 repos~4.7k tokens
    Testing & QAAuto-check passed
  • Python Testing

    affaan-m/ECC

    使用pytest的Python测试策略,包括TDD方法、夹具、模拟、参数化和覆盖率要求. An agent skill from affaan-m/ECC.

    275k GitHub starsUsed in 3 repos~4.2k tokens
    Testing & QAAuto-check passed

More from ArabelaTso/Skills-4-SE

All 150 skills in this repo
  • Framework Migration Assistant

    ArabelaTso/Skills-4-SE

    Automatically migrate Python web applications between frameworks (Flask → FastAPI, Django → FastAPI).

    253 GitHub stars~1.9k tokensUpdated 1 mo ago
    Auto-check passed
  • Metamorphic Test Generator

    ArabelaTso/Skills-4-SE

    Generate test cases using metamorphic testing by applying transformations based on metamorphic properties.

    253 GitHub stars~798 tokensUpdated 1 mo ago
    Auto-check passed
  • Reproduction Trace Instrumenter

    ArabelaTso/Skills-4-SE

    Instruments programs to capture execution traces specifically for reproducing reported bugs, enabling consistent replay and diagnosis of failures.

    253 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Spring Mvc To Boot Migrator

    ArabelaTso/Skills-4-SE

    Automatically migrate Spring MVC applications to Spring Boot.

    253 GitHub stars~2.2k tokensUpdated 1 mo ago
    Auto-check passed
  • State Snapshot Instrumenter

    ArabelaTso/Skills-4-SE

    Instrument programs (Python, C/C++, Java) to capture snapshots of key program states at runtime, including variables, memory, and call stacks.

    253 GitHub stars~2.2k tokensUpdated 1 mo ago
    Auto-check passed

Categories

Questions about Test Driven Generation

What does Test Driven Generation do?

Generate implementation code that passes existing unit tests. Test Driven Generation is an agent skill from ArabelaTso/Skills-4-SE. Generate implementation code that passes existing unit tests.

When should I use Test Driven Generation?

Test Driven Generation fits situations like: the user provides test files (Python pytest/unittest; java JUnit/TestNG) and asks Claude to implement the code to make those tests pass.

How do I install Test Driven Generation in Claude Code?

Run `npx skills add ArabelaTso/Skills-4-SE --skill test-driven-generation -a claude-code`. Or copy the skill folder (skills/test-driven-generation in ArabelaTso/Skills-4-SE) into .claude/skills/test-driven-generation in your project. Claude Code loads it when a task matches its description.

How do I install Test Driven Generation in Codex?

Run `npx skills add ArabelaTso/Skills-4-SE --skill test-driven-generation -a codex`. Or copy the skill folder (skills/test-driven-generation in ArabelaTso/Skills-4-SE) into .agents/skills/test-driven-generation in your project. Codex loads it when a task matches its description.

Can I use Test Driven Generation in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ArabelaTso/Skills-4-SE --skill test-driven-generation -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/test-driven-generation, .gemini/skills/test-driven-generation, .github/skills/test-driven-generation and .opencode/skills/test-driven-generation in your project.

What does Test Driven Generation need to run?

Going by SKILL.md and its folder, Test Driven Generation needs the command-line tools its instructions call (pytest, python, mvn, gradle, javac and java). Our summary lists: Python 3.

Does Test Driven Generation access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Test Driven Generation safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Test Driven Generation use?

Test Driven Generation is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Test Driven Generation use?

About 1.1k tokens (SKILL.md is roughly 4.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Test Driven Generation?

Skills that share tags, products or a category with Test Driven Generation: TDD Guide (LeoYeAI/openclaw-master-skills, 2.2k stars), Test Analysis Extensions (microsoft/testfx, 1k stars), TDD Guide (alirezarezvani/claude-skills, 28k stars) and TDD Guide (aAAaqwq/AGI-Super-Team, 105 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Test Driven Generation?

ArabelaTso (a GitHub user) maintains it in ArabelaTso/Skills-4-SE, which has 253 GitHub stars. The repository holds 150 skills in this directory. The repository was last updated on August 21, 2026.

Source: ArabelaTso/Skills-4-SE on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.