Official agent skill

Write Tests

by grafana in grafana/synthetic-monitoring-app

Write Jest integration and unit tests for the Grafana Synthetic Monitoring app using React Testing Library, MSW, and src/test helpers.

OfficialAGPL-3.0Auto-check passedTesting & QA

Install Write Tests

skills CLI
$ npx skills add grafana/synthetic-monitoring-app --skill write-tests -a claude-code

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

GitHub CLI
$ gh skill install grafana/synthetic-monitoring-app 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/grafana/synthetic-monitoring-app.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/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
171
Token cost
~1.2k tokens
SKILL.md length
455 words
Files
1
Skills in repo
1
Repo updated
First seen
Licence
AGPL-3.0

At a glance

Write Jest integration and unit tests for the Grafana Synthetic Monitoring app using React Testing Library, MSW, and src/test helpers.

  • Works in 3 steps: Read the testing doc (at minimum the… → Find 1–2 nearby tests for the feature… → Open src/test/handlers/index.ts if you…
  • The user asks to add
  • SKILL.md covers Before writing anything, Mental model, Expectations checklist and When to write tests (timing), plus 4 more sections
  • Calls yarn

What it does

Write Tests is an agent skill from grafana/synthetic-monitoring-app, published by the product's own GitHub organization. Write Jest integration and unit tests for the Grafana Synthetic Monitoring app using React Testing Library, MSW, and src/test helpers. Use whenever the user asks to add, fix, or review tests, mentions yarn test, .test.tsx, integration tests, user journeys, MSW handlers, fixtures, unhappy paths, or PR test coverage — even if they do not say "write tests" explicitly.

Its SKILL.md is about 1.2k 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, Unit testing and Monitoring and alerting. It works with Grafana, Jest and Testing Library. The repository describes itself as: Synthetic Monitoring frontend application. The licence is AGPL-3.0.

When your agent uses it

  • The user asks to add
  • Mentions yarn test
  • Integration tests
  • PR test coverage — even if they do not say write tests explicitly

Example prompts

  • “write tests”
  • “/write-tests”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Read the testing doc (at minimum the Expectations section).
  2. Find 1–2 nearby tests for the feature you are covering — match local conventions before inventing new patterns.
  3. Open src/test/handlers/index.ts if you need to override or add API routes; open src/test/fixtures/ for existing named data.

What it can do on your machine

Read from SKILL.md and the folder at commit 2739165. 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:

    • yarn

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

  • Network

    No URLs in SKILL.md. Its commands use yarn, which can reach the network depending on how they are called.

    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.2k tokens when it runs. Until then it costs about 95 tokens; SKILL.md has 455 words of instructions outside code blocks.

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

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 grafana/synthetic-monitoring-app at commit 2739165, republished under its AGPL-3.0 licence (© grafana). 455 words, ~1,162 tokens.

Download SKILL.mdSave it as .claude/skills/write-tests/SKILL.md (or your agent's skills folder).
name
write-tests
description
Write Jest integration and unit tests for the Grafana Synthetic Monitoring app using React Testing Library, MSW, and src/test helpers. Use whenever the user asks to add, fix, or review tests, mentions yarn test, *.test.tsx, integration tests, user journeys, MSW handlers, fixtures, unhappy paths, or PR test coverage — even if they do not say "write tests" explicitly.

Write tests for Synthetic Monitoring

Read docs/development/testing.md first. That doc is the harness-agnostic source of truth for expectations and how-to. This skill is the agent workflow for applying it.

Before writing anything

  1. Read the testing doc (at minimum the Expectations section).
  2. Find 1–2 nearby tests for the feature you are covering — match local conventions before inventing new patterns.
  3. Open src/test/handlers/index.ts if you need to override or add API routes; open src/test/fixtures/ for existing named data.

Mental model

Our suite is a pseudo e2e framework: real UI, user journeys, mocked APIs. Integration tests carry the most weight. Unit tests are fine for pure logic but matter less than journey coverage.

Expectations checklist

When adding or reviewing tests, verify:

  • New API? Handler in src/test/handlers/, registered in API_ROUTES, fixtures/factories if needed — not inline JSON in every test.
  • UI / end-goal focused? Assert what the user sees and achieves (copy, roles, navigation, disabled CTAs, redirects). Avoid testing implementation details.
  • Repeated journey? Extract a small helper in __testHelpers__/ next to the feature (see checkForm.tsx, formHelpers.ts for patterns).
  • Unhappy paths covered? Errors, permissions, limits, validation — not just the happy path. Multi-step journeys should assert intermediate failure/success at each step.
  • Tests as docs? Prefer tests over standalone docs. If testing is impractical, document behaviour instead and note it in the PR.

When to write tests (timing)

  • Propose TDD (tests first) when it fits the task.
  • If the user rejects TDD, wait until the feature is PR-ready before writing tests — mid-exploration tests often blur requirements.
  • Frontend engineers: full test depth expected. Others: OK to defer complex tests with a PR note asking an FE engineer to add them.
Show full SKILL.md (183 more words)Show less

Choose the right test type

SituationApproach
Component or page behaviourIntegration test via test/render
Multi-step check wizardJourney helpers in page/__testHelpers__/ + Checkster helpers
Pure function / adaptor / validationUnit test, no custom render
Hard to test (heavy upstream deps)Document behaviour; note in PR

Integration test workflow

tsx
import { screen } from '@testing-library/react';
import { apiRoute, getServerRequests } from 'test/handlers';
import { render } from 'test/render';
import { server } from 'test/server';
import { OFFLINE_PROBE } from 'test/fixtures/probes';

it('shows Offline for an offline probe', async () => {
  render(<Probe probe={OFFLINE_PROBE} />);
  expect(await screen.findByText('Offline')).toBeInTheDocument();
});

Rules:

  • Tests are async; use findBy* / findAllBy* after render (network must settle).
  • Use user from render, not userEvent directly.
  • Override MSW with server.use(apiRoute('routeKey', { result: () => ({ ... }) })).
  • Assert API payloads with getServerRequests() when the journey submits data.
  • Use mockFeatureToggles and runTestAs* from test/utils for flags and personas — not ad-hoc config mocks.
  • Prefer stable fixtures (test/fixtures/*) over one-off DB.build unless you need a custom variant.

For routing, pass path and route to render. Assert navigation via ROUTER_TEST_ID from test/dataTestIds.

For hooks, use createWrapper() with renderHook.

Verify

Run the file you changed:

bash
yarn test <filename>

Fix failures before considering the work done.

Do not

  • Paste the full handler registry into tests or comments — reference src/test/handlers/index.ts.
  • Add copious unit tests when a single integration test covers the user journey.
  • Hand-roll provider stacks — use test/render.
  • Skip unhappy-path coverage for a journey that has meaningful failure modes.

© grafana, 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 .agents/skills/write-tests of grafana/synthetic-monitoring-app.

Open the folder on GitHubat commit 2739165

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 skillgrafana/synthetic-monitoring-app171—~1.2kAutomated safety check: PassAGPL-3.0
Testingredis/RedisInsight8.9k—~3.3kAutomated safety check: PassCustom licence
Senior QAalirezarezvani/claude-skills28k1 repos~2.1kAutomated safety check: PassMIT
Appbuilder Testingadobe/skills195—~2.8kAutomated safety check: PassApache-2.0
OpenROAD Module Test AdderThe-OpenROAD-Project/OpenROAD3.2k—~1.8kAutomated safety check: PassBSD-3-Clause
Write Testsopenplayerjs/openplayerjs649—~1.8kAutomated safety check: PassMIT

Similar skills

  • Testing

    redis/RedisInsight

    Official

    Unit/integration testing standards for RedisInsight using Jest and Testing Library: test structure, the renderComponent helper, faker for test data, mocking patterns, and waitFor instead of fixed…

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

    alirezarezvani/claude-skills

    Generates unit tests, integration tests, and E2E tests for React/Next.js applications.

    28k GitHub starsUsed in 1 repo~2.1k tokens
    Testing & QAAuto-check passed
  • Appbuilder Testing

    adobe/skills

    Generate and run tests for Adobe App Builder actions and UI components.

    195 GitHub stars~2.8k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • 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 today
    Testing & QAAuto-check passed
  • Write Tests

    openplayerjs/openplayerjs

    Write or extend Jest tests for OpenPlayerJS to this repo's exact conventions — makeCore factories, typed internals handles instead of as any, media property mocking, fake timers, ads/vast mocks, and…

    649 GitHub stars~1.8k tokensUpdated 2 days ago
    Testing & QAAuto-check passed
  • Unit Tests

    Khan/wonder-blocks

    Jest + React Testing Library best practices for Wonder Blocks unit tests.

    163 GitHub stars~4.2k tokensUpdated today
    Testing & QAAuto-check passed

Categories

Questions about Write Tests

What does Write Tests do?

Write Jest integration and unit tests for the Grafana Synthetic Monitoring app using React Testing Library, MSW, and src/test helpers. Write Tests is an agent skill from grafana/synthetic-monitoring-app, published by the product's own GitHub organization. Write Jest integration and unit tests for the Grafana Synthetic Monitoring app using React Testing Library, MSW, and src/test helpers.

When should I use Write Tests?

Write Tests fits situations like: the user asks to add; mentions yarn test; integration tests; PR test coverage — even if they do not say write tests explicitly.

How do I install Write Tests in Claude Code?

Run `npx skills add grafana/synthetic-monitoring-app --skill write-tests -a claude-code`. Or copy the skill folder (.agents/skills/write-tests in grafana/synthetic-monitoring-app) 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 grafana/synthetic-monitoring-app --skill write-tests -a codex`. Or copy the skill folder (.agents/skills/write-tests in grafana/synthetic-monitoring-app) 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 grafana/synthetic-monitoring-app --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 (yarn).

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.2k tokens (SKILL.md is roughly 4.6k 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: Testing (redis/RedisInsight, 8.9k stars), Senior QA (alirezarezvani/claude-skills, 28k stars), Appbuilder Testing (adobe/skills, 195 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?

grafana (a GitHub organization, an official publisher) maintains it in grafana/synthetic-monitoring-app, which has 171 GitHub stars. The repository was last updated on October 6, 2026.

Source: grafana/synthetic-monitoring-app on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.