divine-mobile: Skill for Claude Code

.agents/skills/mockito-stale-mock-silent-trycatch-failure/SKILL.md

mockito-stale-mock-silent-trycatch-failure is a skill for Claude Code, Codex from divinevideo/divine-mobile. It costs 186 tokens per session (1,375 once invoked), scanned A, original, MPL-2.0.

A guide to diagnosing Flutter and Dart tests that use Mockito, a library for creating fake services. It explains why generated test doubles can become outdated and why caught errors may appear as empty or default test results.

In plain words
What is it for?
Use it when tests fail after adding service methods, generated mock files are stale, or CI reports that generated files are out of date. It helps trace empty results back to missing stubs.
Why use it?
It removes misleading failures where a test expects data but receives an empty list because a missing mock method error was hidden by try/catch code.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code; installed under .agents/ (shared by several agents).

This is divinevideo/divine-mobile's own configuration. It tells Claude Code and Codex how to work on divine-mobile itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything divine-mobile configures →

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/divinevideo/divine-mobile/main/.agents/skills/mockito-stale-mock-silent-trycatch-failure/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/divinevideo/divine-mobile

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for mockito-stale-mock-silent-trycatch-failure

README.md
[![agentmods](https://agentmods.dev/badge/skills/divinevideo/divine-mobile/mockito-stale-mock-silent-trycatch-failure/github.svg)](https://agentmods.dev/skills/divinevideo/divine-mobile/mockito-stale-mock-silent-trycatch-failure)
Your own site
<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.

agentmods 80×15 button for mockito-stale-mock-silent-trycatch-failure

Your own site · 80×15
<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>
Per session 186 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,375 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 8d ago against content hash 9df0145ebcf5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

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.

.agents/skills/mockito-stale-mock-silent-trycatch-failure/SKILL.md · 138 lines

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 MissingStubError in 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

Read the full file on GitHub · 138 lines

Changes

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.

  1. 8d ago First seen · 138 lines · 186 tokens per session scan A 9df0145ebcf5

Subscribe to this mod's changes

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.

Related

Other skills, from other repositories