run-puzzle-tests
Acerca de
Esta habilidad ejecuta el conjunto de pruebas de jigsawR mediante la ejecución de R en WSL, admitiendo pruebas completas, filtrado por patrón o ejecuciones de archivos individuales. Interpreta los resultados de aprobado/fallo/omitido e identifica fallos, evitando el flag --vanilla para una correcta activación de renv. Los desarrolladores deben usarla después de cambios en el código, antes de confirmaciones o al depurar fallos específicos en las pruebas.
Instalación rápida
Claude Code
Recomendadonpx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/run-puzzle-testsCopia y pega este comando en Claude Code para instalar esta habilidad
Documentación
Run Puzzle Tests
Run jigsawR test suite. Read results.
When Use
- After modifying R source in package
- After adding new puzzle type or feature
- Before commit to verify nothing broken
- Debugging specific test failure
Inputs
- Required: Test scope (
full,filtered,single) - Optional: Filter pattern (filtered mode, e.g.
"snic","rectangular") - Optional: Specific test file path (single mode)
Steps
Step 1: Choose Test Scope
| Scope | Use when | Duration |
|---|---|---|
| Full | Before commits, after major changes | ~2-5 min |
| Filtered | Working on one puzzle type | ~30s |
| Single | Debugging a specific test file | ~10s |
Got: Scope selected by workflow: full before commits, filtered for one type, single for one debug.
If fail: Unsure? Default to full. Slower but catches cross-type regressions.
Step 2: Create and Execute Test Script
Full suite.
Make script (e.g., /tmp/run_tests.R).
devtools::test()
R_EXE="/mnt/c/Program Files/R/R-4.5.0/bin/Rscript.exe"
cd /mnt/d/dev/p/jigsawR && "$R_EXE" -e "devtools::test()"
Filtered by pattern.
"$R_EXE" -e "devtools::test(filter = 'snic')"
Single file.
"$R_EXE" -e "testthat::test_file('tests/testthat/test-snic-puzzles.R')"
Got: Test output with pass/fail/skip counts.
If fail:
- Do NOT use
--vanillaflag; renv needs.Rprofileto activate - renv errors? Run
renv::restore()first - Complex commands fail with Exit 5? Write to script file
Step 3: Interpret Results
Look for summary line.
[ FAIL 0 | WARN 0 | SKIP 7 | PASS 2042 ]
- PASS: Tests succeeded
- FAIL: Tests failed (need investigation)
- SKIP: Tests skipped (usually missing optional packages like
snic) - WARN: Warnings during tests (review but not blocking)
Got: Summary line parsed for PASS, FAIL, SKIP, WARN. FAIL = 0 = clean run.
If fail: Summary not visible? Runner crashed before completing. Check R-level errors above. Output truncated? Redirect to file: "$R_EXE" -e "devtools::test()" > test_results.txt 2>&1.
Step 4: Investigate Failures
If tests fail.
- Read failure msg — includes file, line, expected vs actual
- Check if new failure or pre-existing
- Assertion failures: read test + function being tested
- Error failures: check function signature changed
# Run just the failing test with verbose output
"$R_EXE" -e "testthat::test_file('tests/testthat/test-failing.R', reporter = 'summary')"
Got: Root cause of each failing test identified. Failure = real regression (fix code) or test env issue (missing dep, path).
If fail: Failure msg unclear? Add browser() or print() to test, re-run with testthat::test_file() for interactive debug.
Step 5: Verify Skip Reasons
Skipped tests normal when optional deps missing.
snicpackage tests skip withskip_if_not_installed("snic")- Tests needing specific OS skip with
skip_on_os() - CRAN-only skips with
skip_on_cran()
Confirm skip reasons legitimate, not masking real failures.
Got: All skips accounted for by legitimate reasons (optional dep, platform skip, CRAN-only). No skips masking actual failures.
If fail: Skip suspicious? Temporarily remove skip_if_*() and run test to see pass or hidden failure.
Checks
- All tests pass (FAIL = 0)
- No unexpected warnings
- Skip count matches expected (only optional dep skips)
- Test count not decreased (no tests removed by accident)
Pitfalls
- Use
--vanilla: Breaks renv activation. Never with jigsawR. - Complex
-estrings: Shell escaping = Exit 5. Use script files. - Stale package state: Run
devtools::load_all()ordevtools::document()before testing if NAMESPACE-affecting code changed. - Missing test deps: Some tests need suggested packages. Check
DESCRIPTIONSuggests. - Parallel test issues: Tests interfere? Run sequential with
testthat::test_file().
See Also
generate-puzzle— generate puzzles to verify behavior matches testsadd-puzzle-type— new types need comprehensive test suiteswrite-testthat-tests— general patterns for writing R testsvalidate-piles-notation— test PILES parsing independently
Repositorio GitHub
Habilidades relacionadas
evaluating-llms-harness
PruebasEsta Skill de Claude ejecuta el benchmark lm-evaluation-harness para evaluar modelos de lenguaje en más de 60 tareas académicas estandarizadas como MMLU y GSM8K. Está diseñada para que los desarrolladores comparen la calidad de los modelos, realicen seguimiento del progreso del entrenamiento o reporten resultados académicos. La herramienta admite varios backends, incluidos modelos de HuggingFace y vLLM.
cloudflare-cron-triggers
PruebasEsta habilidad proporciona conocimiento integral para implementar Cron Triggers de Cloudflare y programar Workers mediante expresiones cron. Cubre la configuración de tareas periódicas, trabajos de mantenimiento y flujos de trabajo automatizados, manejando problemas comunes como expresiones cron inválidas y inconvenientes de zonas horarias. Los desarrolladores pueden utilizarla para configurar manejadores programados, probar activadores cron e integrar con Workflows y Green Compute.
webapp-testing
PruebasEsta habilidad de Claude proporciona un kit de herramientas basado en Playwright para probar aplicaciones web locales mediante scripts de Python. Permite verificación de frontend, depuración de interfaz de usuario, captura de pantallas y visualización de registros, mientras gestiona los ciclos de vida del servidor. Úsela para tareas de automatización de navegadores, pero ejecute los scripts directamente en lugar de leer su código fuente para evitar contaminación del contexto.
finishing-a-development-branch
PruebasEsta habilidad ayuda a los desarrolladores a completar el trabajo terminado verificando que las pruebas pasen y luego presentando opciones estructuradas de integración. Guía el flujo de trabajo para fusionar, crear PRs o limpiar ramas después de que se completa la implementación. Úsala cuando tu código esté listo y probado para finalizar sistemáticamente el proceso de desarrollo.
