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

vally-tests — скилл для Claude Code: тесты на соответствие промптов

Скилл vally-tests генерирует тесты Vally, проверяющие, что промпты, инструкции, субагенты и скиллы ведут себя так, как заявлено. Пригодится при приёмке новых артефактов в репозиторий.

MIT ★ 1 627 обновлён 2026-10-25

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

Что делает vally-tests

Скилл запускается командой /vally-tests или через субагента Vally Test Author в двух режимах. В from-artifact он берёт файл .prompt.md, .instructions.md, .agent.md или SKILL.md, определяет тип артефакта по имени (или по параметру kind) и добавляет блоки стимулов в целевой eval-файл Vally. В corpus-import на входе CSV или XLSX по шаблону репозитория: путь должен заканчиваться на .csv или .xlsx, иначе скилл остановится и назовёт ошибку. Каждая строка импортированного корпуса получает тег tags.advisory: true, который нельзя переопределить.

Авторинг теста проходит шесть шагов: определение типа артефакта, подбор проверки из справочника по этому типу, выбор грейдера Vally из каталога, проверку устойчивости паттерна (чтобы грейдер не падал на корректном ответе и не проходил по одному тексту промпта), самопроверку по таксономии отказов и дедупликацию по SHA-256 хэшу нормализованного текста. Итог — отчёт о добавленных стимулах, пропущенных дубликатах и сработавших отказах с путём к JSON-отчёту запуска.

Скилл отказывается писать джейлбрейки, пейлоды для промпт-инъекций, стимулы для извлечения PII или секретов и тесты на обход политик: для таких задач нужен другой инструмент. Работа с corpus-import требует Vally CLI версии 0.15.0 и выше, PowerShell 7, bash и Python 3.11 с uv.

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

  • проверить, что промпт или скилл соблюдает заявленное поведение
  • сгенерировать тесты из CSV или XLSX корпуса сценариев
  • подобрать грейдер Vally под конкретную проверку
  • избежать дублирования стимулов в eval-файле
  • отказаться от генерации джейлбрейк- и инъекционных пейлодов

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

  • Напиши тесты Vally для agents/reviewer.agent.md
  • Импортируй корпус поведений из tests/corpus.csv в eval-файл
  • Проверь скилл SKILL.md на соответствие заявленным проверкам

Как установить vally-tests

1Через Skills CLI (Vercel)

npx skills add microsoft/hve-core --skill vally-tests -a claude-code

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

~/.claude/skills/vally-tests/SKILL.md

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

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

Вопросы о vally-tests

Как установить vally-tests в Claude Code?

Выполните npx skills add microsoft/hve-core --skill vally-tests -a claude-code, скилл появится в ~/.claude/skills/vally-tests/SKILL.md.

Что делает vally-tests?

Скилл пишет тесты на соответствие для промптов, инструкций, субагентов и скиллов, подбирая подходящий грейдер Vally и проверяя, что паттерн не ломается на корректных ответах. При этом он отказывается от генерации джейлбрейков, инъекций и запросов на извлечение PII.

Что нужно для режима corpus-import?

Нужны Vally CLI версии 0.15.0 или новее, PowerShell 7, bash и Python 3.11 с uv, а сам файл корпуса должен быть в формате CSV или XLSX по шаблону репозитория.

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

SKILL.md · MIT
---
name: vally-tests
description: 'Authors Vally conformance tests for prompts, instructions, agents, and skills, and refuses jailbreak, prompt-injection, harmful-elicitation, TOS, CoC, and PII-extraction stimuli'
argument-hint: '[mode={from-artifact|corpus-import}] [files=...] [path=...] [kind={auto|prompt|instructions|agent|skill}]'
license: MIT
user-invocable: true
compatibility: 'Requires Vally CLI 0.15.0+, PowerShell 7+, bash, and Python 3.11+ with uv for corpus-import workflows'
metadata:
  authors: "microsoft/hve-core"
  spec_version: "1.0"
  last_updated: "2026-10-07"
---
<!-- cspell:ignore roleplay doxxing scaffolder -->

# Vally Tests Skill

## Purpose

This skill authors Vally conformance tests for the four supported artifact kinds in this repository: prompts, instructions, agents, and skills. Each test exercises a documented behavior the artifact already claims and routes the result through an appropriate Vally grader so failures are explainable. Test authoring is bounded by a refusal taxonomy that keeps the skill out of adversarial, harmful, or policy-evasion territory.

Follow the shared content-policy public-output guard for eval stimuli and any public summaries derived from this skill. Vally tests are not a venue for terms-of-service boundary mapping, payload generation, refusal-text scoring, hidden-instruction disclosure, PII extraction, or secret extraction.

The skill ships:

