Agent skill

Writing Tests

by cashew-labs in cashew-labs/libretto

Write and edit test files that model real user flows. An agent skill from cashew-labs/libretto.

MITAuto-check passedFrontend & Design

Install Writing Tests

skills CLI
$ npx skills add cashew-labs/libretto --skill writing-tests -a claude-code

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

GitHub CLI
$ gh skill install cashew-labs/libretto writing-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/cashew-labs/libretto.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/writing-tests .claude/skills/writing-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
writing-tests
GitHub stars
904
Token cost
~535 tokens
SKILL.md length
274 words
Files
1
Skills in repo
21
Repo updated
First seen
Licence
MIT

At a glance

Write and edit test files that model real user flows. An agent skill from cashew-labs/libretto.

  • Works in 4 steps: Match the user's interface exactly → Keep tests verbose and concrete → One flow per test → …
  • Reviewing test files
  • SKILL.md covers Core Principle: Tests Are User… and Rules
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Writing Tests is an agent skill from cashew-labs/libretto. Write and edit test files that model real user flows. Use when creating, modifying, or reviewing test files.

Its SKILL.md is about 540 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 Frontend & Design, covering UX design. The repository describes itself as: The AI toolkit for building reliable browser automations. The licence is MIT.

When your agent uses it

  • Reviewing test files
  • Tasks that involve UX design

Example prompts

  • “/writing-tests”

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Match the user's interface exactly
  2. Keep tests verbose and concrete
  3. One flow per test
  4. Tests form a behavioral hull

What it can do on your machine

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

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

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

  • Network

    No URLs in SKILL.md.

    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

Writing Tests loads about 535 tokens when it runs. Until then it costs about 31 tokens; SKILL.md has 274 words of instructions outside code blocks.

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

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 cashew-labs/libretto at commit 41ab782, republished under its MIT licence (© cashew-labs). 274 words, ~535 tokens.

