# Mock To Internals Migration

> Codex adapter for migrating opencode-swarm tests away from Bun mock.module leakage toward _internals dependency-injection seams. Use when touching tests with mock.module, adding test seams, fixing Bun mock isolation failures, or updating source modules for injectable internals.

- Skill: `zaxbysauce/mock-to-internals-migration` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add zaxbysauce/mock-to-internals-migration`
- Raw SKILL.md: https://api.skillmd.com/api/skills/zaxbysauce/mock-to-internals-migration/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: zaxbysauce (https://skillmd.com/u/zaxbysauce)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/zaxbysauce/mock-to-internals-migration

---


# Mock To Internals Migration

Read `.opencode/skills/generated/mock-to-internals-migration/SKILL.md` for the canonical migration protocol.

Also load:

1. `.agents/skills/writing-tests/SKILL.md`
2. `.agents/skills/engineering-conventions/SKILL.md` if the seam touches runtime-sensitive code

Codex-specific execution notes:

- Use `apply_patch` for source and test edits.
- Use focused per-file `bun --smol test <file> --timeout 30000` validation first.
- Restore any `_internals` overrides in `afterEach`.
- Prefer small seams that expose only the dependency under test.

