.github/skills/tsh-creating-instructions/SKILL.md
Creates custom instruction files (.instructions.md) for GitHub Copilot in VS Code. Covers repository-level instructions (copilot-instructions.md) and granular file-based instructions with applyTo glob patterns. Provides templates and decision framework for instruction vs. skill placement. Use when creating, reviewing, or updating .instructions.md files.
npx skillsauth add thesoftwarehouse/copilot-collections tsh-creating-instructionsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Creates well-structured instruction files for GitHub Copilot in VS Code. Covers the repository-level constitution and granular scoped conventions, with clear guidance on what belongs in instructions versus skills.
Repository-level instructions (.github/copilot-instructions.md): A single file per repository — the "constitution." Defines architecture, directory structure, languages, frameworks, library versions, and fundamental project constraints. Applied to ALL Copilot interactions in the workspace. No frontmatter required. This is the first file any developer or AI agent should read to understand the project.
Granular custom instructions (*.instructions.md): Multiple files per repository. Support YAML frontmatter with applyTo glob patterns. Applied automatically when matching files are in context, or manually added to chat. Stored in .github/instructions/ folder. These encode file-type-specific or directory-specific coding conventions.
| Aspect | Repository-level | Granular custom |
|---|---|---|
| File | .github/copilot-instructions.md | *.instructions.md |
| Count per repo | Exactly one | Multiple |
| Frontmatter | Not required | Recommended (applyTo, name, description) |
| Applied when | Every Copilot interaction | Files matching applyTo pattern are in context, or description semantically matches the task |
| Location | .github/copilot-instructions.md | .github/instructions/ folder |
| Purpose | Project constitution — architecture, stack, fundamental rules | Scoped conventions — file-type or domain-specific rules |
</instruction-types>
Skills define HOW — procedural workflows loaded on-demand by agents to perform specific tasks. Skills are generic, reusable across projects, and encode expert knowledge.
| If the content is... | It belongs in... | Example |
|---|---|---|
| A project-specific rule or constraint | Instructions | "Use date-fns instead of moment.js — moment.js is deprecated" |
| A step-by-step workflow for performing a task | Skill | "How to perform code review with severity categorization" |
| A coding convention for specific file types | Instructions (granular) | "React components use functional style with hooks" |
| A reusable process template across projects | Skill | "How to create a new API endpoint with validation" |
| An architectural decision for this repository | Instructions (repo-level) | "This is a monorepo with apps/ and packages/ structure" |
| Domain knowledge needed to execute a task | Skill | "E2E testing patterns with Playwright Page Objects" |
| Technology stack and version requirements | Instructions (repo-level) | "TypeScript 5.4, React 19, Next.js 15" |
| A coding standard that linters don't enforce | Instructions (granular) | "Business logic must not import from UI layer" |
Mental model: Instructions are "the law" (always in force). Skills are "expert handbooks" (consulted for specific tasks). </instructions-vs-skills>
<conciseness> Instruction files compete for the context window with conversation history, skills, and the actual task.date-fns instead of moment.js — moment.js is deprecated and increases bundle size").Use the checklist below and track progress:
Creation progress:
- [ ] Step 1: Determine the instruction type
- [ ] Step 2: Define the instruction scope
- [ ] Step 3: Gather content for the instruction file
- [ ] Step 4: Write the instruction file
- [ ] Step 5: Validate the instruction file
Step 1: Determine the instruction type
Determine from context or ask the user. Use the vscode/askQuestions tool to clarify the user's intent if it's ambiguous:
copilot-instructions.md? → Create repository-level instructions.copilot-instructions.md and file-specific rules are needed? → Create granular instructions..github/copilot-instructions.md exists. If not, recommend creating it first. The constitution comes before specific laws.Step 2: Define the instruction scope
For repository-level instructions, the scope is always the entire project. Research by:
package.json, pyproject.toml, Cargo.toml, go.mod, or equivalent to identify languages, frameworks, and versions..eslintrc, tsconfig.json, .prettierrc, etc.) to understand tooling.For granular instructions, determine:
applyTo glob pattern).applyTo patterns).applyTo glob pattern reference:
| Pattern | Matches |
|---|---|
| **/*.ts | All TypeScript files |
| **/*.test.ts | All test files |
| src/components/** | All files under components directory |
| **/*.{ts,tsx} | All TypeScript and TSX files |
| src/api/** | All API-related files |
| ** | All files (rarely needed for granular — use repo-level instead) |
Step 3: Gather content for the instruction file
For repository-level instructions (the constitution), research and document:
For granular instructions, research and document:
Use the ./assets/copilot-instructions.template.md and ./assets/custom-instructions.template.md templates as starting points.
Step 4: Write the instruction file
For repository-level instructions:
.github/copilot-instructions.md../assets/copilot-instructions.template.md template.For granular instructions:
.github/instructions/ directory.{scope}.instructions.md (e.g., python.instructions.md, react-components.instructions.md, api-endpoints.instructions.md).name, description, and applyTo../assets/custom-instructions.template.md template.Frontmatter fields reference:
| Field | Required | Description |
|---|---|---|
| name | No | Display name shown in UI. Defaults to filename. |
| description | Recommended | Short description shown on hover. Also used for semantic matching — if description matches the current task, instructions may apply even without applyTo match. |
| applyTo | Recommended | Glob pattern relative to workspace root. If omitted, instructions are not applied automatically. |
Step 5: Validate the instruction file
Validation:
- [ ] File is in the correct location (`.github/copilot-instructions.md` or `.github/instructions/*.instructions.md`)
- [ ] Frontmatter (if present) is valid YAML
- [ ] `applyTo` pattern (if present) matches the intended files — verify with a glob tester
- [ ] Instructions are short and self-contained — each rule is a single statement
- [ ] Non-obvious rules include reasoning ("because...")
- [ ] Preferred/avoided patterns include concrete code examples
- [ ] No duplication of rules already enforced by linters/formatters
- [ ] No procedural workflow content (that belongs in skills)
- [ ] No agent personality or behavior definitions (that belongs in .agent.md)
- [ ] No prompt/workflow triggers (that belongs in .prompt.md)
- [ ] Repository-level file covers: architecture, stack with versions, key conventions
- [ ] Granular files have descriptive, non-overlapping `applyTo` patterns
| Type | Location | Purpose | Setting |
|---|---|---|---|
| Repository instructions | .github/copilot-instructions.md | Project constitution | Always on by default |
| Custom instructions | .github/instructions/*.instructions.md | Scoped conventions | chat.includeApplyingInstructions |
| AGENTS.md | Workspace root | Multi-AI-agent instructions | chat.useAgentsMdFile |
| CLAUDE.md | Workspace root / .claude/ | Claude Code compatibility | chat.useClaudeMdFile |
| Organization instructions | GitHub org level | Cross-repo shared rules | github.copilot.chat.organizationInstructions.enabled |
Higher takes precedence on conflict:
.github/copilot-instructions.md or AGENTS.md)tsh-creating-agents - to ensure agent files don't embed coding standards that belong in instructionstsh-creating-skills - to understand the boundary between procedural knowledge (skills) and declarative rules (instructions)tsh-creating-prompts - to ensure prompts reference instructions rather than duplicating conventionstsh-technical-context-discovering - the complementary skill that discovers and reads existing instruction filestsh-codebase-analysing - to analyze existing instruction files and identify patterns to followdevelopment
Custom hook and composable patterns — naming, composition, stable return shapes, lifecycle cleanup, and testing strategies. Use when writing reusable logic units (React hooks, Vue composables), refactoring logic into hooks, debugging hook behavior, or reviewing hook implementations.
testing
UI verification criteria, structure checklists, severity definitions, and tolerance rules for comparing implementations against Figma designs. Use for verifying UI matches design, understanding what to check, and determining acceptable differences.
development
Clean raw workshop or meeting transcripts from small talk, filler words, and off-topic tangents. Extract and structure business-relevant content into a standardized format with discussion topics, key decisions, action items, and open questions.
development
Discover and establish technical context before implementing any feature. Prioritize project instructions, existing codebase patterns, and external documentation in that order. Use for any task requiring understanding of project conventions, coding standards, architecture patterns, and established practices before writing code.