Use when generating mocks, stubbing methods, verifying interactions, capturing arguments, or choosing between mocks, fakes, and real objects (Mockito).
npx skills add https://github.com/evanca/flutter-ai-rules --skill mockito
This skill defines how to correctly use the mockito package for mocking in Dart and Flutter tests.
| Use | When |
|---|---|
| Real object | Prefer over mocks when practical. |
| Fake (extends Fake) | Lightweight custom implementation; override only the methods you need. Prefer over mocks when you don't need interaction verification. |
| Mock (extends Mock) | Only when you need to verify interactions (call counts, arguments) or stub dynamic responses. |
verify assertions; otherwise prefer real or fake objects.@GenerateMocks([MyClass])
// or for nice mocks (return simple legal values for missing stubs):
@GenerateNiceMocks([MockSpec<MyClass>()])
void main() { ... }
dart run build_runner build
test/ for mock generation by default.build.yaml if you need to generate mocks outside of test/.@override methods or implementations to a class extending Mock.final mock = MockCat();
// Return a value
when(mock.sound()).thenReturn('Meow');
// Throw an error
when(mock.sound()).thenThrow(Exception('No sound'));
// Calculate response at call time
when(mock.sound()).thenAnswer((_) => computedValue);
// Return values in sequence
when(mock.sound()).thenReturnInOrder(['Meow', 'Purr']);
@GenerateMocks → throws; @GenerateNiceMocks → returns a simple legal value.throwOnMissingStub(mock) to throw on any unstubbed call.verify(mock.sound()); // called at least once
verifyNever(mock.eat(any)); // never called
verify(mock.sound()).called(2); // called exactly twice
Async:
await untilCalled(mock.sound()); // wait for the interaction
// Flexible stubbing
when(mock.eat(any)).thenReturn(true);
when(mock.eat(argThat(isNotNull))).thenReturn(true);
// Named arguments
when(mock.fetch(any, headers: any)).thenReturn(response);
null as an argument adjacent to an argument matcher.any or argThat as values, not as argument names.final captured = verify(mock.eat(captureAny)).captured;
print(captured.last); // last captured argument
Use captureThat for conditional capturing.
reset(mock); // clear all stubs AND interactions
clearInteractions(mock); // clear only recorded interactions
To mock a function type (e.g., a callback), define an abstract class with the required signature and generate mocks for it:
abstract class Callback {
void call(String value);
}
@GenerateMocks([Callback])
logInvocations([mock1, mock2]); // print all collected invocations
Integration with protocols.io API for managing scientific protocols. This skill should be used when working with protocols.io to search, create, update, or publish protocols; manage protocol steps and materials; handle discussions and comments; organize workspaces; upload and manage files; or integrate protocols.io functionality into workflows. Applicable for protocol discovery, collaborative protocol development, experiment tracking, lab protocol management, and scientific documentation.
Analyzes job descriptions and generates tailored resumes that highlight relevant experience, skills, and achievements to maximize interview chances
Generate Excalidraw diagrams from natural language descriptions. Use when asked to "create a diagram", "make a flowchart", "visualize a process", "draw a system architecture", "create a mind map", or "generate an Excalidraw file". Supports flowcharts, relationship diagrams, mind maps, and system architecture diagrams. Outputs .excalidraw JSON files that can be opened directly in Excalidraw.
Build and distribute Expo development clients locally or via TestFlight
Use when you have a written implementation plan to execute in a separate session with review checkpoints
Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.
Benchling R&D platform integration. Access registry (DNA, proteins), inventory, ELN entries, workflows via API, build Benchling Apps, query Data Warehouse, for lab data management automation.
Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.
Take evanca/mockito from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.