* A canonical authoring workflow that runs directly through `/vally-tests` or through the `Vally Test Author` subagent.
* Per-kind reference files that enumerate every conformance check the skill knows how to express.
* A grader catalog that maps Vally CLI grader types to the checks they fit, and robustness rules that keep an emitted grader from asserting the impossible or failing correct behavior.
* A safety refusal taxonomy with regex patterns the safety lint script consumes.
* Helper scripts and asset templates for stimulus emission, corpus import, and dedupe.

## When to Invoke

Invoke this skill in one of two modes:

* From-artifact mode. The caller points at one or more artifact files (a `.prompt.md`, `.instructions.md`, `.agent.md`, or `SKILL.md`) through `files`, or at the open or attached file when `files` is omitted, and asks for conformance test stimuli that verify each artifact's stated behaviors. The skill detects the artifact kind from the filename unless `kind` overrides it, looks up the matching per-kind reference, picks graders, and appends stimulus blocks to the routed Vally eval file.
* Corpus-import mode. The caller supplies a CSV or XLSX corpus through `path` that follows the shipped template, and the skill turns each row into a stimulus block in the routed eval file. Before reading, confirm that `path` exists and ends in `.csv` or `.xlsx`; otherwise name the bad path and stop. Every imported row carries `tags.advisory: true`, and corpus content cannot override it. Used when a large batch of behaviors needs identical formatting and dedupe handling.

After either mode, report the target eval file, stimuli appended, duplicates skipped, refusals triggered, and the JSON run report path.

Do not invoke this skill to:

* Generate adversarial probes, jailbreak attempts, prompt-injection payloads, or red-team stimuli.
* Test refusal quality on harmful, illegal, or policy-violating prompts.
* Author stimuli that elicit PII, secrets, hidden instructions, or model self-disclosure.
* Store payload examples, paraphrased prohibited requests, or quoted flagged content in Vally eval specs, corpus rows, PR summaries, issue bodies, or comments.
* Replace Responsible AI threat modeling. RAI work lives in the RAI Planner agent.

## Authoring Workflow

Each invocation follows the same six-step pipeline:

1. **Artifact-kind detection.** Resolve the kind from the artifact path or the corpus row's `kind` column. Supported kinds: `prompt`, `instructions`, `agent`, `skill`. Reject unknown kinds with a refusal block.
2. **Reference lookup.** Load the matching reference file from `references/` and select the check or checks the stimulus exercises. Stage the artifact under test in the stimulus's `agent_environment` so the agent can read what the prompt names.
3. **Grader selection.** Use `references/grader-catalog.md` as the authoritative selection surface. Pick the registered Vally grader family that directly observes the expected behavior and follow its stimulus-shape guidance.
4. **Robustness check.** Apply `references/grader-robustness.md`. Confirm the stimulus stages every file whose wording the grader asserts, that the pattern constrains order and proximity only where those are the behavior under test, that a compliant agent phrasing the behavior differently still passes, and that no positive grader passes on the prompt text alone. Verify the pattern offline against answers that must pass and answers that must still fail before appending.
5. **Safety self-check.** Run a safety self-check against the refusal taxonomy regex set. Refusing here is the correct outcome for any stimulus that matches a refusal category.
6. **Dedupe and append.** Compute a SHA-256 hash of the normalized prompt text, compare against existing stimuli in the target eval file, and append only when novel.

The pipeline is identical for both invocation modes. Corpus-import mode runs steps 2 through 6 once per row.

## Safety Refusal Taxonomy

Authoring is bounded by seven refusal categories. Any stimulus that matches a category's regex set is refused before it reaches the dedupe step. The categories and their normative source are listed below. The full regex set lives in `references/refusal-taxonomy.md` and is consumed by the safety lint script.

| Category                  | Definition                                                                                                                | Normative Source        |
|---------------------------|---------------------------------------------------------------------------------------------------------------------------|-------------------------|
| jailbreak                 | Attempts to bypass model safety policies through persona switching, hypothetical framing, or roleplay coercion.           | Project Code of Conduct |
| prompt-injection          | Attempts to override system or developer instructions through embedded or external content.                               | Project Code of Conduct |
| harmful-elicitation       | Requests for content that causes physical, financial, psychological, or reputational harm.                                | Project Code of Conduct |
| tos-violation             | Stimuli that solicit content prohibited by GitHub, Microsoft, or model-provider terms of service.                         | Project Code of Conduct |
| coc-violation             | Stimuli that violate this repository's Code of Conduct, including harassment, discrimination, or doxxing.                 | Project Code of Conduct |
| model-refusal-elicitation | Attempts to provoke a model refusal so the refusal text itself can be scored, graded, or used to map provider boundaries. | RAI Planner guidance    |
| pii-extraction            | Attempts to elicit personally identifiable information, secrets, credentials, or proprietary training data.               | RAI Planner guidance    |

When a request triggers a refusal, emit the canonical refusal block:

