writing-tests

writing-tests is a skill for Claude Code, Codex from hotovo/aider-desk. It costs 48 tokens per session (486 once invoked), scanned A, original, Apache-2.0.

A testing guide for AiderDesk, using Vitest and React Testing Library. Unit tests check isolated code, component tests check React user interfaces, and integration tests check parts working together.

In plain words
What is it for?
Use it when creating tests, increasing coverage, configuring mocks, setting up test files, or debugging failed tests in AiderDesk.
Why use it?
It gives developers repeatable ways to check code and investigate failing tests instead of relying on manual checks. It also documents how to replace dependencies with test doubles.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { add } from '../../utils/math';.

Good fit Use it when creating tests, increasing coverage, configuring mocks, setting up test files, or debugging failed tests in AiderDesk.

Compare 6 skills from other repositories ↓
About the project

AiderDesk is an open-source desktop platform that coordinates AI-assisted software development around the Aider coding tool, letting engineers inspect and control proposed changes. It is for professional developers who want AI help while retaining their existing editor, terminal, and Git workflow. Catalogue add-ons extend its controlled development workflow.

hotovo/aider-desk · 1,422 stars · on GitHub · aiderdesk.hotovo.com

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/hotovo/aider-desk
agentmods
npx agentmods add skills/hotovo/aider-desk/writing-tests

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for writing-tests

README.md
[![agentmods](https://agentmods.dev/badge/skills/hotovo/aider-desk/writing-tests/github.svg)](https://agentmods.dev/skills/hotovo/aider-desk/writing-tests)
Your own site
<a href="https://agentmods.dev/skills/hotovo/aider-desk/writing-tests"><img src="https://agentmods.dev/badge/skills/hotovo/aider-desk/writing-tests/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for writing-tests

Your own site · 80×15
<a href="https://agentmods.dev/skills/hotovo/aider-desk/writing-tests"><img src="https://agentmods.dev/badge/skills/hotovo/aider-desk/writing-tests.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 486 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00048 $0.00486
Opus 5 $0.00024 $0.00243
Sonnet 5 $0.00010 $0.00097
Haiku 4.5 $0.00005 $0.00049

Measured 11d ago against content hash 10429adaa4d4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

writing-tests scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.aider-desk/skills/writing-tests/SKILL.md · 57 lines

What it actually says

Writing Tests

Write effective tests using Vitest and React Testing Library.

Quick Start

Create a unit test in packages/common/__tests__/utils/math.test.ts:

import { describe, it, expect } from 'vitest';
import { add } from '../../utils/math';

describe('math utility', () => {
  it('adds two numbers correctly', () => {
    expect(add(1, 2)).toBe(3);
  });
});

Run tests with npm run test.

Core Patterns

Unit Testing

Focus on pure functions and logic in src/main or packages/common. Use vi.mock() for dependencies.

Component Testing

Test React components in src/renderer. Focus on user interactions and props.

Mocking

Use centralized mock factories for consistent testing across components and contexts.

Debugging Failing Tests

  1. Read the error output and identify the failing assertion
  2. Check mock setup — verify vi.mock() paths and return values match expectations
  3. For component tests, inspect rendered output with screen.debug()
  4. Run a single test in isolation: npm run test:node -- --no-color -t "test name"
  5. Verify coverage: npm run test:coverage to confirm new code is tested

Advanced Usage

For detailed information:

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 57 lines · 48 tokens per session scan A 10429adaa4d4

Subscribe to this mod's changes

writing-tests is a skill published in the GitHub repository hotovo/aider-desk (1,422 stars, last pushed today), licensed Apache-2.0. It adds 48 tokens to every session and 486 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

testing-patterns

Jest testing patterns, factory functions, mocking strategies, and TDD workflow. Use when writing unit tests, creating test factories, or following TDD red-green-refactor cycle.

KunanonJ/ai-skills-hub · 40 tokens

javascript-testing-patterns

Comprehensive guide for implementing robust testing strategies in JavaScript/TypeScript applications using modern testing frameworks and best practices.

KunanonJ/ai-skills-hub · 28 tokens

frontend-testing

Generate comprehensive Vitest and React Testing Library tests for frontend components, hooks, and utilities. Covers test structure, incremental workflow, async patterns, mocking strategies, and coverage goals. Use when writing or reviewing frontend tests, improving coverage, or setting up testing infrastructure for…

yunseo-kim/agent-toolbox · 58 tokens

javascript-testing-patterns

Implement comprehensive testing strategies using Jest, Vitest, and Testing Library for unit tests, integration tests, and end-to-end testing with mocking, fixtures, and test-driven development. Use when writing JavaScript/TypeScript tests, setting up test infrastructure, or implementing TDD/BDD workflows.

yunseo-kim/agent-toolbox · 63 tokens

unit-testing-test-generate

Generate comprehensive, maintainable unit tests across languages with strong coverage and edge case focus.

KunanonJ/ai-skills-hub · 23 tokens

property-based-testing

Property-based testing with fast-check (TypeScript/JavaScript) and Hypothesis (Python). Generate test cases automatically, find edge cases, and test mathematical properties. Use when user mentions property-based testing, fast-check, Hypothesis, generating test data, QuickCheck-style testing, or finding edge cases…

KunanonJ/ai-skills-hub · 67 tokens