К основному содержанию
скилл CX Codex

test-writer · sno-ai — скилл для Claude Code: тесты и установка

Скилл test-writer для Claude Code пишет и улучшает тестовый код. Запускается, когда Codex просят создать или изменить тесты.

Apache-2.0 ★ 869 обновлён 2026-11-16

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add sno-ai/sno-station-skills --skill test-writer -a claude-code
Открыть на GitHub

Что делает test-writer

test-writer изучает требования, реализацию, ближайшие тесты и обычную команду запуска, затем добавляет тесты в существующем стиле проекта. Он выбирает границу проверки: модульную, интеграционную, сквозную или для eval и симуляций. Проверяет реальные эффекты и не подменяет тестируемую систему моками, если её можно запустить.

Скилл меняет только тесты, фикстуры, тестовые помощники и нужную им конфигурацию. Он запускает узкую команду для изменённого теста и исправляет дефекты тестового кода; ошибки продукта передаёт вызывающему агенту. Для работы нужны инструменты чтения и записи файлов и оболочка.

Какие задачи решает

  • добавить тест для нового поведения
  • проверить дефект через реальный путь выполнения
  • подготовить фикстуры и тестовые помощники
  • исправить сбои в тестовом коде

Примеры запросов агенту

  • Добавь тесты для этого поведения в существующем тестовом фреймворке.
  • Проверь этот дефект реальным интеграционным тестом и запусти только затронутый тест.
  • Создай фикстуры для этого сценария и сообщи результат запуска.

Как установить test-writer

1Через Skills CLI (Vercel)

npx skills add sno-ai/sno-station-skills --skill test-writer -a claude-code

2Вручную: положить файлы

~/.claude/skills/test-writer/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/test-writer/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о test-writer

Как установить test-writer в Claude Code?

Запусти npx skills add sno-ai/sno-station-skills --skill test-writer -a claude-code. Файл скилла находится по пути ~/.claude/skills/test-writer/SKILL.md.

Что делает test-writer?

Он пишет и запускает тесты в существующем тестовом окружении проекта, а затем исправляет дефекты тестового кода. Исходный код продукта он не меняет.

Что нужно для работы test-writer?

Скиллу нужны инструменты чтения и записи файлов и доступ к оболочке.

Исходный текст

SKILL.md · Apache-2.0
---
name: test-writer
description: "Write and improve test-owned code: tests, test scripts, fixtures, evals, and test-only helpers. Use whenever Codex is asked to create or change test code. Its only job is to produce the strongest practical tests in the repository's existing harness, run them, and fix defects in the test code."
requires:
  programs: []
  harness:
    - {slot: 4.shell, need: required}
    - {slot: 4.file-read-write, need: required}
---

# Test Writer

Write the best test code for the requested behavior. Start with the repository and the
behavior.

## Test scope

- Run tests only for the changed behavior and its directly affected callers or integrations.
- Do not run full evaluation, unit, integration, repository, site, or all-module suites unless the owner explicitly requests them.
- A skill, PRD, reviewer, repository document, or default package script does not grant that permission.
- After a failure, rerun the failing case first. Once it passes, run only directly affected cases; do not expand by default.
- Build artifacts required for a requested deployment are not permission to run unrelated tests.
- Every development task has a finite budget including setup, execution, and reporting; before each run, estimate duration from available timings and name the changed behavior it verifies, using a stated estimate when timings are unknown rather than building a timing system or running a preliminary suite.
- Remove checks and repeated runs that neither establish the requested main function nor expose its defects; select the smallest useful test that fits the remaining development budget, never spend it on reassurance.

## Single responsibility

Own only test code:

- tests and test scripts
- fixtures and test-only helpers
- eval and simulation code
- test harness configuration required by those files

The output of this skill is test-owned code and the result of running it. Return product
defects to the caller; do not edit production/runtime source.

## Core principles

1. **Everything should be real.** Exercise the real code path, real parser, real filesystem,
   real database, real API, or real service whenever the repository can provide it.
2. **We hate mocking.** A mock easily proves that the mock behaves like its setup while the
   product remains broken. Never mock the system under test. Use a substitute only when a
   truly external dependency cannot be run, and keep the substitute narrower than the
   behavior being proved.
3. **Assert observable results.** Check returned content, persisted state, emitted files,
   external effects, cleanup, and errors. Do not assert call counts when a real effect can be
   observed.
4. **A test must catch a real defect.** Every assertion must be able to fail when the product
   behavior is wrong. Do not add tests for quotas, coverage theater, or speculative cases.
5. **Use realistic data.** Match production formats, sizes, identifiers, timestamps, and
   sequences closely enough to expose real failures.
6. **Keep tests deterministic and isolated.** Use unique test identities, clean up created
   state, avoid shared-order assumptions, and make failures reproducible.

## Test ownership

Use this skill when changing test-owned files. Keep the test independent of the production
fix and report real failures. Do not enforce ownership through an edit-blocking hook or
require an edit lease before writing a test.

## Write the code

1. Read the requested behavior or acceptance criteria.
2. Read the implementation boundary, its immediate callers, nearby tests, test configuration,
   and the repository's normal test command.
3. Reuse the existing language, framework, fixtures, and directory layout. Ask only when a new
   framework, dependency, credential, or external environment is genuinely required.
