Skip to content

feat: add GitHub Copilot platform support#382

Open
Vignesh-Thangamariappan wants to merge 3 commits intotirth8205:mainfrom
Vignesh-Thangamariappan:main
Open

feat: add GitHub Copilot platform support#382
Vignesh-Thangamariappan wants to merge 3 commits intotirth8205:mainfrom
Vignesh-Thangamariappan:main

Conversation

@Vignesh-Thangamariappan
Copy link
Copy Markdown

@Vignesh-Thangamariappan Vignesh-Thangamariappan commented Apr 23, 2026

Changes

GitHub Copilot (VS Code) platform support

  • Add copilot entry to PLATFORMS dict in skills.py
    • Config: .vscode/mcp.json with servers key (VS Code MCP format)
    • Detection: checks ~/.vscode exists
    • needs_type: True (VS Code requires type: stdio)

GitHub Copilot CLI platform support

  • Add copilot-cli entry to PLATFORMS dict in skills.py
    • Config: ~/.copilot/mcp-config.json with servers key (user-level)
    • Detection: checks ~/.copilot exists
    • needs_type: True

Copilot instruction file

  • Add .github/code-review-graph.instruction.md to _PLATFORM_INSTRUCTION_FILES
    • Named code-review-graph.instruction.md (not copilot-instructions.md) to avoid conflicts with users' existing files
    • Includes YAML front matter (applyTo: '**', description) so Copilot Chat applies it workspace-wide as a skill
    • References Copilot-specific tool names (#tool:read/readFile, #tool:search/fileSearch, #tool:search/textSearch) for explicit tool matching

skills.py internals

  • Add _COPILOT_SECTION constant with Copilot-tailored instruction content
  • Add _PLATFORM_INSTRUCTION_CUSTOM_SECTIONS dict to route per-file content in inject_platform_instructions

CLI & tests

  • Add copilot and copilot-cli to _PLATFORM_CHOICES in cli.py
  • Add TestCopilotPlatform and TestCopilotCLIPlatform test classes (16 tests) covering platform entry, config install, idempotency, dry-run, instruction file injection, and detection
  • Update inject_platform_instructions tests to include the new instruction file

README

  • Add --platform copilot and --platform copilot-cli examples
  • Update platform lists in alt text and footer

Usage

code-review-graph install --platform copilot      # configure only GitHub Copilot (VS Code)
code-review-graph install --platform copilot-cli  # configure only GitHub Copilot CLI

Vignesh-Thangamariappan and others added 2 commits April 23, 2026 22:04
- Add 'copilot' entry to PLATFORMS dict in skills.py
  - Config: .vscode/mcp.json with 'servers' key (VS Code MCP format)
  - Detection: checks ~/.vscode exists
  - needs_type: True (VS Code requires type: stdio)
- Add .github/copilot-instructions.md to _PLATFORM_INSTRUCTION_FILES
- Add 'copilot' to _PLATFORM_CHOICES in cli.py
- Add TestCopilotPlatform test class with 8 tests covering
  platform entry, config install, idempotency, dry-run, and
  instruction file injection
- Update inject_platform_instructions tests to include new file
- Update README.md platform lists and install example

Usage:
  code-review-graph install --platform copilot

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add 'copilot-cli' entry to PLATFORMS dict in skills.py
  - Config: ~/.copilot/mcp-config.json (user-level, global)
  - Key: 'servers' (VS Code MCP format, same as copilot platform)
  - Detection: checks ~/.copilot exists
  - needs_type: True (type: stdio required)
- Add 'copilot-cli' as co-owner of .github/copilot-instructions.md
  in _PLATFORM_INSTRUCTION_FILES so install --platform copilot-cli
  also injects graph-aware instructions into the project
- Add 'copilot-cli' to _PLATFORM_CHOICES in cli.py
- Add TestCopilotCLIPlatform test class (8 tests) covering:
  platform entry metadata, config install, idempotency, existing
  server preservation, instruction injection, dry-run, all-detection,
  and user-level config path assertion
- Update README platform lists and install examples

Unlike the 'copilot' platform (.vscode/mcp.json, project-level),
copilot-cli writes to ~/.copilot/mcp-config.json making the MCP
server available globally across all projects in the terminal.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread .github/code-review-graph.instruction.md
Comment thread .github/copilot-instructions.md Outdated
## MCP Tools: code-review-graph

**IMPORTANT: This project has a knowledge graph. ALWAYS use the
code-review-graph MCP tools BEFORE using Grep/Glob/Read to explore
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If we are truly targeting copilot instructions then we might as well reference the adequate tools in addition to terminal commands in the case the model does not text match on the explicitness of the tools when invoking runInTerminal

Suggested change
code-review-graph MCP tools BEFORE using Grep/Glob/Read to explore
code-review-graph MCP tools BEFORE using #tool:read/readFile #tool:search/fileSearch #tool:search/textSearch to explore

…ool refs

Per PR tirth8205#382 review feedback:
- Rename .github/copilot-instructions.md → .github/code-review-graph.instruction.md
  to avoid conflicts with users' existing copilot-instructions.md files
- Add YAML front matter (applyTo, description) so Copilot Chat applies the
  instructions workspace-wide as a skill
- Replace generic 'Grep/Glob/Read' with Copilot-specific tool references
  (#tool:read/readFile, #tool:search/fileSearch, #tool:search/textSearch)
  so the model text-matches on explicit tool names
- Add _COPILOT_SECTION constant and _PLATFORM_INSTRUCTION_CUSTOM_SECTIONS
  dict in skills.py to use the Copilot-tailored section for the instruction file
- Update all test references to the new filename

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Vignesh-Thangamariappan
Copy link
Copy Markdown
Author

Resolved both comments. Kindly re-review @wax911

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.

2 participants