Skip to main content
interlace
Plugin: conventionsRules

enforced-rule-in-prose

Report never/always lines in agent guidance that a tool could enforce, unlinked to the tool that does

Next step

enforced-rule-in-prose ships in eslint-plugin-conventions, with 6 of its 20 rules in the recommended preset.

Install
npm install -D eslint-plugin-conventions
eslint.config.js
import { configs } from 'eslint-plugin-conventions';

export default [configs.recommended];

Plugin pagenpmSource on GitHub

Ask of every never/always line in agent guidance: which tool enforces it?

Rule Details

"For every rule, ask: can a tool check this?" A line like IMPORTANT: never --no-verify names something a git hook or a Claude Code hook can hold. Written only in prose it holds nothing the day the model forgets it — and in a repository with no git hooks it guards nothing at all.

The rule reads CLAUDE.md, AGENTS.md, GEMINI.md, skills and subagent files, outside code fences and frontmatter. A line is reported when it is imperative (never, always, must, do not, don't, IMPORTANT) and names something checkable (an inline-code span, a --flag, or a file path such as package-lock.json):

  • unenforced — it links no lever. Build the lint rule, hook, lock test or CI gate, then link it or delete the line.
  • removable — it links a lever (a link whose target names a lint rule, hook, lefthook, lock test, .test. file, gate or workflow). The tool already reports the violation with its own fix, so the always-loaded line is a duplicate paid for on every session.

The rule decides only facts a parser can tell. Whether a line is worth its bytes stays a person's call.

Examples

❌ Incorrect

- IMPORTANT: never `--no-verify`. The hooks are the gate.

✅ Correct

The rule lives in a hook, and the guidance line is gone:

- Commits go through the hooks; they are the gate.

While it is being moved

Linking the hook from the line is an intermediate state, still reported (as removable) as a reminder to delete it once the hook is trusted:

- Never `--no-verify` ([hook](.claude/hooks/guard-bash.mjs)).

Known limitations

  • The imperative-plus-target heuristic is the risky part. The intent's bar is a false-positive rate under 10% on the Interlace repositories; above that after one tuning pass, it becomes a report command instead of a rule.

Use this rule

npm install -D eslint-plugin-conventions
eslint.config.js
import conventions from 'eslint-plugin-conventions';export default [  {    plugins: { 'conventions': conventions },    rules: {      'conventions/enforced-rule-in-prose': 'error'    },  },];
npm install -D oxlint-plugin-conventions
.oxlintrc.json
{  "jsPlugins": ["oxlint-plugin-conventions"],  "rules": {    "conventions/enforced-rule-in-prose": "error"  }}
vite.config.ts
import { defineConfig } from 'vite-plus';export default defineConfig({  lint: {    jsPlugins: ['oxlint-plugin-conventions'],    rules: {      'conventions/enforced-rule-in-prose': 'error',    },  },});

oxlint-plugin-conventions re-exports eslint-plugin-conventions/oxlint: the same rules under the same IDs, and no ESLint install. Why oxlint.

Did this rule catch something? Star the repo to get new CWE coverage as we ship it — or follow the AI-code-security benchmarks behind these rules.