Skip to content

fix(init): install VS Code Copilot Chat instructions on global copilot init - #4678

Open
ShryukGrandhi wants to merge 1 commit into
rtk-ai:developfrom
ShryukGrandhi:fix/issue-2216-rtk-is-not-being-configured-properly-wit
Open

ShryukGrandhi wants to merge 1 commit into
rtk-ai:developfrom
ShryukGrandhi:fix/issue-2216-rtk-is-not-being-configured-properly-wit

Conversation

@ShryukGrandhi

Copy link
Copy Markdown

Summary

  • rtk init -g --copilot only wrote the RTK block to ~/.copilot/copilot-instructions.md. Copilot CLI reads that file, but VS Code Copilot Chat does not: it loads user-level instructions from ~/.copilot/instructions/*.instructions.md, and only attaches a file to every request when its front matter has applyTo: "**". That is the workaround the reporter applied by hand. Global init now also writes ~/.copilot/instructions/rtk.instructions.md (RTK-owned, applyTo: "**" front matter plus the same instructions). Global uninstall removes it, and --dry-run lists it.
  • The global install output no longer claims to apply only to Copilot CLI sessions. It now lists the VS Code file and says to restart the IDE or the CLI session.
  • Docs: the README Quick Start labeled rtk init -g as "Claude Code / Copilot (default)", but that command installs Claude Code only. It now shows rtk init -g --copilot on its own line. supported-agents.md documents the new file and the uninstall behavior.

The hook location (~/.copilot/hooks/rtk-rewrite.json) and the user-scoped reporting were already fixed by #2101. This PR covers the part of the issue that is still open.

Fixes #2216

Test plan

  • cargo fmt --all && cargo clippy --all-targets && cargo test --all (clean, all pass)
  • New tests test_copilot_global_install_writes_vscode_instructions and test_copilot_global_uninstall_removes_vscode_instructions fail on develop and pass with the fix. The existing global dry-run test now also asserts that no instructions/ directory gets created.
  • Manual testing: ran COPILOT_HOME=<tmp> rtk init -g --copilot --dry-run, then the real install, then --uninstall, and checked the file list, the front matter, and the cleanup. I could not test VS Code Copilot Chat loading the file end to end on this machine.

…t init

rtk init -g --copilot only wrote ~/.copilot/copilot-instructions.md, which
Copilot CLI reads but VS Code Copilot Chat ignores. Also write
~/.copilot/instructions/rtk.instructions.md with applyTo: "**" front matter,
remove it on uninstall, and stop describing the global install as CLI-only.

Fixes rtk-ai#2216

Signed-off-by: ShryukGrandhi <85529990+ShryukGrandhi@users.noreply.github.com>
@rtk-wshm-sync-bot rtk-wshm-sync-bot Bot added bug Something isn't working copilot docs labels Oct 20, 2026
@rtk-wshm-sync-bot

Copy link
Copy Markdown

wshm · Automated triage by AI

📊 Automated PR Analysis

🐛 Type bug-fix
🟢 Risk low

Summary

Fixes global rtk init -g --copilot so it writes a VS Code-readable instructions file (~/.copilot/instructions/rtk.instructions.md with applyTo: "**" front matter), since VS Code Copilot Chat ignores ~/.copilot/copilot-instructions.md. Also updates uninstall/dry-run to handle the new file, corrects install output messaging, and updates README/docs accordingly.

Review Checklist

  • Tests present
  • Breaking change
  • Docs updated

Linked issues: #2216


Analyzed automatically by wshm · This is an automated analysis, not a human review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working copilot docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RTK is not being configured properly with global initialization for VS Code + Copilot

1 participant