
migrate-to-spec
Convert an existing hand-written CLAUDE.md into a typed .spec.ts file for incremental adoption
- Installs
- 207
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/zernie/vigiles --skill migrate-to-spec- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads migrate-to-spec automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
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.
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:
npm install -D vigiles
Step 2: Parse the Structure
Identify these sections in the markdown:
- Commands — lines like
`npm run build` — descriptionor- `command` — description - Key files — lines like
`src/foo.ts` — descriptionlisting important files - Rules —
###headings with**Enforced by:**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
**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:
import {
claude,
enforce,
guidance,
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:
- Use
file()refs in sections where file paths appear in backticks — this enables stale reference detection - Use
cmd()refs for anynpm runcommands mentioned in sections - Convert
**Enforced by:** \code-review`rules toguidance()` — 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 toenforce()orguidance() - If sections reference other files or skills, use
ref()for cross-references
Step 4: Verify the Spec Compiles
Run:
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.
Step 5: Present the Result
Show the user:
- The generated spec file
- How many rules were converted (enforce vs guidance vs TODO)
- How many file/cmd refs were added for stale reference detection
- The command to compile:
npx vigiles compile - The command to verify:
npx vigiles check
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 check.
Step 6: Optional — Set Up CI
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
FAQ
What does the migrate-to-spec skill do?
Convert an existing hand-written CLAUDE.md into a typed .spec.ts file for incremental adoption
How do I install migrate-to-spec?
Run npx skills add https://github.com/zernie/vigiles --skill migrate-to-spec in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/migrate-to-spec/ (personal) or .claude/skills/migrate-to-spec/ (project).
Which AI agents can use migrate-to-spec?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is migrate-to-spec safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains migrate-to-spec?
It is published by zernie in zernie/vigiles. It has 207 recorded installs.
More from zernie/vigiles
edit-spec
zernie/vigiles
Edit a vigiles .spec.ts to change a compiled instruction file (CLAUDE.md / AGENTS.md) — add, modify, or remove a rule, section, command, or file pointer (including a request to add a "key file" — the keyFiles field is deprecated). Use whenever you need to change a CLAUDE.md/AGENTS.md that carries a vigiles hash (edit the spec, never the artifact), including adding a new enforce()/check()/guidance() rule.
strengthen
zernie/vigiles
Upgrade a vigiles spec's guidance() rules to enforce() — scan the guidance rules in a CLAUDE.md/AGENTS.md spec and find existing linter rules (ESLint, Ruff, Clippy, Pylint, RuboCop, Stylelint) that back them. Use when asked to strengthen, harden, or make vigiles rules enforceable; NOT for general linting or fixing lint errors.
test-harness
zernie/vigiles
Install vigiles and test a Claude Code harness — hooks, skills, agents, settings, CLAUDE.md — by picking the right tier (unit / deterministic / eval) and writing a test that passes. Use to check that a hook fires or blocks, that a skill triggers, that injected context lands; or to observe a run — which tools it called, whether it stayed inside its declared allowed-tools, what files and side effects it produced, how to intercept a call without executing it.
linter-docs
zernie/vigiles
Deep linter reference for authoring or debugging a vigiles enforce() rule — plugin tables, AST selectors, type-aware rules, auto-fix, and edge cases for ESLint, Ruff, Pylint, RuboCop, Stylelint, and Clippy. Use when you need the exact rule name or config for a specific linter, not for running a linter. (JVM/Go linters — detekt, ktlint, Checkstyle, golangci-lint — and Cedar have no deep-dive file yet; their reference lives in docs/linter-support.md.)
adopt-spec
zernie/vigiles
Adopt a typed .spec.ts for an existing hand-written CLAUDE.md — start from the file you already have, non-destructively
debug-my-harness
zernie/vigiles
Diagnose why an agent harness misbehaved by reading the local flight-recorder ledger (.vigiles/runs.jsonl) — which skills fired or got hijacked, which hooks blocked or wrongly allowed, which subagent tool-contract violations happened, and how a skill's trigger rate moved. Use when asked why a skill stopped firing, why a hook didn't block, why the wrong skill ran, or to debug/investigate what the harness actually did. NOT for writing new rules (use strengthen) or editing the spec (use edit-spec).
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.