enforce-rules-format — скилл для Claude Code: проверка правил
Проверяет, отмечены ли правила как enforce, check или guidance, и предлагает исправления. Пригодится для проектов с Vigiles и файлами инструкций.
npx skills add zernie/vigiles --skill enforce-rules-format -a claude-codeЧто делает enforce-rules-format
Скилл определяет формат проекта по файлам. Наличие CLAUDE.md.spec.ts или другого *.spec.ts указывает на v2: правила должны использовать enforce(), check() или guidance(). Для v1 он проверяет CLAUDE.md, AGENTS.md и .cursorrules, где нужны специальные аннотации.
Для v2 скилл запускает npx vigiles compile и npx vigiles discover, сверяет enforce() с правилами линтера и ищет проверки, которые можно передать линтеру. Для v1 он просматривает заголовки ### и формирует список правил без аннотаций.
Перед изменениями скилл спрашивает пользователя. Без согласия он предлагает вариант с enforce() или guidance(), а для v1 — соответствующую аннотацию. В конце проверяет результат через npx vigiles check; для v2 также использует npx vigiles compile.
Какие задачи решает
- проверить классификацию правил в spec-файлах
- найти правила v1 без аннотаций
- сопоставить
enforce()с правилами линтера - предложить замену ручных проверок на линтер
- проверить результат через
npx vigiles check
Примеры запросов агенту
- Запусти скилл
enforce-rules-formatи проверь правила проекта. - Определи формат по
CLAUDE.md.spec.ts,CLAUDE.mdи.cursorrules, затем составь список проблем. - Проверь, какие правила можно связать с линтером, и спроси меня перед изменениями.
Как установить enforce-rules-format
1Через Skills CLI (Vercel)
npx skills add zernie/vigiles --skill enforce-rules-format -a claude-code2Вручную: положить файлы
~/.claude/skills/enforce-rules-format/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/enforce-rules-format/
1Через Skills CLI (Vercel)
npx skills add zernie/vigiles --skill enforce-rules-format -a codex2Вручную: положить файлы
.agents/skills/enforce-rules-format/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add zernie/vigiles --skill enforce-rules-format -a cursor2Вручную: положить файлы
.cursor/skills/enforce-rules-format/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install zernie/vigiles enforce-rules-format2Вручную: положить файлы
.github/skills/enforce-rules-format/SKILL.md1Через Skills CLI (Vercel)
npx skills add zernie/vigiles --skill enforce-rules-format -a gemini-cli2Командой платформы
gemini skills install https://github.com/zernie/vigiles --path .claude/skills/enforce-rules-formatВручную: положить файлы
.devin/skills/enforce-rules-format/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add zernie/vigiles --skill enforce-rules-format -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о enforce-rules-format
Как установить enforce-rules-format в Claude Code?
Выполните npx skills add zernie/vigiles --skill enforce-rules-format -a claude-code, затем проверьте файл ~/.claude/skills/enforce-rules-format/SKILL.md.
Что делает enforce-rules-format?
Скилл проверяет классификацию правил в v1- и v2-проектах, сопоставляет их с линтером и предлагает исправления с подтверждением пользователя.
Чем отличаются проверки v1 и v2?
В v2 анализируются вызовы enforce(), check() и guidance(), а также запускаются команды Vigiles. В v1 проверяются аннотации **Enforced by:**, **Guidance only** и <!-- vigiles-disable -->.
Исходный текст
SKILL.md · MIT
---
name: enforce-rules-format
description: Validate that all rules have proper enforcement classification (enforce/check/guidance)
disable-model-invocation: true
---
Validate that every rule in the project's instruction files has a proper enforcement classification, and fix any that are missing.
## Instructions
### Step 1: Detect Format
Check which format the project uses:
**v2 (spec-based):** Look for `CLAUDE.md.spec.ts` or any `*.spec.ts` files. If found, this is a v2 project — rules must use `enforce()`, `check()`, or `guidance()`.
**v1 (hand-written):** Look for `CLAUDE.md`, `AGENTS.md`, `.cursorrules`. If found without a spec file, this is a v1 project — rules need `**Enforced by:**` or `**Guidance only**` annotations.
### Step 2: Validate
**For v2 specs:**
The TypeScript type system already prevents unannotated rules — you can't create a rule without calling `enforce()`, `check()`, or `guidance()`. So focus on:
1. Do `enforce()` rules reference real linter rules? Run `npx vigiles compile` to check.
2. Are there guidance rules that COULD be `enforce()`? Check linter configs for matching rules.
3. Are there `check()` assertions that could be delegated to a linter? Suggest `enforce()` instead.
```bash
npx vigiles compile
npx vigiles discover
```
**For v1 hand-written files:**
Scan for `###` headings. Each must have one of:
- `**Enforced by:** \`linter/rule-name\``
- `**Guidance only** — reason`
- `<!-- vigiles-disable -->`
Report missing annotations with a summary table.
### Step 3: Fix Issues
For each issue found:
1. Check the project's linter configuration for matching rules
2. Suggest `enforce("linter/rule")` (v2) or `**Enforced by:** \`linter/rule\`` (v1)
3. If no linter rule exists, suggest `guidance()` (v2) or `**Guidance only**` (v1)
4. **Ask the user** before making changes
### Step 4: Suggest Migration
If the project uses v1 format, suggest migrating to v2 specs for type safety:
> Your rules could benefit from type-safe specs. Run the `adopt-spec` skill to convert your CLAUDE.md to a typed .spec.ts file.
### Step 5: Verify
Run the appropriate command:
```bash
# v2
npx vigiles compile && npx vigiles check
# validate
npx vigiles check
```
Report the validation result.
© zernie · MIT · zernie/vigiles