/** * THE RULE SET — every lint rule vigiles ships, in one tuple, assembled here in * the outer rule layer and handed to core by the composition roots * (`src/cli-main.ts`, the browser demo's entry). Core declares the port * (`../core/rule.ts`) and never imports this file; `boundaries` refuses it. * * A rule is a module `./.ts` (`defineRule`), imported here and listed in * {@link RULES}. The rules not yet migrated to their own module are ROWS below, * which is why this one file may spell every id (`local/no-rule-ids` exempts * it); each row leaves when its rule becomes a module (vigiles#390). * * The order is the config schema's key order — the JSON Schema an editor reads * and the "Known: …" list an unknown rule name gets both follow it. * * Adding a rule: its module (or row), its line in `RULES`, its * `docs/rules/.md` and its row in `docs/verifying-instruction-files.md`. * `./index.test.ts` fails on a missing doc, matrix row or group. */ import { z } from "zod"; import { type RulesConfigOf, type VigilesConfigOf } from "../core/config-schema.js"; import { RULE_GROUPS } from "./groups.js"; export { RULE_GROUPS }; /** Every rule, in the config schema's key order. */ export declare const RULES: readonly [{ readonly id: "spec-refs"; readonly group: "structural"; readonly bucket: "external-decidable"; readonly surface: readonly ["instruction"]; readonly defaultSeverity: "error"; readonly cure: "edit"; readonly summary: "A compiled instruction file whose spec references a file/script that no longer exists."; readonly detector: "compileClaude"; }, { readonly id: "orphan-docs"; readonly group: "nudge"; readonly bucket: "heuristic-behavioral"; readonly surface: readonly ["docs"]; readonly defaultSeverity: "warn"; readonly cure: "edit"; readonly summary: "Opt-in: a doc in a configured dir (default docs/) that no other .md references."; readonly detector: "findOrphanDocs"; }, { readonly id: "duplicate-rules"; readonly group: "nudge"; readonly bucket: "heuristic-behavioral"; readonly surface: readonly ["instruction"]; readonly defaultSeverity: "warn"; readonly cure: "edit"; readonly summary: "Near-duplicate rules within one spec (NCD similarity) — two rules saying the same thing."; readonly detector: "findDuplicateRules"; }, { readonly id: "require-instructions-spec"; readonly group: "structural"; readonly bucket: "external-decidable"; readonly surface: readonly ["instruction"]; readonly defaultSeverity: "warn"; readonly cure: { readonly cli: "init"; }; readonly summary: "A .spec.ts exists behind each CLAUDE.md / AGENTS.md."; readonly detector: "spec-presence (cli)"; }, { readonly id: "require-skill-spec"; readonly group: "nudge"; readonly bucket: "external-decidable"; readonly surface: readonly ["skill"]; readonly defaultSeverity: "off"; readonly cure: { readonly export: "experimental_skill"; }; readonly summary: "A .spec.ts exists behind each SKILL.md (opt-in)."; readonly detector: "spec-presence (cli)"; }, { readonly id: "integrity"; readonly group: "nudge"; readonly bucket: "external-decidable"; readonly surface: readonly ["instruction"]; readonly defaultSeverity: "warn"; readonly cure: { readonly cli: "compile"; }; readonly summary: "A compiled instruction file still matches its spec's SHA-256."; readonly detector: "checkIntegrity"; readonly upstreamPrevention: "compile stamps the hash; this catches later hand-edits"; }, { readonly id: "coverage"; readonly group: "workflow"; readonly bucket: "external-decidable"; readonly surface: readonly ["instruction"]; readonly defaultSeverity: "off"; readonly cure: "edit"; readonly summary: "The spec covers ≥ threshold of linter rules / npm scripts."; readonly detector: "analyzeCoverage"; readonly options: z.ZodObject<{ linterRules: z.ZodOptional; scripts: z.ZodOptional; }, z.core.$strict>; }, { readonly id: "untested-skill"; readonly group: "workflow"; readonly bucket: "external-decidable"; readonly surface: readonly ["skill"]; readonly defaultSeverity: "warn"; readonly cure: "edit"; readonly summary: "A SKILL.md ships with a test or eval."; readonly detector: "findUntestedSurfaces"; readonly options: z.ZodObject<{ include: z.ZodOptional]>, z.ZodTransform>>; testExtension: z.ZodOptional; }, z.core.$strict>; }, { readonly id: "untested-subagent"; readonly group: "workflow"; readonly bucket: "external-decidable"; readonly surface: readonly ["subagent"]; readonly defaultSeverity: "warn"; readonly cure: "edit"; readonly summary: "A subagent (agents/*.md) ships with a test or eval."; readonly detector: "findUntestedSurfaces"; readonly options: z.ZodObject<{ include: z.ZodOptional]>, z.ZodTransform>>; testExtension: z.ZodOptional; }, z.core.$strict>; }, { readonly id: "untested-hook"; readonly group: "workflow"; readonly bucket: "external-decidable"; readonly surface: readonly ["hook"]; readonly defaultSeverity: "warn"; readonly cure: "edit"; readonly summary: "A file-backed hook script ships with a test or eval."; readonly detector: "findUntestedSurfaces"; readonly options: z.ZodObject<{ include: z.ZodOptional]>, z.ZodTransform>>; testExtension: z.ZodOptional; }, z.core.$strict>; }, { readonly id: "untested-output-style"; readonly group: "workflow"; readonly bucket: "external-decidable"; readonly surface: readonly ["output-style"]; readonly defaultSeverity: "warn"; readonly cure: "edit"; readonly summary: "An output style ships with a test or eval."; readonly detector: "findUntestedSurfaces"; readonly options: z.ZodObject<{ include: z.ZodOptional]>, z.ZodTransform>>; testExtension: z.ZodOptional; }, z.core.$strict>; }, { readonly id: "unmarked-refs"; readonly group: "nudge"; readonly bucket: "heuristic-behavioral"; readonly surface: readonly ["instruction"]; readonly defaultSeverity: "warn"; readonly cure: "edit"; readonly summary: "Code-shaped refs in an instruction file are marked (verifiable)."; readonly detector: "collectRefIssues"; }, { readonly id: "subagent-tool-contract"; readonly group: "structural"; readonly bucket: "structural-closed"; readonly surface: readonly ["subagent"]; readonly defaultSeverity: "warn"; readonly cure: "edit"; readonly summary: "A subagent's tools: are all real (no never-available / typo)."; readonly detector: "verifyToolContract / scoredIssues"; readonly upstreamPrevention: "typed experimental_agent() vocabulary + compileAgent — an unknown tool is a tsc/compile error"; }, { readonly id: "hook-events"; readonly group: "structural"; readonly bucket: "structural-closed"; readonly surface: readonly ["hook"]; readonly defaultSeverity: "warn"; readonly cure: "edit"; readonly summary: "A hook's event name is one the harness defines (it can fire)."; readonly detector: "verifyHookEvents / scoredIssues"; readonly upstreamPrevention: "compiled hook on: is dialect-validated at compile"; }, { readonly id: "subagent-frontmatter"; readonly group: "structural"; readonly bucket: "structural-closed"; readonly surface: readonly ["subagent"]; readonly defaultSeverity: "warn"; readonly cure: "edit"; readonly summary: "A subagent has required name/description + valid model/color."; readonly detector: "frontmatterIssuesFor"; readonly upstreamPrevention: "compileAgent emits the required frontmatter"; }, { readonly id: "mcp-config"; readonly group: "structural"; readonly bucket: "structural-closed"; readonly surface: readonly ["mcp"]; readonly defaultSeverity: "warn"; readonly cure: "edit"; readonly summary: "A declared MCP server can start (has a command or url)."; readonly detector: "verifyMcpServers"; }, { readonly id: "skill-frontmatter"; readonly group: "nudge"; readonly bucket: "structural-closed"; readonly surface: readonly ["skill"]; readonly defaultSeverity: "warn"; readonly cure: "edit"; readonly summary: "A SKILL.md declares an explicit name + description (reliable trigger)."; readonly detector: "skillMetaIssuesFor"; readonly upstreamPrevention: "skill() compiler emits name + description"; }, { readonly id: "mcp-tool-resolves"; readonly group: "structural"; readonly bucket: "external-decidable"; readonly surface: readonly ["subagent", "mcp"]; readonly defaultSeverity: "warn"; readonly cure: "edit"; readonly summary: "A subagent's mcp__server__tool names a declared server."; readonly detector: "verifyMcpToolServers"; }, { readonly id: "hook-script-exists"; readonly group: "structural"; readonly bucket: "external-decidable"; readonly surface: readonly ["hook"]; readonly defaultSeverity: "warn"; readonly cure: { readonly cli: "compile"; }; readonly summary: "A file a compiled hook line needs (runtime, program, stamp) exists."; readonly detector: "scanHooks over the hook-line plan (status 'missing')"; readonly upstreamPrevention: "a compiled hook is self-contained (no external script)"; }, { readonly id: "hand-written-hook"; readonly group: "nudge"; readonly bucket: "heuristic-behavioral"; readonly surface: readonly ["hook"]; readonly defaultSeverity: "off"; readonly cure: { readonly export: "experimental_defineHook"; }; readonly summary: "A hook line vigiles did not write is named: a static reader cannot verify it, so compile it."; readonly detector: "scanHooks (handWritten: no planned line matches)"; readonly upstreamPrevention: "a compiled hook's line is written by compile itself"; readonly legacy: { readonly scanField: "handWrittenHooks"; }; }, { readonly id: "disallowed-tools-contract"; readonly group: "structural"; readonly bucket: "structural-closed"; readonly surface: readonly ["subagent"]; readonly defaultSeverity: "warn"; readonly cure: "edit"; readonly summary: "A disallowedTools: entry isn't a typo that blocks nothing."; readonly detector: "disallowedToolIssues"; readonly upstreamPrevention: "typed experimental_agent() vocabulary (a typo is a tsc error)"; }, { readonly id: "description-overlap"; readonly group: "structural"; readonly bucket: "heuristic-behavioral"; readonly surface: readonly ["skill"]; readonly defaultSeverity: "warn"; readonly cure: "edit"; readonly summary: "Two model-invocable skills aren't near-identical (wrong one fires)."; readonly detector: "findDescriptionOverlaps"; }, { readonly id: "skill-description-budget"; readonly group: "nudge"; readonly bucket: "heuristic-behavioral"; readonly surface: readonly ["skill"]; readonly defaultSeverity: "warn"; readonly cure: "edit"; readonly summary: "A model-invocable skill's description isn't so long the trigger is buried."; readonly detector: "findDescriptionBudgetIssues"; }, { readonly id: "compile-budget"; readonly group: "structural"; readonly bucket: "structural-closed"; readonly surface: readonly ["instruction"]; readonly defaultSeverity: "warn"; readonly cure: "edit"; readonly summary: "A compiled instruction file stays within its size budgets (command entries, sections, the Rules total)."; readonly detector: "checkContentBudgets"; readonly upstreamPrevention: "compile measures the spec before writing; a render policy (enforce render, guidance details) meets a budget without deleting a rule"; readonly options: z.ZodObject<{ maxEntryChars: z.ZodOptional; maxSectionChars: z.ZodOptional; maxRulesChars: z.ZodOptional; }, z.core.$strict>; }, { readonly id: "frontmatter-valid"; readonly group: "nudge"; readonly bucket: "heuristic-behavioral"; readonly surface: readonly ["skill", "subagent"]; readonly defaultSeverity: "warn"; readonly cure: "edit"; readonly summary: "A --- block parses as YAML (js-yaml is stricter than some loaders)."; readonly detector: "malformedFrontmatterFor"; readonly upstreamPrevention: "the spec compiler emits valid frontmatter"; }, { readonly id: "mcp-hook-target-resolves"; readonly group: "structural"; readonly bucket: "external-decidable"; readonly surface: readonly ["hook", "mcp"]; readonly defaultSeverity: "warn"; readonly cure: "edit"; readonly summary: "A type:mcp_tool hook action is complete + names a declared server."; readonly detector: "verifyMcpHookTargets"; }, { readonly id: "lethal-trifecta"; readonly group: "nudge"; readonly bucket: "structural-closed"; readonly surface: readonly ["skill", "subagent"]; readonly defaultSeverity: "warn"; readonly cure: "edit"; readonly summary: "No unit's tools hold all three lethal-trifecta legs at once."; readonly detector: "lethalTrifectaIssues"; }, { readonly id: "skill-resource-resolves"; readonly group: "experimental"; readonly bucket: "external-decidable"; readonly surface: readonly ["skill"]; readonly defaultSeverity: "off"; readonly cure: "edit"; readonly summary: "A SKILL.md's bundled-file reference exists under the skill dir."; readonly detector: "skillResourceIssues"; readonly findings: (scan: import("../core/rule.js").ScanInput) => readonly import("../core/rule.js").Finding[]; }, { readonly id: "skill-missing-fence"; readonly group: "nudge"; readonly bucket: "structural-closed"; readonly surface: readonly ["skill"]; readonly defaultSeverity: "warn"; readonly cure: "edit"; readonly summary: "A SKILL.md opens with a --- fence (else it loads as inert body)."; readonly detector: "skillMissingFence"; readonly upstreamPrevention: "skill() compiler always emits the fence"; }, { readonly id: "plugin-dir-layout"; readonly group: "nudge"; readonly bucket: "external-decidable"; readonly surface: readonly ["plugin"]; readonly defaultSeverity: "warn"; readonly cure: "edit"; readonly summary: "No functional surface dir is nested inside the manifest dir."; readonly detector: "pluginDirLayoutIssues"; readonly upstreamPrevention: "init scaffolds surfaces at the plugin root"; }, { readonly id: "delegation-trifecta"; readonly group: "nudge"; readonly bucket: "structural-closed"; readonly surface: readonly ["subagent"]; readonly defaultSeverity: "warn"; readonly cure: "edit"; readonly summary: "No subagent's (own ∪ delegated) capability forms a trifecta."; readonly detector: "delegationTrifectaIssues"; }, { readonly id: "hook-block-ineffective"; readonly group: "nudge"; readonly bucket: "structural-closed"; readonly surface: readonly ["hook"]; readonly defaultSeverity: "warn"; readonly cure: "edit"; readonly summary: "A hook that looks like it blocks actually can (event + field)."; readonly detector: "hookBlockIssues"; readonly upstreamPrevention: "compiled hooks — deny compiles to exit 2; the field/exit code is never hand-written"; }, { readonly id: "hook-matcher"; readonly group: "nudge"; readonly bucket: "structural-closed"; readonly surface: readonly ["hook"]; readonly defaultSeverity: "warn"; readonly cure: "edit"; readonly summary: "A hook matcher fires as written (no tool-name typo, no MCP pattern that reaches nothing or misses real server names)."; readonly detector: "hookMatcherIssues"; readonly upstreamPrevention: "compiled hook tool()/tools() matcher is typed"; }, { readonly id: "doc-refs"; readonly group: "nudge"; readonly bucket: "external-decidable"; readonly surface: readonly ["docs"]; readonly defaultSeverity: "off"; readonly cure: "edit"; readonly summary: "Builder calls quoted in markdown ```ts fences resolve for real (opt-in: a fence is usually a drawing of config, not config)."; readonly detector: "findDocRefs"; }, { readonly id: "instruction-weight"; readonly group: "structural"; readonly bucket: "external-decidable"; readonly surface: readonly ["instruction"]; readonly defaultSeverity: "error"; readonly cure: "edit"; readonly summary: "The always-loaded instruction weight did not move off its committed baseline."; readonly detector: "compareToBaseline"; readonly options: z.ZodObject<{ max: z.ZodOptional; }, z.core.$strict>; }, { readonly id: "deprecated-key-files"; readonly group: "nudge"; readonly bucket: "structural-closed"; readonly surface: readonly ["instruction"]; readonly defaultSeverity: "warn"; readonly cure: "edit"; readonly summary: "An instruction spec doesn't use the deprecated keyFiles (always-loaded file map)."; readonly detector: "findDeprecatedKeyFiles"; readonly upstreamPrevention: "the @deprecated keyFiles field is removed next major"; }]; /** A rule id of the shipped set. */ export type RuleId = (typeof RULES)[number]["id"]; /** The shipped set's `rules`, each id with its own options type. */ export type RulesConfig = RulesConfigOf; /** The shipped set's parsed `.vigilesrc.json` — the root's precise config type. */ export type VigilesConfig = VigilesConfigOf; //# sourceMappingURL=index.d.ts.map