Make instructions

From dotnet/dotnet · View interactive version

Make instructions is an AI agent skill from the GitHub repository dotnet/dotnet. Create and evaluate VS Code file-based instructions (.instructions.md files). Use when asked to create, scaffold, or add file-based instructions for Copilot. Generates scoped instructions and a paired Vally harness eval.

How to use this skill

Skill file

Create File-Based Instructions

This skill helps you scaffold VS Code file-based instructions (.instructions.md files) that provide background knowledge to Copilot about specific parts of the codebase. These files are applied automatically based on glob patterns or semantic matching, giving Copilot domain-specific context when working on matching files.

When Not to Use

Workflow

Step 1: Investigate the topic

Build understanding of the area the instructions should cover. Identify:

Read the repository-wide instruction files that apply to the same paths and make an explicit exclusion list. Do not repeat those rules in the new file, even when they are relevant examples for the scoped area; include only guidance that becomes more specific or materially different at the narrower scope.

If the scope is unclear or overlaps with existing instructions, ask the user for clarification.

Step 2: Choose the file location

Instructions files go in .github/instructions/ by default. Pick a descriptive filename:

.github/instructions/<topic>.instructions.md

Examples: csharp-style.instructions.md, query-pipeline.instructions.md, test-conventions.instructions.md

Step 3: Generate the file with YAML frontmatter

Create the file with the required YAML frontmatter header:

---
name: '<Display Name>'              # Optional. Display name in the UI. Defaults to filename.
description: '<Short description>'  # Optional. Shown on hover. Also used for semantic matching.
applyTo: '<glob pattern>'           # Optional. Glob pattern relative to workspace root. Omit to require manual attachment or rely on semantic matching only.
---

Common applyTo patterns:

Step 4: Write the body content

Write concise, actionable Markdown content. Follow these principles:

Recommended sections (adapt as needed):

  1. <Title> — one-line heading describing the domain
  2. Context paragraph — brief explanation of what this area is and why these rules matter
  3. Guidelines / Conventions — bullet list of concrete rules
  4. Examples — short code blocks showing do/don't patterns (optional)
  5. Key Files — table of important files for orientation (optional)
  6. Common Pitfalls — traps to avoid (optional)

Step 5: Author and validate the harness evaluation

Create eng/harness-evaluation/instructions/<id>/eval.yaml, where <id> is the instruction path relative to .github/instructions/ with its suffix removed and nested path separators replaced by --.

Follow the authoring and validation rules in eng/harness-evaluation/README.md. Exercise guidance distinctive to the instruction and ensure the treatment meaningfully outperforms the omitted-instruction control.

For initial authoring, produce and lint the requested instruction and eval before running behavioral comparisons.

After creating the file, verify:

Common Pitfalls

| Pitfall | Solution |

|---------|----------|

| applyTo too broad | Use specific globs; ** applies to every file and wastes context |

| Missing applyTo | Without it, instructions won't auto-apply — they require manual attachment or semantic matching via description |

| Vague guidance | Replace "write good tests" with something like "add both positive and negative test cases using [ConditionalFact] methods" |

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.