ai-agents: Instructions file for GitHub Copilot

.github/instructions/canonical-source-mirror.instructions.md

ai-agents canonical-source-mirror.instructions.md is an instructions file for GitHub Copilot from rjmurillo/ai-agents. It costs 5,026 tokens per session, scanned B, original, MIT.

Repository instructions for keeping code that claims to mirror a canonical source aligned with that source. A canonical source is the authoritative regex, schema, function signature, or contract being copied.

In plain words
What is it for?
Use them when adding or changing hooks, rules, validation scripts, build scripts, skills, prompts, governance files, or retrospectives whose behavior must match an existing source.
Why use it?
They prevent reviewers and maintainers from trusting an inaccurate claim that two implementations match. They require evidence and checks when code is derived from another source.

Instructions file for GitHub Copilot

Written for GitHub Copilot: a Copilot instructions file. Also seen: reads .claude/ paths.

This is rjmurillo/ai-agents's own configuration. It tells GitHub Copilot how to work on ai-agents itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything ai-agents configures →

Reuse

Borrowing it

Nothing to install: this file belongs to rjmurillo/ai-agents. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/rjmurillo/ai-agents/main/.github/instructions/canonical-source-mirror.instructions.md
Clone the repo
git clone --depth 1 https://github.com/rjmurillo/ai-agents

Made for: GitHub Copilot.

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 ai-agents canonical-source-mirror.instructions.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/rjmurillo/ai-agents/canonical-source-mirror.svg)](https://agentmods.dev/instructions/rjmurillo/ai-agents/canonical-source-mirror)
Your own site
<a href="https://agentmods.dev/instructions/rjmurillo/ai-agents/canonical-source-mirror"><img src="https://agentmods.dev/badge/instructions/rjmurillo/ai-agents/canonical-source-mirror.svg" alt="Measured on agentmods" height="20"></a>
Per session 5,026 This file is loaded in full into every session.
When invoked 5,026 The same file — it is already loaded in full.
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.05026 $0.05026
Opus 5 $0.02513 $0.02513
Sonnet 5 $0.01005 $0.01005
Haiku 4.5 $0.00503 $0.00503

Measured today against content hash 37b858887274, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade B, and why

ai-agents canonical-source-mirror.instructions.md 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 today.

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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

Situations 3 and 4 leave no source line to grep for. Situation 4 used to fall back to `**`, which inverted intent: narrowing a rule to `.claude/**` read like a reduction in scope and silently widened it to every turn in
.github/instructions/canonical-source-mirror.instructions.md · 202 lines

How it starts

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

Canonical Source Mirror Rule

When a component's docstring, comment, or README claims to "match", "mirror", "align with", or "extend" an existing source (a regex, a schema, a function signature, a set of exit codes, a JSON contract), the claim is a load-bearing assertion. The reader trusts it. So does the reviewer. So does the next maintainer who replays the contract from your code instead of from the source.

This rule binds those claims to evidence. It exists because PR #1887 (the M4 evidence-rule guard) was designed against an imagined contract instead of the canonical scripts/validate_session_json.py:CONTRADICTION_PATTERNS regex. The error survived several reviews. Aligning M4 to canonical took 7 fix commits. The retrospective at .agents/retrospective/2026-05-05-pr-1887-iteration-paradox.md names this anti-pattern "confident incorrectness": partial signal, premature conclusion, confident delivery, multi-round correction.

What this rule binds

This rule binds any new component under .claude/hooks/, .claude/rules/, scripts/validation/, build/scripts/, .claude/skills/, .github/prompts/, .agents/governance/, or .agents/retrospective/ whose contract is derived from another source in the repository. The two Copilot-side mirrors scope differently by consumer. .github/instructions/canonical-source-mirror.instructions.md, read by Copilot in full-repo context, keeps the full path set (.claude/hooks/**, .claude/rules/**, scripts/validation/**, build/scripts/**, .claude/skills/**, .github/prompts/**, .agents/governance/**, .agents/retrospective/**). Its src/copilot-cli/ twin ships inside the plugin, so it narrows to the paths that travel with the plugin (scripts/validation/**, build/scripts/**, .github/prompts/**). The rule still binds the .claude/ paths on the Claude side. Examples:

  • A pre-push hook that "mirrors" a CI validator's regex.
  • A skill helper that "matches" the exit codes of a validator script.
  • A build script that "extends" a schema defined in another module.
  • An adapter that "aligns with" the wire format produced by an existing emitter.

Read the full file on GitHub · 202 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. today Changed 37b858887274
  2. 4d ago First seen · 202 lines · 5,026 tokens per session scan B 3ff8e8eb6ce3

Subscribe to this mod's changes

ai-agents canonical-source-mirror.instructions.md is an instructions file published in the GitHub repository rjmurillo/ai-agents (45 stars, last pushed today), licensed MIT. It adds 5,026 tokens to every session, about $0.0251 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other instructions, from other repositories

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens