copilot-instruction-creator
Skill4 starsChanged 11 days agoMITView on GitHub
Guide for creating custom instructions to tailor GitHub Copilot responses for personal, repository, or organization use. Use this when setting up Copilot customization for better responses.
In this repository24 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/client-config-opencode/references/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- repository-reviewSkill
- weekly-skill-refreshSkill
- skill-maintenanceSkill
- about-me-skill-creatorSkill
- agent-creator-claudecodeSkill
- agent-creator-codexSkill
- agent-creator-copilotSkill
- agent-creator-opencodeSkill
- client-config-claudecodeSkill
- client-config-codexSkill
- client-config-copilotcliSkill
- client-config-opencodeSkill
- copilot-workerSkill
- docker-image-managementSkill
- git-commit-messagesSkill
- google-style-docsSkill
- handoffSkill
- markdownlint-validatorSkill
- mkdocs-site-managementSkill
- skill-routerSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
22 rules. About 0 are common, 18 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈18
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Use this skill when:
- Distinctive: line 31
IMPORTANT: Before creating any custom instructions, always check the official GitHub documentation for the latest information: …
- Distinctive: line 38
All relevant instruction sets are sent to Copilot.
- Distinctive: line 114
Keep statements short and self-contained
- Very specific: line 137
Create .github/instructions/ directory (subdirectories are allowed)
- Very specific: line 138
Add NAME.instructions.md files (e.g., frontend.instructions.md)
- Very specific: line 139
Start each file with YAML frontmatter containing applyTo — a glob, or comma-separated globs, matching the files the instructions cover.
- Distinctive: line 151
Create AGENTS.md files anywhere in the repository — the nearest one in the directory tree takes precedence
- Very specific: line 158
Copilot CLI: Create ~/.copilot/copilot-instructions.md, or modular ~/.copilot/instructions//*.instructions.md files matched by applyTo
- Distinctive: line 172
Test in different files and scenarios
- Distinctive: line 173
Verify behavior across team members
- Distinctive: line 176
Check if responses follow instructions
- Distinctive: line 187
Regular review: Check instructions periodically
- Distinctive: line 190
Team communication: Ensure team knows about updates
- Distinctive: line 317
Be specific: Use concrete examples rather than vague guidance
- Distinctive: line 319
Test thoroughly: Verify instructions work as intended
- Distinctive: line 320
Avoid conflicts: Ensure instructions don't contradict each other
- Distinctive: line 327
Team alignment: Ensure instructions reflect team consensus
- Distinctive: line 333
Complement repository: Don't override important project standards
- Distinctive: line 346
Solution: Check precedence (personal > repository > organization), ensure instructions are clear and specific
- Distinctive: line 355
Solution: Check support matrix at <https://docs.github.com/en/copilot/reference/custom-instructions-support>
- Distinctive: line 358
Solution: Ensure repository instructions are consistent, check for personal overrides
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Copilot Custom Instructions
This skill provides comprehensive guidance for creating custom instructions that tailor GitHub Copilot's responses to your personal preferences, team workflows, project requirements, or organization standards. Custom instructions help Copilot generate higher quality, more relevant responses without needing to repeat context in every interaction.
When to Use This Skill
Use this skill when:
- Setting up personal custom instructions for consistent Copilot behavior
- Creating repository-wide instructions for project-specific standards
- Developing organization-level instructions for company-wide preferences
- Configuring path-specific instructions for different file types or directories
- Optimizing Copilot responses for coding standards, frameworks, or workflows
- Ensuring consistent AI assistance across team members
Prerequisites
- Always check the latest GitHub documentation: https://docs.github.com/en/copilot/concepts/prompting/response-customization
- Access to GitHub Copilot (Pro, Pro+, Business, or Enterprise plan)
- Understanding of your project, team, or organization's needs
- Knowledge of the context where instructions will be applied
Latest Information Check
IMPORTANT: Before creating any custom instructions, always check the official GitHub documentation for the latest information: https://docs.github.com/en/copilot/concepts/prompting/response-customization
Key points from the latest documentation:
- Three types: Personal, Repository, and Organization instructions
- Repository instructions include repository-wide, path-specific, and agent instructions
- Precedence: Personal > Repository (path-specific, then repository-wide, then agent) > Organization
- All relevant instruction sets are sent to Copilot; precedence only decides conflicts between them
- Path-specific
.instructions.mdfiles require anapplyToglob in YAML frontmatter - Instructions should be short, self-contained statements
- Support varies by surface (GitHub.com, VS Code, JetBrains, Copilot CLI, and others) — check the support matrix
Instructions
Step 1: Determine Instruction Scope and Type
- Identify the scope: Personal, repository, or organization level?
- Choose instruction type:
- Personal: Individual preferences — Copilot Chat on GitHub.com, or
~/.copilot/copilot-instructions.mdand~/.copilot/instructions/**/*.instructions.mdfor the Copilot CLI - Repository-wide:
.github/copilot-instructions.mdfor entire repository - Path-specific:
.github/instructions/**/NAME.instructions.mdfor specific paths (requiresapplyTofrontmatter) - Agent instructions:
AGENTS.mdanywhere in the repository (the nearest one in the directory tree wins), or a singleCLAUDE.mdorGEMINI.mdat the repository root - Organization: Organization-wide settings (owners only, Copilot Business or Enterprise; GitHub.com Chat, code review, and cloud agent only)
- Personal: Individual preferences — Copilot Chat on GitHub.com, or
- Assess requirements: What behaviors need to be customized?
Step 2: Analyze Context and Requirements
- Gather project information:
- Project purpose and goals
- Technology stack and frameworks
- Coding standards and conventions
- Team workflows and processes
- Identify pain points:
- Common Copilot suggestions that need correction
- Missing context that causes poor responses
- Inconsistent behavior across team members
- Define success criteria:
- What should Copilot always/never do?
- What standards must be followed?
- What context is always relevant?
Step 3: Structure Your Instructions
Start with project overview:
# Project Overview This project is a [description]. It is built using [technologies] and uses [databases/frameworks].Document folder structure:
## Folder Structure - `/src`: Contains the source code for the [component] - `/tests`: Contains test files - `/docs`: Contains documentationSpecify coding standards:
## Coding Standards - Use [naming convention] for variables/functions - Follow [style guide] for formatting - Use [patterns] for [specific cases]List libraries and frameworks:
## Libraries and Frameworks - [Library] v[version] for [purpose] - [Framework] with [configuration]
Step 4: Write Effective Instructions
Guidelines for writing instructions:
- Keep statements short and self-contained
- Use natural language
- Focus on broadly applicable information
- Avoid conflicting instructions
- Test for effectiveness
Common instruction patterns:
- Language preferences:
Always respond in [language]. - Coding standards:
Use [convention] for [element]. - Framework usage:
Use [framework] with [library]. - Response style:
Be clear and concise. - Context requirements:
Always consider [requirement].
Step 5: Create the Instruction Files
For Repository Instructions
- Repository-wide instructions:
- Create
.github/copilot-instructions.md - Include all broadly applicable instructions
- Create
Path-specific instructions:
- Create
.github/instructions/directory (subdirectories are allowed) - Add
NAME.instructions.mdfiles (e.g.,frontend.instructions.md) - Start each file with YAML frontmatter containing
applyTo— a glob, or comma-separated globs, matching the files the instructions cover. Without it, the file is never applied. - Optionally add
excludeAgent: "code-review"orexcludeAgent: "cloud-agent"to keep one of those agents from using the file
--- applyTo: "**/*.ts,**/*.tsx" --- Use strict TypeScript. Never use `any`.- Create
- Agent instructions:
- Create
AGENTS.mdfiles anywhere in the repository — the nearest one in the directory tree takes precedence - Alternatively, use a single
CLAUDE.mdorGEMINI.mdat the repository root - Include agent-specific customizations
- Create
For Personal Instructions
- GitHub.com: In Copilot Chat, click your profile picture, select Personal instructions, enter your preferences, and save
- Copilot CLI: Create
~/.copilot/copilot-instructions.md, or modular~/.copilot/instructions/**/*.instructions.mdfiles matched byapplyTo - VS Code / JetBrains: Personal instructions live in the IDE's user profile — see the IDE's documentation
For Organization Instructions
- Organization owners only, for organizations with Copilot Business or Copilot Enterprise
- Go to organization Settings > Copilot > Custom instructions
- Enter instructions in the Preferences and instructions box and save
- Applies only to Copilot Chat, Copilot code review, and Copilot cloud agent on GitHub.com
Step 6: Test and Refine
- Test in different contexts:
- Try Copilot Chat with various queries
- Test in different files and scenarios
- Verify behavior across team members
- Monitor effectiveness:
- Check if responses follow instructions
- Identify areas needing clarification
- Gather feedback from team members
- Iterate and improve:
- Refine wording for clarity
- Add missing context
- Remove ineffective instructions
Step 7: Maintain and Update
- Regular review: Check instructions periodically
- Update with changes: Modify when project standards change
- Version control: Track changes to instruction files
- Team communication: Ensure team knows about updates
Examples
Example 1: Repository-Wide Instructions for a React Project
Create .github/copilot-instructions.md:
# Project Overview
This project is a modern web application built with React and TypeScript. It provides a task management interface for teams to collaborate on projects and track progress.
## Folder Structure
- `/src/components`: Reusable React components
- `/src/hooks`: Custom React hooks
- `/src/utils`: Utility functions and helpers
- `/src/types`: TypeScript type definitions
- `/tests`: Unit and integration tests
- `/docs`: Project documentation
## Libraries and Frameworks
- React 18 with TypeScript
- React Router for navigation
- Axios for API calls
- React Query for data fetching
- Tailwind CSS for styling
- Jest and React Testing Library for testing
## Coding Standards
- Use functional components with hooks
- Prefer custom hooks over class components
- Use TypeScript interfaces for all data structures
- Follow the single responsibility principle
- Write descriptive variable and function names
- Use early returns in functions
- Handle errors gracefully with try-catch blocks
## UI Guidelines
- Use Tailwind CSS classes for styling
- Maintain consistent spacing and typography
- Ensure responsive design for mobile and desktop
- Follow accessibility best practices (WCAG guidelines)
- Use semantic HTML elements
## API Guidelines
- Use RESTful API design principles
- Include proper error handling for API calls
- Implement loading states for async operations
- Cache data appropriately with React Query
- Validate API responses before using dataExample 2: Path-Specific Instructions for Tests
Create .github/instructions/tests.instructions.md:
---
applyTo: "**/*.test.ts,**/*.test.tsx"
---
# Testing Instructions
These instructions apply to all test files in the repository.
## Testing Framework
- Use Jest as the testing framework
- Use React Testing Library for component testing
- Write tests in TypeScript (.test.tsx files)
## Test Structure
- Group related tests in describe blocks
- Use descriptive test names (it should...)
- Follow the Arrange-Act-Assert pattern
- Test one behavior per test case
## Testing Best Practices
- Test component behavior, not implementation details
- Mock external dependencies (API calls, hooks)
- Test error states and edge cases
- Aim for high test coverage (>80%)
- Write integration tests for critical user flows
## Naming Conventions
- Test files: `ComponentName.test.tsx`
- Test cases: descriptive sentences
- Mock files: `ComponentName.mock.tsx`Example 3: Personal Instructions
In Copilot Chat on GitHub.com (profile picture > Personal instructions):
Always respond in clear, concise English.
Explain code concepts with practical examples.
Prefer modern JavaScript/TypeScript features.
When suggesting code, include brief comments for complex logic.
Focus on readable, maintainable solutions over clever optimizations.Example 4: Organization Instructions
For organization owners (Copilot Business or Enterprise), in organization Settings > Copilot > Custom instructions:
Always respond in English unless specifically requested otherwise.
For security-related questions, reference the company security guidelines.
Use the organization's approved coding standards.
When suggesting code, ensure it follows our accessibility requirements.
Prefer our standard technology stack unless there's a specific reason to deviate.Best Practices
Writing Effective Instructions
- Be specific: Use concrete examples rather than vague guidance
- Keep it concise: Short statements are more effective than long explanations
- Test thoroughly: Verify instructions work as intended
- Avoid conflicts: Ensure instructions don't contradict each other
- Update regularly: Review and update as project needs change
Repository Instructions
- Broad applicability: Focus on information relevant to most repository interactions
- Version control: Track instruction files in git
- Team alignment: Ensure instructions reflect team consensus
- Documentation: Reference instruction files in project README
Personal Instructions
- Individual preferences: Focus on your personal workflow preferences
- Complement repository: Don't override important project standards
- Minimal but effective: Few high-impact instructions are better than many
Organization Instructions
- Company standards: Enforce organization-wide policies and preferences
- Cultural alignment: Reflect company values and communication style
- Security first: Include security-related guidelines
- Scalable: Work across different teams and projects
Common Issues
Issue: Copilot not following instructions Solution: Check precedence (personal > repository > organization), ensure instructions are clear and specific
Issue: Path-specific instructions never apply
Solution: Confirm the file is under .github/instructions/, ends in .instructions.md, and has an applyTo glob in frontmatter that matches the target files
Issue: Instructions too broad or conflicting Solution: Refine wording, remove contradictions, test in different contexts
Issue: Instructions not applying to certain features Solution: Check support matrix at https://docs.github.com/en/copilot/reference/custom-instructions-support
Issue: Team members getting different responses Solution: Ensure repository instructions are consistent, check for personal overrides
Issue: Instructions becoming outdated Solution: Regular review process, update when project standards change
Additional Resources
- GitHub Custom Instructions Documentation - Official documentation (always check first)
- Adding Repository Custom Instructions - Step-by-step guide
- Custom Instructions Library - Curated examples
- Custom Instructions Support - Feature compatibility matrix
Testing Checklist
- Instructions follow the correct file naming and location conventions
- Every path-specific
.instructions.mdfile has anapplyToglob in frontmatter - Content is clear, concise, and self-contained
- Instructions don't conflict with each other
- Tested across different Copilot features and contexts
- Team members can access and understand the instructions
- Instructions remain effective over time
- Documentation updated to reference instruction files
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

