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

adopt-spec — скилл для Claude Code: типизированный spec из CLAUDE.md

Превращает уже написанный CLAUDE.md или AGENTS.md в типизированный CLAUDE.md.spec.ts, не трогая исходный файл. Пригодится, если хочется проверять инструкции линтером, но переписывать их с нуля неохота.

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

Что делает adopt-spec

Скилл читает существующий файл инструкций и разбирает его на части: команды, правила, прозаические разделы. Каждое правило получает классификацию — enforce(), если рядом стоит пометка про линтер, guidance(), если это совет или ссылка на code review. Правила без пометок помечаются TODO, чтобы вы разобрались сами.

Главное обещание — ничего не ломать. Оригинальный CLAUDE.md остаётся на месте, скилл пишет только новый .spec.ts и не запускает compile поверх вашего файла. Переход на spec-режим — отдельный шаг, который вы делаете сами, посмотрев diff. Откат тоже есть: vigiles eject <file> возвращает файл в виде обычного markdown.

Перед записью скилл показывает сгенерированный spec и сводку конверсии, а пишет только после вашего согласия. Если vigiles не стоит в devDependencies, он предложит npm install -D vigiles. Отдельно стоит помнить: поле keyFiles устарело, и список «Key Files» из старого файла переносится как обычный прозаический раздел — пока вы не решите, куда девать каждую строку.

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

  • получить типизированный spec из уже написанного CLAUDE.md
  • разметить правила как enforce или guidance без ручного переписывания
  • найти устаревшие ссылки на файлы через file() и cmd()
  • проверить инструкции линтером vigiles lint
  • откатить spec обратно в markdown командой vigiles eject

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

  • Разбери мой CLAUDE.md и собери из него CLAUDE.md.spec.ts, ничего не меняя в исходнике
  • Прогони adopt-spec по AGENTS.md и покажи, сколько правил ушло в enforce, guidance и TODO
  • Сделай spec из CLAUDE.md, но сначала покажи мне результат и сводку, писать не начинай

Как установить adopt-spec

1Через Skills CLI (Vercel)

npx skills add zernie/vigiles --skill adopt-spec -a claude-code

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

~/.claude/skills/adopt-spec/SKILL.md

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

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

Вопросы о adopt-spec

Как установить adopt-spec в Claude?

Выполните npx skills add zernie/vigiles --skill adopt-spec -a claude-code. После этого файл скилла окажется в ~/.claude/skills/adopt-spec/SKILL.md.

Что делает adopt-spec?

Берёт ваш существующий CLAUDE.md или AGENTS.md и строит по нему типизированный CLAUDE.md.spec.ts. Исходный файл при этом не редактируется.

Он переведёт мои правила в строгий режим?

Нет. guidance() остаётся guidance(), а переход на enforce() — отдельный шаг, который делает скилл strengthen. Для этого нужны конфиг и плагины, и возможны ложные срабатывания.

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

SKILL.md · MIT
---
name: adopt-spec
description: Adopt a typed .spec.ts for an existing hand-written CLAUDE.md — start from the file you already have, non-destructively
disable-model-invocation: true
argument-hint: <path to CLAUDE.md, defaults to CLAUDE.md>
---

Start a typed `CLAUDE.md.spec.ts` from an existing hand-written CLAUDE.md (or AGENTS.md). This is the non-destructive adoption path — you keep your existing instruction file as the starting point and get type safety going forward.

## Adoption rules

Adoption is the **safe, faithful on-ramp — never an upgrade in disguise.** These are non-negotiable:

