[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6XC84H6ANFR4V7FH9H0DKER":3,"skill-same:01M6XC84H6ANFR4V7FH9H0DKER":69},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":13,"repositoryHtmlUrl":46,"repositoryHomepageUrl":6,"ownerHtmlUrl":47,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":48,"install":49,"resources":62},"01M6XC84H6ANFR4V7FH9H0DKER","large-file-write-mkdir",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, with an explicit mkdir -p step to ensure the target directory exists before writing.","UF-gzj\u002Fopenspace-claude-evolution","UF-gzj","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F272393507?v=4","01M6XBCZB755P01VVYGQWPYZY3","01M6XBCZFJA5AREA17WGETA3FW",0,"MIT","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Flarge-file-write-mkdir\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"large file write mkdir","file","write","mkdir","fallback","when","limits","unknown","for","size","with","error","writing","payload","tool","shell","constraints","run","python","directory","2026-11-10 10:12:30",false,"---\nname: large-file-write-mkdir\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, with an explicit mkdir -p step to ensure the target directory exists before writing.\n---\n\n# Large File Write Fallback (with Directory Pre-creation)\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\nA second class of failure occurs when the **target directory does not exist**:\nPython's `open()` will raise `FileNotFoundError` if any intermediate directory\nis missing.  Always pre-create the parent directory to prevent this.\n\n## Solution\n\nUse `run_shell` with a **`mkdir -p` prefix and a Python heredoc** pattern.\nThe `mkdir -p` ensures the target directory exists; the heredoc streams the\nfile content through stdin directly into Python's `open()`, bypassing the\npayload constraints of the other tools.\n\n## Template\n\n```bash\nmkdir -p \"\u003CPARENT DIRECTORY OF TARGET PATH>\" && python3 - \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> **Tip:** If the parent directory is not known in advance, use the shell\n> `dirname` helper:\n> `mkdir -p \"$(dirname '\u003CTARGET PATH>')\" && python3 - \u003C\u003C 'EOF'`\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   - **Pre-create the parent directory** with `mkdir -p \u003Cparent_dir>`.  This\n     is a no-op when the directory already exists, so it is always safe to\n     include.  Skipping this step causes Python's `open()` to raise\n     `FileNotFoundError` for any new or deeply-nested path.\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 (mkdir + heredoc) 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```bash\nmkdir -p \"src\u002Fcomponents\" && python3 - \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` + `mkdir -p` + Python heredoc |\n| `shell_agent` also fails on large inline content | `run_shell` + `mkdir -p` + Python heredoc |\n| Target directory may not exist | Always add `mkdir -p \u003Cparent_dir>` first |\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.\n- The `mkdir -p` command is idempotent: it succeeds whether or not the\n  directory already exists, so it is always safe to include.\n- To derive the parent directory from a target path in shell:\n  `mkdir -p \"$(dirname '\u003CTARGET PATH>')\"` works as a generic alternative\n  when the parent path is not already known.\n","# Large File Write Fallback (with Directory Pre-creation)\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\nA second class of failure occurs when the **target directory does not exist**:\nPython's `open()` will raise `FileNotFoundError` if any intermediate directory\nis missing.  Always pre-create the parent directory to prevent this.\n\n## Solution\n\nUse `run_shell` with a **`mkdir -p` prefix and a Python heredoc** pattern.\nThe `mkdir -p` ensures the target directory exists; the heredoc streams the\nfile content through stdin directly into Python's `open()`, bypassing the\npayload constraints of the other tools.\n\n## Template\n\n```bash\nmkdir -p \"\u003CPARENT DIRECTORY OF TARGET PATH>\" && python3 - \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> **Tip:** If the parent directory is not known in advance, use the shell\n> `dirname` helper:\n> `mkdir -p \"$(dirname '\u003CTARGET PATH>')\" && python3 - \u003C\u003C 'EOF'`\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   - **Pre-create the parent directory** with `mkdir -p \u003Cparent_dir>`.  This\n     is a no-op when the directory already exists, so it is always safe to\n     include.  Skipping this step causes Python's `open()` to raise\n     `FileNotFoundError` for any new or deeply-nested path.\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 (mkdir + heredoc) 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```bash\nmkdir -p \"src\u002Fcomponents\" && python3 - \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` + `mkdir -p` + Python heredoc |\n| `shell_agent` also fails on large inline content | `run_shell` + `mkdir -p` + Python heredoc |\n| Target directory may not exist | Always add `mkdir -p \u003Cparent_dir>` first |\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.\n- The `mkdir -p` command is idempotent: it succeeds whether or not the\n  directory already exists, so it is always safe to include.\n- To derive the parent directory from a target path in shell:\n  `mkdir -p \"$(dirname '\u003CTARGET PATH>')\"` works as a generic alternative\n  when the parent path is not already known.\n",{"name":5,"description":7},"main","0650921d63895de3997bc81f1ff1d0ac67032072","showcase\u002Fskills\u002Flarge-file-write-mkdir","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution","https:\u002F\u002Fgithub.com\u002FUF-gzj","2026-04-16 09:31:03",{"source":8,"skillName":5,"commands":50,"prompt":60,"zipAvailable":61},[51,54,57],{"tool":52,"command":53},"npx","npx skills add UF-gzj\u002Fopenspace-claude-evolution --skill large-file-write-mkdir",{"tool":55,"command":56},"bunx","bunx skills add UF-gzj\u002Fopenspace-claude-evolution --skill large-file-write-mkdir",{"tool":58,"command":59},"pnpm","pnpm dlx skills add UF-gzj\u002Fopenspace-claude-evolution --skill large-file-write-mkdir","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Flarge-file-write-mkdir\u002FSKILL.md",true,[63],{"path":64,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":67,"sourceHtmlUrl":68},".skill_id","OTHER","其他",48,"https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Flarge-file-write-mkdir\u002F.skill_id",[70,91,107,115,140,156],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":38},"01M6XCCXD3NCM2YKR3WNGBASPC","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\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-ts-check\u002FSKILL.md",[],[77,20,78,79,80,81,82,83,26,84,85,86,87,88,89,90,19,36],"check","write special chars ts check","typescript","filters","characters","Existing","type-checking","errors","script","output","type","files","only","template",{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":38},"01M6XCCT7E3J922Q345PBGSHPN","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\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-readback\u002FSKILL.md",[],[98,99,20,19,100,36,101,102,103,104,105,90,106,28,81,26,85],"readback","write special chars readback","helper","post","via","scripts","cleanup","read","verification",{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":38},"01M6XCCMQX1R8B6FECWB3P63T7","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\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-heredoc\u002FSKILL.md",[],[114,20,81,33,85,102,90,19,36,26],"write special chars heredoc",{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":38},"01M6XCCG41M994JJEX6VN52PEP","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\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fworldmonitor-reference\u002FSKILL.md",[],[122,123,124,125,126,79,127,128,129,130,131,26,132,133,134,135,136,137,138,139],"reference","worldmonitor","worldmonitor reference","architecture","dashboard","css","scheduler","layer","hierarchy","source","extracting","panel","patterns","edge functions","integrations","open","api","data",{"skillNo":141,"name":142,"nameZh":6,"description":143,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":144,"categories":145,"keywords":146,"publishedAt":38},"01M6XCCCHWNKG2W4VH9E6A10HF","virtual-list","Implement efficient virtual scrolling for rendering large lists with DOM recycling, chunk-based rendering, and performance optimizations","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fvirtual-list\u002FSKILL.md",[],[147,148,149,150,26,151,28,152,153,154,155],"virtual list","list","virtual","chunk","dom","rendering","recycling","implement","performance",{"skillNo":157,"name":158,"nameZh":6,"description":159,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":160,"categories":161,"keywords":162,"publishedAt":38},"01M6XCC7X8PKMR2DEW91XGHYSV","verify-directory-structure","Diagnose and resolve file access issues by first verifying the directory structure.","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fverify-directory-structure\u002FSKILL.md",[],[37,163,164,165,166,167,19,168,169,170],"verify directory structure","structure","verify","access","first","issues","diagnose","file access"]