[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KKC4JXBYCG6TFYEX0VAXM5":3,"skill-same:01M6KKC4JXBYCG6TFYEX0VAXM5":66},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":34,"linkOnly":35,"markdownContent":36,"markdownBody":37,"frontMatter":38,"refName":39,"commitSha":40,"skillDirectory":41,"forksCount":13,"repositoryHtmlUrl":42,"repositoryHomepageUrl":6,"ownerHtmlUrl":43,"ownerBlogUrl":6,"ownerDescription":44,"updatedAt":45,"install":46,"resources":59},"01M6KKC4JXBYCG6TFYEX0VAXM5","large-file-write-heredoc",null,"Reliable fallback technique for writing large file contents when write_file and shell_agent both fail with 'unknown error' due to payload size limits — uses run_shell with a Python heredoc to bypass tool constraints.","AG064\u002FOpenSpace","AG064","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184930299?v=4","01M6KHVFG7TB73NHX3RDYSTMH2","01M6KHVFMM7XA2PZA9Z83PHS3V",0,"MIT","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Flarge-file-write-heredoc\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33],"file","write","large file write heredoc","writing","python","run","constraints","shell","tool","payload","fallback","error","with","size","for","unknown","2026-11-10 10:12:30",false,"---\nname: large-file-write-heredoc\ndescription: Reliable fallback technique for writing large file contents when write_file and shell_agent both fail with 'unknown error' due to payload size limits — uses run_shell with a Python heredoc to bypass tool constraints.\n---\n\n# Large File Write Fallback\n\n## Problem\n\nWhen writing large files (typically several KB or more), two common tools may\nfail with `unknown error` due to internal payload size limits:\n\n- `write_file` — has a maximum content size it can handle in a single call.\n- `shell_agent` — may also hit payload limits when the task description\n  includes large inline content.\n\n## Solution\n\nUse `run_shell` with a **Python heredoc** pattern. This streams the file\ncontent through stdin directly into Python's `open()`, bypassing the payload\nconstraints of the other tools.\n\n## Template\n\n```\npython3 - \u003C\u003C 'EOF'\ncontent = \"\"\"\u003CFILE CONTENTS HERE>\"\"\"\nwith open(\"\u003CTARGET PATH>\", \"w\") as f:\n    f.write(content)\nEOF\n```\n\nPass this as the `command` parameter to `run_shell`.\n\n## Step-by-Step Instructions\n\n1. **Attempt the normal write** using `write_file` first. If it succeeds, you\n   are done.\n\n2. **If `write_file` fails** (especially with `unknown error` or a timeout on\n   large content), do NOT retry with `shell_agent` using inline content —\n   it will likely fail for the same reason.\n\n3. **Use the `run_shell` heredoc fallback:**\n\n   - Embed the full file content inside a Python triple-quoted string.\n   - Specify the target path inside the `open()` call.\n   - Pass the entire block as the `command` to `run_shell`.\n\n4. **Escape carefully** inside the heredoc:\n   - Backslashes that should be literal in the file must be doubled (`\\\\`).\n   - Triple-quotes inside the content must be escaped (`\\\"\\\"\\\"`).\n   - The heredoc delimiter `EOF` must not appear on a line by itself inside\n     the content (rename it to `PYEOF` or `FILEEOF` if needed).\n\n5. **Verify the write** by following up with a `run_shell` call such as:\n   ```bash\n   wc -l \u003CTARGET PATH> && head -5 \u003CTARGET PATH>\n   ```\n\n## Full Example\n\nSuppose you need to write a large TypeScript file to\n`src\u002Fcomponents\u002FDashboard.ts`:\n\n```\npython3 - \u003C\u003C 'PYEOF'\ncontent = \"\"\"import { foo } from '.\u002Ffoo';\n\nexport interface DashboardData {\n  title: string;\n  items: string[];\n}\n\nexport function createDashboard(data: DashboardData): string {\n  return `\u003Cdiv>${data.title}\u003C\u002Fdiv>`;\n}\n\"\"\"\nwith open(\"src\u002Fcomponents\u002FDashboard.ts\", \"w\") as f:\n    f.write(content)\nPYEOF\n```\n\nPass the above (without the surrounding code fence) as the `command`\nargument to `run_shell`.\n\n## When to Use This Pattern\n\n| Situation | Recommended tool |\n|---|---|\n| Small file (\u003C ~2 KB) | `write_file` |\n| Medium file, no errors yet | `write_file` (try first) |\n| Large file or `write_file` failed | `run_shell` + Python heredoc |\n| `shell_agent` also fails on large inline content | `run_shell` + Python heredoc |\n\n## Notes\n\n- This pattern works for **any text-based file** (TypeScript, Python, JSON,\n  YAML, Markdown, etc.).\n- For binary files, adapt the approach to use `base64` decoding inside the\n  Python script.\n- The heredoc delimiter (`EOF`, `PYEOF`, `FILEEOF`) can be any string not\n  present as a standalone line in your content — choose accordingly.\n- This technique is also useful when content contains characters that would\n  need heavy shell escaping in a plain `echo` or `printf` approach.","# Large File Write Fallback\n\n## Problem\n\nWhen writing large files (typically several KB or more), two common tools may\nfail with `unknown error` due to internal payload size limits:\n\n- `write_file` — has a maximum content size it can handle in a single call.\n- `shell_agent` — may also hit payload limits when the task description\n  includes large inline content.\n\n## Solution\n\nUse `run_shell` with a **Python heredoc** pattern. This streams the file\ncontent through stdin directly into Python's `open()`, bypassing the payload\nconstraints of the other tools.\n\n## Template\n\n```\npython3 - \u003C\u003C 'EOF'\ncontent = \"\"\"\u003CFILE CONTENTS HERE>\"\"\"\nwith open(\"\u003CTARGET PATH>\", \"w\") as f:\n    f.write(content)\nEOF\n```\n\nPass this as the `command` parameter to `run_shell`.\n\n## Step-by-Step Instructions\n\n1. **Attempt the normal write** using `write_file` first. If it succeeds, you\n   are done.\n\n2. **If `write_file` fails** (especially with `unknown error` or a timeout on\n   large content), do NOT retry with `shell_agent` using inline content —\n   it will likely fail for the same reason.\n\n3. **Use the `run_shell` heredoc fallback:**\n\n   - Embed the full file content inside a Python triple-quoted string.\n   - Specify the target path inside the `open()` call.\n   - Pass the entire block as the `command` to `run_shell`.\n\n4. **Escape carefully** inside the heredoc:\n   - Backslashes that should be literal in the file must be doubled (`\\\\`).\n   - Triple-quotes inside the content must be escaped (`\\\"\\\"\\\"`).\n   - The heredoc delimiter `EOF` must not appear on a line by itself inside\n     the content (rename it to `PYEOF` or `FILEEOF` if needed).\n\n5. **Verify the write** by following up with a `run_shell` call such as:\n   ```bash\n   wc -l \u003CTARGET PATH> && head -5 \u003CTARGET PATH>\n   ```\n\n## Full Example\n\nSuppose you need to write a large TypeScript file to\n`src\u002Fcomponents\u002FDashboard.ts`:\n\n```\npython3 - \u003C\u003C 'PYEOF'\ncontent = \"\"\"import { foo } from '.\u002Ffoo';\n\nexport interface DashboardData {\n  title: string;\n  items: string[];\n}\n\nexport function createDashboard(data: DashboardData): string {\n  return `\u003Cdiv>${data.title}\u003C\u002Fdiv>`;\n}\n\"\"\"\nwith open(\"src\u002Fcomponents\u002FDashboard.ts\", \"w\") as f:\n    f.write(content)\nPYEOF\n```\n\nPass the above (without the surrounding code fence) as the `command`\nargument to `run_shell`.\n\n## When to Use This Pattern\n\n| Situation | Recommended tool |\n|---|---|\n| Small file (\u003C ~2 KB) | `write_file` |\n| Medium file, no errors yet | `write_file` (try first) |\n| Large file or `write_file` failed | `run_shell` + Python heredoc |\n| `shell_agent` also fails on large inline content | `run_shell` + Python heredoc |\n\n## Notes\n\n- This pattern works for **any text-based file** (TypeScript, Python, JSON,\n  YAML, Markdown, etc.).\n- For binary files, adapt the approach to use `base64` decoding inside the\n  Python script.\n- The heredoc delimiter (`EOF`, `PYEOF`, `FILEEOF`) can be any string not\n  present as a standalone line in your content — choose accordingly.\n- This technique is also useful when content contains characters that would\n  need heavy shell escaping in a plain `echo` or `printf` approach.",{"name":5,"description":7},"main","ff671ef61ed6587c49bd54c81cdc751c0b99e363","showcase\u002Fskills\u002Flarge-file-write-heredoc","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace","https:\u002F\u002Fgithub.com\u002FAG064","AG064, E.Mi.\r\n\r\nA person who thinks all the time, yet all they have to think about is nothing. I want to improve the world and work on open source projects","2026-10-08 06:53:48",{"source":8,"skillName":5,"commands":47,"prompt":57,"zipAvailable":58},[48,51,54],{"tool":49,"command":50},"npx","npx skills add AG064\u002FOpenSpace --skill large-file-write-heredoc",{"tool":52,"command":53},"bunx","bunx skills add AG064\u002FOpenSpace --skill large-file-write-heredoc",{"tool":55,"command":56},"pnpm","pnpm dlx skills add AG064\u002FOpenSpace --skill large-file-write-heredoc","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Flarge-file-write-heredoc\u002FSKILL.md",true,[60],{"path":61,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":64,"sourceHtmlUrl":65},".skill_id","OTHER","其他",39,"https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Flarge-file-write-heredoc\u002F.skill_id",[67,87,103,111,141,157],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":34},"01M6KKMPWA0B5SCCH766F8M5EA","write-special-chars-ts-check","Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) using a Python heredoc script, plus a reliable TypeScript type-checking step that filters output to only the newly-written files to avoid being misled by pre-existing errors.","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-ts-check\u002FSKILL.md",[],[74,75,19,76,77,78,32,79,80,81,82,83,84,85,18,22,86],"write special chars ts check","check","filters","Existing","type-checking","errors","script","output","type","files","only","template","typescript",{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":34},"01M6KKMJXVBNVEY3TRK055F4A7","write-special-chars-readback","Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) using a Python heredoc script, with mandatory post-write verification via read_file and cleanup of \u002Ftmp helper scripts.","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-readback\u002FSKILL.md",[],[94,95,19,85,96,97,18,22,98,99,100,101,102,32,80,30],"readback","write special chars readback","cleanup","read","scripts","verification","via","post","helper",{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":34},"01M6KKMEGX9M9NC105J0W3Q5B9","write-special-chars-heredoc","Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) by using a Python heredoc script executed via shell.","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-heredoc\u002FSKILL.md",[],[19,110,22,32,100,85,25,18,80],"write special chars heredoc",{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":122,"publishedAt":34},"01M6KKM8EJ2AATVHZBNB916WT0","worldmonitor-reference","Curated architecture index of the WorldMonitor open-source dashboard. Reference for extracting patterns — vanilla TypeScript, Panel class hierarchy, service layer, CSS grid, API edge functions, refresh scheduler, and 60+ data source integrations.","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fworldmonitor-reference\u002FSKILL.md",[117],{"categoryNo":118,"categoryName":119,"taxonomyType":120,"taxonomyTypeDesc":121},"01JBSEEDCAT000000000000033","数据分析师","PROFESSION","适用职业",[123,124,125,126,86,127,128,129,130,131,32,132,133,134,135,136,137,138,139,140],"reference","worldmonitor","worldmonitor reference","dashboard","css","architecture","extracting","hierarchy","source","layer","panel","patterns","edge functions","integrations","open","api","data","scheduler",{"skillNo":142,"name":143,"nameZh":6,"description":144,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":145,"categories":146,"keywords":147,"publishedAt":34},"01M6KKM39PHYK627F19GE2B9XN","virtual-list","Implement efficient virtual scrolling for rendering large lists with DOM recycling, chunk-based rendering, and performance optimizations","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fvirtual-list\u002FSKILL.md",[],[148,149,150,151,32,152,30,153,154,155,156],"virtual list","list","virtual","chunk","dom","rendering","recycling","implement","performance",{"skillNo":158,"name":159,"nameZh":6,"description":160,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":161,"categories":162,"keywords":163,"publishedAt":34},"01M6KKKY7T2P61Y0JH54CDEJKQ","verify-directory-structure","Diagnose and resolve file access issues by first verifying the directory structure.","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fverify-directory-structure\u002FSKILL.md",[],[164,165,166,167,168,169,18,170,171,172],"directory","verify","structure","verify directory structure","access","first","issues","diagnose","file access"]