eslint-plugin-copilot

July 4, 2026 ยท View on GitHub

npm license. npm total downloads. latest GitHub release. GitHub stars. GitHub forks. GitHub open issues. codecov.

ESLint plugin for linting GitHub Copilot repository customization files such as:

  • .github/copilot-instructions.md
  • .github/instructions/copilot-instructions.md
  • .github/instructions/**/*.instructions.md
  • .github/prompts/**/*.prompt.md
  • .github/agents/**/*.agent.md
  • .github/chatmodes/**/*.chatmode.md
  • AGENTS.md, CLAUDE.md, and GEMINI.md

The plugin focuses on repository setup quality, metadata correctness, and modern GitHub Copilot customization conventions.

Table of contents

  1. Installation
  2. Quick start
  3. What the presets lint
  4. Presets
  5. Rules
  6. Contributors โœจ

Installation

npm install --save-dev eslint-plugin-copilot eslint @eslint/markdown @eslint/json

Compatibility

  • Supported ESLint versions: 9.x and 10.x
  • Config system: Flat Config only (eslint.config.*)
  • Node.js runtime: >=22.0.0

Quick start

For direct use in an application or repository, use the self-contained presets:

import copilot from "eslint-plugin-copilot";

export default [...copilot.configs.recommended];

The shipped presets already configure:

  • plugins.markdown via @eslint/markdown
  • plugins.json via @eslint/json for repository hooks
  • language: "markdown/gfm"
  • language: "json/json" for .github/hooks/*.json
  • Copilot customization file globs for repository instructions, path-specific instructions, prompt files, custom agents, legacy chat modes, skills, agent-instructions files, and repository hooks

Shareable configs that already register @eslint/markdown and @eslint/json should use the no-language-plugin variants after that registration instead:

import copilot from "eslint-plugin-copilot";
import sharedConfig from "your-shared-eslint-config";

export default [
 ...sharedConfig,
 ...copilot.configs["recommended-without-language-plugins"],
];

Those variants keep the same files, language, and copilot rule layers, but they do not register plugins.markdown or plugins.json. Use them only when an earlier matching flat config entry already registers markdown from @eslint/markdown and json from @eslint/json; otherwise ESLint cannot resolve language: "markdown/gfm" or language: "json/json".

What the presets lint

The built-in presets target these Markdown file patterns:

  • .github/copilot-instructions.md
  • .github/instructions/copilot-instructions.md
  • .github/instructions/**/*.instructions.md
  • .github/prompts/**/*.prompt.md
  • .github/agents/**/*.agent.md
  • .github/chatmodes/**/*.chatmode.md
  • .github/skills/**/*.md
  • .claude/skills/**/*.md
  • **/SKILL.md
  • **/AGENTS.md
  • **/CLAUDE.md
  • **/GEMINI.md

They also target these JSON file patterns:

  • .github/hooks/**/*.json

Presets

This plugin intentionally exports four presets:

Self-contained presetNo-language-plugin variant
๐ŸŸข copilot.configs.minimalcopilot.configs["minimal-without-language-plugins"]
๐ŸŸก copilot.configs.recommendedcopilot.configs["recommended-without-language-plugins"]
๐Ÿ”ด copilot.configs.strictcopilot.configs["strict-without-language-plugins"]
๐ŸŸฃ copilot.configs.allcopilot.configs["all-without-language-plugins"]

Configuration examples by preset

import copilot from "eslint-plugin-copilot";

export default [
 ...copilot.configs.minimal,
 // ...copilot.configs.recommended,
 // ...copilot.configs.strict,
 // ...copilot.configs.all,
];

Rules

