ears-format — правило для Claude Code: требования и установка
Правило ears-format задаёт формат EARS для критериев приёмки: условие, система и действие. Пригодится в spec-driven разработке.
MIT ★ 3 774 обновлён 2026-10-22
.claude/rules/ears-format.mdЧто делает ears-format
ears-format задаёт структуру EARS для критериев приёмки: условие или событие, конкретный субъект и обязательное действие системы. Правило охватывает пять случаев: событие, состояние, нежелательное поведение, опциональную функцию и постоянное требование.
Фиксированные конструкции When, If, While, Where, The system shall и The [system] shall остаются на английском. Переменные части переводятся на язык спецификации, заданный через spec.json.language, например en. Критерии должны описывать одно проверяемое поведение и использовать shall для обязательных требований.
Правило заявлено для Claude Code и Codex. Для Claude Code файл размещают по пути .claude/rules/ears-format.md. Если нужен полностью русскоязычный синтаксис критериев, правило не подойдёт: ключевые фразы EARS остаются на английском.
Какие задачи решает
- структурировать критерии приёмки по EARS
- разделить условие, субъект и действие системы
- оформить требования для событий и состояний
- описать ошибки через проверяемое поведение
- сохранить единый язык спецификации
Примеры запросов агенту
- Оформи критерии приёмки для оплаты по шаблонам EARS.
- Проверь требования в спецификации и оставь
When,IfиThe system shallна английском. - Перепиши критерии на язык из
spec.json.language, локализуя только переменные части.
Как установить ears-format
Вручную: положить файлы
.claude/rules/ears-format.mdПоле paths во frontmatter ограничивает файлы
AGENTS.md
Codex читает AGENTS.md: вставьте текст правила туда
Вручную: положить файлы
.cursor/rules/ears-format.mdcВо frontmatter: description, globs, alwaysApply
Вручную: положить файлы
.github/instructions/ears-format.instructions.mdПоле applyTo задаёт, к каким файлам применять
Вручную: положить файлы
.devin/rules/ears-format.mdВручную: положить файлы
.clinerules/ears-format.mdПо шагам, с командами для каждой платформы: AGENTS.md и CLAUDE.md: что это, кто читает и какой выбрать
Вопросы об ears-format
Как установить ears-format в Claude Code?
Разместите файл по пути .claude/rules/ears-format.md.
Что делает ears-format?
Правило задаёт синтаксис EARS для критериев приёмки. Оно разделяет условие, субъект и действие, а также требует проверяемого поведения.
Можно ли писать критерии полностью на русском?
Нет. Переменные части переводятся на язык спецификации, но ключевые фразы EARS, включая When и The system shall, остаются на английском.
Исходный текст
ears-format.md · MIT
# EARS Format Guidelines ## Overview EARS (Easy Approach to Requirements Syntax) is the standard format for acceptance criteria in spec-driven development. EARS patterns describe the logical structure of a requirement (condition + subject + response) and are not tied to any particular natural language. All acceptance criteria should be written in the target language configured for the specification (for example, `spec.json.language` / `en`). Keep EARS trigger keywords and fixed phrases in English (`When`, `If`, `While`, `Where`, `The system shall`, `The [system] shall`) and localize only the variable parts (`[event]`, `[precondition]`, `[trigger]`, `[feature is included]`, `[response/action]`) into the target language. Do not interleave target-language text inside the trigger or fixed English phrases themselves. ## Primary EARS Patterns ### 1. Event-Driven Requirements - **Pattern**: When [event], the [system] shall [response/action] - **Use Case**: Responses to specific events or triggers - **Example**: When user clicks checkout button, the Checkout Service shall validate cart contents ### 2. State-Driven Requirements - **Pattern**: While [precondition], the [system] shall [response/action] - **Use Case**: Behavior dependent on system state or preconditions - **Example**: While payment is processing, the Checkout Service shall display loading indicator ### 3. Unwanted Behavior Requirements - **Pattern**: If [trigger], the [system] shall [response/action] - **Use Case**: System response to errors, failures, or undesired situations - **Example**: If invalid credit card number is entered, then the website shall display error message ### 4. Optional Feature Requirements - **Pattern**: Where [feature is included], the [system] shall [response/action] - **Use Case**: Requirements for optional or conditional features - **Example**: Where the car has a sunroof, the car shall have a sunroof control panel ### 5. Ubiquitous Requirements - **Pattern**: The [system] shall [response/action] - **Use Case**: Always-active requirements and fundamental system properties - **Example**: The mobile phone shall have a mass of less than 100 grams ## Combined Patterns - While [precondition], when [event], the [system] shall [response/action] - When [event] and [additional condition], the [system] shall [response/action] ## Subject Selection Guidelines - **Software Projects**: Use concrete system/service name (e.g., "Checkout Service", "User Auth Module") - **Process/Workflow**: Use responsible team/role (e.g., "Support Team", "Review Process") - **Non-Software**: Use appropriate subject (e.g., "Marketing Campaign", "Documentation") ## Quality Criteria - Requirements must be testable, verifiable, and describe a single behavior. - Use objective language: "shall" for mandatory behavior, "should" for recommendations; avoid ambiguous terms. - Follow EARS syntax: [condition], the [system] shall [response/action].
© gotalab · MIT · gotalab/cc-sdd