run-puzzle-tests
About
This skill runs the jigsawR test suite through WSL R execution, supporting full tests, pattern filtering, or single file runs. It interprets pass/fail/skip results and identifies failing tests while preserving renv compatibility by avoiding the --vanilla flag. Use it after code modifications, before commits, or when debugging specific test failures to ensure nothing is broken.
Quick Install
Claude Code
Recommendednpx 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-testsCopy and paste this command in Claude Code to install this skill
Documentation
行拼圖之試
行 jigsawR 之試套,並解其果。
用時
- 包中 R 之源已改乃用
- 新拼圖類或特徵已增乃用
- 提交之前驗無破乃用
- 察特試之敗乃用
入
- 必要:試之範(
full、filtered、或single) - 可選:濾之模(為濾模,如
"snic"、"rectangular") - 可選:特試文件之徑(為單模)
法
第一步:擇試之範
| 範 | 用時 | 時 |
|---|---|---|
| Full | 提交之前、大變之後 | 約 2-5 分 |
| Filtered | 治一拼圖之類 | 約 30 秒 |
| Single | 察一試文件 | 約 10 秒 |
得:依當前所為擇範——提交之前用全套,治一類用濾,察一試用單。
敗則:不知擇何範,默用全套。雖久而能捕跨類之回退。
第二步:建並行試本
全套:
立本文件(如 /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()"
依模濾之:
"$R_EXE" -e "devtools::test(filter = 'snic')"
單文件:
"$R_EXE" -e "testthat::test_file('tests/testthat/test-snic-puzzles.R')"
得:試出附過/敗/略之數。
敗則:
- 勿用
--vanilla旗;renv 需.Rprofile以啟 - renv 誤,先行
renv::restore() - 繁命以退碼 5 敗者,書為本文件代之
第三步:解其果
察其總線:
[ FAIL 0 | WARN 0 | SKIP 7 | PASS 2042 ]
- PASS:試之成
- FAIL:試之敗(須察)
- SKIP:試之略(常為缺選裝之包,如
snic) - WARN:試中之警(察而不阻)
得:總線解之,識 PASS、FAIL、SKIP、WARN 之數。淨行則 FAIL = 0。
敗則:總線不見,試或於畢前崩。察其上之 R 級誤。出截斷者,重定於文件:"$R_EXE" -e "devtools::test()" > test_results.txt 2>&1。
第四步:察敗
試敗:
- 讀敗辭——含文件、行、預期與實得
- 察其為新敗或舊存
- 斷言之敗,讀其試與所試之函
- 誤之敗,察函之簽是否變
# Run just the failing test with verbose output
"$R_EXE" -e "testthat::test_file('tests/testthat/test-failing.R', reporter = 'summary')"
得:每敗試之根因已識。敗者,或實之回退(碼宜修),或試境之患(缺依、徑訛)。
敗則:敗辭不明,加 browser() 或 print() 於試,以 testthat::test_file() 重行為交互之察。
第五步:驗略之由
略之試,乃選依不存時之常:
snic包試以skip_if_not_installed("snic")略- 需特 OS 之試以
skip_on_os()略 - CRAN 唯之略以
skip_on_cran()
驗略之由皆正當,非掩實敗。
得:諸略皆有正當之由(選依未裝、平台特略、CRAN 唯略)。無略掩實之試敗。
敗則:略可疑,暫除其 skip_if_*() 而行其試,察其過或現藏敗。
驗
- 諸試皆過(FAIL = 0)
- 無意外之警
- 略數合預期(唯選依之略)
- 試數未降(無誤刪之試)
陷
- 用
--vanilla:破 renv 之啟。jigsawR 永勿用之 - 繁之
-e串:殼轉義之患致退碼 5。用本文件 - 包之陳態:改 NAMESPACE 之碼,試前先行
devtools::load_all()或devtools::document() - 缺試依:某試需 Suggests 之包。察
DESCRIPTION之 Suggests - 並試之患:試相干,以
testthat::test_file()序行
參
generate-puzzle— 生拼圖以驗其行合試add-puzzle-type— 新類需備全試套write-testthat-tests— 寫 R 試之常模validate-piles-notation— 獨驗 PILES 之解
GitHub Repository
Related Skills
evaluating-llms-harness
TestingThis Claude Skill runs the lm-evaluation-harness to benchmark LLMs across 60+ standardized academic tasks like MMLU and GSM8K. It's designed for developers to compare model quality, track training progress, or report academic results. The tool supports various backends including HuggingFace and vLLM models.
cloudflare-cron-triggers
TestingThis skill provides comprehensive knowledge for implementing Cloudflare Cron Triggers to schedule Workers using cron expressions. It covers setting up periodic tasks, maintenance jobs, and automated workflows while handling common issues like invalid cron expressions and timezone problems. Developers can use it for configuring scheduled handlers, testing cron triggers, and integrating with Workflows and Green Compute.
webapp-testing
TestingThis Claude Skill provides a Playwright-based toolkit for testing local web applications through Python scripts. It enables frontend verification, UI debugging, screenshot capture, and log viewing while managing server lifecycles. Use it for browser automation tasks but run scripts directly rather than reading their source code to avoid context pollution.
finishing-a-development-branch
TestingThis skill helps developers complete finished work by verifying tests pass and then presenting structured integration options. It guides the workflow for merging, creating PRs, or cleaning up branches after implementation is done. Use it when your code is ready and tested to systematically finalize the development process.
