Generate a targeted local test plan for branch changes. Use when the user wants to know which tests to run before merging, asks for a test plan, wants to validate changes locally, or mentions running tests for their branch. This skill analyzes commits on top of master and produces a runnable shell script covering Unit, Integration, Playwright, and Poshi tests within a 20-minute local budget.
Produce a runnable shell script that executes the tests most likely to regress given the current branch's changes compared to master.
The full test suite takes hours to run, so the team merges aggressively and relies on a daily full-suite run that delivers results within 24 hours of merge. This skill produces a focused premerge script (under 20 minutes) that mitigates risk without attempting full coverage — its goal is to catch the most likely regressions, not every possible one.
Consult the reference file for detailed test organization patterns:
${CLAUDE_SKILL_DIR}/references/test-organization.mdgit diff master...HEAD --name-only
git log master..HEAD --onelineRead the changed files to understand what the changes actually do — not merely which files were touched, but what behavior changed. This understanding drives the test selection.
Consider the blast radius of each change:
portal-kernel, *-api modules): Anything that depends on the changed API could regress. Search for consumers.The objective is not to "find every test in modules that were touched" — it is to find tests that exercise the code paths that changed.
For each area that could regress, search for test files. Use parallel Agent and Glob calls for speed. Consult ${CLAUDE_SKILL_DIR}/references/test-organization.md for the exact patterns and conventions.
Verify every test file exists before including it in the plan.
Apply the following priority order:
Always include:
Unit tests for directly changed code — fast (approximately 5–15 seconds per class) and highest signal.
Integration tests that directly exercise the changed functionality.
Tests that exercise the core logic change end-to-end.
Include when budget allows:
Representative integration tests from affected downstream modules — choose a few that cover distinct usage patterns rather than running them all.
Playwright tests for affected web modules (approximately 1–3 minutes per spec).
Include when still within budget:
Poshi tests (approximately 2–5 minutes each).
Additional downstream module tests for broader coverage.
When the change affects many modules (for example, a framework change), do not attempt to test every single module. Choose a diverse sample that covers different usage patterns of the changed code.
Delete any existing test.sh at the repository root, then write a new one. The script must be self-contained and runnable via bash test.sh. Use this structure:
#!/usr/bin/env bash
#
# Test plan for branch: <branch-name>
# Generated: <date>
# Estimated time: <X>m / 20m budget
#
# Changes: <N> commits, <N> files changed
# Affected areas: <list of module groups or components>
#
set -o errexit
set -o nounset
set -o pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"
_EXIT_CODE=0
<test commands — one per line, no blank lines between them>
exit ${_EXIT_CODE}Critical rules for the script:
<test commands> with the actual commands discovered during selection.|| _EXIT_CODE=1 so failures are recorded without halting execution. The || recovery neutralizes errexit on test failures while keeping the strict-mode block in place for unrecovered errors. The script exits with ${_EXIT_CODE} at the end — 0 when all tests pass, 1 when any fail../gradlew --project-dir ./modules for Gradle tasks (the script's cd puts the repository root as the working directory).npx --prefix ./modules/test/playwright playwright test for Playwright.After writing the script, mark it executable with chmod +x test.sh and instruct the user to run it via ./test.sh.
0 with a header explaining why.ce5402e
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.