
github-copilot-repo-instructions
Add, audit, or fix GitHub Copilot repository custom instructions — .github/copilot-instructions.md (repo-wide) and .github/instructions/.instructions.md (path-specific) — so Copilot Chat, Copilot code review, and the Copilot coding agent all pick up project-wide guidance. Also covers AGENTS.md, CLAUDE.md, and GEMINI.md as alternate agent instruction files. Use when the user says "add Copilot instructions", "set up copilot-instructions.md", "audit our Copilot config", "make Copilot follow our conventions", "configure Copilot code review", "add path-specific Copilot rules", "applyTo glob", "excludeAgent", "Copilot is ignoring our guidance", or invokes /github-copilot-repo-instructions. Do NOT use for personal (per-user) Copilot instructions — that is /github-copilot-personal-instructions. Do NOT use for opinionated generation aligned with this project's opinionated engineering principles — that is the setup mode of the multi-mode Copilot driver, /copilot setup (if installed)
- Installs
- 56
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/paulnsorensen/skillz-that-grillz --skill github-copilot-repo-instructions- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads github-copilot-repo-instructions automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
github-copilot-repo-instructions
Repository-scoped Copilot guidance. Markdown files in .github/ that GitHub
Copilot reads on every request against the repo.
Generic, doc-faithful. For an opinionated generator that bakes in specific engineering principles, see the
setupmode of/copilot—/copilot setup(if installed).For the multi-mode Copilot driver (review / delegate / setup), see
/copilot(if installed) — this skill only writes and audits the instruction files.
File layout
| File | Scope | Frontmatter | Notes |
|---|---|---|---|
.github/copilot-instructions.md | Repo-wide, every request | None | Single file. Keep ≤ 2 pages. |
.github/instructions/<name>.instructions.md | Path-glob | Required (applyTo) | Multiple files allowed. Filename must end .instructions.md. |
AGENTS.md | Nearest-wins | None | Place anywhere in the tree; the file closest to the edited path wins. |
CLAUDE.md | Repo root only | None | Single file at root. |
GEMINI.md | Repo root only | None | Single file at root. |
The repo-wide file and path-specific files combine when a path matches — both sets of instructions are sent to Copilot together.
Frontmatter (path-specific files only)
---
applyTo: "**/*.ts, **/*.tsx"
excludeAgent: "code-review"
---
- Prefer `interface` over `type` for object shapes.
- Use named exports.
| Field | Required | Values |
|---|---|---|
applyTo | Yes | Glob pattern, or comma-separated globs (*.py, src/**/*.rb, **/subdir/**/*.py). |
excludeAgent | No | "code-review" or "cloud-agent" — hides this file from that surface. |
Surfaces
Copilot reads repo instructions across these surfaces:
- Copilot Chat —
github.com/copilot(with repo attached) and IDE chat. - Copilot code review — PR reviews. Toggleable per-repo. Reads from the base branch, not the feature branch.
- Copilot coding agent (cloud agent) — issue-driven implementations.
Path-specific files (.github/instructions/*.instructions.md) are fully
supported on github.com for code-review and the cloud agent. IDE support for
path-specific files lags — repo-wide file is the safer bet for IDE coverage.
Precedence
When multiple instruction sets exist, all are merged and sent to Copilot. Stated priority order (highest → lowest):
- Personal instructions (per-user, github.com Chat only).
- Repository instructions (this skill).
- Organization instructions.
Conflicts are not auto-resolved — Copilot sees them all. If quality drops, temporarily disable a set rather than fighting overlap.
Protocol
Add repo-wide instructions
mkdir -p .github- Write
.github/copilot-instructions.md. Markdown only, no frontmatter. - Keep it ≤ 2 pages. Whitespace is ignored, so use bullets liberally.
- Content that pulls weight: stack summary, build/test commands, layout map, non-obvious conventions. Skip generic advice Copilot already knows.
- Commit on the base branch (usually
main) — code review reads from base.
Add path-specific instructions
mkdir -p .github/instructions- Create
<name>.instructions.mdwithapplyTofrontmatter. - One file per scope (e.g.
python.instructions.md,frontend.instructions.md). - Use
excludeAgentto keep review-only or coding-agent-only guidance from leaking into the other surface.
Enable Copilot code review
Repo Settings → Code & automation → Copilot → Code review → toggle "Use custom instructions when reviewing pull requests".
Default is enabled, but confirm — orgs sometimes flip it off.
Enable automatic Copilot review on every PR
Two paths — pick one. Both create a branch ruleset; the API path is scriptable.
UI — Settings → Rules → Rulesets → New branch ruleset. Under "Branch rules", select Automatically request Copilot code review. Two sub-toggles: Review new pushes (re-review on each push, burns premium requests) and Review draft pull requests.
API (gh) — the rule type is copilot_code_review. It is not listed
on the rulesets schema page
as of writing, but the endpoint accepts it. Targets work like any other ruleset.
gh api repos/<owner>/<repo>/rulesets -X POST --input - <<'JSON'
{
"name": "copilot-auto-review",
"target": "branch",
"enforcement": "active",
"conditions": { "ref_name": { "include": ["~DEFAULT_BRANCH"], "exclude": [] } },
"rules": [
{
"type": "copilot_code_review",
"parameters": {
"review_on_push": false,
"review_draft_pull_requests": false
}
}
]
}
JSON
Defaults shown are conservative: review once on PR open, skip drafts.
Flip review_on_push to true to re-review on every push — useful for
agentic workflows, expensive on premium-request quota.
Requires Copilot Business/Enterprise on the org, or Copilot Pro for personal repos. The ruleset still installs without a license; reviews just don't fire.
For the full knob inventory across repo / org / per-PR — including what
Copilot review cannot do (no "request changes" mode, no severity
threshold, no API re-request) — read references/code-review-knobs.md.
Verify Copilot is reading the file
- Open
github.com/copilotand attach the repo. - Ask any Copilot Chat question.
- Expand the References list at the top of the response.
.github/copilot-instructions.mdshould appear; click to confirm it's the version you expect. Path-specific files appear when relevant paths are mentioned or attached.
For PR review verification, look at the review comment metadata or trigger a review on a PR that touches a glob covered by a path-specific file.
Audit checklist
When the user says "audit our Copilot config":
ls -la .github/copilot-instructions.md .github/instructions/ AGENTS.md CLAUDE.md GEMINI.md 2>/dev/null(silence missing files).- Read each present file and check:
- Repo-wide file ≤ 2 pages.
- Every path-specific file has
applyTofrontmatter. - Filenames end
.instructions.md(path-specific only). excludeAgentvalues are exactly"code-review"or"cloud-agent".- No instructions baked into the repo-wide file that should be path-scoped (e.g. "always add type hints" — that's Python-only, hoist it).
- Check the base branch in
git log— recent edits to instructions on a feature branch won't be seen by code review until merged. - Flag conflicts with org-level or expected personal instructions.
Rules
- Repo-wide file: no frontmatter. GitHub does not document frontmatter on
.github/copilot-instructions.md. Don't addapplyTothere. - Path-specific file: frontmatter is mandatory. Without
applyTothe file is ignored. - Don't put task-specific instructions in either ("fix bug X", "do refactor Y") — they're long-lived configuration, not ticket scope.
- Don't duplicate org instructions. If your org already says "use Conventional Commits", don't repeat it at repo level.
- Code review reads base branch. PR-only changes to instructions don't affect that PR's own review.
- Don't include secrets, tokens, or internal URLs. These files are part of the repo — anyone with read access sees them.
Gotchas
- A path-specific file with malformed YAML frontmatter is silently dropped. Validate frontmatter before committing.
- If a glob isn't matching as expected, prefix with
**/to cover nested paths (**/*.pycovers nested files;*.pymay only cover the root, depending on the glob engine). - The IDE may cache instructions; reload the window after editing.
AGENTS.mdis recursive — a deeply nestedAGENTS.mdoverrides a higher one for files near it. Useful, but confusing if the user expects merging.CLAUDE.mdandGEMINI.mdare also read by Copilot now, even though they originated as other-vendor files. If you maintain both, expect Copilot to see all three.- Personal instructions take precedence over repo guidance for that one
user on github.com Chat — symptoms look like "Copilot ignores our rules
for Alice but works for everyone else". Check
/github-copilot-personal-instructions. - The repo-wide file's only documented size guidance is "≤ 2 pages". Treat that as the ceiling — long instructions crowd out the actual question.
What this skill is not
- Not a setup wizard — it advises and edits, does not interview.
- Not the same as
/copilot setup(if installed) — that mode of the/copilotdriver bakes in a specific style. - Not personal instructions — see
/github-copilot-personal-instructions. - Not org-level instructions — those are configured in GitHub Enterprise org settings, outside any repo.
Source
FAQ
What does the github-copilot-repo-instructions skill do?
Add, audit, or fix GitHub Copilot repository custom instructions — .github/copilot-instructions.md (repo-wide) and .github/instructions/.instructions.md (path-specific) — so Copilot Chat, Copilot code review, and the Copilot coding agent all pick up project-wide guidance. Also covers AGENTS.md, CLAUDE.md, and GEMINI.md as alternate agent instruction files. Use when the user says "add Copilot instructions", "set up copilot-instructions.md", "audit our Copilot config", "make Copilot follow our conventions", "configure Copilot code review", "add path-specific Copilot rules", "applyTo glob", "excludeAgent", "Copilot is ignoring our guidance", or invokes /github-copilot-repo-instructions. Do NOT use for personal (per-user) Copilot instructions — that is /github-copilot-personal-instructions. Do NOT use for opinionated generation aligned with this project's opinionated engineering principles — that is the setup mode of the multi-mode Copilot driver, /copilot setup (if installed)
How do I install github-copilot-repo-instructions?
Run npx skills add https://github.com/paulnsorensen/skillz-that-grillz --skill github-copilot-repo-instructions in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/github-copilot-repo-instructions/ (personal) or .claude/skills/github-copilot-repo-instructions/ (project).
Which AI agents can use github-copilot-repo-instructions?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is github-copilot-repo-instructions safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains github-copilot-repo-instructions?
It is published by paulnsorensen in paulnsorensen/skillz-that-grillz. It has 56 recorded installs.
More from paulnsorensen/skillz-that-grillz
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.