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

writing-tests

Skill485 starsChanged 3 months 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.

16 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use create-tasks and reviewing-code.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • NTCodingSkill

    create-tasks

    Creates well-formed tasks following a template that engineers can implement. Triggers on: 'create tasks', 'define work items', 'break this down', creating tasks from PRD, converting requirements into actionable tasks, feature breakdown, sprint planning.

    Also in 3 projects that use this

  • augmntSkill

    reviewing-code

    Provides structured code review with prioritized feedback. Use when reviewing PRs, analyzing code quality, checking for bugs, or auditing changes. Triggers on "review this", "check this code", PR reviews, or code quality questions.

    Also in 3 projects that use this

The file

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 16 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 9
  2. Very specific:

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

    line 16
  3. Very specific:

    Use apply_patch for manual test/source edits.

    line 20
  4. Very specific:

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

    line 21
  5. Very specific:

    Prefer shell test commands for repo validation.

    line 22

“Common” is measured: kept by at least 6 in 10 of the 16 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.