spread-real-module-exports-as-base-of-every-mock-module-return-o
spread-real-module-exports-as-base-of-every-mock-module-return-o is a Claude Code skill that sets a pattern for objects returned by mock.module. It activates around that pattern and Node’s built-in mocking.
MIT ★ 539 updated 2026-10-29
npx skills add ZaxbyHub/opencode-swarm --skill spread-real-module-exports-as-base-of-every-mock-module-return-o -a claude-codeWhat spread-real-module-exports-as-base-of-every-mock-module-return-o does
The skill requires each object returned by mock.module to start with the real module’s exports. This applies to module mocks in Node.js tests.
Its review check looks for mock.module calls that omit the real-module spread. When handing related work to another agent, the skill provides the path .opencode/skills/generated/spread-real-module-exports-as-base-of-every-mock-module-return-o/SKILL.md.
What it helps with
- include real exports in a
mock.modulereturn object - find
mock.modulecalls missing the real-module spread - pass the mocking rule to another agent working with
node:modules
Example prompts for the agent
- Apply the real-export spread pattern to the
mock.modulecalls in these tests. - Find
mock.modulecalls whose return objects omit the real module’s exports. - Pass this skill to the agent editing built-in
node:mocks.
How to install spread-real-module-exports-as-base-of-every-mock-module-return-o
1Skills CLI (Vercel)
npx skills add ZaxbyHub/opencode-swarm --skill spread-real-module-exports-as-base-of-every-mock-module-return-o -a claude-code2Manually: put the files in place
~/.claude/skills/spread-real-module-exports-as-base-of-every-mock-module-return-o/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/spread-real-module-exports-as-base-of-every-mock-module-return-o/
1Skills CLI (Vercel)
npx skills add ZaxbyHub/opencode-swarm --skill spread-real-module-exports-as-base-of-every-mock-module-return-o -a codex2Manually: put the files in place
.agents/skills/spread-real-module-exports-as-base-of-every-mock-module-return-o/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add ZaxbyHub/opencode-swarm --skill spread-real-module-exports-as-base-of-every-mock-module-return-o -a cursor2Manually: put the files in place
.cursor/skills/spread-real-module-exports-as-base-of-every-mock-module-return-o/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install ZaxbyHub/opencode-swarm .opencode/skills/generated/spread-real-module-exports-as-base-of-every-mock-module-return-o2Manually: put the files in place
.github/skills/spread-real-module-exports-as-base-of-every-mock-module-return-o/SKILL.md1Skills CLI (Vercel)
npx skills add ZaxbyHub/opencode-swarm --skill spread-real-module-exports-as-base-of-every-mock-module-return-o -a gemini-cli2Platform CLI
gemini skills install https://github.com/ZaxbyHub/opencode-swarm --path .opencode/skills/generated/spread-real-module-exports-as-base-of-every-mock-module-return-oManually: put the files in place
.devin/skills/spread-real-module-exports-as-base-of-every-mock-module-return-o/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add ZaxbyHub/opencode-swarm --skill spread-real-module-exports-as-base-of-every-mock-module-return-o -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about spread-real-module-exports-as-base-of-every-mock-module-return-o
How do I install spread-real-module-exports-as-base-of-every-mock-module-return-o in Claude Code?
Run npx skills add ZaxbyHub/opencode-swarm --skill spread-real-module-exports-as-base-of-every-mock-module-return-o -a claude-code, then use ~/.claude/skills/spread-real-module-exports-as-base-of-every-mock-module-return-o/SKILL.md.
What does spread-real-module-exports-as-base-of-every-mock-module-return-o do?
It requires each mock.module return object to include the real module’s exports. It also calls for checking mock calls that lack that spread.
What belongs in a mock.module return object?
The real module’s exports form the base of the object, with the required mocks added to it.
Source text
SKILL.md · MIT
--- name: spread-real-module-exports-as-base-of-every-mock-module-return-o description: spread real module exports as base of every mock.module return object metadata: triggers: '["mock.module spread pattern","node: built-in mock"]' generated_from_knowledge: '[]' source_knowledge_ids: '[]' generated_at: "2026-07-02T02:35:49.913Z" confidence: "0.60" status: active version: "2" skill_origin: generated --- <!-- generated by opencode-swarm skill-generator. Do not edit by hand; edits will be preserved on regeneration only with controlled update mode. --> # spread real module exports as base of every mock.module return object ## Trigger - mock.module spread pattern - node: built-in mock ## Required Procedure - spread real module exports as base of every mock.module return object ## Forbidden Shortcuts - (none recorded) ## Delegation Template When delegating a task affected by this skill, include: ``` SKILLS: file:.opencode/skills/generated/spread-real-module-exports-as-base-of-every-mock-module-return-o/SKILL.md ``` ## Reviewer Checks - grep for mock.module patterns that lack ...realModule spread ## Test Engineer Checks - Add or update tests covering the trigger condition and the forbidden shortcut.
© ZaxbyHub · MIT · ZaxbyHub/opencode-swarm