```text
This skill authors conformance tests only. The request appears to fall under <category>. Please consult <Project Code of Conduct | RAI Planner agent> for the appropriate process.
```

Substitute the matched `<category>` and the most relevant normative source. Do not negotiate, rephrase, or partially fulfill the request.

## Helper Script Index

Helper scripts ship as parity pairs (`.ps1` and `.sh`) where the workflow does not require Python. The safety lint is the exception: it ships only as `Lint-VallyTestSafety.ps1`, which `import_corpus.py` invokes, so a single regex engine evaluates the refusal taxonomy. Python is used only for the corpus-import path because the source-of-truth interchange format is CSV with an XLSX mirror.

| Script                             | Purpose                                                                                           | Language      | Delivery |
|------------------------------------|---------------------------------------------------------------------------------------------------|---------------|----------|
| `scripts/New-Stimulus.ps1`         | Scaffolds a single stimulus YAML block from an artifact path and appends to the routed eval file. | PowerShell 7+ | Phase 2  |
| `scripts/new-stimulus.sh`          | Parity counterpart for the PowerShell stimulus scaffolder.                                        | bash          | Phase 2  |
| `scripts/import_corpus.py`         | Reads the CSV or XLSX corpus template and emits dedupe-checked stimulus blocks per kind.          | Python 3.11+  | Phase 2  |
| `scripts/Lint-VallyTestSafety.ps1` | Runs the refusal taxonomy regex set against a candidate stimulus and exits non-zero on match.     | PowerShell 7+ | Phase 3  |

All helpers honour a shared dedupe contract: SHA-256 of the prompt text after Unicode NFC normalization and whitespace collapse.

The helpers emit a JSON run report to `logs/vally-test-author-<timestamp>.json`, where `<timestamp>` is `YYYYMMDD-HHMMSS` (UTC). The report captures, at minimum: `mode`; `inputs` (the resolved `files`/`path` and `kind`); `target_eval_file`; `stimuli_appended` (count and per-row hash); `dedupe_results` (count and per-row hash for skipped duplicates); `refusal_check` (per-row category match, if any); `safety_lint_exit_code`; `blockers` (any ambiguous safety-lint outcomes surfaced for review); and `written_paths`.

## Reference Index

References capture the conformance taxonomy, grader selection rules, eval-suite routing, and the regex source of truth for the refusal taxonomy. Each file targets a specific decision point in the authoring workflow.

| Reference                                                 | Covers                                                                                               |
|-----------------------------------------------------------|------------------------------------------------------------------------------------------------------|
| [prompts.md](references/prompts.md)                       | The 12 conformance checks emitted for `.prompt.md` artifacts.                                        |
| [instructions.md](references/instructions.md)             | The 8 conformance checks emitted for `.instructions.md` artifacts.                                   |
| [agents.md](references/agents.md)                         | The 9 conformance checks emitted for `.agent.md` artifacts.                                          |
| [skills.md](references/skills.md)                         | The 9 conformance checks emitted for `SKILL.md` artifacts.                                           |
| [grader-catalog.md](references/grader-catalog.md)         | Vally CLI grader types, selection rules, and gotchas.                                                |
| [grader-robustness.md](references/grader-robustness.md)   | Mounting, order and proximity limits, negation guards, prompt-echo checks, and the pre-commit probe. |
| [refusal-taxonomy.md](references/refusal-taxonomy.md)     | Regex source of truth for the 7 refusal categories and worked examples.                              |
| [eval-suite-routing.md](references/eval-suite-routing.md) | Maps artifact kind to the canonical Vally eval file under `evals/`.                                  |

## Asset Index

Assets supply the interchange formats the corpus-import path consumes. The CSV is the source of truth. The XLSX mirror is regenerated from the CSV by `import_corpus.py` and is never edited directly.

| Asset                                | Purpose                                                                                                       |
|--------------------------------------|---------------------------------------------------------------------------------------------------------------|
| `assets/corpus-import-template.csv`  | Canonical CSV template with header `prompt,kind,target_artifact,grader,tags,expected_refusal_category,notes`. |
| `assets/corpus-import-template.xlsx` | Excel mirror of the CSV regenerated by the import script.                                                     |

## Output Targets per Kind

Authored stimuli always land in one of the routed Vally eval files. The router is encoded in `references/eval-suite-routing.md` and mirrored here for quick lookup.

| Kind         | Target Eval File                                      | Vally Suite Name     |
|--------------|-------------------------------------------------------|----------------------|
| prompt       | `evals/behavior-conformance/prompts.eval.yaml`        | behavior-conformance |
| instructions | `evals/behavior-conformance/instructions.eval.yaml`   | behavior-conformance |
| agent        | `evals/agent-behavior/eval.yaml`                      | agent-behavior       |
| skill        | `evals/behavior-conformance/skill-behavior.eval.yaml` | behavior-conformance |

