Add no-heredoc instructions to prevent terminal file corruption#662
Add no-heredoc instructions to prevent terminal file corruption#662garrettsiegel wants to merge 2 commits intogithub:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new instruction file to prevent file corruption caused by heredoc operations in VS Code's integrated terminal when using Copilot.
Changes:
- Adds
no-heredoc.instructions.mdinstruction file that enforces the use of file editing tools instead of terminal heredoc operations (cat << EOF, etc.)
| --- | ||
| description: 'Prevents terminal heredoc file corruption in VS Code Copilot by enforcing use of file editing tools instead of shell redirections' | ||
| applyTo: '**' | ||
| --- |
There was a problem hiding this comment.
According to the repository's coding guidelines for instruction files, the new file should be added to docs/README.instructions.md. The entry should be added alphabetically between "Next.js Best Practices for LLMs (2026)" and "Object Calisthenics Rules" (approximately line 122-123 in the README). The entry should follow the same format as other entries in the table, including a title, file path, install badges, and the description from the front matter.
| --- | ||
| description: 'Prevents terminal heredoc file corruption in VS Code Copilot by enforcing use of file editing tools instead of shell redirections' | ||
| applyTo: '**' | ||
| --- |
There was a problem hiding this comment.
Can you add a name field here so the instructions are more discoverable rather than relying on the first H1 of the markdown.
Adds instructions to prevent file corruption caused by terminal heredoc operations in VS Code Copilot.
Problem
Heredoc syntax (
cat << EOF) in VS Code's integrated terminal causes file corruption due to:Solution
This instruction file tells Copilot to always use file editing tools instead of terminal redirections for any file creation or modification.
Applies to all files (
**) since the issue affects any agent writing files via terminal.