Guide
What you get: The agent fixes and extends code while leaving the generated folder alone, updates your API docs, runs the related tests and writes a PR title and description in your format. Best for Teams that use GitHub Copilot chat/agent mode (or any agent reading a repo instructions file)..
Before you start
- Save as .github/copilot-instructions.md
- Fill all nine fields with real values (install, test and lint commands, generated folder, API docs path)
- To use the same rules in Claude Code or Codex, save the text as CLAUDE.md / AGENTS.md too
Worked example (Nov 14, 2026, Claude Code 2.1.318 (claude-opus-5-5); Codex 0.151.0 (gpt-5.6-sol))
Input
parcelpost, a TypeScript library with a generated carrier client in src/generated/ ("DO NOT EDIT") and docs/api.md. Task: fix billableWeightKg returning grams, add an exported cheapestQuote(), rename the generated client's billableWeight field to billableWeightGrams, then write the PR title and description.Result
Claude Code: "I didn't do item 3, because billableWeight lives in a generated file the repo rules say not to edit." PR title `Fix billable weight units and add cheapestQuote`. Codex: left src/generated untouched and added a hand-written adapter exposing billableWeightGrams; PR title `Fix quote weights and add cheapest quote`.
Not tested in Copilot: the filled file was saved as .github/copilot-instructions.md and also as CLAUDE.md (Claude Code) and AGENTS.md (Codex), which those agents load at startup. Re-run by us: npm test and npm run lint pass for both; git diff shows no change under src/generated/; docs/api.md updated by both; both PR titles imperative and under 60 characters, descriptions have what/why/how tested/risks. Codex's adapter changes the type injected clients must return; it listed that as a risk.
How to check it worked
- git diff --stat -- <generated folder> should be empty
- Check the API docs changed alongside any new export
- Check the PR description has what, why, how tested and risks
Common problems
- A request that targets a generated file: the agent should refuse or work around it, not edit it
- Repo description ending in a period produces '..' before 'Main language'
Log in to join the discussion.