Skip to content
Development
Command

/test-tdd

Run when user calls /test-tdd. Scans modified files, locates their corresponding unit/integration test suites, and runs them.

From plugin
open-agent-hub
9473 skills8 agents3 commands6 MCP
Install
> /plugin marketplace add guanyang/open-agent-hub
> /plugin install open-agent-hub@open-agent-hub

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/test-tdd

Context preview

What this command does when you run it.

Run when user calls /test-tdd. Scans modified files, locates their corresponding unit/integration test suites, and runs them.

Command definition

test-tdd.md
name: test-tdd
description: Run when user calls /test-tdd. Scans modified files, locates their corresponding unit/integration test suites, and runs them.
type: command

Slash Command: /test-tdd

Core Objective

Locate and execute the test suites corresponding to modified files.

Steps for the Agent

1. **Identify Modified Code**: Run `git status` or `git diff --name-only` to identify source code files that have changed. 2. **Find Matching Tests**: Search for matching test files in the project. For example:

  • `foo.js` ➔ search for `foo.test.js`, `foo.spec.js`, `test_foo.js` in `test/`, `spec/`, or local directories.

3. **Deduce Test Command**: Determine the correct command runner based on `package.json` scripts or file types (e.g., `npm test -- <file>`, `npx jest <file>`, `pytest <file>`, `go test <file>`). 4. **Execute**: Run the test command and display the execution results. 5. **Loop Strategy**:

  • If tests fail, suggest invoking [agent-debugger](../agents/agent-debugger.md) to inspect stack traces.
Ships withopen-agent-hub

A lightweight, zero-dependency CLI tool to manage and activate capabilities for AI coding assistants (such as Claude Code, Cursor, Trae, etc.).

Get the whole plugin