SkillsReviewed · testdriverai

TestDriver Cache Skill

testdriver:cache is an assistant skill for developers configuring TestDriver UI-test caching, but visual similarity determines when earlier results are reused. It explains screenshot comparisons, OpenCV element matching, automatic cache keys, configuration overrides and debugging. No measured speedup is provided.

Researched 16 Nov 2026

In short.

testdriver:cache is an assistant skill for developers tuning TestDriver UI-test caching, but cache hits reuse earlier results without a fresh AI call. The documented find() workflow sends screenshots and cache metadata to the API, checks screen differences and element matching, and requests a fresh AI result when reuse fails. The file provides detailed configuration guidance, but measured performance, current SDK compatibility, pricing, screenshot retention and licence terms are unknown. Nothing was executed.

Researched and written by an AI model and checked by a second AI model. How it works

The selected scope is ai/skills/testdriver-cache and its files, with licence notices beside and above it. The supplied manifest lists only ai/skills/testdriver-cache/SKILL.md at revision 97d4d35d7727b2f83b1a73282aabf2e6e74824a2. No companion files or related licence notices are supplied. The SDK and API implementations, upstream cache.mdx, service terms and benchmarks are outside the available evidence. No code was executed; runtime behavior, performance, compatibility and costs remain unverified.

The overview

Identity

The resource is the testdriver:cache skill in ai/skills/testdriver-cache/SKILL.md within testdriverai/testdriverai. It documents TestDriver's screenshot-based cache through explanations, JavaScript examples and TypeScript interfaces. The caching functionality belongs to the TestDriver SDK and API; this file supplies guidance for using it.

The file identifies itself as generated from cache.mdx. That upstream documentation source and the cache implementation are not included in the supplied material.

Assessment

The skill offers concrete help for developers who already use TestDriver and want control over repeated visual lookups. Its useful detail includes default thresholds, per-command overrides, automatic invalidation and cache diagnostics.

Its stated benefit is avoiding AI calls when cached results pass visual checks. The evidence contains no benchmarks, accuracy measurements or observed runs, so the size of any speed improvement and the reliability of reuse are not established.

Users

The clearest audience is developers and test engineers maintaining TestDriver UI tests, including people using an assistant to configure those tests. Beginners receive an explanation of screen and element matching; experienced users receive configuration types, precedence rules and OpenCV algorithm details.

As an inference from its matching rules, repeated tests with visually stable screens are plausible candidates for cache reuse. The file does not establish expected hit rates for animated interfaces, frequently changing content or particular application types.

Capabilities

The documented controls cover enabling or disabling caching, setting screen-difference limits, setting an element-match threshold for find(), and setting an assertion screen-difference limit. The find threshold configuration also applies to findAll(), but its element threshold is explicitly excluded from findAll().

Cache keys can be generated from test-file contents or supplied manually. Entries are partitioned by key, operating system and screen resolution. Debug metadata exposes cacheHit, similarity and cacheSimilarity; despite its name, similarity represents a pixel-difference percentage, so lower values indicate closer screens.

Using it

Requirements

The examples assume access to the TestDriver SDK, screenshots and the TestDriver API. Caching requires a valid cacheKey, even when cache.enabled is true. Automatic key generation requires the SDK to locate and read the calling test file.

The file does not specify package installation, authentication, supported SDK or runtime versions, or how to install the skill into an assistant. Screenshot transmission is described, but retention, deletion, storage location and access controls are unknown.

Mechanism

For find(), the SDK sends the current screenshot and cache metadata to the API. The API compares the screen with cached results under the same key. Cached coordinates are returned when the screen-difference check and element-template check pass; otherwise, a new AI call supplies a result that is cached.

Element validation uses OpenCV TM_CCOEFF_NORMED normalized correlation to match a cached image crop against the current screenshot. The described algorithm tries scale factors of 1, 0.5, 2, 0.75, 1.25 and 1.5, extracts match positions and returns coordinates and dimensions.

Automatic cache keys use the first 16 hexadecimal characters of a SHA-256 hash of the calling test file's contents. Changing that file changes its automatic key. Operating-system and resolution partitions further restrict which entries can be reused.

Setup

The documented constructor defaults are cache.enabled: true, cache.thresholds.find.screen: 0.05, cache.thresholds.find.element: 0.8 and cache.thresholds.assert: 0.05. The screen value allows a 5% pixel difference; the element value is a correlation threshold, not an accuracy measurement. An explicit cacheKey overrides automatic generation.

