Stop Prompt-Engineering Copilot. Write Three Rules in a File Instead.
Most advice about getting better output from Copilot is advice about phrasing. Be specific. Give it context. Ask it to think step by step. That plateaus quickly, and it plateaus for a structural reason: better phrasing asks the model to try harder. It does not tell the model anything it did not already know. The thing that actually moves output is a file. .github/copilot-instructions.md , committed to the repository, read on every request. The location, precisely .github/copilot-instructions.md Inside the .github directory, not the repository root. Plain Markdown, no frontmatter required. That is the whole setup. What makes a rule work Compare these two: - Write clean, maintainable code. - Use proper error handling. - Money is `Decimal` , never `float` . Round half-up to two places at the response boundary only, never mid-calculation. - All datetimes are timezone-aware UTC. `datetime.utcnow()` returns a naive datetime and will compare incorrectly against everything else here. The first pair costs context on every request and changes nothing — the model already agrees with both, and agreeing is not the same as knowing what you meant. The second pair changes the output, because it contains information the model did not have : a fact about your codebase that is not inferable from the code it can see. Three properties, and a rule wants all three: Durable. True next month. Anything task-shaped belongs in a prompt, not here. Specific. datetime.utcnow() returns a naive datetime — not "handle timezones correctly". Checkable. Somebody can look at a diff and say whether the rule was followed. Prohibitions beat aspirations "Do not use datetime.utcnow() ; it returns a naive datetime and this codebase compares against aware ones." gets followed. "Use timezone-aware datetimes." gets agreed with, and then not done. The difference is that the first one names the specific thing to avoid and says why. Give a reason and the rule survives contact with a situation you did not anticipate