adopt-spec
Adopt a typed .spec.ts for an existing hand-written CLAUDE.md — start from the file you already have, non-destructively
Resumen
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, key file, and prose section as-is. Invent nothing — the spec must compile back to ~the user's existing file.
- Non-destructive. Never edit the original
CLAUDE.md/AGENTS.md. Only write the new.spec.ts. Never auto-compileover 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()asguidance(). Upgrading toenforce()has a cost (config/plugins, possible false positives) and is a separate opt-in step — thestrengthenskill. Adoption is not turning on strict /workflowgating. - 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 `` comments are verified by
vigiles lintwith 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:
npm install -D vigilesStep 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. A path maps to ONE LINE saying what the file is for —
// aim for 120 characters, never exceed ~200. The entry is a pointer, not a
// summary: how the file works belongs in its own header comment, which is
// read when someone opens it. This file is loaded on every request, so a
// paragraph here is paid for every turn. Prune a stale neighbour whenever
// you add one; `vigiles audit` prints the running total as
// `Always-loaded instructions`.
},
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.tsCompare 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 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:
- name: Compile specs
run: npx vigiles compile
- name: Verify references + integrity
run: npx vigiles lintOr using the vigiles GitHub Action:
- uses: zernie/vigiles@v1
with:
command: lintArchivos 1 archivo
Instálala a mano
Deska ejecuta esto por ti, para cada agente que elijas. Para ejecutarlo tú en una terminal:
npx skills add zernie/vigiles --skill adopt-specMás de zernie
- edit-speczernieEdit a vigiles .spec.ts to change a compiled instruction file (CLAUDE.md / AGENTS.md) — add, modify, or remove a rule, section, command, or key file. 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.2,000 instalaciones en skills.sh0
- linter-docszernieDeep 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.)2,000 instalaciones en skills.sh0
- strengthenzernieUpgrade 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.2,000 instalaciones en skills.sh0
- test-harnesszernieInstall 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.2,000 instalaciones en skills.sh0