본문으로 건너뛰기
Skillpedia
테스트33k · #8806

test-detect

하는 일

이 스킬은 Jest, pytest, Playwright처럼 프로젝트가 이미 쓰는 테스트 도구를 찾아 맞는 테스트를 실행합니다. 빠르고 정확하게 테스트를 돌리려는 개발자를 위한 것입니다.

사용하는 경우

  • ✓명령을 찾아보지 않고 프로젝트의 모든 테스트를 실행하고 싶을 때.
  • ✓바꾼 파일 하나에 대한 테스트만 실행하고 싶을 때.
  • ✓새 코드를 위한 기본 테스트를 작성해야 하는 경우.

스킬 링크

https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/test-detect/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/test-detect/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 프로젝트의 테스트를 실행하고 실패한 것이 있는지 알려 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 Jest나 pytest 설정 같은 단서를 프로젝트 파일에서 확인하고, 찾은 프레임워크를 보고한 뒤, 전체 테스트 모음이나 한 파일에 맞는 명령을 실행합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Test Detect

Automatically detect the testing framework in the current project and run the right tests.

Workflow

Step 1: Detect the testing framework

Check for these files in order (first match wins):

Check Framework Run Command
vitest.config.* exists OR vitest in devDeps Vitest npx vitest run
jest.config.* exists OR jest in devDeps Jest npx jest
playwright.config.* exists Playwright npx playwright test
cypress.config.* exists Cypress npx cypress run
pytest.ini or conftest.py or pyproject.toml with [tool.pytest] pytest python -m pytest
go.mod exists Go test go test ./...
Cargo.toml exists Rust/cargo cargo test
mix.exs exists ExUnit mix test
Gemfile with rspec RSpec bundle exec rspec
package.json has scripts.test npm test npm test

Report the detected framework before proceeding.

Step 2: Parse arguments

Check $ARGUMENTS for the mode:

  • No arguments or "all": Run the full test suite (Step 3)
  • File path (e.g., src/auth/login.ts): Run tests for that file (Step 4)
  • "generate" + file path (e.g., generate src/utils.ts): Generate tests (Step 5)

Step 3: Run full test suite

Run the detected test command. After completion:

  • Report total tests, passed, failed, skipped
  • If tests fail, show the first 3 failure messages with file:line references
  • Suggest: "Run /test-detect <failing-file> to investigate a specific failure"

Step 4: Run tests for a specific file

Given a source file path, find its test file:

Search strategy (try in order):

  1. __tests__/<filename>.test.<ext> (Jest convention)
  2. <filename>.test.<ext> (co-located)
  3. <filename>.spec.<ext> (alternative convention)
  4. test/<filename>_test.<ext> (Go/Python convention)
  5. tests/test_<filename>.<ext> (pytest convention)
  6. <filename>_test.go (Go convention)

Use Glob to find matches. If found, run only that test file:

Framework Command
Vitest npx vitest run <test-file>
Jest npx jest <test-file>
Playwright npx playwright test <test-file>
pytest python -m pytest <test-file>
Go go test -run <TestName> ./<package>/
Cargo cargo test <test_name>

If no test file found, ask: "No tests found for this file. Want me to generate them? Run /test-detect generate <file>"

Step 5: Generate tests

Read the source file and analyze:

  1. Identify all exported functions/classes/components
  2. Determine the appropriate test patterns for the framework
  3. Generate a test file with:
    • Import statements
    • describe block per function/class
    • it/test blocks covering: happy path, edge cases, error cases
    • Framework-appropriate assertions and mocking

Save to the conventional location for the detected framework:

  • Jest/Vitest: __tests__/<filename>.test.<ext> or <filename>.test.<ext> (match existing convention)
  • pytest: tests/test_<filename>.py
  • Go: <filename>_test.go (same directory)
  • RSpec: spec/<filename>_spec.rb

Show the generated file path and ask if the user wants to run the new tests.

Tips

  • If multiple frameworks are detected (e.g., Vitest for unit tests + Playwright for e2e), mention both and default to the unit test framework
  • For monorepos, detect from the closest config file to the current directory
  • If package.json has both test and test:unit/test:e2e scripts, prefer the specific one when context is clear
자주 묻는 질문

어떤 테스트 도구를 인식하나요?

Jest, Vitest, Playwright, Cypress, pytest, Go test를 언급하며 Cargo, ExUnit, RSpec도 다룹니다.

새 테스트도 쓸 수 있나요?

네. 지정한 파일에 대한 기본 테스트를 만들 수 있습니다.

프레임워크를 찾지 못하면 어떻게 하나요?

흔한 설정 파일 목록을 순서대로 확인하므로, 특이한 프로젝트에서는 수동 명령이 필요할 수 있습니다.

상세 정보

작성자의 원본 설명

Auto-detect testing framework and run relevant tests. Identifies Jest, Vitest, Playwright, Cypress, pytest, Go test, and others. Can run all tests, specific file tests, or generate basic tests for new code. Usage - /test-detect, /test-detect src/auth/login.ts, /test-detect generate src/utils.ts

repo: davila7/claude-code-templates

인기도

GitHub 스타
33k
순위
#8806
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