From vigiles
Converts existing CLAUDE.md or AGENTS.md into a typed .spec.ts file for incremental adoption of type-safe instructions.
How this skill is triggered — by the user, by Claude, or both
Slash command
/vigiles:migrate-to-spec <path to CLAUDE.md, defaults to CLAUDE.md><path to CLAUDE.md, defaults to CLAUDE.md>The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Convert an existing hand-written CLAUDE.md (or AGENTS.md) into a typed `CLAUDE.md.spec.ts` file. This is the incremental adoption path — you keep your existing instruction file as the starting point and get type safety going forward.
Convert an existing hand-written CLAUDE.md (or AGENTS.md) into a typed CLAUDE.md.spec.ts file. This is the incremental adoption path — you keep your existing instruction file as the starting point and get type safety going forward.
Don't need full TypeScript? A typed spec is the deepest commitment level. If the user only wants verified rules without a build step, point them at markdown mode first: inline
<!-- vigiles:enforce ... -->comments (Level 0) or avigiles:YAML frontmatter block withvigiles generate-schemafor editor autocomplete (Level 1). Both are verified byvigiles lintwith the same engine as a spec. Seedocs/markdown-mode.md. Migrate to a spec only when they want compiler-grade guarantees.
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:
npm install -D vigiles
Identify these sections in the markdown:
`npm run build` — description or - `command` — description`src/foo.ts` — description listing important files### headings with **Enforced by:** or **Guidance only** annotationsFor each rule, classify it:
**Enforced by:** \linter/rule`→enforce("linter/rule", "why")`**Enforced by:** \code-review`or similar non-linter →guidance("...")`**Guidance only** → guidance("...")Create CLAUDE.md.spec.ts (or the appropriate name based on the source file) with this structure:
import {
claude,
enforce,
guidance,
check,
every,
file,
cmd,
ref,
instructions,
} from "vigiles/spec";
export default claude({
sections: {
// Prose sections here
},
keyFiles: {
// Key files here
},
commands: {
// Commands here
},
rules: {
// Rules here
},
});
Important guidelines:
file() refs in sections where file paths appear in backticks — this enables stale reference detectioncmd() refs for any npm run commands mentioned in sections**Enforced by:** \code-review`rules toguidance()` — code review is not a mechanical enforcement// TODO: classify as enforce() or guidance() comment**Why:** text as the second argument to enforce() or guidance()ref() for cross-referencesRun:
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, key files, and prose content should be preserved.
Show the user:
npx vigiles compilenpx vigiles checkAsk if they want you to write the file. If yes, also suggest adding to .gitignore or updating CI to run vigiles compile and vigiles check.
If the user wants CI integration, suggest adding to their GitHub Actions workflow:
- name: Compile specs
run: npx vigiles compile
- name: Verify integrity
run: npx vigiles check
Or using the vigiles GitHub Action:
- uses: zernie/vigiles@main
with:
command: check
npx claudepluginhub zernie/vigilesEdit a vigiles .spec.ts to modify compiled instruction files (CLAUDE.md/AGENTS.md) — add, remove, or update rules, sections, commands, or key files. Use when instruction files carry a vigiles hash.
CLAUDE.md instruction quality: writing effective project instructions, diagnosing why Claude ignores rules, routing content to the right layer, and systematic improvement. Invoke whenever task involves any interaction with CLAUDE.md files — writing, reviewing, auditing, improving, or debugging instruction compliance.
Improves CLAUDE.md files by wrapping conditional instructions in <important if> blocks to counter irrelevance warnings and boost adherence in Claude Code.