TestDriver Cache Tuning Reference
A reference skill for configuring and debugging TestDriver's screenshot-based cache to speed up AI test runs.
Dev & CodingIntermediate★ 243⑂ 37AI score 7/10Last updated: Sep 21, 2026
What it does
- Gives Claude accurate knowledge of TestDriver SDK caching: screen-level pixel diff plus OpenCV template matching on the cached element crop.
- Generates config code for
cache.thresholds.find.screen,element, andassertwith correct defaults and ranges. - Explains threshold resolution order (per-command option > legacy numeric arg > constructor config > hard-coded defaults) so changes are predictable.
- Documents auto-generated
cacheKey(first 16 hex chars of the test file's SHA-256), automatic invalidation, and cache partitioning by OS and resolution. - Helps diagnose misses via
getDebugInfo()fieldscacheHit,similarity,cacheSimilarity.
Who it's for
- QA engineers and developers running TestDriver AI E2E tests who want fewer AI calls and faster suites.
- Teams hitting flaky results because a cached element position is reused when it shouldn't be.
- Anyone debugging poor cache reuse across CI machines with different OS or screen resolutions.
Examples
- "My login test rarely hits cache — how should I tune screen/element thresholds?" → guidance around the 0.05 / 0.8 defaults with ready-to-paste snippets.
- "Make just this assertion strict" →
assert('dashboard loaded', { cache: { threshold: 0.01 }, cacheKey: 'dashboard-check' }). - "Disable caching only in CI" → set
TD_NO_CACHE=trueor passnew TestDriver({ cache: false }).
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/testdriverai/testdriverai/HEAD/ai/skills/testdriver-cache/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the ai/skills/testdriver-cache folder from the GitHub repo testdriverai/testdriverai into my ~/.claude/skills/testdriver-cache/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/testdriverai/testdriverai.git /tmp/testdriverai && mkdir -p ~/.claude/skills/testdriver-cache && cp -r /tmp/testdriverai/ai/skills/testdriver-cache/* ~/.claude/skills/testdriver-cache/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal.
- Clone the repo:
git clone https://github.com/testdriverai/testdriverai.git - Create the skill folder:
mkdir -p ~/.claude/skills/testdriver-cache - Copy the files:
cp -r testdriverai/ai/skills/testdriver-cache/* ~/.claude/skills/testdriver-cache/ - Restart Claude Code and confirm
testdriver:cacheappears in your skills list. - To use it for real work, install the SDK in your project (
npm i testdriverai) and ask Claude to wire upnew TestDriver({ cache: { ... } })in your test file.