Official agent skill

Test Guidelines

by getsentry in getsentry/sentry-react-native

Enforce Sentry React Native SDK test conventions for naming, structure, mocking, and fixtures with Jest.

OfficialMITAuto-check passedTesting & QA

Install Test Guidelines

skills CLI
$ npx skills add getsentry/sentry-react-native --skill test-guidelines -a claude-code

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

GitHub CLI
$ gh skill install getsentry/sentry-react-native test-guidelines --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/getsentry/sentry-react-native.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/test-guidelines .claude/skills/test-guidelines && 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
test-guidelines
GitHub stars
1.8k
Token cost
~1.3k tokens
SKILL.md length
530 words
Files
1
Skills in repo
6
Repo updated
First seen
Licence
MIT

At a glance

Enforce Sentry React Native SDK test conventions for naming, structure, mocking, and fixtures with Jest.

  • Modifying tests
  • SKILL.md covers Test-first loop, File structure, Naming and Style — Arrange / Act / Assert, plus 3 more sections
  • Calls yarn
  • Reviewing test code

What it does

Test Guidelines is an agent skill from getsentry/sentry-react-native, published by the product's own GitHub organization. Enforce Sentry React Native SDK test conventions for naming, structure, mocking, and fixtures with Jest. Use when writing tests, adding tests, modifying tests, reviewing test code, fixing failing tests, adding coverage, TDD, test-first / red-green, reproducing bugs with tests, regression tests, or test refactoring in packages/core.

Its SKILL.md is about 1.3k 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-driven development, Cross-platform mobile apps and Unit testing. It works with Sentry, React Native and Jest. The repository describes itself as: Official Sentry SDK for React Native. The licence is MIT.

When your agent uses it

  • Modifying tests
  • Reviewing test code
  • Fixing failing tests
  • Adding coverage

Example prompts

  • “/test-guidelines”

What it can do on your machine

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

Test Guidelines loads about 1.3k tokens when it runs. Until then it costs about 88 tokens; SKILL.md has 530 words of instructions outside code blocks.

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

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 getsentry/sentry-react-native at commit 6ce1083, republished under its MIT licence (© getsentry). 530 words, ~1,319 tokens.

