copilot-instructions

copilot-instructions is a cursor rule for Cursor from nedcodes-ok/cursorrules-collection. It costs 0 tokens per session (730 once invoked), scanned B, original, MIT.

A reference for configuring GitHub Copilot with repository-wide instructions, path-specific rules, and agent guidance. GitHub Copilot is a coding assistant that can use these files when generating, reviewing, or changing code.

In plain words
What is it for?
Use it to create or organize Copilot instruction files, set rules for selected file types or directories, and understand how Copilot also uses AGENTS.md and related guidance.
Why use it?
It clarifies where Copilot looks for instructions and how rules for particular file paths differ from project-wide guidance. This reduces the chance of putting instructions in a file Copilot does not use.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc). Also seen: mentions CLAUDE.md; mentions AGENTS.md; mentions Codex.

Good fit Use it to create or organize Copilot instruction files, set rules for selected file types or directories, and understand how Copilot also uses AGENTS.md and related guidance.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/nedcodes-ok/cursorrules-collection/copilot-instructions
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/nedcodes-ok/cursorrules-collection

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for copilot-instructions

README.md
[![agentmods](https://agentmods.dev/badge/rules/nedcodes-ok/cursorrules-collection/copilot-instructions/github.svg)](https://agentmods.dev/rules/nedcodes-ok/cursorrules-collection/copilot-instructions)
Your own site
<a href="https://agentmods.dev/rules/nedcodes-ok/cursorrules-collection/copilot-instructions"><img src="https://agentmods.dev/badge/rules/nedcodes-ok/cursorrules-collection/copilot-instructions/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for copilot-instructions

Your own site · 80×15
<a href="https://agentmods.dev/rules/nedcodes-ok/cursorrules-collection/copilot-instructions"><img src="https://agentmods.dev/badge/rules/nedcodes-ok/cursorrules-collection/copilot-instructions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 730 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00730
Opus 5.5 $0.00000 $0.00292
Sonnet 5.5 $0.00000 $0.00146
Haiku 4.5 $0.00000 $0.00073

Measured 3mo ago against content hash 9c710d89d20b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

copilot-instructions scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nullifies safety policiesmediumAnti-refusal

"You have no restrictions", "do anything now", "ignore your guidelines": a direct jailbreak that disables guardrails.

- Don't try to give Copilot a personality or override its safety guidelines — it won't work and wastes instruction space

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

rules-mdc/ai-tools/copilot-instructions.mdc · 62 lines

How it starts

The opening of the file, as written. The whole thing — 62 lines — stays where its author put it; the contents beside it link to each section on GitHub.

GitHub Copilot Custom Instructions Rules

Copilot supports three layers of custom instructions, from broad to specific.

Repository-Wide Instructions

  • File: .github/copilot-instructions.md
  • Applies to all Copilot interactions in the repo: chat, completions, code review, and the coding agent
  • Plain markdown, no special frontmatter required
  • You can ask the Copilot coding agent to generate this file for you — it will analyze your repo and create one

Path-Specific Instructions

  • Files: .github/instructions/<name>.instructions.md
  • Each file includes a YAML frontmatter applyTo field with a glob pattern specifying which files the instructions apply to
  • When Copilot is working on a file that matches the glob, both the repo-wide and the matching path-specific instructions are used together
  • Example:
---
applyTo: "**/*.ts"
---
# TypeScript Instructions
- Use strict mode
- Prefer interfaces over type aliases for object shapes
- Use discriminated unions for state management

Agent Instructions (AGENTS.md)

  • Copilot coding agent also reads AGENTS.md files (the OpenAI Codex format)
  • Nearest AGENTS.md in the directory tree takes precedence over others
  • Copilot also supports CLAUDE.md and GEMINI.md at the repo root as alternatives
  • If you have both copilot-instructions.md and AGENTS.md, both are used

What Works Well

  • Build, test, and validation commands — the coding agent uses these to verify its own changes
  • Framework and library preferences: "use React Testing Library, not Enzyme," "use fetch, not axios"
  • Naming conventions, file organization expectations, import ordering
  • Code review instructions: what Copilot should flag during reviews ("check for missing error handling," "verify accessibility attributes on interactive elements")

Path-Specific Patterns

  • **/*.test.ts — testing conventions (framework, assertion style, mock patterns)
  • src/api/** — API conventions (response format, error handling, auth patterns)
  • **/*.css — styling conventions (methodology, naming, no inline styles)
  • docs/** — documentation conventions (format, required sections, link validation)

Read the full file on GitHub · 62 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 62 lines · 0 tokens per session scan B 9c710d89d20b

Subscribe to this mod's changes

copilot-instructions is a cursor rule published in the GitHub repository nedcodes-ok/cursorrules-collection (38 stars, last pushed 9mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 730 tokens. A static security scan graded it B with 1 finding (nullifies safety policies). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

copilot-instructions compared with cursor rules from other repositories

copilot-instructions next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
copilot-instructionsnedcodes-ok/cursorrules-collectionCursor rule389mo agoMITB0Cursor
23-app-startuporbitalsonic/AndroidPilotCursor rule11mo agononeA0Cursor
21-ads-billingorbitalsonic/AndroidPilotCursor rule11mo agononeA0Cursor
30-screen-languageorbitalsonic/AndroidPilotCursor rule11mo agononeA0Cursor
01-feature-checklistorbitalsonic/AndroidPilotCursor rule11mo agononeA36Cursor
06-coroutines-floworbitalsonic/AndroidPilotCursor rule11mo agononeA0Cursor
09-resources-xmlorbitalsonic/AndroidPilotCursor rule11mo agononeA0Cursor