Skip to content
Skills Library
Programming · Testing

write-tests

/write-tests

Write or change Wavefunction tests that earn their place under the case and time budget, using the existing fixtures. Use when adding a regression test, testing a new behavior, or a test fails for reasons you need to understand.

Licence
MIT
Last repository change
07.11.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 07.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Write or change Wavefunction tests that earn their place under the case and time budget, using the existing fixtures. Use when adding a regression test, testing a new behavior, or a test fails for reasons you need to understand.

Original author description

Write or change Wavefunction tests that earn their place under the case and time budget, using the existing fixtures. Use when adding a regression test, testing a new behavior, or a test fails for reasons you need to understand.

How it works

  1. Before adding a test
  2. Backend (backend/tests/)
  3. Frontend (frontend/src/)
  4. After
Original SKILL.md headings · 34 lines, 412 words
SKILL.md preview
---
name: write-tests
description: Write or change Wavefunction tests that earn their place under the case and time budget, using the existing fixtures. Use when adding a regression test, testing a new behavior, or a test fails for reasons you need to understand.
---

# Write tests

The policy is in [docs/TESTING.md](../../../docs/TESTING.md): a budget of 240 backend and 230 frontend cases, 30 s per backend test, and a time limit for each suite.

## Before adding a test

- **Find the existing test for this behavior.** Tests drive the HTTP API, so search by route or behavior: `rg -l "/fork" backend/tests/`, `rg -l "composer" frontend/src`. Extending a test of the same workflow is often better than a new case.
- **Make a bug fix's test fail first.** Run it against the code without your fix and see it fail for the reason you claim. A test that passes either way is not a regression test.
- **Decide what to assert.** What the user sees, what the API returns, what reaches disk or the model. Not private helpers, markup, CSS or source text.
- **Watch the budget.** Near it, replace a weaker test instead of adding one. Never merge unrelated scenarios to save a case.

## Backend (`backend/tests/`)

- **Fixtures** (`conftest.py`): `coding` gives `(client, workspace, services)` on a temporary data folder. Helpers (`support.py`): `create(client, ...)` makes a chat; `repository(tmp_path)` and `git(...)` make a synthetic Git repository. Import helpers from `support`, never from another test module.
- **Scripted model.** `script_gateway(services.models, [...])` with `tool_call_message(name, args, id)` and `AIMessage(...)` drives a real tool loop without a model. Then `ws.send(thread_id, text)` and `services.runtime.wait(run_id)`.
- **Markers.**
  - `@pytest.mark.sandbox` for anything that runs a command through the app's tools: Git, edits, terminals, discovery.
  - `@pytest.mark.destructive` if it runs a real deletion command, even in a temporary repository. That test then runs only in CI.
  - Cleanup that only deletes temporary folders isn't needed: pytest discards `tmp_path`.
- **No sleeps.** Wait for state, not time: the existing tests poll a condition with a deadline. Keep each test under 30 s.
- **Run from `backend/`.** `uv run --no-sync pytest tests/test_x.py -k name`. IDs and `--deselect` paths are relative to it.

## Frontend (`frontend/src/`)

- **Placement.** Tests sit next to the code (`x.test.tsx`), with Testing Library and `userEvent`.
- **Queries.** Find elements by role and accessible name, the way a user or browser automation would.
- **Mocks.** Mock the API at `coding/api.ts` or `lib/api.ts` and assert where requests go and what the user sees.
- **Time.** Each test has 5 s.

## After

Run `npm run check`. If a test is flaky, fix it; don't retry or add a sleep. If you can't fix it now, skip it with `reason="flaky: <issue link>"` and open an issue.

Versions

RepositoryScoreLicence
This page · stoyan-stoyanov/wavefunction90MIT
onsi/biloba100MIT
runwield/runwield100MIT
dzhng/jevgrep100MIT
lukedj78/dev-flow100MIT
dzhng/skills100MIT
rowansci/rowan-python100MIT
yaohuangguan/agent-playbook100MIT
microsoft/semantic-link-labs100MIT

Database snapshot: 13.11.2026 · package version 40f0ce2363d8 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100rebuild-wavefunction
    Rebuild and relaunch the local Wavefunction macOS app with its bundled Python sidecar while preserving conversations, projects, skills, and credentials. Use when the user requests an app rebuild or restart after changes.
  • 100package-wavefunction-install-kit
    Build and verify a shareable Wavefunction macOS app ZIP and checksum using its bundled Python runtime. Use when the user asks for an install kit, test kit, or app archive for another Mac.
  • 100v1-write-tests
    Use when writing unit tests for code changes or new functionality. Triggers on "write tests", "add tests", "test this code".
  • 90test-writer
    Write tests that verify behavior (not implementation), use table-driven/parameterized patterns, and minimize mocking. Triggers when asked to write tests, add test coverage, or create test files. Also triggers when reviewing existing tests for quality.
  • 100testing-python
    Write and evaluate effective Python tests using pytest. Use when writing tests, reviewing test code, debugging test failures, or improving test coverage. Covers test design, fixtures, parameterization, mocking, async testing, and CI integration.
  • 100awesome-test-writing
    Designs and writes tests that catch real regressions: unit, integration or E2E placement, fixtures, behavior-first assertions, characterization and property tests. Use when asked to write tests, add coverage or a regression test.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.