Short session

Create and Verify Your First Copilot Instruction File

A small repository instruction file, a documented check that your Copilot environment discovered it, and one project-specific rule tested against generated output.

Welcome back. — carry on from where you stopped.

This browser is not keeping storage, so ticks will last for this page only.

Hands-on time
About 25 minutes — provisional, from reading the steps, not from timing anyone.
You will need
  • A repository you can commit to, with Copilot working in your editor or the CLI
  • One convention in that project that a generic model would not know — a rounding rule, a naming rule, a forbidden dependency

of 5 steps ticked

  1. Pick one rule a model would get wrong

    Choose a single project-specific requirement that is verifiable in a generated example — not a style preference, a rule with a right and a wrong answer.

    Before you tick it: The rule written down in one sentence, with what a wrong answer would look like.

  2. Write .github/copilot-instructions.md

    Create the file at the documented location with a short project summary and the rule stated as something a model can act on. Keep it well under two pages.

    Before you tick it: The file exists at .github/copilot-instructions.md and contains the rule.

  3. Confirm your environment discovered it

    In Copilot Chat on GitHub.com or VS Code, ask something in the project and expand the response's references list; in Copilot CLI, run /instructions in a session started after the file was saved.

    Before you tick it: The file's name visible in the references list, or listed by /instructions. A model repeating the rule is not this evidence.

  4. Test the rule against generated output

    Ask for a small piece of code the rule governs. Read the result for the rule specifically — not for whether the code looks reasonable.

    Before you tick it: A generated example that follows the rule, or one that does not and a note of which.

  5. Record what you found

    Note the environment, whether discovery was confirmed, and whether the rule held. A rule that was discovered and not followed is a different problem from one that was not discovered.

    Before you tick it: Three lines: environment, discovered yes/no, rule followed yes/no.

The finish lineFinished

You can point at the file, at the evidence it was discovered, and at one generated example judged against your rule.

Ticks are your own record that you did each step. They are kept in this browser under one key and do not mark the source lessons complete — a step is one section of a lesson, not the lesson.

One next step

Scope a rule to part of the repository

You have one rule that applies everywhere. The next file applies a rule only where it should, with an applyTo glob.

Only this session. Lessons, labs and other sessions are untouched.

All short sessions · My Academy