- **Faithful.** Preserve every rule, command, and prose section as-is. Invent nothing — the spec must compile back to ~the user's existing file. The one exception is a file map ("Key Files"): never emit the deprecated `keyFiles` field — see the guideline under Step 3.
- **Non-destructive.** Never edit the original `CLAUDE.md` / `AGENTS.md`. Only write the new `.spec.ts`. Never auto-`compile` over the file — switching it to spec-managed is a separate, explicit step the user runs with a diff to review.
- **Don't escalate enforcement.** Keep `guidance()` as `guidance()`. Upgrading to `enforce()` has a cost (config/plugins, possible false positives) and is a separate opt-in step — the `strengthen` skill. Adoption is **not** turning on strict / `workflow` gating.
- **Reversible.** `vigiles eject <file>` hands the file back as plain hand-owned markdown anytime — it's never a one-way door. Tell the user this.
- **Ask before writing.** Present the generated spec and a conversion summary first; write only on the user's yes.
- **A lighter touch exists.** For no spec at all, inline `<!-- vigiles:enforce ... -->` comments are verified by `vigiles lint` with the same engine.

## Instructions

### Step 1: Read the Existing File

Read the target instruction file (default: `CLAUDE.md` in the repo root). If the user specified a path, use that.

Also check if vigiles is installed: look for `vigiles` in `package.json` devDependencies. If not, suggest:

```bash
npm install -D vigiles
```

### Step 2: Parse the Structure

Identify these sections in the markdown:

- **Commands** — lines like `` `npm run build` — description `` or ``- `command` — description``
- **A file map ("Key Files")** — lines like `` `src/foo.ts` — description `` listing important files. Never becomes `keyFiles` (deprecated); see the guideline under Step 3
- **Rules** — `###` headings with `**Enforced by:**`, `**Claimed (unverified):**` or `**Guidance only**` annotations
- **Prose sections** — everything else (positioning, architecture, principles, etc.)

For each rule, classify it:

- Has `**Enforced by:** \`linter/rule\``→`enforce("linter/rule", "why")`
- Has `**Claimed (unverified):** \`linter/rule\``→`enforce("linter/rule", "why")` too — the last compile could not verify it; the next one will say why
- Has `**Enforced by:** \`code-review\``or similar non-linter →`guidance("...")`
- Has `**Guidance only**` → `guidance("...")`
- Has no annotation → mark as TODO for the user to classify

### Step 3: Generate the Spec File

Create `CLAUDE.md.spec.ts` (or the appropriate name based on the source file) with this structure:

```typescript
import {
  claude,
  enforce,
  guidance,
  file,
  cmd,
  ref,
  instructions,
} from "vigiles/spec";

export default claude({
  sections: {
    // Prose sections here
  },

  // No `keyFiles`: the field is deprecated (removed next major). A "Key Files"
  // list in the original file is NOT carried over as a map — see the
  // guideline below.

  commands: {
    // Commands here
  },

  rules: {
    // Rules here
  },
});
```

**Important guidelines:**

- Use `file()` refs in sections where file paths appear in backticks — this enables stale reference detection
- 🔴 **Never emit `keyFiles`.** The field is deprecated and removed in the next major (`vigiles lint` warns as `deprecated-key-files`). For a "Key Files" / file-map section in the original, apply the migration recipe (`docs/rules/deprecated-key-files.md` in the vigiles repository) and show the user, per entry, where it goes — the first that fits: (1) the file's header, the docs or the path already say it (or the path no longer exists) → delete it; (2) a fact about that one file → that file's header comment; (3) a rule for working in one folder → that folder's nested `CLAUDE.md` (its own `<folder>/CLAUDE.md.spec.ts`); (4) nothing else would lead an agent to the file → a one-line `file()` pointer in the section where the decision that needs it is written. Where each entry goes is the user's call; that the map does not become `keyFiles` is not. Until they decide, carry the list over as a plain prose section so adoption stays faithful
- Use `cmd()` refs for any `npm run` commands mentioned in sections
- Convert `**Enforced by:** \`code-review\``rules to`guidance()` — code review is not a mechanical enforcement
- For rules with no annotation, add a `// TODO: classify as enforce() or guidance()` comment
- Keep rule IDs as kebab-case versions of the heading text
- Preserve the `**Why:**` text as the second argument to `enforce()` or `guidance()`
- If sections reference other files or skills, use `ref()` for cross-references

