Writing tests

From ZaxbyHub/opencode-swarm · View interactive version

Writing tests is an AI agent skill from the GitHub repository ZaxbyHub/opencode-swarm. Codex adapter for opencode-swarm test authoring rules. Use before creating or modifying any test file in this repository, especially bun:test files, mock.module usage, _internals seams, temp directories, cross-platform tests, or CI-sensitive test structure.

How to use this skill

Skill file

Writing Tests

Use this Codex-facing adapter before touching tests in opencode-swarm.

Read, in order:

  1. AGENTS.md
  2. .opencode/skills/writing-tests/SKILL.md

If the task also touches architecture, plugin initialization, subprocesses, tool registration, plan durability, .swarm storage, runtime portability, session/global state, guardrails/retry, chat/system hooks, or release/cache behavior, also load .agents/skills/engineering-conventions/SKILL.md.

Codex-specific execution notes:

Carry forward the source skill's core rules: bun:test only, dependency injection or _internals over mock.module where possible, real module spreading when mocking Node built-ins, os.tmpdir() plus path.join(...) for temp paths, and per-file isolation for mock-heavy directories.

Regression tests must also be falsifiable: remove or bypass the fix, confirm the

test fails for the expected reason, restore the fix, and confirm the test passes;

record the evidence or document why an equivalent mutation was required.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.