Skip to main content
skill CX Codex

writing-tests · zaxbyhub — Claude Code skill: tests and installation

writing-tests sets test-authoring rules for the opencode-swarm repository. Use it before changing tests that involve mocks, temporary paths, or regression checks.

MIT ★ 539 updated 2026-10-29

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add ZaxbyHub/opencode-swarm --skill writing-tests -a claude-code
Open on GitHub

What writing-tests does

Before editing tests, the skill directs you to read AGENTS.md, followed by .opencode/skills/writing-tests/SKILL.md. Tasks touching architecture and other listed areas also call for .agents/skills/engineering-conventions/SKILL.md.

The guidance requires bun:test and favors dependency injection or _internals over mock.module when practical. Temporary paths use os.tmpdir() with path.join(...); mock-heavy directories should be tested one file at a time. Regression tests need a falsifiable check: bypass the fix, confirm the test fails for the expected reason, then restore the fix and confirm it passes. In Codex, use apply_patch for manual edits and shell commands for test runs; avoid broad test_runner scopes.

What it helps with

  • check repository test rules before editing
  • choose a mock strategy for Node.js modules
  • build temporary paths for cross-platform tests
  • verify that a regression test catches the bug

Example prompts for the agent

  • Before changing tests, read the opencode-swarm guidance and check my edits.
  • Add a regression test for this bug and show that it fails without the fix.
  • Write a test using os.tmpdir() and path.join(...) for its temporary directory.

How to install writing-tests

1Skills CLI (Vercel)

npx skills add ZaxbyHub/opencode-swarm --skill writing-tests -a claude-code

2Manually: put the files in place

~/.claude/skills/writing-tests/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/writing-tests/

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

Questions about writing-tests

How do I install writing-tests in Claude Code?

Run npx skills add ZaxbyHub/opencode-swarm --skill writing-tests -a claude-code, then open ~/.claude/skills/writing-tests/SKILL.md.

What does writing-tests do?

It provides test-authoring rules for opencode-swarm, including guidance on mocks, temporary paths, and regression checks.

How should I verify a regression test with writing-tests?

Bypass the fix and confirm the test fails for the expected reason. Restore the fix and check that the test passes.

Source text

SKILL.md · MIT
---
name: writing-tests
description: 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.
metadata:
  audience: swarm-plugin
---

# 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:

- Use `apply_patch` for manual test/source edits.
- Use the available shell execution tool for `bun --smol test`, per-file loops, `rg`, and validation commands.
- Prefer shell test commands for repo validation. Do not use broad OpenCode `test_runner` scopes.
- Preserve unrelated user changes in the worktree.

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.

© ZaxbyHub · MIT · ZaxbyHub/opencode-swarm

Similar skills

All skills for Testing and QA →

writing-tests by other authors comes first.

writing-tests spencerpauly writing-tests inspects existing code, detects your test runner, and drafts unit and integration tests with mocks and edge cases. CX Codex +1 550installs writing-tests ZaxbyHub writing-tests is a Claude Code skill that directs the agent to opencode-swarm's test rules before it writes or edits tests. CX Codex +1 ★ 539repo stars writing-tests ZaxbyHub writing-tests is a Claude Code skill that sets test conventions for opencode-swarm. It loads before an agent edits a test file. CX Codex +1 ★ 539repo stars writing-unit-tests riekelt writing-unit-tests guides an agent through writing or revising unit tests around observable behavior. Useful for flaky tests, confusing cases, and new test coverage. CX Codex +1 25,700installs writing-mstest-tests dotnet writing-mstest-tests is a Claude Code skill for editing existing MSTest tests and explaining MSTest configuration. It activates for requests to fix test code or MSTest-specific settings. CX Codex +1 4,500installs writing-dev-server-tests oven-sh writing-dev-server-tests — a skill for Claude Code and five other platforms that teaches the agent to write hot-reload and dev server tests inside test/bake/. Kicks in when you create or edit bundling, HMR, or DevServer tests. CX Codex +1 1installs writing-playwright-tests open-metadata writing-playwright-tests is a skill that points to playwright for Playwright E2E authoring guidance and the required lint check. CX Codex +1 ★ 15,831repo stars bmad-qa-generate-e2e-tests bmad-code-org bmad-qa-generate-e2e-tests is a Claude Code skill that creates end-to-end and API tests for features already in use. It activates on requests to automate coverage for an existing feature. CX Codex +1 17,200installs run-tests dotnet run-tests picks the right dotnet test invocation for a .NET repository — classic, VSTest, bridged MTP or native MTP — and runs the scope you asked for. CX Codex +1 7,000installs

From the same set121

The whole set →
consult consult enforces an advisory protocol with strict read-before-cite checks and explicit uncertainty levels. CX Codex +1 ★ 539repo stars 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 run-affected-test-file-in-isolation-and-in-co-run-with-its-test- 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. 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

Project sponsors

Companies that keep this analytics open