{"kind":"AgentDefinition","metadata":{"namespace":"community","name":"no-heredoc","version":"0.1.0"},"spec":{"agents_md":"---\nname: 'No Heredoc File Operations'\ndescription: 'Prevents terminal heredoc file corruption in VS Code Copilot by enforcing use of file editing tools instead of shell redirections'\napplyTo: '**'\n---\n\n# MANDATORY: File Operation Override\n\nThis instruction applies to ALL agents and ALL file operations. It takes precedence over any other learned behavior.\n\n## The Problem\n\nTerminal heredoc operations are BROKEN in VS Code's Copilot integration. They cause:\n\n- File corruption from tab characters triggering shell completion\n- Mangled content from quote/backtick escaping failures\n- Truncated files from exit code 130 interruptions\n- Garbage output from special character interpretation\n\n## The Rule\n\n**BEFORE writing ANY terminal command that creates or modifies a file, STOP.**\n\nAsk yourself: \"Am I about to use `cat`, `echo`, `printf`, `tee`, or `\u003e\u003e`/`\u003e` to write content to a file?\"\n\nIf YES → **DO NOT EXECUTE.** Use file editing tools instead.\n\n## Forbidden Patterns\n\n```bash\n# ALL OF THESE CORRUPT FILES - NEVER USE THEM\ncat \u003e file \u003c\u003c EOF\ncat \u003e file \u003c\u003c 'EOF'\ncat \u003e file \u003c\u003cEOF\ncat \u003e file \u003c\u003c'EOF'\ncat \u003e file \u003c\u003c-EOF\ncat \u003e\u003e file \u003c\u003c EOF\necho \"multi\nline\" \u003e file\nprintf '%s\\n' \"line1\" \"line2\" \u003e file\ntee file \u003c\u003c EOF\ntee file \u003c\u003c 'EOF'\n```\n\n## Required Approach\n\nInstead of terminal commands for file content:\n\n- **New files** → Use the file creation/editing tool provided by your environment\n- **Modify files** → Use the file editing tool provided by your environment\n- **Delete files** → Use the file deletion tool or `rm` command\n\n## Terminal IS Allowed For\n\n- `npm install`, `pip install`, `cargo add` (package management)\n- `npm run build`, `make`, `cargo build` (builds)\n- `npm test`, `pytest`, `go test` (testing)\n- `git add`, `git commit`, `git push` (version control)\n- `node script.js`, `python app.py` (running existing code)\n- `ls`, `cd`, `mkdir`, `pwd`, `rm` (filesystem navigation)\n- `curl`, `wget` (downloading, but not piping to files with content manipulation)\n\n## Terminal is FORBIDDEN For\n\n- ANY file creation with content\n- ANY file modification with content\n- ANY heredoc syntax (`\u003c\u003c`)\n- ANY multi-line string redirection\n\n## Enforcement\n\nThis is not a suggestion. This is a hard technical requirement due to VS Code terminal integration bugs. Ignoring this instruction will result in corrupted files that the user must manually fix.\n\nWhen you need to create or edit a file:\n\n1. Stop before typing any terminal command\n2. Use the appropriate file editing tool\n3. The tool will handle the content correctly without corruption\n","description":"Prevents terminal heredoc file corruption in VS Code Copilot by enforcing use of file editing tools instead of shell redirections","import":{"commit_sha":"541b7819d8c3545c6df122491af4fa1eae415779","imported_at":"2026-05-18T20:05:35Z","license_text":"MIT License\n\nCopyright GitHub, Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","owner":"github","repo":"github/awesome-copilot","source_url":"https://github.com/github/awesome-copilot/blob/541b7819d8c3545c6df122491af4fa1eae415779/instructions/no-heredoc.instructions.md"},"manifest":{}},"content_hash":[251,243,13,14,139,133,9,54,161,33,129,219,240,117,11,77,3,103,133,114,149,7,126,178,100,87,166,9,176,75,177,69],"trust_level":"unsigned","yanked":false}