Per-command options take precedence over a legacy numeric argument, which takes precedence over constructor settings and then hard-coded defaults. The documented disable options are new TestDriver({ cache: false }) and the TD_NO_CACHE=true environment variable. The file says disabling sets thresholds to -1 internally so the API skips cache lookups.

Example

A documented stricter lookup is await testdriver.find('submit button', { cache: { thresholds: { screen: 0.01, element: 0.95 } } }). This sets the screen-difference limit to 1% and the element-correlation threshold to 0.95 for that command.

For assertions, the file shows await testdriver.assert('dashboard loaded', { cache: { threshold: 0.01 }, cacheKey: 'dashboard-check' }). After a find(), el.getDebugInfo() exposes cache metadata for inspection. These are documentation examples; no execution or resulting cache hit is established.

Assessment & evidence

Limitations

Visual similarity alone does not establish application correctness or hidden state. As an inference from the pixel-difference rule, a small but meaningful screen change could remain within an allowed difference. The source supplies no measurements of false cache hits or missed reuse.

The element threshold does not apply to findAll(), and assertion caching receives less algorithmic detail than find(). The file also lists internal matching thresholds of 0.9, 0.8 and 0.7 without explaining how those trials interact with the configured element threshold.

Cache entries are partitioned by resolution, so the listed template-scaling attempts do not establish reuse across different resolution partitions. Expiration, eviction, storage limits, concurrent access and behavior when automatic key generation fails are unspecified.

Reasoning

The documented design combines a broad screen check with a targeted element check for find(). This gives developers two separate controls over when cached coordinates can replace a new AI lookup.

Lower screen limits and higher element thresholds demand closer matches. As an inference, stricter settings can reduce reuse opportunities, while looser settings permit greater visual variation. The file provides no measured basis for choosing an optimal threshold for a particular test suite.

Automatic keys invalidate reuse when the test file changes, but unchanged test code can still encounter a changed application. The screenshot and element checks remain relevant even when the key stays the same.

Alternatives

The directly documented alternative is disabling caching, which skips cache lookups. Within the cache feature, developers can use stricter per-command settings or explicit keys instead of relying entirely on defaults and automatic keys.

No external testing tools or competing caching systems are described. Comparative performance, pricing and compatibility with alternatives are therefore not assessed.

Evidence

The source is ai/skills/testdriver-cache/SKILL.md at repository revision 97d4d35d7727b2f83b1a73282aabf2e6e74824a2. Its original captured address is [https://raw.githubusercontent.com/testdriverai/testdriverai/97d4d35d7727b2f83b1a73282aabf2e6e74824a2/ai/skills/testdriver-cache/SKILL.md].

The supplied manifest records 7,466 bytes and file SHA-256 ab742d812987130234080aa865016072ebb994b2a0db90786e01a4bce2aeaeee. The evidence establishes what this documentation describes, without independently establishing SDK or API behavior. No code was executed.

Access & freshness

Costs

Pricing, subscriptions, usage limits and API-request charges are unknown. The file states that successful cache reuse avoids an AI call, but the documented find() path still contacts the API.

Fewer AI calls may affect runtime or charges, depending on service behavior and billing. Neither savings nor cache-processing overhead is quantified, and avoiding an AI call does not establish that a request is free.

Rights

The supplied SKILL.md contains no licence grant or reuse terms. No licence notices beside the file or in ancestor directories are included, so permission to copy, modify or redistribute the skill is unknown.

Terms governing the SDK, API and screenshots sent to the service are also not established by this file.

Freshness

The supplied capture timestamp is 2026-11-16T08:04:26.824Z, and the document is pinned to revision 97d4d35d7727b2f83b1a73282aabf2e6e74824a2. This identifies the source snapshot; it does not establish when the cache feature was released or last changed.

The file names no SDK release version. Compatibility with currently installed packages and any changes after the captured revision are unknown.

Actions

Before adopting the configuration, confirm that the installed SDK supports these options and establish API pricing and screenshot-handling terms. Obtain applicable licence terms before copying or redistributing the skill.

To evaluate fit for a particular suite, compare representative cached and cache-disabled runs and inspect cacheHit, similarity and cacheSimilarity. Include small meaningful UI changes, dynamic content and operating-system or resolution changes. Measure runtime, AI calls and incorrect reuse before claiming a benefit; none of those measurements is supplied here.

Evidence for this report

ai/skills/testdriver-cache/SKILL.mdselected · checked 2026-11-16