Verifies that existing tests successfully capture a bug by running them before applying a fix.
Install
mkdir -p .claude/skills/verify-tests-fail-without-fix && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/5187" && unzip -o skill.zip -d .claude/skills/verify-tests-fail-without-fix && rm skill.zipInstalls to .claude/skills/verify-tests-fail-without-fix
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Verifies tests catch the bug. Auto-detects test type (UI tests, device tests, unit tests) and dispatches to the appropriate runner. Supports two modes - verify failure only (test creation) or full verification (test + fix validation).Key capabilities
- →Auto-detect test types
- →Verify test failure without fix
- →Validate fix with full verification
- →Generate test logs
- →Route to appropriate test runners
How it works
It runs tests in two stages to ensure they fail when the bug is present and pass only after the fix is applied.
Inputs & outputs
When to use verify-tests-fail-without-fix
- →Verifying UI tests catch a bug
- →Confirming unit test failure
- →Validating test suite coverage before fixes
About this skill
Verify Tests Fail Without Fix
Verifies tests actually catch the issue. Supports all test types (UI tests, unit tests, XAML tests, device tests) and two workflow modes.
Supported Test Types
| Test Type | Auto-Detected From | Runner |
|---|---|---|
| UITest | TestCases.Shared.Tests/, TestCases.HostApp/ | BuildAndRunHostApp.ps1 |
| DeviceTest | DeviceTests/ | Run-DeviceTests.ps1 |
| UnitTest | *.UnitTests/, Graphics.Tests/ | dotnet test |
| XamlUnitTest | Xaml.UnitTests/ | dotnet test |
Test type is auto-detected from changed files. Override with -TestType if needed.
-Platform is required for UI and Device tests. It selects which platform to verify the fix on. Unit and XAML tests do not require -Platform.
Activation Guard
🛑 This skill ONLY verifies that existing tests reproduce a bug. Do NOT activate for:
- Writing new tests → use write-tests-agent
- Running tests without verification context → use run-device-tests
- Code review → use code-review skill
- General test advice
Requires: a platform and either test files in the PR or an explicit TestFilter.
⚠️ CRITICAL: Inverted Pass/Fail Semantics
In this skill, test outcomes mean the OPPOSITE of normal:
| Test Result (without fix) | Verification Result | Why |
|---|---|---|
| Tests FAIL | ✅ GOOD | Tests detect the bug |
| Tests PASS | ❌ BAD | Tests miss the bug |
NEVER say "verification passed" when tests PASS without the fix.
Workflow
Step 1: Determine Mode
- Check if fix files exist in the PR (non-test code changes detected by the script from the git diff)
- If fix files present → Full Verification mode (
-RequireFullVerification) - If no fix files → Verify Failure Only mode (omit the flag)
Step 2: Construct Command
pwsh .github/skills/verify-tests-fail-without-fix/scripts/verify-tests-fail.ps1 `
-Platform <platform> `
-TestFilter "<filter>" `
[-RequireFullVerification] # Only if fix files exist
Step 3: Interpret Results
⚠️ Remember: test outcomes are INVERTED from normal!
- Script outputs
VERIFICATION PASSED→ Tests catch the bug ✅ - Script outputs
VERIFICATION FAILED→ Tests don't catch the bug ❌ - Script outputs error/timeout → Report as Blocked
Step 4: Report
- Report the result to the invoking orchestrator
Mode 1: Verify Failure Only (Test Creation)
Use when creating tests before writing a fix:
- Runs tests to verify they FAIL (proving they catch the bug)
- No fix files required
- Perfect for test-first development
# Auto-detect test type and filter
pwsh .github/skills/verify-tests-fail-without-fix/scripts/verify-tests-fail.ps1 -Platform android
# Explicit test type + filter
pwsh .github/skills/verify-tests-fail-without-fix/scripts/verify-tests-fail.ps1 -Platform android -TestType UnitTest -TestFilter "Maui12345"
Mode 2: Full Verification (Fix Validation)
Use when validating both tests and fix:
- Without fix - tests should FAIL (bug is present)
- With fix - tests should PASS (bug is fixed)
# Auto-detect everything (recommended)
pwsh .github/skills/verify-tests-fail-without-fix/scripts/verify-tests-fail.ps1 -Platform android -RequireFullVerification
# With explicit test filter
pwsh .github/skills/verify-tests-fail-without-fix/scripts/verify-tests-fail.ps1 -Platform ios -TestFilter "Issue33356" -RequireFullVerification
Note: -RequireFullVerification ensures the script errors if no fix files are detected, preventing silent fallback to failure-only mode.
Requirements
Verify Failure Only Mode:
- Test files in the PR (or working directory)
Full Verification Mode:
- Test files in the PR
- Fix files in the PR (non-test code changes)
The script auto-detects which mode to use based on whether fix files are present.
Expected Output
Verify Failure Only Mode:
╔═══════════════════════════════════════════════════════════╗
║ VERIFICATION PASSED ✅ ║
╠═══════════════════════════════════════════════════════════╣
║ Tests FAILED as expected! ║
║ This proves the tests correctly reproduce the bug. ║
╚═══════════════════════════════════════════════════════════╝
Full Verification Mode:
╔═══════════════════════════════════════════════════════════╗
║ VERIFICATION PASSED ✅ ║
╠═══════════════════════════════════════════════════════════╣
║ - FAIL without fix (as expected) ║
║ - PASS with fix (as expected) ║
╚═══════════════════════════════════════════════════════════╝
What It Does
Verify Failure Only Mode (no fix files):
- Fetches base branch from origin (if available)
- Auto-detects test type from changed files (UITest, UnitTest, XamlUnitTest, DeviceTest)
- Auto-detects test classes from changed test files
- Routes to the appropriate test runner
- Runs tests (should FAIL to prove they catch the bug)
- Reports result
Full Verification Mode (fix files detected):
- Fetches base branch from origin to ensure accurate diff
- Auto-detects fix files (non-test code) from git diff
- Auto-detects test type and test classes from changed files
- Reverts fix files to base branch
- Runs tests using the appropriate runner (should FAIL without fix)
- Restores fix files
- Runs tests using the appropriate runner (should PASS with fix)
- Generates markdown reports:
CustomAgentLogsTmp/TestValidation/verification-report.md- Full detailed reportCustomAgentLogsTmp/PRState/verification-report.md- Validate section for agent
- Reports result
Note: PR label management (s/ai-reproduction-confirmed / s/ai-reproduction-failed) is handled by Review-PR.ps1, not by this script.
Output Files
The skill generates output files under CustomAgentLogsTmp/PRState/<PRNumber>/PRAgent/gate/verify-tests-fail/:
| File | Description |
|---|---|
verification-report.md | Comprehensive markdown report with test results and full logs |
verification-log.txt | Text log of the verification process |
test-without-fix.log | Full test output from run without fix |
test-with-fix.log | Full test output from run with fix |
Plus test logs in CustomAgentLogsTmp/:
UITests/- UI test device logs and outputDeviceTests/- Device test outputUnitTests/- Unit test output
Example structure:
CustomAgentLogsTmp/
├── UITests/ # UI test logs
│ ├── android-device.log
│ └── test-output.log
├── DeviceTests/ # Device test logs
│ └── test-output.log
├── UnitTests/ # Unit/XAML test logs
│ └── test-output.log
└── PRState/
└── 27847/
└── PRAgent/
└── gate/
└── verify-tests-fail/
├── verification-report.md # Full detailed report
├── verification-log.txt
├── test-without-fix.log
└── test-with-fix.log
PR Number Detection:
- Auto-detected from branch name (e.g.,
pr-27847) - Falls back to
gh pr viewcommand - Uses "unknown" if detection fails
- Can be manually specified with
-PRNumberparameter
Troubleshooting
| Problem | Cause | Solution |
|---|---|---|
| No fix files detected | Base branch detection failed or no non-test files changed | Use -FixFiles or -BaseBranch explicitly |
| Tests pass without fix | Tests don't detect the bug | Review test assertions, update test |
| Tests fail with fix | Fix doesn't work or test is wrong | Review fix implementation |
| App crashes | Duplicate issue numbers, XAML error | Check device logs |
| Element not found | Wrong AutomationId, app crashed | Verify IDs match |
Optional Parameters
# Require full verification (fail if no fix files detected) - recommended
-RequireFullVerification
# Explicit test type (auto-detected if omitted)
-TestType UnitTest # or XamlUnitTest, DeviceTest, UITest
# Explicit test filter
-TestFilter "Issue32030|ButtonUITests"
# Explicit fix files
-FixFiles @("src/Core/src/File.cs")
# Explicit base branch
-BaseBranch "main"
When not to use it
- →Writing new tests
- →General code review
- →Running tests without verification context
Prerequisites
Limitations
- →Requires platform specification for UI/Device tests
- →Depends on accurate git diffs
How it compares
It enforces an inverted pass/fail logic to confirm that tests are actually capable of detecting the specific bug.
Compared to similar skills
verify-tests-fail-without-fix side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| verify-tests-fail-without-fix (this skill) | 1 | 2mo | Review | Advanced |
| python-testing-patterns | 77 | 2mo | Review | Intermediate |
| dependency-upgrade | 26 | 5mo | Review | Intermediate |
| test-cases | 57 | 7mo | No flags | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by dotnet
View all by dotnet →You might also like
python-testing-patterns
wshobson
Implement comprehensive testing strategies with pytest, fixtures, mocking, and test-driven development. Use when writing Python tests, setting up test suites, or implementing testing best practices.
dependency-upgrade
wshobson
Manage major dependency version upgrades with compatibility analysis, staged rollout, and comprehensive testing. Use when upgrading framework versions, updating major dependencies, or managing breaking changes in libraries.
test-cases
cexll
This skill should be used when generating comprehensive test cases from PRD documents or user requirements. Triggers when users request test case generation, QA planning, test scenario creation, or need structured test documentation. Produces detailed test cases covering functional, edge case, error handling, and state transition scenarios.
reviewing-code
CaptainCrouton89
Systematically evaluate code changes for security, correctness, performance, and spec alignment. Use when reviewing PRs, assessing code quality, or verifying implementation against requirements.
wcag-audit-patterns
wshobson
Conduct WCAG 2.2 accessibility audits with automated testing, manual verification, and remediation guidance. Use when auditing websites for accessibility, fixing WCAG violations, or implementing accessible design patterns.
code-coverage-with-gcov
gadievron
Add gcov code coverage instrumentation to C/C++ projects