skills/mobile-verification/SKILL.md
Automated testing workflow with pass@k metrics for mobile development. Detects flaky tests and ensures code reliability.
npx skillsauth add ahmed3elshaer/everything-claude-code-mobile mobile-verificationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Comprehensive testing workflow with pass@k metrics for Android development reliability.
Single test runs lie.
A test that passes once might fail tomorrow. Verification loops run tests multiple times to reveal:
Pass@k = proportion of test iterations that passed
Pass@3(test) = tests_passed / 3
testLogin(): ✓✓✓ → Pass@3 = 3/3 = 1.0 (100%)
testLogout(): ✓✓✗ → Pass@3 = 2/3 = 0.67 (67%)
testRefresh(): ✗✗✗ → Pass@3 = 0/3 = 0.0 (0%)
Purpose: Fast feedback during development
Usage: /mobile-verify --k=2
Time: ~2 minutes
When: After small changes, before commit
Purpose: Standard confidence level
Usage: /mobile-verify --k=3
Time: ~5 minutes
When: Before push, after feature complete
Purpose: High confidence, flaky detection
Usage: /mobile-verify --k=5
Time: ~10 minutes
When: Before release, after refactor
Purpose: Maximum confidence
Usage: /mobile-verify --k=10
Time: ~20 minutes
When: Production release, critical bugs
Characteristics:
Target Pass@k: ≥ 0.95 (95%)
Common Flaky Causes:
Fix Strategies:
// Bad: Flaky
@Test
fun testLoadData() {
viewModel.loadData()
assert(viewModel.state.value is Loaded)
}
// Good: Stable
@Test
fun testLoadData() = runTest {
viewModel.loadData()
advanceUntilIdle()
assert(viewModel.state.value is Loaded)
}
Characteristics:
Target Pass@k: ≥ 0.80 (80%)
Common Flaky Causes:
Fix Strategies:
// Register idling resources
@IdlingResource
val countingIdlingResource = CountingIdlingResource("api")
// Disable animations
@get:Rule
val disableAnimationsRule = DisableAnimationsRule()
Characteristics:
Target Pass@k: ≥ 0.90 (90%)
Common Flaky Causes:
Fix Strategies:
@Composable
fun TestComposable(content: @Composable () -> Unit) {
CompositionLocalProvider(
LocalInspectionMode provides true
) {
content()
}
}
# 1. Write test
# 2. Quick verify
/mobile-verify --class=NewTest --k=2
# 3. Fix if fails
# 4. Standard verify
/mobile-verify --class=NewTest --k=3
# Verify changed modules only
/mobile-verify --module=$(git diff --name-only | head -1) --k=2
# Full verification
/mobile-verify --k=3
# Thorough verification with flaky detection
/mobile-verify --k=5 --flaky
| Score | Meaning | Action | |-------|---------|--------| | 1.0 | Perfect | Celebrate | | 0.8-0.9 | Excellent | Monitor | | 0.6-0.7 | Good | Investigate | | 0.4-0.5 | Fair | Fix needed | | 0.0-0.3 | Poor | Block release |
Track pass@k over time:
Week 1: Pass@3 = 0.85
Week 2: Pass@3 = 0.87 ↗ Improving
Week 3: Pass@3 = 0.82 ↘ Degraded - investigate!
Week 4: Pass@3 = 0.88 ↗ Recovered
| Pattern | Likely Cause | |---------|--------------| | Fails on iteration 1 only | Cold start issue | | Fails randomly | Async timing | | Fails on specific iteration | Resource leak | | Fails in parallel only | Shared state |
/mobile-verify --flaky --k=10
Look for patterns in failures.
@Test
fun flakyTest() = runTest {
val startTime = System.currentTimeMillis()
// ... test code ...
val duration = System.currentTimeMillis() - startTime
Log.d("Test", "Duration: $duration ms") // Check for timing issues
}
Common fixes:
advanceUntilIdle() for coroutinesIdlingResource for network@UiThreadTest for main thread work/mobile-verify --class=FixedTest --k=5
Target: Pass@5 = 1.0
Create checkpoint before verification:
/mobile-checkpoint save pre-verify
/mobile-verify --k=3
Track pass@k in memory:
{
"test-coverage": {
"passAt3": 0.87,
"trend": "improving",
"flakyTests": []
}
}
Learn testing patterns:
{
"id": "test-coroutine-async",
"description": "Always use runTest + advanceUntilIdle for ViewModel tests",
"confidence": 0.95
}
| Context | Pass@k Threshold | Rationale | |---------|------------------|-----------| | Unit tests | 0.95 | Should be deterministic | | UI tests | 0.80 | More fragile, device-dependent | | Compose tests | 0.90 | Better than Espresso, more stable | | Integration tests | 0.70 | Complex, more variables | | E2E tests | 0.60 | Full system, many variables |
Remember: A test that sometimes passes is worse than no test at all. It gives false confidence.
data-ai
SQLDelight patterns for Kotlin Multiplatform - .sq file definitions, platform drivers, type adapters, migrations, and shared database access.
data-ai
Room database patterns for Android - entity definitions, DAO interfaces, Database class, migrations, TypeConverters, and Flow integration.
tools
Push notification patterns - FCM setup for Android, APNs for iOS, notification channels, payload handling, foreground/background behavior, and rich notifications.
content-media
Pagination patterns for mobile - Paging 3 for Android (PagingSource, RemoteMediator, LazyPagingItems), cursor-based and offset-based strategies.