SKILL·4A099C

run-puzzle-tests

pjt222
Updated 1 month ago
9 views
21
3
21
View on GitHub
Testingaitestingdesign

About

This skill runs the jigsawR test suite through WSL R with three scoping options (full, filtered, or single test) and interprets the results. It's designed for post-edit verification, pre-commit checks, and debugging, ensuring renv compatibility by never using `--vanilla` mode. Developers use it to quickly identify pass/fail/skip statuses and pinpoint specific test failures.

Quick Install

Claude Code

Recommended
Primary
npx skills add pjt222/agent-almanac -a claude-code
Plugin CommandAlternative
/plugin add https://github.com/pjt222/agent-almanac
Git CloneAlternative
git clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/run-puzzle-tests

Copy and paste this command in Claude Code to install this skill

Documentation

Run Puzzle Tests

Run jigsawR test suite + interpret results.

Use When

  • Post any R src edit
  • Post new puzzle type|feature
  • Pre-commit → verify nothing broke
  • Debug specific fail

In

  • Required: Scope (full|filtered|single)
  • Optional: Filter pattern ("snic", "rectangular")
  • Optional: Test file path (single mode)

Do

Step 1: Choose Scope

ScopeUse whenDuration
FullBefore commits, after major changes~2-5 min
FilteredWorking on one puzzle type~30s
SingleDebugging a specific test file~10s

→ Scope chosen by workflow: full pre-commit, filtered for type work, single for debug.

If err: unsure → default full. Slower but catches cross-type regressions.

Step 2: Create+Exec Test Script

Full:

Create /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:

"$R_EXE" -e "devtools::test(filter = 'snic')"

Single:

"$R_EXE" -e "testthat::test_file('tests/testthat/test-snic-puzzles.R')"

→ Test out w/ pass/fail/skip.

If err:

  • NEVER --vanilla; renv needs .Rprofile
  • renv errs → renv::restore() first
  • Complex cmds fail Exit 5 → write script file

Step 3: Interpret Results

Summary line:

[ FAIL 0 | WARN 0 | SKIP 7 | PASS 2042 ]
  • PASS: Succeeded
  • FAIL: Need investigation
  • SKIP: Skipped (missing optional pkg like snic)
  • WARN: Warns (review, not blocking)

→ Summary parsed → PASS, FAIL, SKIP, WARN counts. FAIL=0 = clean.

If err: no summary → runner crashed pre-complete. Check R errs above. Output truncated → redirect: "$R_EXE" -e "devtools::test()" > test_results.txt 2>&1.

Step 4: Investigate Fails

If fail:

  1. Read msg → file, line, expected vs actual
  2. New fail or pre-existing?
  3. Assertion → read test + tested fn
  4. Error → check fn signature changed?
# Run just the failing test with verbose output
"$R_EXE" -e "testthat::test_file('tests/testthat/test-failing.R', reporter = 'summary')"

→ Root cause id'd. Real regression (fix code) or env issue (dep, path).

If err: msg unclear → add browser()|print() + re-run via testthat::test_file() for interactive debug.

Step 5: Verify Skip Reasons

Skips normal when optional deps missing:

  • snicskip_if_not_installed("snic")
  • OS-specific → skip_on_os()
  • CRAN-only → skip_on_cran()

Confirm legitimate, not masking real fails.

→ All skips accounted by legit reasons. None mask actual fails.

If err: skip suspicious → temp remove skip_if_*() + run → see if pass or hidden fail.

Check

  • All pass (FAIL=0)
  • No unexpected warns
  • Skip matches expected (only optional dep skips)
  • Test count not decreased (no accidentally removed)

Traps

  • --vanilla: Breaks renv. Never w/ jigsawR.
  • Complex -e strings: Shell escape → Exit 5. Use script files.
  • Stale pkg state: Run devtools::load_all()|document() before test if NAMESPACE changed.
  • Missing test deps: Some need Suggests pkgs. Check DESCRIPTION.
  • Parallel issues: Tests interfere → run sequential w/ testthat::test_file().

  • generate-puzzle — gen puzzles → verify behavior matches tests
  • add-puzzle-type — new types need comprehensive suites
  • write-testthat-tests — general R test patterns
  • validate-piles-notation — test PILES parse standalone

GitHub Repository

pjt222/agent-almanac
Path: i18n/caveman-ultra/skills/run-puzzle-tests
0
agentsagentskillsai-assisted-developmentclaude-codeskillsteams
FAQ

Frequently asked questions

What is the run-puzzle-tests skill?

run-puzzle-tests is a Claude Skill by pjt222. Skills package instructions and resources that Claude loads on demand, so Claude can perform run-puzzle-tests-related tasks without extra prompting.

How do I install run-puzzle-tests?

Use the install commands on this page: add run-puzzle-tests to Claude Code as a plugin, or clone its repository into your skills directory, then restart Claude so it picks up the skill.

What category does run-puzzle-tests belong to?

run-puzzle-tests is in the Testing category, tagged ai, testing and design.

Is run-puzzle-tests free to use?

Yes. run-puzzle-tests is listed on AIMCP and free to install. It runs inside Claude, so no separate service account is required to use the skill itself.

Related Skills

evaluating-llms-harness
Testing

This 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.

View skill
cloudflare-cron-triggers
Testing

This 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.

View skill
webapp-testing
Testing

This 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.

View skill
finishing-a-development-branch
Testing

This 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.

View skill