Agent skill

Write Tests

by ryokun6 in ryokun6/ryos

Write and run ryOS tests with Bun's native test runner (bun:test).

AGPL-3.0Auto-check passedTesting & QA

Install Write Tests

skills CLI
$ npx skills add ryokun6/ryos --skill write-tests -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ryokun6/ryos write-tests --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ryokun6/ryos.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.cursor/skills/write-tests .claude/skills/write-tests && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
write-tests
GitHub stars
1.3k
Token cost
~1.7k tokens
SKILL.md length
427 words
Files
1
Skills in repo
10
Repo updated
First seen
Licence
AGPL-3.0

At a glance

Write and run ryOS tests with Bun's native test runner (bun:test).

  • Writing test coverage for a change
  • SKILL.md covers Layout, Two Kinds of Tests, Quick Start Checklist and Unit / Wiring Test, plus 4 more sections
  • Calls bun
  • Running/triaging the test suite

What it does

Write Tests is an agent skill from ryokun6/ryos. Write and run ryOS tests with Bun's native test runner (bun:test). Covers unit/wiring tests (no server) vs API integration tests (require the standalone API server), shared HTTP helpers, and the package.json suite commands. Use when adding tests, writing test coverage for a change, or running/triaging the test suite.

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Test generation, Third-party API integration and Test coverage. It works with npm and Redis. The repository describes itself as: ryOS, made with Cursor. The licence is AGPL-3.0.

When your agent uses it

  • Writing test coverage for a change
  • Running/triaging the test suite

Example prompts

  • “/write-tests”

What it can do on your machine

Read from SKILL.md and the folder at commit 4b48219. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • bun

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Write Tests loads about 1.7k tokens when it runs. Until then it costs about 83 tokens; SKILL.md has 427 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~83
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ryokun6/ryos at commit 4b48219, republished under its AGPL-3.0 licence (© ryokun6). 427 words, ~1,688 tokens.

