Skip to main content
interlace
Plugin: conventionsRules

no-duplicated-guidance

Disallow the same guidance line in two always-loaded agent files (CLAUDE.md, AGENTS.md, GEMINI.md) of one repo

Next step

no-duplicated-guidance 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

Disallow the same guidance line in two always-loaded files of one repo

Rule Details

CLAUDE.md, AGENTS.md and GEMINI.md in one directory chain are loaded together. A rule written in two of them is paid for twice on every session, and when one copy is edited the two disagree.

The rule compares this file's prose lines with the always-loaded files in the same directory and every ancestor up to the lint working directory. Lines are normalised first (list marker, emphasis, code ticks and whitespace removed, case folded) and must be at least minLength characters (default 40). Each duplicate is reported once: between two files of one directory, in the one whose name sorts later; between a file and an ancestor's file, in the deeper one, since the ancestor never reads its descendants.

Options

{ "minLength": 40 }

Examples

❌ Incorrect

AGENTS.md and CLAUDE.md both say "Never merge on red or unknown; confirm every required check is SUCCESS."

✅ Correct

The line lives in AGENTS.md; CLAUDE.md is @AGENTS.md.

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/no-duplicated-guidance': 'error'    },  },];
npm install -D oxlint-plugin-conventions
.oxlintrc.json
{  "jsPlugins": ["oxlint-plugin-conventions"],  "rules": {    "conventions/no-duplicated-guidance": "error"  }}
vite.config.ts
import { defineConfig } from 'vite-plus';export default defineConfig({  lint: {    jsPlugins: ['oxlint-plugin-conventions'],    rules: {      'conventions/no-duplicated-guidance': '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.