Urgent.News

What's breaking now, across thousands of outlets.

Editions

AI

Pet peeves with GitHub Copilot Instructions and my solution

This blog post was originally published on my own web site . Photo by Łukasz Łada on Unsplash One of my favorite features of Claude Code is .claude/rules/ , docs here: https://code.claude.com/docs/en/memory#organize-rules-with-claude/rules/ . If you're not yet aware, it allows you to create arbitrary markdown files with instructions or guidance for the model that will be loaded only when the…

Pet peeves with GitHub Copilot Instructions and my solution

Claude Code's .claude/rules/ feature allows creating custom markdown files with instructions for the model. This feature is advantageous as it lets developers include specific rules for certain codebases while omitting irrelevant guidance. This saves input tokens and improves agent performance.

However, GitHub Copilot has its own format for custom instructions, located in .github/instructions/*.instructions.md. The format requires a single string property called applyTo instead of the paths property used in Claude Code. If a Copilot instructions file needs to reference multiple patterns, this becomes cluttered and unreadable.

To add to the frustration, Claude Code supports a @path/to/file syntax that allows referencing other files in the project's context at launch. This can be useful when there are pre-existing project documentation files that are not directly related to the AI-assisted development rules. This feature is missing from GitHub Copilot's instructions format.

One client I work with operates in a restricted security environment, only allowing GitHub Copilot access through the CLI, VSCode, or IntelliJ plugins. While they appreciate the cross-compatibility of Copilot with Claude rules, they encountered a limitation - the missing @import syntax in Copilot instructions. This feature would have been helpful for loading referenced files and integrating with Backstage for generating online wikis.

The workaround I implemented was to create a Node.js script that parses through instruction files, searching for patterns like !-- @import path/to/file -- and replacing them with the referenced contents. By using HTML comments, the script avoids interfering with the LLM's processing. This solution lets me author my instruction files with the desired @import syntax while avoiding redundancy in the documentation.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in AI

Your AI Coding Agent Just Finished. Now Ask It to Attack Its Own Work.

AI coding agents are remarkably good at getting from “here’s what I want” to “here’s a working implementation.” They are also remarkably good at being satisfied with what they just built.

  • AI coding agents excel at transforming vague requests into functional implementations.
  • Agents often fail to critically evaluate their own code.
  • Prompting agents to conduct adversarial reviews improves code robustness.

More from Friday 21 August →