🧪
QualityTypeScript

Writing Tests

by saffron-health

Writing Tests is a Quality skill for Claude Code, published by saffron-health in libretto.

877 stars67 forkson saffron-health/librettoAdded 2026/08/22Repository updated 2026/08/21
automationbrowserclaude-codecodexrpa
Install in seconds
Install Writing Tests
Copy Writing Tests into your Claude Code skills folder. Run the command in your terminal, or review the source on GitHub before installing.
terminal
npx degit https://github.com/saffron-health/libretto/tree/main/.agents/skills/writing-tests ~/.claude/skills/writing-tests

Requires Node.js. Downloads this skill only — not the rest of the repository — into your Claude Code skills folder.

Without Node.js

git clone https://github.com/saffron-health/libretto.git

Clones the whole repository, then copy the skill’s own directory into your skills folder yourself.

In this catalog

Source file
.agents/skills/writing-tests/SKILL.md in saffron-health/libretto
Installs to
~/.claude/skills/writing-tests
Collection
One of 23 skills cataloged from this repository
Category
Quality1354 skills

What Writing Tests does

Writing Tests helps you create and edit test files that model real user flows. Use it when adding, modifying, or reviewing tests that should match the product interface closely.

Writing Tests is cataloged under Quality on DirSkills. Writing Tests comes from a repository tagged automation, browser, claude-code, codex and rpa.

Documentation

README

Writing Tests

Core Principle: Tests Are User Flows

Each test should represent a single, concrete flow that a real user would follow when interacting with the system. Write tests at the same abstraction level as the user experiences the system.

Rules

1. Match the user's interface exactly

The test should call the system the same way a user would. If the system is a CLI, the test should invoke the CLI with argument strings. If it's a library, the test should call the public API. Don't wrap the interface in test-specific helpers that hide what's actually happening.

Good — the test reads like what a user would do:

This is the opening of the README. Read the full README on GitHub.

Frequently asked about Writing Tests

  • What else does saffron-health publish alongside Writing Tests?

    Writing Tests is one of 23 skills that DirSkills catalogs from saffron-health/libretto, the repository it ships in. Its siblings there include Address Review, CLI Development and Errore. Each one is a separate skill with its own page in this directory, installs the same way Writing Tests does, and is maintained by saffron-health in that same repository. The rest of the collection is listed on the saffron-health/libretto page.

  • How does Writing Tests compare to other Quality skills?

    Writing Tests ranks #906 by stars among the 1354 Quality skills in this catalog. The most-starred ones next to it are Benchmark, Benchmark Optimization Loop and API Design Patterns. DirSkills ranks by the star count of the repository each skill ships in, so that order reflects how popular those repositories are rather than any review of Writing Tests against them. Open each page to compare what they document and how they install.

More from saffron-health/libretto

Writing Tests is one of 23 skills cataloged on DirSkills from saffron-health/libretto.

See all 23 skills
📝
1w ago

Address Review

Address Review systematically fetches PR feedback, applies requested code changes, and verifies them with tests and checks. Use it when responding to human review comments on a pull request.
Automation
87767
⌨️
1w ago

CLI Development

CLI Development designs command-line interfaces with scoped help, clear success messages, and diagnosable failures. Use it when creating or updating commands, argument parsing, exit codes, or human- and machine-friendly CLI output.
Automation
87767
⚠️
1w ago

Errore

Errore is Go-style error handling for TypeScript, where functions return Error | T instead of throwing. Use it when you want typed, visible error handling with early returns and cause chains.
AI Engineering
87767
🖥️
1w ago

External Electron Apps

External Electron Apps automates user-installed Electron desktop apps through Libretto and CDP. Use it to control apps like Slack, VS Code, Discord, Notion, Figma, or Spotify on the user's machine.
Automation
87767
🧩
1w ago

Fix Merge Conflicts

Fix Merge Conflicts resolves Git merge, rebase, and cherry-pick conflicts by checking PR intent and preserving compatible changes from both sides. Use it when unmerged paths or conflict markers need careful resolution before validation.
Automation
87767
📝
1w ago

Generate Spec

Generate Spec creates a spec sheet in the specs directory for a significant feature or complex fix. Use it to research the codebase, clarify open questions, and define goals, non-goals, and an implementation plan.
Writing
87767