test-detect

Detects the project testing framework and runs or generates matching tests.

30.5k|3.5k|Updated Jul 4, 2025
One-click install
npx skills add https://github.com/davila7/claude-code-templates --skill test-detect
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-detect
Source: https://github.com/davila7/claude-code-templates/tree/main/cli-tool/components/skills/development/test-detect
Command: npx skills add https://github.com/davila7/claude-code-templates --skill test-detect

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Every project uses a different testing framework, and remembering the right commands, config files, and test file conventions for each one slows down development. This Skill automatically identifies the framework in your project and runs the correct tests without manual configuration.

Core Features & Use Cases

  • Framework Auto-Detection: Identifies Vitest, Jest, Playwright, Cypress, pytest, Go test, Cargo, ExUnit, RSpec, or npm test by inspecting config files and dependencies.
  • Targeted Test Runs: Runs the full suite or locates and executes only the test file matching a given source file using framework-specific search conventions.
  • Test Generation: Analyzes a source file's exported functions and generates a test file with happy path, edge case, and error case coverage in the conventional location.
  • Use Case: You open an unfamiliar repository and want to verify nothing is broken. Run the Skill with no arguments to detect the framework, execute the full suite, and get a summary of passed, failed, and skipped tests with failure details.

Quick Start

Ask the assistant to detect the testing framework in this project and run the full test suite, or pass a file path to run or generate tests for that specific file.

Frequently Asked Questions about test-detect

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automatically detect which test framework a project uses?

Check for framework-specific config files and dependencies in order: vitest.config or jest.config for JavaScript, playwright.config or cypress.config for e2e, pytest.ini or conftest.py for Python, and go.mod or Cargo.toml for Go and Rust. The first match determines the run command.

How to run tests for a single file in Jest or Vitest?

Pass the test file path directly to the runner, such as npx jest path/to/file.test.ts or npx vitest run path/to/file.test.ts. To find the test file from a source file, check __tests__ directories, co-located .test or .spec files, and framework-specific conventions.

Can I generate unit tests automatically for an existing source file?

Yes. The Skill reads the source file, identifies exported functions and classes, and generates a test file with describe blocks, happy path, edge case, and error case tests. It saves the file to the conventional location for the detected framework.

What happens when a project has multiple testing frameworks installed?

When multiple frameworks are detected, such as Vitest for unit tests and Playwright for e2e, both are reported and the unit test framework is used by default. For monorepos, detection uses the config file closest to the current directory.

Why is no test file found for my source file?

The search covers common conventions like __tests__ folders, co-located .test and .spec files, tests/test_ prefixes for pytest, and _test.go suffixes for Go. If none match, the file likely has no tests yet and you can generate them with the generate mode.