Skip to content
CoursesWeb Forum

How do I give Copilot project instructions so it stops guessing my stack

Asked by Ewa P. · AI Coding Assistants and MCP1 replyupdated

Short answer

I maintain a handful of client sites. Plain PHP 8.3 with PDO, no framework, MariaDB, and vanilla JavaScript on the front end. Copilot Chat in VS Code keeps answering as if every project were Laravel or React. Today it gave me an Eloquent model when I asked for a query, and yesterday a JSX component for a simple form.

Written by Ewa P. ·
CiteCoursesWeb Forum, "How do I give Copilot project instructions so it stops guessing my stack", https://coursesweb.net/forum/t/how-do-i-give-copilot-project-instructions-so-it-stops-guessing/, accessed 2026-11-27.
  1. Member ·

    I end up typing the same paragraph into every chat: "No framework, use PDO with prepared statements, escape output with htmlspecialchars, no jQuery". That is tiring and I forget half of it.

    Is there a file I can put in the repository so Copilot reads the rules every time? I saw people mention a markdown file in a .github folder, but I am not sure of the name, whether it works in VS Code or only on github.com, and whether the client can see it if I share the repo with them.

    0
    ReplyLink

Plain text or simple Markdown. Links are nofollow. Your email is never shown.

  1. Jun P.Member ·

    Yes, it is .github/copilot-instructions.md at the root of the repo. I use one in my Node projects. Mine is about ten lines: Node version, ESM only, test runner, and "do not add new dependencies without asking". The answers got noticeably more on target the same day.

CoursesWeb Forum. Questions and answers on learning web development: HTML, CSS, JavaScript, PHP, MySQL, Node.js and AI coding help.