Download SKILL.mdSave it as .claude/skills/write-tests/SKILL.md (or your agent's skills folder).
name
write-tests
description
Write and run ryOS tests with Bun's native test runner (bun:test). Covers unit/wiring tests (no server) vs API integration tests (require the standalone API server), shared HTTP helpers, and the package.json suite commands. Use when adding tests, writing test coverage for a change, or running/triaging the test suite.

Writing & Running ryOS Tests

ryOS uses Bun's native test runner (bun:test). Suites live under tests/, are named test-*.test.ts or test-*.test.tsx, and use describe / test / expect.

Layout

tests/
├── setup.ts              # Global preload
├── helpers/              # Shared helpers (not suites)
├── fixtures/
├── unit/<domain>/        # No-server unit / wiring
└── integration/
    ├── api/              # Needs `bun run dev:api`
    └── opt-in/           # Env-gated (e.g. REALTIME_LOCAL_URL)

Two Kinds of Tests

KindWhat it coversNeeds API server?Suite command
Unit / wiringPure logic, Zod schemas, store reducers, helper functions, "is X wired to Y" checksNobun run test:unit
API integrationReal HTTP against api/* endpointsYes (bun run dev:api)bun run test:api

Prefer a unit test when the logic can be exercised without a server (most schema/util/store work). Add an API integration test when you need the real request → handler → Redis path.

Quick Start Checklist

- [ ] 1. Decide: unit/wiring (no server) or API integration (needs server)
- [ ] 2. Create tests/unit/<domain>/test-<feature>.test.ts
       or tests/integration/api/test-<feature>.test.ts
- [ ] 3. Use describe / test / expect from "bun:test"
- [ ] 4. For API tests, use helpers from tests/helpers/test-utils.ts
- [ ] 5. For API or opt-in tests, add the file to `scripts/test-groups.ts`
- [ ] 6. Run `bun run test:registration`; iterate until green
- [ ] 7. Run it; iterate until green

Unit / Wiring Test

No server required. Import the code under test directly. Schema tests are the highest-value, lowest-friction kind.

typescript
import { describe, expect, test } from "bun:test";
import { mediaControlSchema } from "../../../api/chat/tools/schemas";

describe("mediaControlSchema", () => {
  test("accepts a valid 'list' call", () => {
    expect(
      mediaControlSchema.safeParse({ target: "tv", action: "list" }).success
    ).toBe(true);
  });

  test("rejects 'tune' with neither channelId nor channelNumber", () => {
    expect(
      mediaControlSchema.safeParse({ target: "tv", action: "tune" }).success
    ).toBe(false);
  });
});

Run a single file or domain:

bash
bun test tests/unit/media/test-media-control-unified.test.ts
bun test tests/unit/media/

API Integration Test

Requires the standalone server running in a separate terminal:

bash
# Terminal 1
bun run dev:api      # port 3000; exports TRUSTED_PROXY_COUNT=1 and a Telegram mock API base URL
# Terminal 2
bun run test:api     # or a single file: bun test tests/integration/api/test-<feature>.test.ts

Use the shared HTTP helpers from tests/helpers/test-utils.ts — they set the required Origin header and auth:

typescript
import { describe, test, expect } from "bun:test";
import {
  BASE_URL,
  fetchWithOrigin,
  fetchWithAuth,
  ensureUserAuth,
  makeRateLimitBypassHeaders,
  getTokenFromAuthCookie,
} from "../../helpers/test-utils";

describe("My feature", () => {
  test("requires auth → 401", async () => {
    const res = await fetchWithOrigin(`${BASE_URL}/api/my-feature`, { method: "POST" });
    expect(res.status).toBe(401);
  });

  test("creates when authed", async () => {
    const token = await ensureUserAuth("testuser_feat", "testtest");
    const res = await fetchWithAuth(`${BASE_URL}/api/my-feature`, "testuser_feat", token!, {
      method: "POST",
      headers: makeRateLimitBypassHeaders(),
      body: JSON.stringify({ name: "hi" }),
    });
    expect(res.status).toBe(201);
  });
});
Helpers in tests/helpers/
HelperPurpose
test-utils.ts → BASE_URLprocess.env.API_URL or http://localhost:3000
fetchWithOrigin(url, opts)adds Origin: http://localhost:3000
fetchWithAuth(url, username, token, opts)adds Origin + Authorization + X-Username
makeRateLimitBypassHeaders()Content-Type + random X-Forwarded-For to dodge per-IP limits
ensureUserAuth(username, password)register-or-login, returns a token (or null)
getTokenFromAuthCookie(res) / getAuthFromCookie(res)read token from the ryos_auth httpOnly cookie
fake-redis.tsIn-memory Redis double for unit suites
local-storage-stub.tsEarly localStorage install for store-heavy suites
theme-css-fixtures.tsShared CSS fixture strings
Show full SKILL.md (202 more words)Show less
Integration test conventions
  • Generate fresh usernames per run to avoid cross-run collisions; reuse via ensureUserAuth.
  • Always include makeRateLimitBypassHeaders() (or a unique IP) on rate-limited routes.
  • Tolerate rate limiting where the suite expects it: if (res.status === 429) return; is an accepted skip pattern in existing suites.
  • Auth endpoints set the token in the ryos_auth cookie, not the JSON body — read it via the cookie helpers.

Registering New Test Files

Unit/wiring tests under tests/unit/ are discovered automatically by bun run test:unit. Server-backed and opt-in suites are explicit in scripts/test-groups.ts:

  • Unit/wiring → no manual registration; place under tests/unit/<domain>/.
  • API integration → append to API_TEST_FILES (path under tests/integration/api/).
  • Opt-in/local-service suites → append to OPT_IN_TEST_FILES (path under tests/integration/opt-in/).
  • Optionally add a focused "test:<feature>" script for fast local runs.
  • Run bun run test:registration after adding or renaming tests.

bun test (no args / "test") runs everything, including API suites, so it needs the server too.

Running Subsets

bash
bun run test:unit                       # all no-server suites
bun run test:api                        # all API suites (server required)
bun test tests/unit/chat/               # one domain
bun test tests/unit/realtime/test-pusher-*.test.ts

See package.json for targeted suites (test:ai, test:song, test:new-api, test:sync-v2, test:chat-regression, …).

When to Add Tests (match repo conventions)

  • Adding/altering a Zod schema, util, store reducer, or API contract → add or extend a test.
  • Touching code that already has a sibling tests/unit/<domain>/test-*.test.ts → update it.
  • Do not build large new test infrastructure unrelated to the change unless asked.

© ryokun6, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .cursor/skills/write-tests of ryokun6/ryos.

Open the folder on GitHubat commit 4b48219

Compare with similar skills

Write Tests next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Write Tests compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Write Tests this skillryokun6/ryos1.3k—~1.7kAutomated safety check: PassAGPL-3.0
Generate Testscoco-research/coco473—~1.7kAutomated safety check: PassCustom licence
Coverage CheckAI-Unified-Process/marketplace140—~2.7kAutomated safety check: PassApache-2.0
Senior QAnicepkg/auto-company1923 repos~1.1kAutomated safety check: NotesNone
OpenROAD Module Test AdderThe-OpenROAD-Project/OpenROAD3.2k—~1.8kAutomated safety check: PassBSD-3-Clause
Find Untested Sourcesdotnet/skills5.6k1 repos~3.3kAutomated safety check: PassMIT

Similar skills

  • Generate Tests

    coco-research/coco

    A skill your agent uses when asked to generate tests for a file, module or component, to raise coverage, or to bootstrap a suite for untested code.

    473 GitHub stars~1.7k tokensUpdated today
    Testing & QAAuto-check passed
  • Coverage Check

    AI-Unified-Process/marketplace

    Audits an already-written use case (UC-XXX) or test case (TC-XXX) against its specification and reports a coverage matrix: which main success scenario steps, alternative flows, business rules…

    140 GitHub stars~2.7k tokensUpdated 2 days ago
    Testing & QAAuto-check passed
  • Senior QA

    nicepkg/auto-company

    Comprehensive QA and testing skill for quality assurance, test automation, and testing strategies for ReactJS, NextJS, NodeJS applications.

    192 GitHub starsUsed in 3 repos~1.1k tokens
    Testing & QAAuto-check: notes
  • OpenROAD Module Test Adder

    The-OpenROAD-Project/OpenROAD

    Adds integration or unit tests to an OpenROAD module: writes the Tcl test, generates golden files and registers it in both CMake and Bazel.

    3.2k GitHub stars~1.8k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Official

    Statically pairs source files with test files to list code that no test references, using Roslyn for C# or tree-sitter for many languages, with no build.

    5.6k GitHub starsUsed in 1 repo~3.3k tokens
    Testing & QAAuto-check passed
  • Testing iOS Code

    bitwarden/ios

    Official

    Write tests, add test coverage, unit test, or add missing tests for Bitwarden iOS.

    694 GitHub stars~1.8k tokensUpdated yesterday
    Testing & QAAuto-check passed

More from ryokun6/ryos

All 10 skills in this repo
  • Add AI Chat Tool

    ryokun6/ryos

    Add or modify an AI chat tool ("Ask Ryo" capability) in ryOS.

    1.3k GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Create Ryos App

    ryokun6/ryos

    Create new applications for ryOS following established patterns and conventions.

    1.3k GitHub stars~3.7k tokensUpdated today
    Auto-check passed
  • Create Store

    ryokun6/ryos

    Create or modify ryOS Zustand stores following repo conventions — persist middleware, partialize, versioned migrations, the debounced write-behind storage adapter for large slices, and cloud-sync…

    1.3k GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Desktop Release

    ryokun6/ryos

    Cut and publish ryOS Electron desktop releases on GitHub. An agent skill from ryokun6/ryos.

    1.3k GitHub stars~1k tokensUpdated today
    Auto-check: notes
  • Localize

    ryokun6/ryos

    Localize ryOS apps and components by extracting hardcoded strings, replacing with translation keys, and syncing across languages.

    1.3k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • React performance optimization guidelines from Vercel Engineering (vercel-labs/agent-skills).

    1.3k GitHub stars~2k tokensUpdated today
    Auto-check passed

Works with

Questions about Write Tests

What does Write Tests do?

Write and run ryOS tests with Bun's native test runner (bun:test). Write Tests is an agent skill from ryokun6/ryos. Write and run ryOS tests with Bun's native test runner (bun:test).

When should I use Write Tests?

Write Tests fits situations like: writing test coverage for a change; running/triaging the test suite.

How do I install Write Tests in Claude Code?

Run `npx skills add ryokun6/ryos --skill write-tests -a claude-code`. Or copy the skill folder (.cursor/skills/write-tests in ryokun6/ryos) into .claude/skills/write-tests in your project. Claude Code loads it when a task matches its description.

How do I install Write Tests in Codex?

Run `npx skills add ryokun6/ryos --skill write-tests -a codex`. Or copy the skill folder (.cursor/skills/write-tests in ryokun6/ryos) into .agents/skills/write-tests in your project. Codex loads it when a task matches its description.

Can I use Write Tests in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ryokun6/ryos --skill write-tests -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/write-tests, .gemini/skills/write-tests, .github/skills/write-tests and .opencode/skills/write-tests in your project.

What does Write Tests need to run?

Going by SKILL.md and its folder, Write Tests needs the command-line tools its instructions call (bun).

Does Write Tests access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Write Tests safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Write Tests use?

Write Tests is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Write Tests use?

About 1.7k tokens (SKILL.md is roughly 6.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Write Tests?

Skills that share tags, products or a category with Write Tests: Generate Tests (coco-research/coco, 473 stars), Coverage Check (AI-Unified-Process/marketplace, 140 stars), Senior QA (nicepkg/auto-company, 192 stars) and OpenROAD Module Test Adder (The-OpenROAD-Project/OpenROAD, 3.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Write Tests?

ryokun6 (a GitHub user) maintains it in ryokun6/ryos, which has 1,264 GitHub stars. The repository holds 10 skills in this directory. The repository was last updated on October 7, 2026.

Source: ryokun6/ryos on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.