Skip to main content
skill CX Codex

run-affected-test-file-in-isolation-and-in-co-run-with-its-test- skill

run-affected-test-file-in-isolation-and-in-co-run-with-its-test- is a Claude Code skill that makes the agent run tests in isolation and with sibling files after mock cleanup changes.

MIT ★ 539 updated 2026-10-29

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add ZaxbyHub/opencode-swarm --skill run-affected-test-file-in-isolation-and-in-co-run-with-its-test- -a claude-code
Open on GitHub

What run-affected-test-file-in-isolation-and-in-co-run-with-its-test- does

The skill addresses a Bun issue: adding afterEach(() => mock.restore()) can break co-run if sibling tests rely on leaked mock state. The agent must verify both isolated and group execution before committing.

It contains three blocks: trigger (no explicit condition), required procedure (run tests in both modes), forbidden shortcut (adding afterEach without co-run check). Delegation references the SKILL.md file, verification happens through diff and test runs.

Auto-generated from the opencode-swarm knowledge base, source ID 1b7d37db-81d1-4b0d-90ab-85a7e68f90bf. Works without external dependencies — this is a test process rule.

What it helps with

  • run tests isolated and grouped after mock cleanup
  • catch leaked mock state between files in Bun
  • block commits with afterEach but no co-run verification

Example prompts for the agent

  • Run auth.test.ts isolated and with user.test.ts after adding mock.restore()
  • Check that tests in services/ pass both solo and together after mock changes
  • Add afterEach for mock cleanup and run all test-suite files

How to install run-affected-test-file-in-isolation-and-in-co-run-with-its-test-

1Skills CLI (Vercel)

npx skills add ZaxbyHub/opencode-swarm --skill run-affected-test-file-in-isolation-and-in-co-run-with-its-test- -a claude-code

2Manually: put the files in place

~/.claude/skills/run-affected-test-file-in-isolation-and-in-co-run-with-its-test-/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/run-affected-test-file-in-isolation-and-in-co-run-with-its-test-/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about run-affected-test-file-in-isolation-and-in-co-run-with-its-test-

How to install run-affected-test-file-in-isolation-and-in-co-run-with-its-test- in Claude Code?

Run npx skills add ZaxbyHub/opencode-swarm --skill run-affected-test-file-in-isolation-and-in-co-run-with-its-test- -a claude-code. The skill will land in ~/.claude/skills/run-affected-test-file-in-isolation-and-in-co-run-with-its-test-/SKILL.md.

What does run-affected-test-file-in-isolation-and-in-co-run-with-its-test- do?

It forces the agent to run tests twice after mock cleanup — first the single file, then the whole group — to catch leaked mock state between files in Bun.

Why check both isolated and co-run in Bun?

Adding afterEach(() => mock.restore()) can break co-run if neighbouring tests depend on leaked mocks. Both modes surface different failure patterns.

Source text

SKILL.md · MIT
---
name: run-affected-test-file-in-isolation-and-in-co-run-with-its-test-
description: run affected test file in isolation AND in co-run with its test-suite peers after mock cleanup changes
metadata:
  generated_from_knowledge: '["1b7d37db-81d1-4b0d-90ab-85a7e68f90bf"]'
  source_knowledge_ids: '["1b7d37db-81d1-4b0d-90ab-85a7e68f90bf"]'
  generated_at: "2026-07-06T14:02:41.500Z"
  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. -->

# run affected test file in isolation AND in co-run with its test-suite peers after mock cleanup changes

## Trigger

- (no explicit trigger metadata; cluster derived from category/tags)

## Required Procedure

- run affected test file in isolation AND in co-run with its test-suite peers after mock cleanup changes

## Forbidden Shortcuts

- add top-level afterEach mock.restore without verifying co-run with sibling test files

## Delegation Template

When delegating a task affected by this skill, include:

```
SKILLS: file:.opencode/skills/generated/run-affected-test-file-in-isolation-and-in-co-run-with-its-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

- 1b7d37db-81d1-4b0d-90ab-85a7e68f90bf — In Bun, adding afterEach(() => mock.restore()) to fix mock isolation can break co-run with sibling test files that depend on leaked mock state. Always verify both isolated and co-run behavior before committing mock cleanup changes.

© ZaxbyHub · MIT · ZaxbyHub/opencode-swarm

Similar skills

All skills for Testing and QA →

From the same set121

The whole set →
run-affected-test-suite-end-to-end-after-multi-file-signature-ch run-affected-test-suite-end-to-end-after-multi-file-signature-ch is a Claude Code skill that runs affected tests and checks every call site after function signatures change across files. CX Codex +1 ★ 539repo stars issue-tracer issue-tracer takes a bug from reproduction to a PR-ready fix: locates the cause, plans the change, and puts it through critic review. CX Codex +1 ★ 539repo stars confirm-failures-are-causally-linked-to-the-task-before-reportin confirm-failures-are-causally-linked-to-the-task-before-reportin is a Claude Code skill that separates pre-existing test failures from new regressions before rejecting work. CX Codex +1 ★ 539repo stars writing-tests writing-tests sets test-authoring rules for the opencode-swarm repository. Use it before changing tests that involve mocks, temporary paths, or regression checks. CX Codex +1 ★ 539repo stars update-or-delete-tests-that-assert-intentionally-removed-behavio update-or-delete-tests-that-assert-intentionally-removed-behavio is a Claude Code skill for revising or removing tests of deliberately removed behavior. It applies to code changes that retire a code path. CX Codex +1 ★ 539repo stars use-internals-di-seam-pattern-for-test-injectable-functions use-internals-di-seam-pattern-for-test-injectable-functions is a Claude Code skill that uses _internals as a DI seam and checks mock isolation in combined Bun test runs. CX Codex +1 ★ 539repo stars worktree-retry-cleanup worktree-retry-cleanup is a Claude Code skill that cleans up a swarm worktree lane before a task is dispatched again. CX Codex +1 ★ 539repo stars swarm Enables a rigorous swarm-style posture with parallel searches, visible plan updates, and dual review gates for code changes. CX Codex +1 ★ 539repo stars

Project sponsors

Companies that keep this analytics open