The `prompt` target is created on first use when a repository has no prompt stimuli yet.

Never write to `evals/baseline-equivalence/`, `evals/script-validation/`, or `evals/results/` from this skill. Those targets serve baseline equivalence, script validation, and historical comparison flows that are out of scope for conformance authoring.

## Contributing

Follow these conventions when extending this skill:

* New per-kind checks belong in the matching `references/{kind}.md` file. Bump the check count in this SKILL.md when the reference adds or removes checks.
* New grader types belong in `references/grader-catalog.md` and only after the matching Vally CLI version is pinned in `package.json` devDependencies.
* New refusal categories require updates to `references/refusal-taxonomy.md`, the regex set the safety lint script consumes, the Safety Refusal Taxonomy table above, and the canonical refusal block.
* Helper scripts must ship in parity pairs (`.ps1` and `.sh`) unless the workflow has a hard Python dependency. The safety lint is the one exception and ships only as `Lint-VallyTestSafety.ps1`; do not add a bash mirror. Python helpers live under `scripts/` and are configured by the skill's `pyproject.toml`.

© microsoft · MIT · microsoft/hve-core

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

Все скиллы по теме «Тесты и QA» →
configs-variations launchdarkly Скилл configs-variations для Claude Code создаёт вариации конфигов и помогает сравнивать модели, промпты и параметры. Эксперимент строится вокруг одной изменяемой переменной. CX Codex +1 1 900установок promptfoo-evaluation daymade Скилл promptfoo-evaluation помогает настроить и запустить оценку LLM через Promptfoo: конфиг promptfooconfig.yaml, свои проверки на Python, судейство моделью по рубрике. CX Codex +1 1 600установок agent-evaluation sickn33 Скилл agent-evaluation для Claude Code, который задаёт процедуру сравнения версий агента по зафиксированным кейсам. Запускается, когда меняются промпты, инструменты или модель и нужно понять, не сломалось ли поведение. CX Codex +1 994установок prompt-regression-tester VoltAgent prompt-regression-tester — субагент для Codex, который подбирает регрессионные тесты для изменений в ИИ-системе. Он оценивает риски для промптов, моделей, инструментов и рабочих процессов. CX Codex ★ 6 505звёзд репо run-tests dotnet Скилл run-tests для Claude Code подбирает и запускает команду dotnet test с учётом проекта и раннера. Разбирает несовпадения фильтров и флагов в .NET-тестах. CX Codex +1 7 000установок om-integration-tests open-mercato Скилл om-integration-tests помогает создавать и отлаживать E2E-тесты в живом приложении без угадывания селекторов. Исследует запущенный сервис через настроенный браузер и сохраняет привычный тестовый раннер репозитория. CX Codex +1 3 800установок

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

Весь набор →
System Architecture Reviewer Субагент System Architecture Reviewer разбирает архитектурные решения с учётом ограничений проекта, фиксирует компромиссы и помогает сохранить обоснование решений. Пригодится перед выбором архитектуры или оформлением ADR. CX Codex +1 ★ 1 627звёзд репо Data Science and Engineering Coach Субагент Data Science and Engineering Coach, который ведёт сессию data science и инженерии данных с явным выбором задач, сохранением состояния и маршрутизацией работы в специализированные скиллы. CX Codex +1 ★ 1 627звёзд репо RAI Planner Субагент RAI Planner проводит оценку этичности и надёжности ИИ-системы по стандарту NIST AI RMF 1.0, формируя итоговый отчёт rai-plan.md через шесть фаз с проверками. CX Codex +1 ★ 1 627звёзд репо disclaimer-language Правило disclaimer-language добавляет предупреждение к планам и результатам проверок, созданным ИИ-агентом. Оно напоминает, что выводы должны пройти проверку специалиста. CX Codex +1 ★ 1 627звёзд репо functional-planner Скилл functional-planner разбирает документ требований на структуру задач для Azure DevOps, GitHub или Jira без прямых правок в трекере. CX Codex +1 ★ 1 627звёзд репо backlog-execute Скилл backlog-execute для Claude Code создаёт задачи или применяет handoff в Azure DevOps, GitHub и Jira. Вносит согласованные изменения в трекер по запросу или по файлу операций. CX Codex +1 ★ 1 627звёзд репо backlog-templates Скилл backlog-templates для Claude Code хранит общие шаблоны задач для ADO и GitHub с метаданными, ID и правилами санитизации. Их используют планировщики RAI, Security, SSSC, Accessibility и Privacy. CX Codex +1 ★ 1 627звёзд репо copilot-otel-metrics Скилл copilot-otel-metrics настраивает экспорт телеметрии OpenTelemetry из GitHub Copilot в VS Code: поднимает локальный стек с Grafana или готовит шаблоны сбора в Azure. CX Codex +1 ★ 1 627звёзд репо

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

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