agentleFS
ZaxbyHubZaxbyHub/opencode-swarm/.agents/skills/writing-tests/SKILL.md

writing-tests

Skill517 starsChanged 3 days agoMITView on GitHub

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.

We split this skill into the rules it gives an agent

5 rules. 0 are common, 0 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 36 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

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

    line 10
  2. Very specific:

    If the task also touches architecture, plugin initialization, subprocesses, tool registration, plan durability, .swarm storage, runtime …

    line 17
  3. Very specific:

    Use apply_patch for manual test/source edits.

    line 21
  4. Very specific:

    Use the available shell execution tool for bun --smol test, per-file loops, rg, and validation commands.

    line 22
  5. Very specific:

    Prefer shell test commands for repo validation.

    line 23

“Common” is measured: kept by at least 6 in 10 of the 36 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.