test-detect
Qué hace
Esta skill encuentra la herramienta de pruebas que tu proyecto ya usa, como Jest, pytest o Playwright, y ejecuta las pruebas correspondientes. Está pensada para desarrolladores que quieren ejecuciones de prueba rápidas y correctas.
Cuándo usarla
- ✓Cuando quieres ejecutar todas las pruebas de tu proyecto sin buscar el comando.
- ✓Cuando quieres ejecutar solo las pruebas de un archivo que modificaste.
- ✓Cuando necesitas pruebas básicas para un nuevo fragmento de código.
Link de la skill
https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/test-detect/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Ejecuta las pruebas de mi proyecto y dime si algo falla.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
El agente busca pistas en los archivos del proyecto, como una configuración de Jest o de pytest, informa qué framework encontró y ejecuta el comando correspondiente para todo el conjunto o para un archivo.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de 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):
__tests__/<filename>.test.<ext>(Jest convention)<filename>.test.<ext>(co-located)<filename>.spec.<ext>(alternative convention)test/<filename>_test.<ext>(Go/Python convention)tests/test_<filename>.<ext>(pytest convention)<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:
- Identify all exported functions/classes/components
- Determine the appropriate test patterns for the framework
- Generate a test file with:
- Import statements
describeblock per function/classit/testblocks 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.jsonhas bothtestandtest:unit/test:e2escripts, prefer the specific one when context is clear
Preguntas frecuentes
¿Qué herramientas de prueba reconoce?
Nombra Jest, Vitest, Playwright, Cypress, pytest y Go test, y también cubre Cargo, ExUnit y RSpec.
¿Puede escribir pruebas nuevas?
Sí. Puede generar pruebas básicas para un archivo que le indiques.
¿Qué pasa si no encuentra un framework?
Revisa una lista de archivos de configuración habituales, en orden, así que un proyecto poco común puede necesitar un comando manual.
Detalles
Descripción original del autor
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
Popularidad
- Estrellas en GitHub
- 33 mil
- Posición en el ranking
- #8806
- Licencia
- MIT
- Actualizada
- 2/11/2026
Comentarios
- …
Más skills de este repositorio
owasp-security
33 milEnseña a tu agente la guía de seguridad OWASP para webs, APIs, móviles, contenedores y agentes de IA, para detectar debilidades comunes y sugerir correcciones.
agent-management
33 milPermite que tu agente cree, liste, hiberne, despierte, renombre y elimine agentes de IA con la CLI de AI Maestro, gestionando su ciclo de vida.
agent-messaging
33 milPermite que tu agente envíe, reciba y responda mensajes firmados entre agentes de IA con el Protocolo de Mensajería de Agentes, sobre todo en tu equipo.
docs-search
33 milBusca en la documentación generada del código las firmas de funciones, clases y comentarios, para revisar la API real antes de cambiar nada.
Skills parecidas
test-driven-development
311 milEnseña a tu agente a escribir primero una prueba que falle, verla fallar y después escribir el código más pequeño que la hace pasar, antes de construir cualquier función o corrección.
verification-before-completion
311 milEnseña a tu agente a ejecutar comprobaciones reales y leer su resultado antes de afirmar que una tarea, una corrección o una compilación está completa o en buen estado.
migrate-to-shoehorn
310 milSustituye los casts de tipo arriesgados de tus archivos de prueba por la librería shoehorn, para que las pruebas usen datos parciales y sigan pasando las comprobaciones de tipos.