Skip to content

Optimize Copilot instructions for clarity and maintainability#1578

Merged
waldekmastykarz merged 6 commits intodotnet:mainfrom
waldekmastykarz:optimize-copilot-instructions
Mar 2, 2026
Merged

Optimize Copilot instructions for clarity and maintainability#1578
waldekmastykarz merged 6 commits intodotnet:mainfrom
waldekmastykarz:optimize-copilot-instructions

Conversation

@waldekmastykarz
Copy link
Collaborator

Summary

Reorganizes and improves the Copilot instructions file to better serve AI assistants working on this codebase.

Changes

Structure

  • Critical (Non-Obvious): Information Copilot cannot discover through code exploration (proxy engine fork, ~appFolder token, MCP server)
  • Reference (Architecture): Discoverable info kept for cache with prompt caching, this is essentially free after the first turn while saving exploration timeefficiency

New Content

  • Best Practices: Link to comprehensive guide + key points from MCP server docs
  • Testing Guidelines: Always use --as-system-proxy false --port 0 --api-port 0 to avoid conflicts (port 0 lets OS assign random available ports)
  • Plugin Development: Interface selection guidance (IProxyPlugin vs IStdioPlugin)
  • Commits & Releases: Commit message style, semver, homebrew/winget manual updates
  • Auth Workarounds: M365/Azure CLI commands for token acquisition
  • Cleanup: Log file cleanup reminder

Rationale

34 lines) removing "obvious" architecture info. However, with prompt caching, verbose instructions are essentially free after the first while code exploration has real cost every session. Added architecture back as "Reference" section, clearly separated from critical non-discoverable info.request

Testing

Verified --port 0 --api-port 0 behavior: OS correctly assigns random available ports (tested locally, proxy bound to ports 49977/49978).

@waldekmastykarz waldekmastykarz requested a review from a team as a code owner March 1, 2026 09:32
Copilot AI review requested due to automatic review settings March 1, 2026 09:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Reorganizes .github/copilot-instructions.md to separate non-obvious repo knowledge from general reference material, aiming to make Copilot guidance clearer and easier to maintain.

Changes:

  • Restructures the instructions into “Critical (Non-Obvious)”, “Best Practices”, “Plugin Development”, “Commits & Releases”, “Testing Code Changes”, and “Reference (Architecture)”.
  • Adds specific operational/testing guidance (ports set to 0, avoiding system proxy changes) and links to MCP best practices.
  • Reintroduces architecture/reference pointers (entry point, proxy engine, commands, config locations).

Copy link
Contributor

@garrytrinder garrytrinder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs-only change. Reviewed content for accuracy — IStdioPlugin reference confirmed, external best-practices link verified. Better structure, more practical. LGTM.

@garrytrinder garrytrinder enabled auto-merge (squash) March 2, 2026 10:20
waldekmastykarz and others added 5 commits March 2, 2026 11:11
- Reorganize sections: Critical (non-obvious) vs Reference (architecture)
- Add best practices link and key points from MCP server docs
- Add testing guidelines: use --as-system-proxy false --port 0 --api-port 0
- Add plugin development guidance (interface selection)
- Add commit message and release conventions
- Add M365/Azure auth workaround notes
- Add cleanup instructions for log files

Architecture sections kept for cache efficiency (free after first turn)
while clearly separating non-discoverable critical info.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@garrytrinder garrytrinder force-pushed the optimize-copilot-instructions branch from b5e8c27 to cc184a0 Compare March 2, 2026 11:11
@waldekmastykarz waldekmastykarz disabled auto-merge March 2, 2026 12:20
@waldekmastykarz waldekmastykarz merged commit 87050e5 into dotnet:main Mar 2, 2026
3 checks passed
@waldekmastykarz waldekmastykarz deleted the optimize-copilot-instructions branch March 2, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants