Agent skill

Write Unit Tests

by Endava in Endava/BEEQ

Write Vitest unit tests for BEEQ shared utilities. An agent skill from Endava/BEEQ.

Apache-2.0Auto-check passedTesting & QA

Install Write Unit Tests

skills CLI
$ npx skills add Endava/BEEQ --skill write-unit-tests -a claude-code

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

GitHub CLI
$ gh skill install Endava/BEEQ write-unit-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/Endava/BEEQ.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/write-unit-tests .claude/skills/write-unit-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-unit-tests
GitHub stars
163
Token cost
~795 tokens
SKILL.md length
157 words
Files
1
Skills in repo
9
Repo updated
First seen
Licence
Apache-2.0

At a glance

Write Vitest unit tests for BEEQ shared utilities. An agent skill from Endava/BEEQ.

  • Fixing unit tests for helper functions
  • SKILL.md covers When to Use, File Location, Imports and Test Structure (AAA Pattern), plus 4 more sections
  • Calls pnpm
  • Pure logic in packages/beeq/src/shared/utils/

What it does

Write Unit Tests is an agent skill from Endava/BEEQ. Write Vitest unit tests for BEEQ shared utilities. Use for: adding or fixing unit tests for helper functions, utilities, and pure logic in packages/beeq/src/shared/utils/. Follows AAA pattern, uses vi.fn()/vi.spyOn(), fake timers, and proper mock cleanup. Not for component E2E tests (use write-e2e-tests skill instead).

Its SKILL.md is about 800 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 Unit testing. It works with Vitest. The repository describes itself as: BEEQ Design System, a web component library ruled by Endavan developers :). The licence is Apache-2.0.

When your agent uses it

  • Fixing unit tests for helper functions
  • Pure logic in packages/beeq/src/shared/utils/

Example prompts

  • “/write-unit-tests”

What it can do on your machine

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

    • pnpm

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

  • Network

    No URLs in SKILL.md. Its commands use pnpm, 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 Unit Tests loads about 795 tokens when it runs. Until then it costs about 84 tokens; SKILL.md has 157 words of instructions outside code blocks.

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

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 Endava/BEEQ at commit 5f4728d, republished under its Apache-2.0 licence (© Endava). 157 words, ~795 tokens.

Download SKILL.mdSave it as .claude/skills/write-unit-tests/SKILL.md (or your agent's skills folder).
name
write-unit-tests
description
Write Vitest unit tests for BEEQ shared utilities. Use for: adding or fixing unit tests for helper functions, utilities, and pure logic in packages/beeq/src/shared/utils/. Follows AAA pattern, uses vi.fn()/vi.spyOn(), fake timers, and proper mock cleanup. Not for component E2E tests (use write-e2e-tests skill instead).
argument-hint
Utility name or file path (e.g. "debounce" or packages/beeq/src/shared/utils/debounce.ts)
metadata.internal
true

Write BEEQ Unit Tests

When to Use

  • Adding tests for a new utility in packages/beeq/src/shared/utils/
  • Fixing failing unit tests after a utility change
  • Increasing coverage for edge cases in an existing utility

For component tests (props, events, slots, DOM), use the write-e2e-tests skill instead.

File Location

packages/beeq/src/shared/utils/__tests__/<utility-name>.spec.ts

Imports

ts
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';

// Import from the barrel — not the individual file
import { myUtility } from '..';

Test Structure (AAA Pattern)

ts
describe(myUtility.name, () => {
  // Arrange → Act → Assert for each case
  it('should <expected behavior>', () => {
    // Arrange
    const input = ...;

    // Act
    const result = myUtility(input);

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

Name describe blocks after the function itself using .name (e.g. describe(clamp.name, ...)). This auto-updates if the function is renamed.

Mocking

Functions
ts
const spy = vi.fn<(...args: string[]) => void>();
myUtility(spy);
expect(spy).toHaveBeenCalledTimes(1);
expect(spy).toHaveBeenCalledWith('expected-arg');
Globals / browser APIs
ts
beforeEach(() => {
  vi.spyOn(globalThis, 'requestAnimationFrame').mockImplementation((cb) => {
    return setTimeout(() => cb(performance.now()), 0) as unknown as number;
  });
});

afterEach(() => {
  vi.restoreAllMocks();
});
Timers
ts
beforeEach(() => {
  vi.useFakeTimers();
});

afterEach(() => {
  vi.restoreAllMocks();
  vi.useRealTimers();
});

it('should fire after delay', () => {
  const fn = debounce(spy, 250);
  fn();
  vi.advanceTimersByTime(251);
  expect(spy).toHaveBeenCalledTimes(1);
});

Mock Cleanup Rules

  • Always call vi.restoreAllMocks() in afterEach
  • Always call vi.useRealTimers() in afterEach when fake timers were used
  • Each test must be completely independent — no shared mutable state between tests

Coverage Goals

For each utility, cover:

CaseExample
Happy pathValid input returns expected output
Edge casesnull, undefined, empty string, 0, empty array
Boundary valuesMin/max of a range, single-element collections
Error conditionsInvalid input throws or returns fallback
Side effectsCallbacks called with correct args and count

Running Unit Tests

bash
# Run all unit tests
pnpm exec nx run beeq:test

# Run tests for a specific file
pnpm exec nx run beeq:test -- <utility-name>.spec.ts

# Watch mode
pnpm exec nx run beeq:test -- <utility-name>.spec.ts --watch

© Endava, Apache-2.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-unit-tests of Endava/BEEQ.

Open the folder on GitHubat commit 5f4728d

Compare with similar skills

Write Unit 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 Unit Tests compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Write Unit Tests this skillEndava/BEEQ163—~795Automated safety check: PassApache-2.0
Test Writing WorkflowiOfficeAI/AionUi33k1 repos~1.2kAutomated safety check: PassApache-2.0
Test GuardamElnagdy/guard-skills1.3k2 repos~2.1kAutomated safety check: PassMIT
Adding LLM MCP ToolsTriliumNext/Trilium38k—~2.5kAutomated safety check: PassAGPL-3.0
Concept Page Test Writerleonardomso/33-js-concepts67k—~5.5kAutomated safety check: PassMIT
Archestra Dev Testingarchestra-ai/archestra4.3k—~3.2kAutomated safety check: PassCustom licence

Similar skills

  • Test Writing Workflow

    iOfficeAI/AionUi

    Sets the test-writing workflow for the repository: risk-first scenario lists, behavior-focused Vitest tests, a full run before each commit and a coverage target.

    33k GitHub starsUsed in 1 repo~1.2k tokens
    Testing & QAAuto-check passed
  • Test Guard

    amElnagdy/guard-skills

    Reviews newly written or edited tests against nine rules that cut test bloat, such as mock-heavy checks and near-duplicate cases, before they are committed.

    1.3k GitHub starsUsed in 2 repos~2.1k tokens
    Testing & QAAuto-check passed
  • Adding LLM MCP Tools

    TriliumNext/Trilium

    A skill your agent uses when adding, changing, or reviewing an LLM/MCP tool in Trilium (the defineTools definitions under packages/trilium-core/src/services/llm/tools/ —…

    38k GitHub stars~2.5k tokensUpdated today
    Testing & QAAuto-check passed
  • Concept Page Test Writer

    leonardomso/33-js-concepts

    Generates Vitest tests for every runnable code example on a JavaScript concept documentation page, following a four-phase extraction and conversion process.

    67k GitHub stars~5.5k tokensUpdated 27 days ago
    Testing & QAAuto-check passed
  • Archestra Dev Testing

    archestra-ai/archestra

    A skill your agent uses for test selection and quality across backend, frontend, and e2e; load its backend reference for Vitest projects, mocking, DB fixtures, and performance.

    4.3k GitHub stars~3.2k tokensUpdated today
    Testing & QAAuto-check passed
  • Vitest

    pixel-point/animate-text

    Vitest testing framework patterns for test setup, async testing, mocking with vi., snapshots, and test performance (formerly test-vitest).

    149 GitHub starsUsed in 2 repos~1.3k tokens
    Testing & QAAuto-check passed

More from Endava/BEEQ

All 9 skills in this repo
  • Beeq

    Endava/BEEQ

    Builds, styles, and reviews UI with BEEQ, Endava's web-component design system.

    163 GitHub stars~5.6k tokensUpdated yesterday
    Auto-check passed
  • Create Component

    Endava/BEEQ

    Create a new BEEQ StencilJS web component. An agent skill from Endava/BEEQ.

    163 GitHub stars~1.5k tokensUpdated yesterday
    Auto-check passed
  • Audit and fix WCAG 2.1 Level AA accessibility issues in BEEQ StencilJS components.

    163 GitHub stars~1.9k tokensUpdated yesterday
    Auto-check passed
  • Review Component

    Endava/BEEQ

    Review a BEEQ StencilJS component against design system guidelines and project standards.

    163 GitHub stars~1.7k tokensUpdated yesterday
    Auto-check passed
  • Write E2E Tests

    Endava/BEEQ

    Write E2E tests for BEEQ StencilJS components using @stencil/vitest in browser mode (Playwright/Chromium).

    163 GitHub stars~1.3k tokensUpdated yesterday
    Auto-check passed
  • Write Stories

    Endava/BEEQ

    Write Storybook stories and MDX docs for BEEQ web components.

    163 GitHub stars~968 tokensUpdated yesterday
    Auto-check passed

Works with

Categories

Questions about Write Unit Tests

What does Write Unit Tests do?

Write Vitest unit tests for BEEQ shared utilities. An agent skill from Endava/BEEQ. Write Unit Tests is an agent skill from Endava/BEEQ. Write Vitest unit tests for BEEQ shared utilities.

When should I use Write Unit Tests?

Write Unit Tests fits situations like: fixing unit tests for helper functions; pure logic in packages/beeq/src/shared/utils/.

How do I install Write Unit Tests in Claude Code?

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

How do I install Write Unit Tests in Codex?

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

Can I use Write Unit 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 Endava/BEEQ --skill write-unit-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-unit-tests, .gemini/skills/write-unit-tests, .github/skills/write-unit-tests and .opencode/skills/write-unit-tests in your project.

What does Write Unit Tests need to run?

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

Does Write Unit 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 Unit 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 Unit Tests use?

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

How many tokens does Write Unit Tests use?

About 795 tokens (SKILL.md is roughly 3.2k 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 Unit Tests?

Skills that share tags, products or a category with Write Unit Tests: Test Writing Workflow (iOfficeAI/AionUi, 33k stars), Test Guard (amElnagdy/guard-skills, 1.3k stars), Adding LLM MCP Tools (TriliumNext/Trilium, 38k stars) and Concept Page Test Writer (leonardomso/33-js-concepts, 67k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Write Unit Tests?

Endava (a GitHub organization) maintains it in Endava/BEEQ, which has 163 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on October 6, 2026.

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