ワンクリックで
test-demos
Analyze branch changes for test gaps, then generate a demo-based manual test plan that Claude Code can execute
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Analyze branch changes for test gaps, then generate a demo-based manual test plan that Claude Code can execute
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
Initialize Claude Code in a repository with standard project scaffolding. Use this skill whenever the user wants to set up Claude Code in a new repo, initialize claude configuration, run /init with extras, or mentions "ray-init". This goes beyond the built-in /init by adding gitignore rules, Sideways files, and a local planning doc.
Test-Driven Development discipline for writing code. Use this skill whenever writing new features, adding behavior, refactoring with tests, fixing bugs with regression tests, or when the user mentions TDD, red-green-refactor, test-first, failing tests, or asks to write tests before implementation. Also triggers when branch plans contain FAILING test tasks or test-first instructions.
Create a plan document for the current branch, or for a specified new/existing branch. The complete template and all instructions are provided below — do not search for examples elsewhere.
Plan and track a bugfix with diagnosis-first discipline — create a BUGFIX.<branch>.md working doc, trace the reported symptom to a proven root cause, and write a failing test that reproduces the bug BEFORE fixing it. Use when the user reports a bug to fix, asks to investigate or diagnose a defect, starts a bugfix branch, or mentions "ray-bugfix-plan". The complete template and all instructions are below — do not search for examples elsewhere.
Audit skill source files for personal references, credentials, and other publication blockers before mirroring them into the ray-ai-skills public repo. Use this skill whenever the user wants to audit one or more skills, check skills before publishing/syncing, look for hardcoded paths or sensitive content in skills, or asks "audit my skills". If no specific skills are named, audit every skill that has changed since the last sync (or is new and not yet mirrored).
Update the ray-ai-skills repo from source skills under ~/.claude/skills/ — audit, then sync, then stop before commit. Also handles adding a new skill to .shared-skills, removing a skill from the mirror, or auditing without syncing. Use this skill whenever the user wants to sync skills into the repo, publish skill changes, update the skills mirror, add a skill to the shared list, remove a skill from the shared list, or says "skills-update". Accepts natural-language targets like "sync all", "update ray-tdd and ray-commit", "remove ray-foo", "audit only", etc.
SOC 職業分類に基づく
| name | test-demos |
| description | Analyze branch changes for test gaps, then generate a demo-based manual test plan that Claude Code can execute |
Generate a PLAN.demo-manual-tests.md file for the current branch. The plan exercises changed code through the project's demo scripts, filling coverage gaps that the unit-test suite may not reach (e.g., integration flows, visual output, print/summary formatting, multi-step pipelines).
Note: The examples below use an R package layout (
R/,tests/testthat/,demo/*.R). The methodology — pairing demos with regression tests to cover gaps the unit suite misses — applies to any language. Adapt the paths, file globs, and tooling to fit your project's layout.
/test-demos
Determine the base branch (same logic as /branch-review: check for develop, fall back to main/master).
git diff <base>...HEAD --name-only -- 'R/*.R'
Collect the list of changed R/*.R files. If no R source files changed, report that and stop.
For each changed file, search for test files that exercise its functions:
Grep for the changed file's exported/internal function names across tests/testthat/test-*.R and tests/testthat/test-*.r.tests/testthat/fixtures/ exercise the changed code paths.Build a coverage map: { changed_file → [test_files_that_reference_it] }.
Flag functions or code paths in changed files that have no testthat coverage — these are the "test gaps."
For each test gap, determine which demo/*.R scripts exercise the uncovered code:
demo/.If a test gap cannot be covered by any demo, note it in the output as "not demo-coverable" so the developer knows manual testing may still be needed.
For each selected demo, design R code checks that verify the changed code works correctly. Follow these patterns:
Structural checks (automated PASS/FAIL):
" -> " separator)tryCatch wrappers)Visual checks (developer review required):
test_plots/ using save_plot() wrapped in tryCatch (some environments lack DiagrammeRsvg/rsvg)Check conventions:
"PASS: <description>" for passing checks"FAIL: <description>" for failing checks"WARN: <description>" for non-fatal issues (e.g., missing optional packages)Some demos overwrite variables as they run multiple configurations sequentially. When this happens:
Read each selected demo script to understand its variable names, what objects it creates, and whether it overwrites them.
Create PLAN.demo-manual-tests.md in the project root with this structure:
# Manual Demo Tests for [Branch Name]
> Automated test plan for Claude Code to execute. Each section sources a demo file, then runs verification checks. Plots are saved for developer review.
## Instructions for Claude Code
1. Create `test_plots/` directory for plot output
2. For each section: run the R script via `Rscript` from the package root
3. Check output for any `FAIL:` lines — report these immediately
4. Where indicated, ask the developer to review saved plot files before continuing
5. After all sections pass, delete `test_plots/`
---
## N. Section Title (`demo-name`)
**Refactored code exercised:** `file.R` (`function_name()`, `predicate()`), `other_file.R` (`other_function()`)
[Optional: note about demo behavior, e.g., "The demo runs N configurations sequentially..."]
**Run this R script:**
~~~r
devtools::load_all()
dir.create("test_plots", showWarnings = FALSE)
source("demo/demo-name.R")
cat("PASS: demo completed without error\n")
# Check: [description]
[verification code]
# Save plots (if applicable)
tryCatch({
plot(model_obj); save_plot("test_plots/Na_description.png")
cat("PASS: plots saved to test_plots/Na\n")
}, error = function(e) cat("WARN: plot save failed:", e$message, "\n"))
~~~
**Ask developer to verify plots before continuing:** (only if plots were saved)
- `test_plots/Na_description.png` — [what to look for]
---
## Cleanup
After all sections pass:
~~~r
unlink("test_plots", recursive = TRUE)
~~~
After writing the file, summarize:
devtools::load_all() so it can be run independently.tryCatch since rendering packages may not be installed. Use WARN not FAIL for optional capabilities.Before writing verification code that accesses summary or model fields, probe the actual object structure using str() or class() on a live R session (or read the relevant summary.* / print.* S3 methods). Common mistakes to avoid:
$loadings, $vif_antecedents, $quality$antecedent_vifs) are nested lists (often class list_output), not numeric matrices. You cannot call round() directly on them — use lapply(x, round, 3) instead.chisq, rmsea, cfi, tli, srmr live in $quality$fit$all (a named numeric vector keyed by name), not in $quality$fit$curated$ordinary (which contains only a curated subset without those names). Use names(fit) not rownames(fit) to check for presence.save_plot(). CFA/CBSEM models use semPlot — save_plot() is not compatible and will error. Don't wrap CFA/CBSEM plot saves expecting them to work; instead note that the demo's own plot() calls already render via semPlot.