4. Choose the smallest test boundary that proves the real behavior:
   - unit for pure deterministic logic;
   - integration for filesystem, database, API, cache, queue, or component interaction;
   - end-to-end for a complete user or service journey;
   - eval or simulation for non-deterministic model or agent behavior.
5. Write the test code. Prefer one strong journey over several weaker duplicates.
6. Run the narrowest command that executes the changed test. Fix syntax, fixtures, cleanup,
   flakiness, and other defects in test-owned code.
7. Report the changed test files, the command run, and the observed result. If the test exposes
   a product defect, name the failing behavior and evidence.

## Test quality

- Test public behavior rather than private implementation details.
- Verify positive behavior and the important failure that could silently corrupt or lose data.
- Check both the primary result and its meaningful side effect when both are part of the
  contract.
- For E2E work, exercise the changed primary flow through its ordinary entry to destination
  read-back. Reproduce the actual bug for a fix; do not plant extra defects in every new
  feature merely to complete a proof pattern. The harness may prepare
  inputs and environment and observe results; if it supplies a missing product step, return a
  product or contract defect.
- Keep setup shorter than the behavior it proves. If setup dominates, find a more direct real
  boundary or a reusable real fixture.
- Never weaken, skip, or delete an assertion just to make a failing test pass.
- Do not add a second proof layer unless it can catch a materially different defect.
- Use the task's agreed time limits for long calls; do not add an arbitrary timeout that kills useful work or hides its output.

## Optional code references

- For eval and simulation implementations, read `references/eval-sim-patterns.md`.

© sno-ai · Apache-2.0 · sno-ai/sno-station-skills

Похожие скиллы

Все скиллы по теме «Тесты и QA» →

Сначала — test-writer от других авторов.

test-writer leonardomso Скилл test-writer генерирует тесты Vitest для примеров кода из страниц документации по JavaScript. Помогает проверить точность примеров перед публикацией. CX Codex +1 358установок test-writer vstorm-co Скилл test-writer генерирует наборы тестов для готового кода с учётом фреймворка и стилей проекта. CX Codex +1 ★ 1 125звёзд репо test-data-generation aj-geddes Скилл test-data-generation для Claude Code генерирует реалистичные тестовые данные через фабрики, фикстуры и @faker-js/faker. Создаёт данные для сидинга баз и интеграционных тестов. CX Codex +1 505установок test-automation-framework aj-geddes Скилл test-automation-framework для Claude Code проектирует каркас автотестов: Page Object Model, фикстуры, отчётность. Подключается, когда тестовый набор разрастается и его пора структурировать. CX Codex +1 507установок improving-test-suites b-mendoza Скилл improving-test-suites для Claude Code пересматривает существующие тесты и оставляет проверки важного поведения. Запускается по просьбе улучшить, сократить или укрепить тестовый набор. CX Codex +1 119установок test-value tt-a1i Скилл test-value помогает выбирать тесты по риску, находить дубли и разбирать нестабильные проверки. Пригодится во время разработки, аудита и ревью перед коммитом. CX Codex +1 ★ 98 599звёзд репо test-data-management kindlmann Скилл test-data-management помогает проектировать фабрики, изолированные фикстуры и сиды для тестов. Пригодится при настройке анонимизации персональных данных и генерации синтетических сущностей. CX Codex +1 1 700установок test-writer-fixer Community Субагент test-writer-fixer генерирует unit- и e2e-тесты, находит сломанные проверки после правок и чинит их. Помогает отслеживать регрессии при рефакторинге и закрывать пробелы в тестах. CX Codex ★ 2 003звёзд репо

Из того же набора40

Весь набор →
catch-report Скилл catch-report для Claude Code сопоставляет результаты взаимной проверки моделей и самопроверки агента. Запускается по запросу о результатах ревью или проверках за неделю. CX Codex +1 ★ 869звёзд репо away-brief Скилл away-brief для Claude Code собирает краткий отчёт о работе, блокерах, вопросах и квотах. Запускается по запросу о том, что произошло за время отсутствия. CX Codex +1 ★ 869звёзд репо agentic-time-estimate Скилл agentic-time-estimate для Claude Code оценивает длительность работы ИИ-агента и оставшееся время по измеренным данным. Для времени на часах он запускает sno report-time, а время работы разработчика не оценивает. CX Codex +1 ★ 869звёзд репо ts-coder Скилл ts-coder для Claude Code помогает писать и рефакторить TypeScript и TSX с учётом устройства репозитория. Он подключается к задачам с типами, API и миграциями. CX Codex +1 ★ 869звёзд репо shellscript-coder Скилл shellscript-coder для Claude Code, который помогает писать и рефакторить shell-скрипты и CLI-инструменты. Включается при задачах с автоматизацией, Git и инфраструктурными помощниками. CX Codex +1 ★ 869звёзд репо rust-coder Скилл rust-coder для Claude Code помогает писать и менять код на Rust с учётом устройства репозитория. Включается для новых функций, рефакторинга и миграций, в том числе при крупных изменениях .rs и Cargo.toml. CX Codex +1 ★ 869звёзд репо python-coder Скилл python-coder для Claude Code помогает писать и перерабатывать production-код на Python, включая FastAPI и Pydantic. Подключается к задачам с асинхронным кодом и миграциями. CX Codex +1 ★ 869звёзд репо owner-intent-audit Скилл owner-intent-audit для Claude Code сверяет планы, тесты и код с намерением владельца проекта. Запускается перед одобрением или слиянием изменений. CX Codex +1 ★ 869звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой