restore-internals-seams-in-finally-blocks-after-each-test
restore-internals-seams-in-finally-blocks-after-each-test is a Claude Code skill that directs agents to restore original _internals in finally after each test of error paths through DI seams.
MIT ★ 539 updated 2026-10-29
npx skills add ZaxbyHub/opencode-swarm --skill restore-internals-seams-in-finally-blocks-after-each-test -a claude-codeWhat restore-internals-seams-in-finally-blocks-after-each-test does
For tests that exercise error handling through _internals DI seams, the skill requires restoring the original implementations in finally after each test. Otherwise, changed implementations can affect other tests in Bun’s shared runner process and trigger cascading failures.
It also calls for checking seam restoration in afterEach. Reviewers should look for both actions in the diff, and test engineers should add or update tests for the relevant condition. This is guidance for test changes, not a test-running script.
What it helps with
- restore original
_internalsimplementations after a test - prevent DI seam changes from affecting other tests
- check seam restoration in
afterEach - add tests for the restoration condition
Example prompts for the agent
- Check error-handling tests that use
_internalsand restore the original implementations infinallyafter each test. - Verify that
afterEachchecks seam restoration. - Update the tests to cover
_internalsrestoration after an error.
How to install restore-internals-seams-in-finally-blocks-after-each-test
1Skills CLI (Vercel)
npx skills add ZaxbyHub/opencode-swarm --skill restore-internals-seams-in-finally-blocks-after-each-test -a claude-code2Manually: put the files in place
~/.claude/skills/restore-internals-seams-in-finally-blocks-after-each-test/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/restore-internals-seams-in-finally-blocks-after-each-test/
1Skills CLI (Vercel)
npx skills add ZaxbyHub/opencode-swarm --skill restore-internals-seams-in-finally-blocks-after-each-test -a codex2Manually: put the files in place
.agents/skills/restore-internals-seams-in-finally-blocks-after-each-test/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add ZaxbyHub/opencode-swarm --skill restore-internals-seams-in-finally-blocks-after-each-test -a cursor2Manually: put the files in place
.cursor/skills/restore-internals-seams-in-finally-blocks-after-each-test/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install ZaxbyHub/opencode-swarm .opencode/skills/generated/restore-internals-seams-in-finally-blocks-after-each-test2Manually: put the files in place
.github/skills/restore-internals-seams-in-finally-blocks-after-each-test/SKILL.md1Skills CLI (Vercel)
npx skills add ZaxbyHub/opencode-swarm --skill restore-internals-seams-in-finally-blocks-after-each-test -a gemini-cli2Platform CLI
gemini skills install https://github.com/ZaxbyHub/opencode-swarm --path .opencode/skills/generated/restore-internals-seams-in-finally-blocks-after-each-testManually: put the files in place
.devin/skills/restore-internals-seams-in-finally-blocks-after-each-test/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add ZaxbyHub/opencode-swarm --skill restore-internals-seams-in-finally-blocks-after-each-test -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 restore-internals-seams-in-finally-blocks-after-each-test
How do I install restore-internals-seams-in-finally-blocks-after-each-test in Claude Code?
Run npx skills add ZaxbyHub/opencode-swarm --skill restore-internals-seams-in-finally-blocks-after-each-test -a claude-code. The skill file is at ~/.claude/skills/restore-internals-seams-in-finally-blocks-after-each-test/SKILL.md.
What does restore-internals-seams-in-finally-blocks-after-each-test do?
It instructs agents to restore original _internals DI seam implementations in finally after each error-handling test, then check restoration in afterEach.
Why restore _internals in finally?
The shared Bun test process can carry changed implementations into other tests. Restoring them helps prevent cascading failures.
Source text
SKILL.md · MIT
--- name: restore-internals-seams-in-finally-blocks-after-each-test description: restore _internals seams in finally blocks after each test metadata: generated_from_knowledge: '["5ef666bf-7c7b-4990-b652-20782bf9c866"]' source_knowledge_ids: '["5ef666bf-7c7b-4990-b652-20782bf9c866"]' generated_at: "2026-07-14T05:31:50.176Z" confidence: "0.60" status: active version: "1" 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. --> # restore _internals seams in finally blocks after each test ## Trigger - (no explicit trigger metadata; cluster derived from category/tags) ## Required Procedure - restore _internals seams in finally blocks after each test - verify seam restoration in afterEach ## Forbidden Shortcuts - (none recorded) ## Delegation Template When delegating a task affected by this skill, include: ``` SKILLS: file:.opencode/skills/generated/restore-internals-seams-in-finally-blocks-after-each-test/SKILL.md ``` ## Reviewer Checks - Verify each required action above appears in the diff. ## Test Engineer Checks - Add or update tests covering the trigger condition and the forbidden shortcut. ## Source Knowledge IDs - 5ef666bf-7c7b-4990-b652-20782bf9c866 — When testing error-handling paths via _internals DI seams, always restore original implementations in a finally block to prevent cross-test pollution that causes cascading failures in Bun's shared test-runner process
© ZaxbyHub · MIT · ZaxbyHub/opencode-swarm