From vigiles
Edit a vigiles .spec.ts to update compiled instruction files (CLAUDE.md/AGENTS.md). Use when you need to add, modify, or remove rules, sections, commands, or key files.
How this skill is triggered — by the user, by Claude, or both
Slash command
/vigiles:edit-spec <what to change — e.g., "add a rule about error handling" or "update the testing section"><what to change — e.g., "add a rule about error handling" or "update the testing section">The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Edit a `.spec.ts` file to update the project's instruction files. The spec is the source of truth — CLAUDE.md and AGENTS.md are compiled build artifacts that must not be edited directly.
Edit a .spec.ts file to update the project's instruction files. The spec is the source of truth — CLAUDE.md and AGENTS.md are compiled build artifacts that must not be edited directly.
$ARGUMENTS — What the user wants to change. Examples:
Look for spec files in the repo root:
CLAUDE.md.spec.ts — source for CLAUDE.mdAGENTS.md.spec.ts — source for AGENTS.md*.spec.ts matching instruction filesIf no spec exists: if there's a hand-written CLAUDE.md, suggest the
adopt-spec skill; otherwise suggest npx vigiles init to scaffold one.
Read the spec file. It's a TypeScript file that exports a claude() call with these fields:
import { claude, enforce, guidance, check, every } from "vigiles/spec";
export default claude({
// Optional: output target (defaults to "CLAUDE.md")
target: "CLAUDE.md",
// or multi-target:
// target: ["CLAUDE.md", "AGENTS.md"],
// Prose sections — become ## headings in compiled output
sections: {
positioning: "What this project does...",
architecture: "How the codebase is structured...",
},
// File paths verified to exist at compile time
keyFiles: {
"src/index.ts": "Main entry point",
},
// Commands verified against package.json
commands: {
"npm run build": "Compile the project",
"npm test": "Run all tests",
},
// Rules — three types
rules: {
// enforce() — backed by a linter rule, verified to exist AND be enabled
"no-any": enforce(
"@typescript-eslint/no-explicit-any",
"Use unknown and narrow with type guards.",
),
// check() — filesystem assertion run by vigiles
"test-pairing": check(
every("src/**/*.service.ts").has("{name}.test.ts"),
"Every service must have tests.",
),
// guidance() — prose only, no enforcement
"research-first": guidance("Google unfamiliar APIs before implementing."),
},
});
Based on what the user asked for:
Adding a rule (this absorbs the old generate-rule skill):
enforce() — a linter rule can back it. Check the project's linter configs
(ESLint, Ruff, Clippy, Pylint, RuboCop, Stylelint) for a matching rule; also
consider an architectural tool (ast-grep, Dependency Cruiser, Steiger). If
uncertain whether a rule exists, ask the user rather than guessing.check() — a filesystem structural convention ("every X needs a Y"). Only
for file-pairing; never for code content.guidance() — can't be mechanically enforced (subjective conventions,
process rules, migration context).enforce(): use the real linter rule name (e.g. eslint/no-console,
@typescript-eslint/no-explicit-any, ruff/T201).rules object with a kebab-case key derived from the intent,
preserving alphabetical order if the existing rules are alphabetical. Import
any new builders needed (e.g. check and every for the first check()).Updating a section:
sections. Sections are plain strings or tagged template literals with file(), cmd(), ref() for verified references# or ## headers inside sections — they break the document structureAdding a key file or command:
keyFiles or commands. The compiler verifies these exist at compile timepackage.jsonAfter editing the spec, run:
npx vigiles compile
This regenerates the compiled instruction file(s). Review the output for any errors:
stale-file — a key file path doesn't existstale-command — a command isn't in package.jsoninvalid-rule — a linter rule doesn't exist or is disabledsection-has-header — a section contains # headers (break into separate named sections)npx vigiles lint
If the vigiles plugin is installed (/plugin marketplace add zernie/vigiles then /plugin install vigiles@vigiles, or npx vigiles init), the PostToolUse hook recompiles automatically after you save the spec.
enforce() rules are verified — the compiler checks the rule exists AND is enabled in your linter config# or ## headers — use separate named sections insteadnpx claudepluginhub zernie/vigilesGenerates a typed .spec.ts from an existing CLAUDE.md, preserving content while adding type safety via vigiles. For users who want compiler-grade guarantees on their instruction files.
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.