test-tdd
The /test-tdd slash command identifies modified source files in a repository using git status, locates their corresponding test files by matching naming patterns across common test directories, determines the appropriate test runner from package.json or file type, and executes those tests. Use this command to quickly validate changes during development by running only the tests relevant to modified code.
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/guanyang/open-agent-hub/HEAD/commands/test-tdd.md -o ~/.claude/commands/test-tdd.mdtest-tdd.md
# 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.
Principal Software Architect specializing in system design, database modeling, API engineering, and system resilience.
Principal Diagnostics Engineer specializing in root cause analysis, error troubleshooting, and hotfixes.
Principal Clean Code Specialist specializing in code simplification, performance tuning, and refactoring loops.
Senior Technical Lead and Security Auditor specializing in code quality, correctness, and security audits.
Senior QA Automation Engineer specializing in unit, integration, and E2E test suite creation.
Run when user calls /commit or asks to generate a commit message. Analyzes staged changes and writes a structured commit message.
Run when user calls /review. Analyzes local changes and runs a comprehensive code review using the agent-reviewer prompt.
This skill should be used for advanced LLM evaluation: LLM-as-judge systems, direct scoring, pairwise comparison, rubric calibration, evaluator bias mitigation, confidence scoring, and automated quality assessment.