TDD Assistant for Openclaw

An AI-enhanced development assistant that automates the red-green-refactor cycle, test generation, and code coverage tracking across multiple languages.

michealxie001
v1.1.0
Apr 2, 2026
0
769
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install oc-tdd

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install oc-tdd using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is TDD Assistant?

The TDD skill for Openclaw Skills is a robust toolkit designed to integrate Test-Driven Development directly into your AI-assisted coding workflow. It enables developers to maintain high code quality by automatically generating test cases from function signatures or specifications, managing test execution, and providing deep insights into code health. By supporting a variety of frameworks like pytest, Jest, and Go test, it ensures that your software remains reliable and maintainable as it evolves.

This skill serves as a guide through the traditional red-green-refactor cycle, offering real-time feedback and state tracking. It goes beyond simple test execution by incorporating advanced features like mutation testing, which evaluates the effectiveness of your test suite by intentionally introducing bugs to see if your tests catch them, making it a premier choice for teams using Openclaw Skills.

TDD Assistant Use Cases

  • Automating the creation of unit tests for new features to ensure immediate code validation.
  • Increasing code coverage in legacy projects by identifying and generating tests for uncovered functions.
  • Implementing a strict red-green-refactor workflow to minimize technical debt during rapid development.
  • Validating the quality of a test suite through automated mutation testing and edge-case analysis.

How TDD Assistant Works

  1. The user initiates a TDD cycle for a specific source file using the CLI entry point.
  2. The skill analyzes the code or specification to generate a suite of failing test cases, establishing the initial RED state.
  3. As the developer writes the implementation, the runner executes tests in real-time or watch mode to reach the GREEN state.
  4. Once tests pass, the assistant provides coverage reports and mutation analysis to guide the REFACTOR phase safely.
  5. Status tracking maintains the context of the current development phase, ensuring the developer follows TDD best practices.

TDD Assistant Setup

To utilize this skill within Openclaw Skills, navigate to your project root and ensure the scripts are accessible. You can configure your environment using a .tdd.json file.

# Generate tests for a specific function
python3 scripts/main.py generate --function "calculate_total" --file src/cart.py

# Start a monitored TDD cycle
python3 scripts/main.py cycle --file src/new_feature.py

# Run the test suite in watch mode
python3 scripts/main.py run --watch

TDD Assistant Data Schema & Taxonomy

The TDD skill organizes its operations through a structured configuration and specific file hierarchy:

Component Purpose
.tdd.json Configuration file defining frameworks (pytest, jest, etc.), coverage thresholds, and source directories.
scripts/main.py The unified CLI entry point for all TDD operations.
tests/ The default directory for all generated and manual test files.
coverage/ Stores raw coverage data and generated HTML reports.
mutant/ Temporary workspace for mutation testing variations.

TDD Assistant Advanced Features

  • Mutation Testing: Automatically modifies code to verify if existing tests are strict enough to catch subtle bugs.
  • Watch Mode: Continuously monitors the filesystem to trigger test runs immediately upon code changes.
  • Multi-Framework Auto-Detection: Seamlessly switches between Python (pytest), JavaScript (Jest), and Go testing frameworks.
  • HTML Coverage Reporting: Generates visual, line-by-line coverage maps to identify testing gaps.
  • CI/CD Integration: Ready-to-use configurations for GitHub Actions to enforce coverage and quality gates.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*