Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

add-tests

БесплатноБез исполняемых скриптовНе проверен

Inspect the current pull request, stacked pull requests, branch, or working-tree change; draft a risk-based test plan; interview the user to agree on what…

owidот owid★ 1 574 звезды на GitHub

Об этом скилле

Add Tests

Build agreement on useful evidence before writing tests. Optimize for the smallest suite that rejects plausible regressions, not for test count or blanket coverage.

Modes

  • Interview (default). Draft a plan, interview the user, and implement only what they agree to.
  • Decide-for-me (opt-in). Use this mode only when the user explicitly asks for it: they pass decide-for-me as an argument, or say they don't want to be interviewed and you should make the testing decisions yourself. Everything else stays the same: read the policy, inspect the scope, draft the plan with the same care, then take your own recommendation at every decision point that would otherwise go to the user. Record each such decision and your reasons, and include them in the final report (step 7) so the user can review them afterwards. Never infer this mode from silence, urgency, or a non-interactive session.

1. Read the testing policy

Read docs/testing-strategy.md in full before inspecting or proposing tests. Treat it as authoritative. Also read every applicable AGENTS.md and any area-specific testing documentation for files likely to change.

Do not edit tests or production code yet.

2. Establish the review range

If the user names specific files, modules, or behaviors to test, that is the scope: treat their current behavior as the contract and skip the PR and stack inspection below, while still reading nearby code, callers, and existing tests.

Otherwise, inspect the repository rather than asking the user to restate work that Git can show. Start with:

  • current branch, worktree status, recent commits, and upstream/tracking state;
  • the current PR's title, body, base, commits, and changed files when GitHub CLI or equivalent PR metadata is available;
  • both committed and uncommitted diffs;
  • nearby production code, existing tests, fixtures, and test commands.

If the work is a PR stack, identify every PR layer and the parent/base of the bottom PR. Review both:

  1. the cumulative diff from the stack base to the current tip, to understand the final contract; and
  2. each layer's diff and stated intent, to identify guarantees introduced or changed at that layer.

Do not assume the default branch is the right base. Prefer PR metadata and merge bases. If stack metadata is unavailable, infer the likely range from local history, state the inference, and ask the user to confirm it before relying on the plan.

Separate unrelated dirty-worktree changes from the PR. Never discard or overwrite them. Call out ambiguity that materially changes the proposed coverage.

3. Reconstruct the behavioral contract

Summarize the work in observable terms, not file-by-file implementation terms. For each behavior, record:

  • the claim the change makes;
  • the plausible regression or wrong result worth rejecting;
  • existing evidence that already protects it;
  • the cheapest faithful test boundary;
  • important boundaries, counterexamples, sequences, or integrations;
  • what should deliberately remain untested and why.

Inspect existing tests deeply enough to avoid duplicating coverage and to follow local helpers and conventions. Static checks are not runtime evidence. Do not propose a database, browser, SVG, built-package, or external-runtime test unless the claim depends on that boundary.

For a bug fix, determine whether a focused test can fail against the pre-fix behavior for the expected reason. Recommend red/green verification when it is safe and useful, but do not revert broad changes or disturb unrelated work merely to demonstrate failure.

4. Present a first-draft plan

Present the draft before making changes. Keep it concrete enough that the user can disagree with individual choices. Use this structure:

Contract and risk

A short account of the behavior and the failures that matter.

Existing evidence

Name relevant tests and say exactly what they already prove or fail to prove.

Proposed tests

For each proposed test or coherent group, specify:

Field Content
Claim Observable rule protected
Boundary Unit/state/component, DB/API, browser, SVG, artifact, runtime, or manual
Cases Representative success, boundary, failure, and sequence cases only where distinct
Evidence Concrete assertions that distinguish correct behavior from likely regressions
Placement Proposed test file or suite
Cost Runtime, fixture, brittleness, or maintenance tradeoff

Include the focused commands that would validate the finished tests.

Deliberate exclusions

List tempting cases or higher-level regimes not proposed, with the eq

Полный SKILL.md на GitHub

Установить add-tests в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

agents/openai.yaml

FAQ

Что делает скилл add-tests?

Inspect the current pull request, stacked pull requests, branch, or working-tree change; draft a risk-based test plan; interview the user to agree on what deserves testing, the faithful test boundary, representative cases, and explanatory comments; then implement the agreed tests. Use when asked to add tests, decide test coverage for current work, test a PR or PR stack, or turn a completed change into a reviewed test plan and test suite. Pass `decide-for-me` to skip the interview and have the agent take its own recommendations.

Как установить скилл add-tests?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл add-tests запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

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

Сравнить add-tests с