Copilot Gets Smarter: Microsoft Lays Out How to Use Prompt & Instruction Files

Microsoft has published guidelines for two new file-types — Instruction Files and Prompt Files — designed to help developers give Copilot clear rules and context when generating code. Learn what are they, when to use them, and how to use them.

Instruction Files

  • What are they?

    Instruction files often named copilot-instructions.md defines the rules, coding standards, or guidelines Copilot should follow when generating code in your repo or workspace.

  • When to use?

    Perfect for team projects or open-source repos to keep Copilot’s suggestions aligned with org standards and naming conventions.

  • How to use?

    Create your file from a sample or scratch. Save it in .github/ or add file-type-specific instructions in .github/instructions/. Copilot automatically applies them to every request.

Prompt Files

  • What are they?

    Prompt files provide context for a specific coding session or file, steering Copilot’s output for a targeted task.

  • When to use?

    Great for prototyping, custom algorithms, integrations, compliance requirements, or onboarding new team members needing explicit guidance.

  • How to use?

    Draft your prompt and place it in .github/prompts/ as [promptname].prompt.md. In VS Code type /[promptName] in chat, or in Visual Studio type #[promptName] to activate.

Next
Next

Microsoft Unveils Private Preview: Azure Boards Now Integrated with GitHub Copilot