Download SKILL.mdSave it as .claude/skills/test-guidelines/SKILL.md (or your agent's skills folder).
name
test-guidelines
description
Enforce Sentry React Native SDK test conventions for naming, structure, mocking, and fixtures with Jest. Use when writing tests, adding tests, modifying tests, reviewing test code, fixing failing tests, adding coverage, TDD, test-first / red-green, reproducing bugs with tests, regression tests, or test refactoring in `packages/core`.

Apply these conventions to all new and modified tests in packages/core. Existing tests may not follow them — do not refactor them unless asked. Tests run on Jest (yarn test, yarn test:watch, yarn test:sdk, yarn test:tools).

Tests are easiest to write against code designed to accept its dependencies — when implementing the code under test, load design-first (where the seams go) and code-guidelines (the rules).

Test-first loop

Work in vertical slices. One failing test → the minimal code that makes it pass → repeat. Each test proves one thin path end-to-end, and what it teaches shapes the next.

Do not write all the tests first and then all the implementation. That horizontal slicing produces tests of imagined behavior — they assert the shape you guessed at and pass when the real behavior breaks. Write one test at a time, against behavior you can already reason about.

Fixing a bug? Reproduce it with a failing test first — see diagnosing-bugs.

File structure

  • One test file per source file. Mirror the path: src/js/client.ts → test/client.test.ts; src/js/integrations/release.ts → test/integrations/release.test.ts.
  • React component tests use .test.tsx and @testing-library/react-native.
  • A single top-level describe naming the unit under test, with nested describe/it inside it.

Naming

Follow the convention in packages/core/AGENTS.md: describe/it blocks (preferred), with the it describing the expected behavior for a given input.

  • The top-level describe names the unit under test — the exported name (myFeatureIntegration, NATIVE, the class).
  • Nested describe groups a method or a scenario; it states the behavior being verified.
  • Write it as a clear behavior description, e.g. returns expected value when input is valid.
typescript
describe('nativeLinkedErrorsIntegration', () => {
  describe('when the native module is unavailable', () => {
    it('returns the event unchanged', () => { /* ... */ });
  });

  describe('processEvent', () => {
    it('appends linked errors up to the configured limit', () => { /* ... */ });
  });
});

Style — Arrange / Act / Assert

Structure every test in three clear sections; a blank line between them is enough.

typescript
it('returns expected value when input is valid', () => {
  // Arrange
  const input = 'test';

  // Act
  const result = functionName(input);

  // Assert
  expect(result).toBe('expected');
});

Use specific matchers — they produce better failure messages:

typescript
expect(array).toHaveLength(3);          // not expect(array.length).toBe(3)
expect(obj).toMatchObject({ a: 1 });    // partial structural match
expect(fn).toThrow(Error);
await expect(promise).resolves.toBe('ok');
await expect(promise).rejects.toThrow();

Assert the exact symptom, not "didn't crash". A test that only checks a call didn't throw catches almost nothing.

Show full SKILL.md (232 more words)Show less

Mocking

  • Reset between tests. Use afterEach(() => { jest.clearAllMocks(); }) (or resetAllMocks when you also stub implementations). A leaked mock is the most common flaky-test cause here.
  • Mock the native module, not the whole SDK. Prefer the shared helpers (test/mockWrapper.ts, test/mocks/) over re-mocking react-native ad hoc. When you must, mock the bridge surface only:
typescript
jest.mock('react-native', () => ({
  NativeModules: { RNSentry: { fetchNativeSdkInfo: jest.fn(() => Promise.resolve({})) } },
  Platform: { OS: 'ios', select: (o: any) => o.ios ?? o.default },
}));
  • Test both architectures / platforms when the code branches on them. Drive Platform.OS, isTurboModuleEnabled(), isFabricEnabled() from the test rather than assuming one.
  • Prefer injecting a fake at a seam over jest.mock of a deep import — a test that mocks internals breaks on refactors even when behavior is unchanged (see design-first: the interface is the test surface).
  • Don't mock the thing under test. Don't assert on private internals; assert on observable output (the event, the envelope, the resolved value).

Async & timers

  • Always await async assertions; return or await the promise so Jest sees failures.
  • For timing-dependent code (flush timers, debounces, retries) use fake timers (jest.useFakeTimers() + jest.advanceTimersByTime(...)), not real setTimeout — real delays make tests slow and flaky. Restore with jest.useRealTimers() in afterEach.
  • No real network or filesystem. Stub the transport / bridge.

What to test

  • The behavior at the seam a caller depends on — inputs → observable outputs.
  • Edge cases the code guidelines call out: native module missing, enableNative false, PII gating on/off, serialization round-trips across the bridge, both architectures.
  • Every bug fix carries a regression test that goes red before the fix and green after.

© getsentry, MIT. 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/test-guidelines of getsentry/sentry-react-native.

Open the folder on GitHubat commit 6ce1083

Compare with similar skills

Test Guidelines 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.

Test Guidelines compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Test Guidelines this skillgetsentry/sentry-react-native1.8k—~1.3kAutomated safety check: PassMIT
Test Guidelinesgetsentry/sentry-dart873—~3.1kAutomated safety check: PassMIT
Jest Testing PatternsChrisWiles/claude-code-showcase6.1k7 repos~1.5kAutomated safety check: PassNone
TDD Workflows TDD Redaiskillstore/marketplace4306 repos~1.3kAutomated safety check: PassNone
Cometchat React Native Testingcometchat/cometchat-skills129—~997Automated safety check: PassMIT
React Native Testingcallstackincubator/agent-skills1.7k—~1.8kAutomated safety check: PassMIT

Similar skills

  • Test Guidelines

    getsentry/sentry-dart

    Official

    Enforce Sentry Dart/Flutter SDK test conventions for naming, structure, and fixtures.

    873 GitHub stars~3.1k tokensUpdated today
    Testing & QAAuto-check passed
  • Jest Testing Patterns

    ChrisWiles/claude-code-showcase

    Jest patterns for React Native style tests: TDD discipline, mock factory functions, module and GraphQL hook mocking, custom render helpers and anti-patterns to avoid.

    6.1k GitHub starsUsed in 7 repos~1.5k tokens
    Testing & QAAuto-check passed
  • TDD Workflows TDD Red

    aiskillstore/marketplace

    Generate failing tests for the TDD red phase to define expected behavior and edge cases.

    430 GitHub starsUsed in 6 repos~1.3k tokens
    Testing & QAAuto-check passed
  • Cometchat React Native Testing

    cometchat/cometchat-skills

    Test a CometChat React Native integration — mock the SDK for Jest unit tests, assert init-before-render ordering and no-Auth-Key-in-source, and use Detox for the flows only a device can prove.

    129 GitHub stars~997 tokensUpdated 2 days ago
    Testing & QAAuto-check passed
  • React Native Testing

    callstackincubator/agent-skills

    Official

    Write tests using React Native Testing Library (RNTL) v13 and v14 (@testing-library/react-native).

    1.7k GitHub stars~1.8k tokensUpdated yesterday
    MobileAuto-check passed
  • Creating Reanimated Animations

    gluestack/gluestack-ui

    Generate React Native Reanimated animation code for React Native apps.

    5.3k GitHub stars~2.4k tokensUpdated 1 mo ago
    MobileAuto-check passed

More from getsentry/sentry-react-native

  • Code Guidelines

    getsentry/sentry-react-native

    Official

    Enforce Sentry React Native SDK code guidelines for implementation, refactoring, and review.

    1.8k GitHub stars~3.2k tokensUpdated today
    Auto-check passed
  • Review

    getsentry/sentry-react-native

    Official

    Three-axis review of the branch diff — Standards (this repo's documented standards + public API/bridge surface), Spec (the originating Linear/GitHub issue or PR), and Correctness (runtime bugs + the…

    1.8k GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Design First

    getsentry/sentry-react-native

    Official

    Shape non-trivial work before writing it — decide the modules, the seams, and the public API surface up front.

    1.8k GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Diagnosing Bugs

    getsentry/sentry-react-native

    Official

    A discipline for hard bugs, flaky tests, CI hangs, native crashes, and performance regressions in this SDK.

    1.8k GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Spec

    getsentry/sentry-react-native

    Official

    Produce a verified spec — problem, desired outcome, and acceptance criteria — before building.

    1.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed

Categories

Questions about Test Guidelines

What does Test Guidelines do?

Enforce Sentry React Native SDK test conventions for naming, structure, mocking, and fixtures with Jest. Test Guidelines is an agent skill from getsentry/sentry-react-native, published by the product's own GitHub organization. Enforce Sentry React Native SDK test conventions for naming, structure, mocking, and fixtures with Jest.

When should I use Test Guidelines?

Test Guidelines fits situations like: modifying tests; reviewing test code; fixing failing tests; adding coverage.

How do I install Test Guidelines in Claude Code?

Run `npx skills add getsentry/sentry-react-native --skill test-guidelines -a claude-code`. Or copy the skill folder (.agents/skills/test-guidelines in getsentry/sentry-react-native) into .claude/skills/test-guidelines in your project. Claude Code loads it when a task matches its description.

How do I install Test Guidelines in Codex?

Run `npx skills add getsentry/sentry-react-native --skill test-guidelines -a codex`. Or copy the skill folder (.agents/skills/test-guidelines in getsentry/sentry-react-native) into .agents/skills/test-guidelines in your project. Codex loads it when a task matches its description.

Can I use Test Guidelines 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 getsentry/sentry-react-native --skill test-guidelines -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/test-guidelines, .gemini/skills/test-guidelines, .github/skills/test-guidelines and .opencode/skills/test-guidelines in your project.

What does Test Guidelines need to run?

Going by SKILL.md and its folder, Test Guidelines needs the command-line tools its instructions call (yarn).

Does Test Guidelines 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 Test Guidelines 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 Test Guidelines use?

Test Guidelines is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Test Guidelines use?

About 1.3k tokens (SKILL.md is roughly 5.3k 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 Test Guidelines?

Skills that share tags, products or a category with Test Guidelines: Test Guidelines (getsentry/sentry-dart, 873 stars), Jest Testing Patterns (ChrisWiles/claude-code-showcase, 6.1k stars), TDD Workflows TDD Red (aiskillstore/marketplace, 430 stars) and Cometchat React Native Testing (cometchat/cometchat-skills, 129 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Test Guidelines?

getsentry (a GitHub organization, an official publisher) maintains it in getsentry/sentry-react-native, which has 1,824 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on October 7, 2026.

Source: getsentry/sentry-react-native on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.