speckit.companion.living-validate — команда для Claude Code
Команда speckit.companion.living-validate проверяет разметку living-спецификаций и дельт без правки файлов. Находит требования без сценариев, битые заголовки и синтаксические ошибки.
MIT ★ 110 обновлён 2026-10-19
.claude/commands/speckit.companion.living-validate.mdЧто делает speckit.companion.living-validate
Команда запускает скрипт python3 .specify/extensions/companion/scripts/living_validate.py из корня репозитория. Инструмент сканирует активные спецификации и сверяет их структуру: ищет требования длиннее 120 слов, формулировки с более чем 4 директивами SHALL, MUST или SHOULD, а также сценарии без блоков WHEN или THEN. При передаче аргумента --capability <name> валидатор проверяет только выбранную функциональность.
Инструмент работает в режиме чтения и никогда не прерывает пайплайн аварийным кодом: скрипт всегда завершается с нулевым статусом. Он только выводит список находок с кодами ошибок, номерами строк и готовыми подсказками по исправлению, не редактируя разметку самостоятельно.
Для работы требуется установленный интерпретатор Python 3. Если команда python3 недоступна в системе, валидатор выведет предупреждение и пропустит проверку. При отключённых living-спецификациях проверка ничего не сообщает и завершает работу.
Какие задачи решает
- найти требования без проверочных сценариев
- выявить сценарии без условий WHEN или результатов THEN
- обнаружить дублирующиеся заголовки требований внутри capability
- заметить дельты, указывающие на отсутствующие секции спецификации
- отследить незакрытые блоки кода в markdown
Примеры запросов агенту
- Запусти проверку спецификаций через speckit.companion.living-validate
- Проверь структуру living-спецификации для capability billing с ключом --json
Как установить speckit.companion.living-validate
Вручную: положить файлы
.claude/commands/speckit.companion.living-validate.mdВызов — /speckit.companion.living-validate. Для всех проектов — ~/.claude/commands/
Вручную: положить файлы
~/.codex/prompts/speckit.companion.living-validate.mdВызов — /prompts:speckit.companion.living-validate. В Codex этот формат помечен устаревшим, замена — скиллы
Вручную: положить файлы
.github/prompts/speckit.companion.living-validate.prompt.mdВручную: положить файлы
.gemini/commands/speckit.companion.living-validate.tomlGemini хранит команды в TOML: текст запроса — в поле prompt
Вопросы о speckit.companion.living-validate
Как установить speckit.companion.living-validate в Claude Code?
Разместите файл команды по пути .claude/commands/speckit.companion.living-validate.md внутри вашего проекта.
Что проверяет speckit.companion.living-validate?
Команда ищет дубликаты заголовков, требования без сценариев, незакрытые блоки кода и дельты, указывающие на несуществующие разделы.
Исправляет ли команда найденные ошибки сама?
Нет, команда работает строго на чтение и никогда не меняет файлы. Решение о правках и само редактирование спецификаций остаётся за автором.
Исходный текст
speckit.companion.living-validate.md · MIT
--- description: "Check the shape of living specs and a feature spec's deltas — a requirement with no scenario, a scenario missing WHEN or THEN, a duplicate heading, a delta pointing at nothing (opt-in, read-only, never halts)" --- # Spec Shape Check that every living spec, and every active feature spec's delta sections, are shaped the way every reader of them assumes. A living spec is only worth keeping if what gets folded into it is trustworthy, and until something checked, a requirement with no scenario or a delta pointing at a heading that does not exist landed silently and was found weeks later by a person reading the file. **Read-only** — it never edits anything, and it **never fails** (always exits success). The fold consumes the same checks and refuses to write on an error; this command only reports. A surrounding workflow may treat findings as a gate; the command itself does not. This is **opt-in**. With living specs disabled (or no config), it reports nothing and exits clean. ## Prerequisites - Verify Python is available by running `python3 --version`. - If `python3` is not available, warn the user and skip: `[companion] Warning: python3 not detected; skipped the spec shape check`. ## Execution Run the checker from the repository root. When the invocation names a capability, add `--capability <name>` so only that capability's spec is checked: ```bash python3 .specify/extensions/companion/scripts/living_validate.py ``` Add `--json` when a caller needs the machine-readable object rather than the list. Each finding carries a severity, a stable code, the path, the line, a sentence saying what is wrong, and a one-line fix. ## What it reports | Code | Severity | Raised when | |---|---|---| | `requirement-without-scenario` | warning | A requirement states a rule and never says how anyone would know it held. | | `requirement-bundles-rules` | warning | A requirement states more than 4 SHALL, MUST or SHOULD sentences under one heading. Split it: one requirement per rule, each with its own heading and scenario. | | `requirement-too-wordy` | warning | A requirement takes more than 120 words to state its rule. Cut it to the rule and the one reason that stops someone breaking it. | | `scenario-missing-half` | error | A scenario has a condition and no outcome, or an outcome and no condition. The keywords are recognised with or without emphasis, so `- WHEN …` counts exactly as `- **WHEN** …` does. | | `duplicate-requirement` | error | Two requirements in one capability share a heading, which is the join key fold-back and coverage use. | | `unknown-capability` | error | A delta block is marked for a capability the registry does not list. | | `delta-heading-not-found` | warning | A MODIFIED or REMOVED entry names a heading the target spec does not carry. The fold promotes an unmatched modification into an addition, so this is a defined outcome rather than damage. | | `unmatched-touches-glob` | warning | A file marker names a pattern matching nothing on disk. | - `requirements-outside-capability` — every file marker names code the capability does not claim, so nothing resolves for that behaviour. - `capability-claims-undescribed-code` — the capability claims code no requirement describes, so a change there is briefed with nothing. | `unbalanced-fence` | warning | A code fence is opened and never closed, so everything after it is invisible to every reader. | Severity answers exactly one question: whether the fold stops. An error means the durable record would be damaged; a warning means it would be untidy. ## Report Relay the checker's own output. Where it reports findings, say how many are errors and how many are warnings, and name the file and line for each. Where it reports skipped files, list them with their reasons verbatim — a clean report must never be readable as a verdict on files that were never examined. Do **not** edit any spec to satisfy a finding as part of this command. Fixing is the author's decision, made with the finding in front of them.
© alfredoperez · MIT · alfredoperez/speckit-companion