Ruleallminimalrecommendedstrict
no-blank-customization-bodyโœ…โ€”โœ…โœ…
no-blank-repository-instructionsโœ…โ€”โœ…โœ…
no-blank-skill-bodyโœ…โ€”โœ…โœ…
no-deprecated-agent-inferโœ…โ€”โœ…โœ…
no-duplicate-agent-namesโœ…โ€”โœ…โœ…
no-duplicate-prompt-namesโœ…โ€”โœ…โœ…
no-duplicate-skill-namesโœ…โ€”โœ…โœ…
no-duplicate-slash-command-namesโœ…โ€”โœ…โœ…
no-empty-repository-hook-arraysโœ…โ€”โ€”โœ…
no-legacy-chatmode-filesโœ…โ€”โœ…โœ…
prefer-custom-instructions-under-code-review-limitโœ…โ€”โ€”โœ…
prefer-fast-repository-hooksโœ…โ€”โ€”โœ…
prefer-qualified-toolsโœ…โ€”โ€”โ€”
require-agent-tool-for-subagentsโœ…โ€”โœ…โœ…
require-agents-md-for-cross-surface-agent-instructionsโœ…โ€”โ€”โœ…
require-chatmode-file-metadataโœ…โœ…โœ…โœ…
require-existing-agent-hook-cwdโœ…โ€”โ€”โœ…
require-existing-agent-mcp-serversโœ…โ€”โ€”โœ…
require-existing-relative-agent-linksโœ…โ€”โ€”โœ…
require-existing-relative-instructions-linksโœ…โ€”โ€”โœ…
require-existing-relative-prompt-linksโœ…โ€”โ€”โœ…
require-existing-relative-skill-linksโœ…โ€”โ€”โœ…
require-existing-repository-hook-cwdโœ…โ€”โ€”โœ…
require-github-copilot-target-for-mcp-serversโœ…โ€”โœ…โœ…
require-instructions-apply-toโœ…โœ…โœ…โœ…
require-json-agent-mcp-serversโœ…โ€”โœ…โœ…
require-prompt-file-metadataโœ…โœ…โœ…โœ…
require-qualified-agent-handoff-modelsโœ…โ€”โœ…โœ…
require-relative-agent-hook-cwdโœ…โ€”โœ…โœ…
require-relative-agent-linksโœ…โ€”โœ…โœ…
require-relative-instructions-linksโœ…โ€”โœ…โœ…
require-relative-prompt-linksโœ…โ€”โœ…โœ…
require-relative-repository-hook-cwdโœ…โ€”โœ…โœ…
require-relative-skill-linksโœ…โ€”โœ…โœ…
require-repository-hook-arraysโœ…โ€”โœ…โœ…
require-repository-hook-command-shellโœ…โ€”โœ…โœ…
require-repository-hooks-objectโœ…โ€”โœ…โœ…
require-repository-instructions-fileโœ…โ€”โ€”โœ…
require-skill-file-locationโœ…โ€”โœ…โœ…
require-skill-file-metadataโœ…โ€”โœ…โœ…
require-skill-md-filenameโœ…โ€”โœ…โœ…
require-skill-name-match-directoryโœ…โ€”โ€”โœ…
require-string-repository-hook-env-valuesโœ…โ€”โœ…โœ…
require-valid-agent-argument-hintโœ…โ€”โœ…โœ…
require-valid-agent-handoff-sendโœ…โ€”โœ…โœ…
require-valid-agent-handoffsโœ…โ€”โœ…โœ…
require-valid-agent-hook-eventsโœ…โ€”โœ…โœ…
require-valid-agent-hook-timeoutsโœ…โ€”โœ…โœ…
require-valid-agent-hooksโœ…โ€”โœ…โœ…
require-valid-agent-invocation-controlsโœ…โ€”โœ…โœ…
require-valid-agent-mcp-serversโœ…โ€”โœ…โœ…
require-valid-agent-modelโœ…โ€”โœ…โœ…
require-valid-agent-nameโœ…โ€”โœ…โœ…
require-valid-agent-subagentsโœ…โ€”โœ…โœ…
require-valid-agent-targetโœ…โ€”โœ…โœ…
require-valid-agent-toolsโœ…โ€”โœ…โœ…
require-valid-instructions-apply-to-globsโœ…โ€”โœ…โœ…
require-valid-prompt-argument-hintโœ…โ€”โœ…โœ…
require-valid-prompt-modelโœ…โ€”โœ…โœ…
require-valid-prompt-nameโœ…โ€”โœ…โœ…
require-valid-prompt-toolsโœ…โ€”โœ…โœ…
require-valid-repository-hook-command-typeโœ…โ€”โœ…โœ…
require-valid-repository-hook-envโœ…โ€”โœ…โœ…
require-valid-repository-hook-eventsโœ…โ€”โœ…โœ…
require-valid-repository-hook-timeoutsโœ…โ€”โœ…โœ…
require-valid-repository-hook-versionโœ…โ€”โœ…โœ…
require-valid-skill-directory-nameโœ…โ€”โœ…โœ…
require-valid-skill-licenseโœ…โ€”โ€”โœ…
require-valid-skill-nameโœ…โ€”โœ…โœ…

Contributors โœจ

All Contributors.

Thanks goes to these wonderful people (emoji key):