Download SKILL.mdSave it as .claude/skills/writing-tests/SKILL.md (or your agent's skills folder).
name
writing-tests
description
Write and edit test files that model real user flows. Use when creating, modifying, or reviewing test files.

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:

ts
const result = await librettoCli("setup --skip-browsers");
expect(result.exitCode).toBe(0);

const result2 = await librettoCli("--help");
expect(result2.stdout).toContain("Usage:");

Bad — extra abstraction obscures the actual interaction:

ts
const result = await setupWithDefaults(); // hides the real CLI invocation
assertSuccess(result); // hides what "success" means
2. Keep tests verbose and concrete

Don't introduce helpers for brevity. The value of a test is that you can read it top-to-bottom and understand exactly what's happening. Repetition across tests is fine — each test should be self-contained and readable on its own.

3. One flow per test

Each test should exercise one coherent user scenario from setup through assertion. Don't combine unrelated flows into a single test, and don't split one logical flow across multiple tests.

4. Tests form a behavioral hull

The full set of tests for a system should cover the sufficiently complete set of flows a user might follow. Think about:

  • The happy path for each major feature
  • Edge cases a user would realistically hit
  • Error cases and what the user sees when things go wrong

When adding a new feature, add tests that cover the new user flows it introduces. When fixing a bug, add a test that reproduces the flow where the bug occurred.

© cashew-labs, 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/writing-tests of cashew-labs/libretto.

Open the folder on GitHubat commit 41ab782

Compare with similar skills

Writing 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.

Writing Tests compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Writing Tests this skillcashew-labs/libretto904—~535Automated safety check: PassMIT
Impeccablebestofjs/bestofjs3.1k26 repos~2.6kAutomated safety check: PassMIT
Interface Design for Dashboards and Appsholaboss-ai/holaOS11k3 repos~6kAutomated safety check: PassMIT
Animategrowupanand/ConvoForm1026 repos~1.9kAutomated safety check: PassApache-2.0
Migrate Content Iadocker/docs4.7k—~5.1kAutomated safety check: PassApache-2.0
UX WalkthroughXiaoMi/hiui879—~1.3kAutomated safety check: PassMIT

Similar skills

  • Impeccable

    bestofjs/bestofjs

    A skill your agent uses when the user wants to design, redesign, shape, critique, audit, polish, clarify, distill, harden, optimize, adapt, animate, colorize, extract, or otherwise improve a…

    3.1k GitHub starsUsed in 26 repos~2.6k tokens
    Frontend & DesignAuto-check passed
  • Pushes an agent past generic defaults when designing dashboards, admin panels, SaaS apps and tools, with attention to structure, type, navigation and how data is shown.

    11k GitHub starsUsed in 3 repos~6k tokens
    Frontend & DesignAuto-check passed
  • Animate

    growupanand/ConvoForm

    Review a feature and enhance it with purposeful animations, micro-interactions, and motion effects that improve usability and delight.

    102 GitHub starsUsed in 6 repos~1.9k tokens
    Frontend & DesignAuto-check passed
  • Official

    Handle Hugo docs information-architecture moves: discover old vs new URLs, add front matter aliases (Phase 1), update in-repo links (Phase 2), interactive List 2 resolution and fragment validation…

    4.7k GitHub stars~5.1k tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • UX Walkthrough

    XiaoMi/hiui

    体验走查 skill。适用于代码库、URL、截图三种输入,输出结构化体验问题报告,并同步生成本地 docx 报告。触发词:体验走查、UX review、交互走查、界面审查、体验问题。

    879 GitHub stars~1.3k tokensUpdated 2 mo ago
    Frontend & DesignAuto-check passed
  • Color Audit

    rome-os/rome

    Audit a design system's color palette against measurable color-science disciplines — WCAG/APCA contrast of declared token pairs, perceptual (OKLCH) ramp uniformity, color-blindness safety of…

    743 GitHub stars~2.7k tokensUpdated today
    Frontend & DesignAuto-check passed

More from cashew-labs/libretto

All 21 skills in this repo
  • System Prompt Writing Guide

    cashew-labs/libretto

    Lays out a minimal, iteration-first approach to writing system prompts for LLM agents, with model-specific notes for Claude, GPT, Gemini, and Codex.

    904 GitHub stars~570 tokensUpdated 1 mo ago
    Auto-check passed
  • Address PR Review Comments

    cashew-labs/libretto

    Works through the review comments on a pull request one by one: fetches the threads, makes the fixes, runs type-check, build and lint, pushes, and resolves the threads.

    904 GitHub stars~532 tokensUpdated 1 mo ago
    Auto-check passed
  • CLI Development

    cashew-labs/libretto

    Design rules for command-line tools: subcommand-scoped help, actionable success output, debuggable failures, stable output, meaningful exit codes and a --json mode.

    904 GitHub stars~781 tokensUpdated 1 mo ago
    Auto-check passed
  • Drives desktop Electron apps already installed on your machine, such as Slack, Discord or VS Code, by relaunching them with a debugging port and using the Libretto CLI.

    904 GitHub stars~967 tokensUpdated 1 mo ago
    Auto-check passed
  • Merge Conflict Resolver

    cashew-labs/libretto

    Resolves Git merge, rebase and cherry-pick conflicts by reading the PRs behind each side, keeping both intents and asking you when they truly clash.

    904 GitHub stars~1.1k tokensUpdated 1 mo ago
    Auto-check passed
  • Feature Spec Generator

    cashew-labs/libretto

    Researches the codebase and relevant docs, asks clarifying questions, then writes a spec sheet in specs/ for a significant feature or complex fix.

    904 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed

Questions about Writing Tests

What does Writing Tests do?

Write and edit test files that model real user flows. An agent skill from cashew-labs/libretto. Writing Tests is an agent skill from cashew-labs/libretto. Write and edit test files that model real user flows.

When should I use Writing Tests?

Writing Tests fits situations like: reviewing test files; tasks that involve UX design.

How do I install Writing Tests in Claude Code?

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

How do I install Writing Tests in Codex?

Run `npx skills add cashew-labs/libretto --skill writing-tests -a codex`. Or copy the skill folder (.agents/skills/writing-tests in cashew-labs/libretto) into .agents/skills/writing-tests in your project. Codex loads it when a task matches its description.

Can I use Writing 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 cashew-labs/libretto --skill writing-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/writing-tests, .gemini/skills/writing-tests, .github/skills/writing-tests and .opencode/skills/writing-tests in your project.

What does Writing Tests need to run?

SKILL.md names no scripts, command-line tools or credentials: Writing Tests is instructions for the agent only.

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

Writing Tests 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 Writing Tests use?

About 535 tokens (SKILL.md is roughly 2.1k 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 Writing Tests?

Skills that share tags, products or a category with Writing Tests: Impeccable (bestofjs/bestofjs, 3.1k stars), Interface Design for Dashboards and Apps (holaboss-ai/holaOS, 11k stars), Animate (growupanand/ConvoForm, 102 stars) and Migrate Content Ia (docker/docs, 4.7k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Writing Tests?

cashew-labs (a GitHub organization) maintains it in cashew-labs/libretto, which has 904 GitHub stars. The repository holds 21 skills in this directory. The repository was last updated on August 21, 2026.

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