grep-for-mock-module… — Claude Code and Codex skill for test mocks
grep-for-mock-module-across-the-entire-test-file-and-confirm-eve is a Claude Code skill that checks every mock.module call in a test file for real-export spreads during a Vitest-to-Bun migration.
MIT ★ 539 updated 2026-10-29
npx skills add ZaxbyHub/opencode-swarm --skill grep-for-mock-module-across-the-entire-test-file-and-confirm-eve -a claude-codeWhat grep-for-mock-module-across-the-entire-test-file-and-confirm-eve does
This one covers a gap in a Vitest-to-Bun move: a test file gets marked converted while some mock.module calls still spread nothing. The procedure is a full sweep — find every occurrence in the file, check that real module exports are spread into each mock, and only then flip the status. One missed call and the file is not done.
The skill ships trigger phrases, the required procedure, a delegation snippet that points an agent at its SKILL.md, and two checklists: one for the reviewer, one for whoever writes the tests. It comes from the opencode-swarm generator, version 2.
The reviewer check greps with --include='*.test.ts'. Tests named *.spec.ts sit outside that filter, so widen the pattern before you trust a clean run.
What it helps with
- sweep a test file for every
mock.modulecall before conversion - confirm each mock spreads real module exports
- stop a file from being marked converted too early
- hand a subagent the skill path in the delegation prompt
- cover the trigger condition with a test
Example prompts for the agent
- Sweep
checkout.test.tsformock.modulecalls and tell me which ones don't spread the real exports. - We're moving these tests from Vitest to Bun — list the files that still need converting.
- Before you mark the file converted, run
grep --include='*.test.ts' 'mock\.module'and check each call.
How to install grep-for-mock-module-across-the-entire-test-file-and-confirm-eve
1Skills CLI (Vercel)
npx skills add ZaxbyHub/opencode-swarm --skill grep-for-mock-module-across-the-entire-test-file-and-confirm-eve -a claude-code2Manually: put the files in place
~/.claude/skills/grep-for-mock-module-across-the-entire-test-file-and-confirm-eve/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/grep-for-mock-module-across-the-entire-test-file-and-confirm-eve/
1Skills CLI (Vercel)
npx skills add ZaxbyHub/opencode-swarm --skill grep-for-mock-module-across-the-entire-test-file-and-confirm-eve -a codex2Manually: put the files in place
.agents/skills/grep-for-mock-module-across-the-entire-test-file-and-confirm-eve/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add ZaxbyHub/opencode-swarm --skill grep-for-mock-module-across-the-entire-test-file-and-confirm-eve -a cursor2Manually: put the files in place
.cursor/skills/grep-for-mock-module-across-the-entire-test-file-and-confirm-eve/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install ZaxbyHub/opencode-swarm .opencode/skills/generated/grep-for-mock-module-across-the-entire-test-file-and-confirm-eve2Manually: put the files in place
.github/skills/grep-for-mock-module-across-the-entire-test-file-and-confirm-eve/SKILL.md1Skills CLI (Vercel)
npx skills add ZaxbyHub/opencode-swarm --skill grep-for-mock-module-across-the-entire-test-file-and-confirm-eve -a gemini-cli2Platform CLI
gemini skills install https://github.com/ZaxbyHub/opencode-swarm --path .opencode/skills/generated/grep-for-mock-module-across-the-entire-test-file-and-confirm-eveManually: put the files in place
.devin/skills/grep-for-mock-module-across-the-entire-test-file-and-confirm-eve/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add ZaxbyHub/opencode-swarm --skill grep-for-mock-module-across-the-entire-test-file-and-confirm-eve -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 grep-for-mock-module-across-the-entire-test-file-and-confirm-eve
How do I install the skill in Claude Code?
Run npx skills add ZaxbyHub/opencode-swarm --skill grep-for-mock-module-across-the-entire-test-file-and-confirm-eve -a claude-code. The skill lands at ~/.claude/skills/grep-for-mock-module-across-the-entire-test-file-and-confirm-eve/SKILL.md.
What does this skill do?
It makes the agent search a whole test file for mock.module and verify that every call spreads the real exports before anyone marks that file converted.
Does it cover .spec.ts files?
The reviewer check greps only *.test.ts, so tests with another suffix slip past that pattern.
Source text
SKILL.md · MIT
--- name: grep-for-mock-module-across-the-entire-test-file-and-confirm-eve description: "grep for 'mock.module' across the entire test file and confirm every occurrence uses spread-real-exports before marking the file as converted" metadata: triggers: '["mock.module conversion","vitest to bun migration"]' generated_from_knowledge: '[]' source_knowledge_ids: '[]' generated_at: "2026-07-02T02:35:49.878Z" 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. --> # grep for 'mock.module' across the entire test file and confirm every occurrence uses spread-real-exports before marking the file as converted ## Trigger - mock.module conversion - vitest to bun migration ## Required Procedure - grep for 'mock.module' across the entire test file and confirm every occurrence uses spread-real-exports before marking the file as converted ## Forbidden Shortcuts - (none recorded) ## Delegation Template When delegating a task affected by this skill, include: ``` SKILLS: file:.opencode/skills/generated/grep-for-mock-module-across-the-entire-test-file-and-confirm-eve/SKILL.md ``` ## Reviewer Checks - grep --include='*.test.ts' 'mock\.module' and verify each call spreads real exports ## Test Engineer Checks - Add or update tests covering the trigger condition and the forbidden shortcut.
© ZaxbyHub · MIT · ZaxbyHub/opencode-swarm