mock-module

mock-module is a skill for Claude Code, Codex from ZaxbyHub/opencode-swarm. It costs 5 tokens per session (206 once invoked), scanned A, original, MIT.

A rule for mocking built-in Node.js modules while retaining the exports that were not replaced.

In plain words
What is it for?
Use it when mocking Node.js built-ins in tests, particularly when the mocked module has several exports.
Why use it?
It prevents mocks from removing unrelated functionality and causing failures in other tests.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/zaxbyhub/opencode-swarm/mock-module
Any agent
npx skills add ZaxbyHub/opencode-swarm --skill mock-module
Clone the repo
git clone --depth 1 https://github.com/ZaxbyHub/opencode-swarm

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 mock-module

README.md
[![agentmods](https://agentmods.dev/badge/skills/zaxbyhub/opencode-swarm/mock-module.svg)](https://agentmods.dev/skills/zaxbyhub/opencode-swarm/mock-module)
Your own site
<a href="https://agentmods.dev/skills/zaxbyhub/opencode-swarm/mock-module"><img src="https://agentmods.dev/badge/skills/zaxbyhub/opencode-swarm/mock-module.svg" alt="Measured on agentmods" height="20"></a>
Per session 5 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 206 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00005 $0.00206
Opus 5 $0.00003 $0.00103
Sonnet 5 $0.00001 $0.00041
Haiku 4.5 $0.00001 $0.00021

Measured 2d ago against content hash 9f18962e4348, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mock-module 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 2d 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/generated/mock-module/SKILL.md · 42 lines

What it actually says

mock.module

Trigger

  • mock.module

Required Procedure

  • spread real module exports when mocking node: built-ins to prevent cross-test pollution

Forbidden Shortcuts

  • mock.node.builtins without spreading the real module's exports

Delegation Template

When delegating a task affected by this skill, include:

SKILLS: file:.opencode/skills/generated/mock-module/SKILL.md

Reviewer Checks

  • Verify each required action above appears in the diff.
Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 2d ago First seen · 42 lines · 5 tokens per session scan A 9f18962e4348

Subscribe to this mod's changes

mock-module is a skill published in the GitHub repository ZaxbyHub/opencode-swarm (464 stars, last pushed today), licensed MIT. It adds 5 tokens to every session and 206 once invoked, about $0.0000 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

writing-tests

Write unit tests, component tests, and integration tests for AiderDesk using Vitest and React Testing Library. Use when creating new tests, adding test coverage, configuring mocks, setting up test files, or debugging failing tests.

hotovo/aider-desk · 48 tokens

moai-ref-testing-pyramid

Test pyramid strategy, coverage targets, test patterns, and quality metrics reference. Agent-extending skill that amplifies manager-develop test-creation and quality-validation work with production-grade testing patterns. NOT for: production code implementation, architecture design, DevOps, security audits.

modu-ai/moai-adk · 61 tokens

java-unit-test

为 Spring Boot 项目生成高质量 Java 单元测试代码。当用户要求"写单元测试"、"生成测试用例"、"帮我写 test"、"补充测试覆盖"、"写 JUnit 测试"、"写 Mockito 测试"、"测试这个 Service / Controller / Mapper"时,必须使用此 skill。即使用户只是说"帮我测一下这个方法"或贴出 Java 代码并问"怎么测",也应触发此 skill。.

hashgraph-online/awesome-codex-plugins · 113 tokens

running-julia-test

Before running tests for a new package, make sure the test environment is already set up. If the package does not have tests yet, follow creating-julia-test-env first. Tests that use using Test must have Test available from the package or test project.

hashgraph-online/awesome-codex-plugins · 10 tokens

memstack-development-test-writer

Use this skill when the user says 'write tests', 'add tests', 'test coverage', 'unit tests', 'integration tests', 'component tests', 'mocking', 'edge cases', or needs to generate tests with proper mocking and edge case coverage. Do NOT use for refactoring plans or database migrations.

cwinvestments/memstack · 70 tokens

typescript

TypeScript strict mode with eslint and jest.

alinaqi/maggy · 10 tokens