workers-vitest-pool

workers-vitest-pool is a skill for OpenCode from rianvdm/product-ai-public. It costs 53 tokens per session (4,467 once invoked), scanned A, original, MIT.

A setup and upgrade guide for testing Cloudflare Workers with Vitest, a JavaScript testing tool, and Cloudflare's Workers test environment.

In plain words
What is it for?
It helps scaffold Worker tests, upgrade older test setups, and fix errors such as “Isolated storage failed” when using Durable Objects.
Why use it?
It addresses a known storage-isolation failure involving SQLite-backed Durable Objects and older package versions.

Skill for OpenCode

Written for OpenCode: installed under .opencode/.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import type { Env as WorkerEnv } from "../src/index";.

Good fit It helps scaffold Worker tests, upgrade older test setups, and fix errors such as “Isolated storage failed” when using Durable Objects.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/rianvdm/product-ai-public
agentmods
npx agentmods add skills/rianvdm/product-ai-public/workers-vitest-pool

Made for: OpenCode.

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 workers-vitest-pool

README.md
[![agentmods](https://agentmods.dev/badge/skills/rianvdm/product-ai-public/workers-vitest-pool/github.svg)](https://agentmods.dev/skills/rianvdm/product-ai-public/workers-vitest-pool)
Your own site
<a href="https://agentmods.dev/skills/rianvdm/product-ai-public/workers-vitest-pool"><img src="https://agentmods.dev/badge/skills/rianvdm/product-ai-public/workers-vitest-pool/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 workers-vitest-pool

Your own site · 80×15
<a href="https://agentmods.dev/skills/rianvdm/product-ai-public/workers-vitest-pool"><img src="https://agentmods.dev/badge/skills/rianvdm/product-ai-public/workers-vitest-pool.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,467 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 warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium MCP Rug Pull · line 159
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
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.00053 $0.04467
Opus 5.5 $0.00021 $0.01787
Sonnet 5.5 $0.00011 $0.00893
Haiku 4.5 $0.00005 $0.00447

Measured 25d ago against content hash a0d572048e89, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

workers-vitest-pool 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 25d 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.

.opencode/skills/workers-vitest-pool/SKILL.md · 329 lines

How it starts

The opening of the file, as written. The whole thing — 329 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Workers vitest pool: known-good setup + v2→v4 upgrade recipe

Cloudflare's @cloudflare/vitest-pool-workers had a long-lived bug in the 0.5.x line where the per-test storage isolation snapshot asserts every persist file ends in .sqlite, but SQLite-backed Durable Objects in WAL mode produce .sqlite-shm and .sqlite-wal files alongside. The bug manifests as:

Failed to pop isolated storage stack frame in <test name>'s test "<...>".
In particular, we were unable to pop Durable Objects storage.
- AssertionError [ERR_ASSERTION]: Expected .sqlite, got .../foo.sqlite-shm

Upstream fix landed in @cloudflare/[email protected], which requires vitest 4 and Node 22+. This skill captures the canonical setup and the migration recipe — battle-tested in tldl (PR #39, 2026-05-02).

The package has since been renamed. @cloudflare/[email protected] prints on every run that it is now @cloudflare/vitest-plugin and gets no further updates; the migration is npx @cloudflare/codemods vitest:pool-workers-to-vitest-plugin. The recipe below is still right for getting off the broken 0.5–0.12 line, but finish by moving to the plugin, and check whether the wrangler pin rule carries over (npm view @cloudflare/vitest-plugin dependencies.wrangler). The plugin path itself is untested here (tracked in elereada-v2 #3).

When to use this skill

  • Scaffolding tests in a new Worker. Use the "Known-good setup" section to pin the modern stack from day one.
  • An existing Worker is on pool-workers 0.5.x / 0.6.x / 0.7.x / 0.8.x / 0.9.x / 0.10.x / 0.11.x / 0.12.x. Even if tests appear to pass, the bug is latent — any test that uses a SQLite-backed Durable Object will hit it eventually. Run the migration.
  • Tests are reporting "Isolated storage failed" or "Expected .sqlite, got .sqlite-shm". That is exactly this bug.

Known-good setup (use this for new projects)

// package.json — devDependencies
{
  "@cloudflare/vitest-pool-workers": "^0.22",
  "@cloudflare/workers-types": "^5",
  "@types/node": "^22",
  "typescript": "^5",
  "vitest": "^4",
  "wrangler": "4.124.0"
}

Read the full file on GitHub · 329 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. 25d ago Changed · +45 lines · -67 tokens per session a0d572048e89
  2. 2mo ago Changed 39712de264a9
  3. 3mo ago First seen · 284 lines · 120 tokens per session scan A 3280a4f81297

Subscribe to this mod's changes

workers-vitest-pool is a skill published in the GitHub repository rianvdm/product-ai-public (21 stars, last pushed 16d ago), licensed MIT. It adds 53 tokens to every session and 4,467 once invoked, about $0.0002 per session on Opus 5.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-08-30.

Related

workers-vitest-pool compared with skills from other repositories

workers-vitest-pool next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
workers-vitest-poolrianvdm/product-ai-publicSkill2116d agoMITA53OpenCode
test-masterJeffallan/claude-skillsSkill13kyesterdayMITA104Claude Code
migrate-xunit-to-xunit-v3dotnet/skillsSkill6.5ktodayMITA149Claude Code
go-testingGentleman-Programming/gentle-aiSkill9.8k2d agoMITA26Claude Code, Codex
dart-testdartsim/dartSkill1.2k2d agoBSD-2-ClauseA18Claude Code, Codex
restore-internals-seams-in-finally-blocks-after-each-testZaxbyHub/opencode-swarmSkill557todayMITA26OpenCode
test-generatorrshankras/claude-code-apple-skillsSkill92827d agoMITA33Claude Code