本文へ移動
cccskills
無料GitHub で公開

run-puzzle-tests

Run the jigsawR test suite via WSL R execution. Supports full suite, filtered by pattern, or single file. Interprets pass/fail/skip counts and identifies failing tests. Never uses --vanilla flag (renv needs .Rprofile for activation). Use after modifying any R source code, after adding a new puzzle type or feature, before committing changes to verify nothing is broken, or when debugging a specific test failure.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md5.5 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Run Puzzle Tests

Run the jigsawR test suite and interpret results.

When to Use

  • After modifying any R source code in the package
  • After adding a new puzzle type or feature
  • Before committing changes to verify nothing is broken
  • Debugging a specific test failure

Inputs

  • Required: Test scope (full, filtered, or single)
  • Optional: Filter pattern (for filtered mode, e.g. "snic", "rectangular")
  • Optional: Specific test file path (for single mode)

Procedure

Step 1: Choose Test Scope

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

Expected: Test scope selected based on current workflow: full suite before commits, filtered when working on a specific puzzle type, single file when debugging one test.

On failure: If unsure which scope to use, default to full suite. It takes longer but catches cross-type regressions.

Step 2: Create and Execute Test Script

Full suite:

Create a script file (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')"

Expected: Test output with pass/fail/skip counts.

On failure:

  • Do NOT use --vanilla flag; renv needs .Rprofile to activate
  • If renv errors, run renv::restore() first
  • For complex commands that fail with Exit code 5, write to a script file instead

Step 3: Interpret Results

Look for the summary line:

[ FAIL 0 | WARN 0 | SKIP 7 | PASS 2042 ]
  • PASS: Tests that succeeded
  • FAIL: Tests that failed (need investigation)
  • SKIP: Tests skipped (usually due to missing optional packages like snic)
  • WARN: Warnings during tests (review but not blocking)

Expected: The summary line parsed to identify PASS, FAIL, SKIP, and WARN counts. FAIL = 0 for a clean test run.

On failure: If the summary line is not visible, the test runner may have crashed before completing. Check for R-level errors above the summary. If output is truncated, redirect to a file: "$R_EXE" -e "devtools::test()" > test_results.txt 2>&1.

Step 4: Investigate Failures

If tests fail:

  1. Read the failure message — it includes file, line, and expected vs actual
  2. Check if it's a new failure or pre-existing
  3. For assertion failures, read the test and the function being tested
  4. For error failures, check if a function signature changed
# Run just the failing test with verbose output
"$R_EXE" -e "testthat::test_file('tests/testthat/test-failing.R', reporter = 'summary')"

Expected: Root cause of each failing test identified. The failure is either a genuine regression (code needs fixing) or a test environment issue (missing dependency, path problem).

On failure: If the failure message is unclear, add browser() or print() statements to the test and re-run with testthat::test_file() for interactive debugging.

Step 5: Verify Skip Reasons

Skipped tests are normal when optional dependencies are missing:

  • snic package tests skip with skip_if_not_installed("snic")
  • Tests requiring specific OS skip with skip_on_os()
  • CRAN-only skips with skip_on_cran()

Confirm skip reasons are legitimate, not masking real failures.

Expected: All skips are accounted for by legitimate reasons (optional dependency not installed, platform-specific skip, CRAN-only skip). No skips are masking actual test failures.

On failure: If a skip seems suspicious, temporarily remove the skip_if_*() call and run the test to see if it passes or reveals a hidden failure.

Validation

  • All tests pass (FAIL = 0)
  • No unexpected warnings
  • Skip count matches expected (only optional dependency skips)
  • Test count hasn't decreased (no tests accidentally removed)

Common Pitfalls

  • Using --vanilla: Breaks renv activation. Never use it with jigsawR.
  • Complex -e strings: Shell escaping issues cause Exit code 5. Use script files.
  • Stale package state: Run devtools::load_all() or devtools::document() before testing if you changed NAMESPACE-affecting code.
  • Missing test dependencies: Some tests need suggested packages. Check DESCRIPTION Suggests field.
  • Parallel test issues: If tests interfere, run sequentially with testthat::test_file().

Related Skills

  • generate-puzzle — generate puzzles to verify behavior matches tests
  • add-puzzle-type — new types need comprehensive test suites
  • write-testthat-tests — general patterns for writing R tests
  • validate-piles-notation — test PILES parsing independently

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Execute structural metamorphosis using strangler fig migration, chrysalis phases, and interface preservation. Covers transformation planning, parallel running, progressive cutover, rollback design, and post-metamorphosis stabilization for system architecture evolution. Use when assess-form has classified the system as READY for transformation, when migrating from monolith to microservices, when replacing a core subsystem while dependents continue operating, or when any architectural change must be gradual rather than big-bang.

日本語の概要は準備中です。原文の説明を表示しています。

pjt222/agent-almanac372026年10月12日 更新

adaptic

無料

Master skill composing the 5-step synoptic cycle for panoramic synthesis across multiple domains. Orchestrates meditate, expand-awareness, observe, awareness, integrate-gestalt, and express-insight into a coherent process that produces unified understanding rather than sequential compromise. Use when a problem genuinely spans 3+ domains and the interactions between domains matter more than depth in any one, when sequential analysis feels like compromise rather than integration, or before major architectural decisions affecting multiple stakeholders.

日本語の概要は準備中です。原文の説明を表示しています。

pjt222/agent-almanac372026年10月12日 更新

Scaffold a new puzzle type across all 10+ pipeline integration points in jigsawR. Creates the core puzzle module, wires it into the unified pipeline (generation, positioning, rendering, adjacency), adds ggpuzzle geom/stat layers, updates DESCRIPTION and config.yml, extends the Shiny app, and creates a comprehensive test suite. Use when adding a completely new puzzle type to the package or following the 10-point integration checklist to ensure nothing is missed end-to-end.

日本語の概要は準備中です。原文の説明を表示しています。

pjt222/agent-almanac372026年10月12日 更新

Add Rcpp or RcppArmadillo integration to an R package for high-performance C++ code. Covers setup, writing C++ functions, RcppExports generation, testing compiled code, and debugging. Use when an R function is too slow and profiling confirms a bottleneck, when you need to interface with existing C/C++ libraries, or when implementing algorithms (loops, recursion, linear algebra) that benefit from compiled code.

日本語の概要は準備中です。原文の説明を表示しています。

pjt222/agent-almanac372026年10月12日 更新

aikido

無料

Practice aikido as a defensive martial art emphasizing harmony, redirection, and controlled resolution. Covers centering and grounding, ukemi (safe falling and rolling), core techniques (irimi-nage, shiho-nage, kote-gaeshi, ikkyo), blending and tai sabaki (body movement), randori (multiple attacker practice), weapons awareness, and applying principles off the mat. Use when learning a defensive martial art that prioritizes de-escalation, developing the ability to redirect aggression without causing unnecessary harm, building safe falling skills, or cultivating calm centeredness under physical pressure.

日本語の概要は準備中です。原文の説明を表示しています。

pjt222/agent-almanac372026年10月12日 更新

Analyze an arbitrary codebase to identify functions, APIs, and data sources suitable for exposure as MCP tools, producing a tool specification document. Use when planning an MCP server for an existing project, auditing a codebase before wrapping it as an AI-accessible tool surface, comparing what a codebase can do versus what is already exposed via MCP, or generating a tool spec to hand off to scaffold-mcp-server.

日本語の概要は準備中です。原文の説明を表示しています。

pjt222/agent-almanac372026年10月12日 更新

pjt222 のスキルをすべて見る

このスキルの問題を報告する