Borrowing it
Nothing to install: this file belongs to divinevideo/divine-mobile. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/divinevideo/divine-mobile/main/.agents/skills/mockito-stale-mock-silent-trycatch-failure/SKILL.mdgit clone --depth 1 https://github.com/divinevideo/divine-mobileWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/divinevideo/divine-mobile/mockito-stale-mock-silent-trycatch-failure)<a href="https://agentmods.dev/skills/divinevideo/divine-mobile/mockito-stale-mock-silent-trycatch-failure"><img src="https://agentmods.dev/badge/skills/divinevideo/divine-mobile/mockito-stale-mock-silent-trycatch-failure/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/divinevideo/divine-mobile/mockito-stale-mock-silent-trycatch-failure"><img src="https://agentmods.dev/badge/skills/divinevideo/divine-mobile/mockito-stale-mock-silent-trycatch-failure.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00186 | $0.01375 |
| Opus 5 | $0.00093 | $0.00687 |
| Sonnet 5 | $0.00037 | $0.00275 |
| Haiku 4.5 | $0.00019 | $0.00137 |
Grade A, and why
mockito-stale-mock-silent-trycatch-failure scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 138 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Mockito Stale Mock + Silent Try/Catch Test Failures
Problem
When a PR adds new methods to a service class (e.g., AnalyticsApiService), and those
methods are called from existing code paths that are wrapped in try/catch blocks, tests
fail with misleading symptoms. The test assertion shows Expected: non-empty, Actual: []
or Expected: true, Actual: false — but the actual root cause is a MissingStubError
being silently caught.
Context / Trigger Conditions
- Symptom: Test expects data (non-empty list, specific values) but gets empty/default
- No obvious error: No
MissingStubErrorin test output because production code catches it - PR context: The PR added new methods to a
@GenerateMocks-annotated service class - CI also shows: "Generated files are out of date" (stale
.g.dart/.mocks.dart) - Existing tests were passing before the PR's changes
The Failure Chain
1. PR adds method `getBulkVideoViews()` to AnalyticsApiService
2. PR adds `_enrichVideosWithBulkStats()` to HomeFeedProvider.build()
3. _enrichVideosWithBulkStats calls getBulkVideoViews (new method)
4. Generated mock is stale — doesn't have getBulkVideoViews at all
5. Even if regenerated, test setUp doesn't stub getBulkVideoViews
6. Mock throws MissingStubError when unstubbed method is called
7. Provider's try/catch catches ALL exceptions (including MissingStubError)
8. Provider falls back to empty state → test sees [] instead of expected data
Solution
Step 1: Regenerate mocks
dart run build_runner build --delete-conflicting-outputs
This updates all .g.dart and .mocks.dart files to include new methods.
Step 2: Identify new method calls in modified code paths
Trace the code path from the test's entry point. Look for any method calls on mocked services that were added or modified by the PR. Pay special attention to methods called after the already-stubbed method (e.g., enrichment/post-processing steps).
Step 3: Add stubs for ALL methods in the call chain
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 8d ago First seen · 138 lines · 186 tokens per session scan A 9df0145ebcf5
mockito-stale-mock-silent-trycatch-failure is a skill published in the GitHub repository divinevideo/divine-mobile (264 stars, last pushed today), licensed MPL-2.0. It adds 186 tokens to every session and 1,375 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
testing
Skill validation framework PLUS daily test-suite health and regression intelligence. Validates skill conformance (frontmatter, manifest coverage, resolver coverage). Runs the project test suite in tiered phases (unit / evals / integration / system health), classifies failures, and produces a regression-aware report.
verify
Verify that a change really works before you claim completion.
detect-static-dependencies
ACTIVATION PREREQUISITE: the request or discovered target must explicitly identify C#, .NET, .cs, or .csproj; otherwise stay dormant without invoking this skill. USE FOR: locating System.DateTime.Now/UtcNow, System.IO.File/Directory, System.Environment, HttpClient, Console, or Process usage in C#; auditing C# code for…
working-effectively-with-legacy-code
Apply Michael Feathers-inspired legacy-code rules when changing hard-to-test code safely with characterization tests, seams, sprout methods, or wrap methods.
refactoring-guru
Apply Refactoring.Guru-inspired rules when diagnosing code smells, choosing refactoring techniques, and stopping cleanup before uncontrolled redesign.
refactoring
Apply Martin Fowler-inspired refactoring rules when improving existing code structure while preserving observable behavior.