### Step 4: Verify the Spec Compiles

Run:

```bash
npm run build
npx vigiles compile CLAUDE.md.spec.ts
```

Compare the compiled output against the original file. Key differences are expected (formatting, section ordering), but all rules, commands, and prose content should be preserved (a file map is the exception — see the `keyFiles` guideline above).

### Step 5: Present the Result

Show the user:

1. The generated spec file
2. How many rules were converted (enforce vs guidance vs TODO)
3. How many file/cmd refs were added for stale reference detection
4. The command to compile: `npx vigiles compile`
5. The command to verify: `npx vigiles lint`

Ask if they want you to write the file. If yes, also suggest adding to `.gitignore` or updating CI to run `vigiles compile` and `vigiles lint`.

### Step 6: Optional — Set Up CI

If the user wants CI integration, suggest adding to their GitHub Actions workflow:

```yaml
- name: Compile specs
  run: npx vigiles compile
- name: Verify references + integrity
  run: npx vigiles lint
```

Or using the vigiles GitHub Action:

```yaml
- uses: zernie/vigiles@v1
  with:
    command: lint
```

© zernie · MIT · zernie/vigiles

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

Все скиллы по теме «Настройка агента: память, контекст, субагенты» →
spec Klerith Помогает составить подробную спецификацию фичи перед написанием кода. Задаёт уточняющие вопросы пачками и сохраняет готовый документ в папку specs/. CX Codex +1 4 100установок cursor-spec-interviewer stark-ai-de Превращает расплывчатый запрос на разработку в проверенную спецификацию для Cursor Agent: с границами, критериями приёмки и планом. CX Codex +1 2 600установок code-to-spec smallnest Разбирает существующий проект и собирает из кода, конфигов и тестов документ SPEC. Пригодится, когда спецификации нет, а понять проект надо. CX Codex +1 470установок write-spec официальный anthropics Превращает сырую идею или запрос пользователя в подробный PRD с целями, не-целями, метриками и требованиями P0/P1/P2. CX Codex +1 3 600установок spec-impl Klerith Скилл запускает реализацию утверждённой спецификации в отдельной git-ветке и ведёт работу по шагам с паузами для проверки diff. CX Codex +1 4 000установок 4-spec challengepost Превращает утверждённый PRD в технический план: стек, где всё работает, компоненты, данные, структура файлов. Последний шаг планирования перед сборкой. CX Codex +1 1 800установок

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

test-harness Скилл помогает протестировать обвязку Claude: хуки, скиллы, агентов, настройки и CLAUDE.md. Выбирает подходящий уровень теста и пишет его. CX Codex +1 2 100установок strengthen Скилл проходит по спекам vigiles и переводит правила guidance() в enforce(), подбирая под них реальные правила линтеров. Пригодится, когда хочется, чтобы договорённости проверялись автоматически. CX Codex +1 2 100установок linter-docs Справочник по правилам ESLint, Ruff, Pylint, RuboCop, Stylelint и Clippy. Нужен, когда пишешь или отлаживаешь правило enforce() в vigiles. CX Codex +1 2 000установок debug-my-harness Разбирает, почему агентная обвязка сработала не так, читая локальный журнал .vigiles/runs.jsonl. Пригодится, когда скилл перестал запускаться или хук пропустил то, что должен был заблокировать. CX Codex +1 1 500установок code-quality Скилл для рефакторинга TypeScript и JavaScript: приводит типы в порядок, убирает невозможные состояния и разделяет логику с вводом-выводом. CX Codex +1 391установок verify-docs-findable Проверяет, отвечает ли документация на реальные вопросы читателя. Запускает дешёвых агентов Haiku, которые читают только доки и показывают, где ответы теряются. CX Codex +1 340установок

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

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