thesoftwarehouse/copilot-collections/tsh-creating-instructions
Claude Code and agent skill by thesoftwarehouse/copilot-collections
- community
Checking that the SKILL.md file is still in the repository.
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.
Install
npx vskill@latest install thesoftwarehouse/copilot-collections/tsh-creating-instructionsSKILL.md
Creating Instructions
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.
Core Design Principles
<principles>
<instruction-types> Two types of instruction files exist:
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>
<instructions-vs-skills> Instructions define RULES — declarative constraints that Copilot must follow whenever they apply. They are project-specific, loaded automatically, and encode decisions for THIS repository.
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.
- Keep instructions short and self-contained — each instruction should be a single, simple statement.
- Include the reasoning behind rules (e.g., "Use
date-fnsinstead ofmoment.js— moment.js is deprecated and increases bundle size"). - Show preferred and avoided patterns with concrete code examples — AI responds more effectively to examples than abstract rules.
- Focus on non-obvious rules — skip conventions that standard linters/formatters already enforce.
- Whitespace between instructions is ignored — format for legibility.
</conciseness>
</principles>
Creation Process
Use the checklist below and track progress:
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:
- Is this a NEW project needing its first
copilot-instructions.md? → Create repository-level instructions. - Are there existing
copilot-instructions.mdand file-specific rules are needed? → Create granular instructions. - Unsure? → Check if
.github/copilot-instructions.mdexists. 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:
- Reading
package.json,pyproject.toml,Cargo.toml,go.mod, or equivalent to identify languages, frameworks, and versions. - Analyzing the directory structure to understand architecture (monorepo, feature-based, layered, etc.).
- Reading existing config files (
.eslintrc,tsconfig.json,.prettierrc, etc.) to understand tooling. - Checking for existing README or architectural documentation.
For granular instructions, determine:
- Which files they apply to (the
applyToglob pattern). - What specific conventions exist for that file scope.
- Whether an existing instruction file already covers this scope (avoid overlapping
applyTopatterns).
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:
- Architecture — Overall architecture pattern (monorepo, microservices, modular monolith, etc.), directory structure, and responsibility of each top-level directory.
- Technology Stack — ALL languages, frameworks, and key libraries with specific versions. Critical — Copilot needs exact versions to generate compatible code.
- Coding Conventions — Conventions NOT enforced by linters/formatters. Architectural rules (e.g., "business logic must not import from UI layer"), project-specific naming conventions, and agreed-upon patterns.
- Error Handling — The project's error handling strategy.
- Testing Strategy — Testing approach (unit, integration, E2E), frameworks, and key patterns.
- Development Workflow — How developers interact with the project. Document task runners (Make, Taskfile, npm scripts, Turbo), containerization (Docker Compose commands), and common developer commands (build, test, lint, migrate, seed). Copilot should use the same scripts and tools a regular developer would — never raw commands when a script exists.
For granular instructions, research and document:
- Specific conventions for the target file scope.
- Preferred patterns with code examples.
- Anti-patterns to avoid with code examples.
- Reasoning behind non-obvious rules.
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:
- Create the file at
.github/copilot-instructions.md. - No frontmatter required.
- Use clear Markdown headers to organize sections.
- Use the
./assets/copilot-instructions.template.mdtemplate.
For granular instructions:
- Create the file in
.github/instructions/directory. - Name the file descriptively:
{scope}.instructions.md(e.g.,python.instructions.md,react-components.instructions.md,api-endpoints.instructions.md). - Include YAML frontmatter with
name,description, andapplyTo. - Use the
./assets/custom-instructions.template.mdtemplate.
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
Quick Reference
Instruction File Types
| 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 |
Priority Order
Higher takes precedence on conflict:
- Personal instructions (user-level) — highest
- Repository instructions (
.github/copilot-instructions.mdorAGENTS.md) - Organization instructions — lowest
Connected Skills
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 follow
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/tsh-creating-instructions/SKILL.md
Popularity
- Repository stars
- 266
- Repository forks
- 18
- 7-day trend score
- 28
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/thesoftwarehouse/copilot-collections/tsh-creating-instructions)