[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6XCCMQX1R8B6FECWB3P63T7":3,"skill-same:01M6XCCMQX1R8B6FECWB3P63T7":59},{"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":28,"linkOnly":29,"markdownContent":30,"markdownBody":31,"frontMatter":32,"refName":33,"commitSha":34,"skillDirectory":35,"forksCount":13,"repositoryHtmlUrl":36,"repositoryHomepageUrl":6,"ownerHtmlUrl":37,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":38,"install":39,"resources":52},"01M6XCCMQX1R8B6FECWB3P63T7","write-special-chars-heredoc",null,"Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) by using a Python heredoc script executed via shell.","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\u002Fwrite-special-chars-heredoc\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27],"write","write special chars heredoc","python","file","shell","template","via","script","for","characters","2026-11-10 10:12:30",false,"---\nname: write-special-chars-heredoc\ndescription: Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) by using a Python heredoc script executed via shell.\n---\n\n# Write File Special Characters Workaround\n\n## Problem\n\nThe `write_file` tool may fail with `[ERROR] unknown error` when file content\ncontains special characters such as:\n\n- Apostrophes \u002F single quotes (`'`)\n- Backticks (`` ` ``)\n- Template literals (`` `${variable}` ``) common in TypeScript\u002FJavaScript\n- Complex combinations of quotes and escape sequences\n\nThis is especially common when writing TypeScript, JavaScript, shell scripts,\nor any source file with string interpolation syntax.\n\n## Solution: Python Heredoc Workaround\n\nWrite a small Python script to `\u002Ftmp\u002F` that uses triple-quoted strings to\nembed the file content, then execute it with `python3`.\n\n### Step-by-Step\n\n1. **Compose a Python writer script** using triple-quoted strings (`\"\"\"...\"\"\"`).\n2. **Write the Python script itself to `\u002Ftmp\u002F`** — its content is plain enough\n   that `write_file` will succeed (no problematic characters in the wrapper).\n3. **Execute** the script with `run_shell`: `python3 \u002Ftmp\u002Fwrite_\u003Cname>.py`\n\n### Escaping Rules Inside the Python Script\n\n| Character | How to handle |\n|-----------|--------------|\n| Backslash `\\` | Escape as `\\\\` |\n| Triple double-quote `\"\"\"` | Escape as `\\\"\\\"\\\"` or use `'''` strings instead |\n| Everything else (backticks, `$`, `'`, `{}`) | No escaping needed |\n\n### Template\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\ncontent = \"\"\"\n\u003CYOUR FILE CONTENT HERE>\n\"\"\".lstrip(\"\\n\")\n\nwith open(\"\u002Fpath\u002Fto\u002Ftarget\u002Ffile.ts\", \"w\") as f:\n    f.write(content)\n\nprint(\"File written successfully.\")\n```\n\n### Concrete Example\n\nSuppose you need to write a TypeScript file with template literals and\napostrophes that causes `write_file` to fail:\n\n**Step 1 — Write the Python helper to `\u002Ftmp\u002F`:**\n\nUse `write_file` with path `\u002Ftmp\u002Fwrite_greeting.py` and content:\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\ncontent = \"\"\"\nexport function greet(name: string): string {\n  const msg = `Hello, ${name}! It's a great day.`;\n  console.log(`Greeting: ${msg}`);\n  return msg;\n}\n\"\"\".lstrip(\"\\n\")\n\nwith open(\"\u002Fapp\u002Fsrc\u002Fgreeting.ts\", \"w\") as f:\n    f.write(content)\n\nprint(\"Written: \u002Fapp\u002Fsrc\u002Fgreeting.ts\")\n```\n\n**Step 2 — Execute the helper:**\n\n```bash\npython3 \u002Ftmp\u002Fwrite_greeting.py\n```\n\n**Step 3 — Verify:**\n\n```bash\ncat \u002Fapp\u002Fsrc\u002Fgreeting.ts\n```\n\n## When to Use This Pattern\n\n- `write_file` returns `[ERROR] unknown error` for a specific file.\n- The file contains TypeScript\u002FJavaScript template literals.\n- The file contains mixed quote styles or shell-like special characters.\n- Any time direct file writing fails and content cannot be easily sanitized.\n\n## Multiple Files\n\nFor writing several problematic files in one pass, consolidate them into a\nsingle Python script:\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\nimport os\n\nfiles = {\n    \"\u002Fapp\u002Fsrc\u002Fcomponent.tsx\": \"\"\"\nimport React from 'react';\n\nconst App = () => (\n  \u003Cdiv className={`container`}>\n    \u003Ch1>It's working!\u003C\u002Fh1>\n  \u003C\u002Fdiv>\n);\n\nexport default App;\n\"\"\".lstrip(\"\\n\"),\n\n    \"\u002Fapp\u002Fsrc\u002Futils.ts\": \"\"\"\nexport const format = (val: number) => `Value: ${val.toFixed(2)}`;\n\"\"\".lstrip(\"\\n\"),\n}\n\nfor path, content in files.items():\n    os.makedirs(os.path.dirname(path), exist_ok=True)\n    with open(path, \"w\") as f:\n        f.write(content)\n    print(f\"Written: {path}\")\n```\n\n## Key Advantages\n\n- **No shell escaping required** — Python triple-quoted strings are literal.\n- **Handles all TypeScript syntax** — template literals, generics, JSX, etc.\n- **Atomic** — the target file is only created if the Python script succeeds.\n- **Debuggable** — the intermediate `.py` file can be inspected if needed.\n- **Cleanup (optional):** `rm \u002Ftmp\u002Fwrite_*.py` after all files are written.","# Write File Special Characters Workaround\n\n## Problem\n\nThe `write_file` tool may fail with `[ERROR] unknown error` when file content\ncontains special characters such as:\n\n- Apostrophes \u002F single quotes (`'`)\n- Backticks (`` ` ``)\n- Template literals (`` `${variable}` ``) common in TypeScript\u002FJavaScript\n- Complex combinations of quotes and escape sequences\n\nThis is especially common when writing TypeScript, JavaScript, shell scripts,\nor any source file with string interpolation syntax.\n\n## Solution: Python Heredoc Workaround\n\nWrite a small Python script to `\u002Ftmp\u002F` that uses triple-quoted strings to\nembed the file content, then execute it with `python3`.\n\n### Step-by-Step\n\n1. **Compose a Python writer script** using triple-quoted strings (`\"\"\"...\"\"\"`).\n2. **Write the Python script itself to `\u002Ftmp\u002F`** — its content is plain enough\n   that `write_file` will succeed (no problematic characters in the wrapper).\n3. **Execute** the script with `run_shell`: `python3 \u002Ftmp\u002Fwrite_\u003Cname>.py`\n\n### Escaping Rules Inside the Python Script\n\n| Character | How to handle |\n|-----------|--------------|\n| Backslash `\\` | Escape as `\\\\` |\n| Triple double-quote `\"\"\"` | Escape as `\\\"\\\"\\\"` or use `'''` strings instead |\n| Everything else (backticks, `$`, `'`, `{}`) | No escaping needed |\n\n### Template\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\ncontent = \"\"\"\n\u003CYOUR FILE CONTENT HERE>\n\"\"\".lstrip(\"\\n\")\n\nwith open(\"\u002Fpath\u002Fto\u002Ftarget\u002Ffile.ts\", \"w\") as f:\n    f.write(content)\n\nprint(\"File written successfully.\")\n```\n\n### Concrete Example\n\nSuppose you need to write a TypeScript file with template literals and\napostrophes that causes `write_file` to fail:\n\n**Step 1 — Write the Python helper to `\u002Ftmp\u002F`:**\n\nUse `write_file` with path `\u002Ftmp\u002Fwrite_greeting.py` and content:\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\ncontent = \"\"\"\nexport function greet(name: string): string {\n  const msg = `Hello, ${name}! It's a great day.`;\n  console.log(`Greeting: ${msg}`);\n  return msg;\n}\n\"\"\".lstrip(\"\\n\")\n\nwith open(\"\u002Fapp\u002Fsrc\u002Fgreeting.ts\", \"w\") as f:\n    f.write(content)\n\nprint(\"Written: \u002Fapp\u002Fsrc\u002Fgreeting.ts\")\n```\n\n**Step 2 — Execute the helper:**\n\n```bash\npython3 \u002Ftmp\u002Fwrite_greeting.py\n```\n\n**Step 3 — Verify:**\n\n```bash\ncat \u002Fapp\u002Fsrc\u002Fgreeting.ts\n```\n\n## When to Use This Pattern\n\n- `write_file` returns `[ERROR] unknown error` for a specific file.\n- The file contains TypeScript\u002FJavaScript template literals.\n- The file contains mixed quote styles or shell-like special characters.\n- Any time direct file writing fails and content cannot be easily sanitized.\n\n## Multiple Files\n\nFor writing several problematic files in one pass, consolidate them into a\nsingle Python script:\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\nimport os\n\nfiles = {\n    \"\u002Fapp\u002Fsrc\u002Fcomponent.tsx\": \"\"\"\nimport React from 'react';\n\nconst App = () => (\n  \u003Cdiv className={`container`}>\n    \u003Ch1>It's working!\u003C\u002Fh1>\n  \u003C\u002Fdiv>\n);\n\nexport default App;\n\"\"\".lstrip(\"\\n\"),\n\n    \"\u002Fapp\u002Fsrc\u002Futils.ts\": \"\"\"\nexport const format = (val: number) => `Value: ${val.toFixed(2)}`;\n\"\"\".lstrip(\"\\n\"),\n}\n\nfor path, content in files.items():\n    os.makedirs(os.path.dirname(path), exist_ok=True)\n    with open(path, \"w\") as f:\n        f.write(content)\n    print(f\"Written: {path}\")\n```\n\n## Key Advantages\n\n- **No shell escaping required** — Python triple-quoted strings are literal.\n- **Handles all TypeScript syntax** — template literals, generics, JSX, etc.\n- **Atomic** — the target file is only created if the Python script succeeds.\n- **Debuggable** — the intermediate `.py` file can be inspected if needed.\n- **Cleanup (optional):** `rm \u002Ftmp\u002Fwrite_*.py` after all files are written.",{"name":5,"description":7},"main","0650921d63895de3997bc81f1ff1d0ac67032072","showcase\u002Fskills\u002Fwrite-special-chars-heredoc","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":40,"prompt":50,"zipAvailable":51},[41,44,47],{"tool":42,"command":43},"npx","npx skills add UF-gzj\u002Fopenspace-claude-evolution --skill write-special-chars-heredoc",{"tool":45,"command":46},"bunx","bunx skills add UF-gzj\u002Fopenspace-claude-evolution --skill write-special-chars-heredoc",{"tool":48,"command":49},"pnpm","pnpm dlx skills add UF-gzj\u002Fopenspace-claude-evolution --skill write-special-chars-heredoc","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-heredoc\u002FSKILL.md",true,[53],{"path":54,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":57,"sourceHtmlUrl":58},".skill_id","OTHER","其他",49,"https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-heredoc\u002F.skill_id",[60,78,94,124,140,156],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":28},"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",[],[67,18,68,69,27,70,71,26,72,25,73,74,75,76,23,21,20,77],"check","write special chars ts check","filters","Existing","type-checking","errors","output","type","files","only","typescript",{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":28},"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",[],[18,85,86,87,24,88,89,90,23,21,91,92,20,93,27,26,25],"write special chars readback","readback","helper","post","scripts","read","verification","cleanup","with",{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":105,"publishedAt":28},"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",[100],{"categoryNo":101,"categoryName":102,"taxonomyType":103,"taxonomyTypeDesc":104},"01JBSEEDCAT000000000000033","数据分析师","PROFESSION","适用职业",[106,107,108,26,109,110,111,112,113,114,115,116,117,118,119,120,121,122,77,123],"reference","worldmonitor reference","worldmonitor","hierarchy","source","open","dashboard","extracting","panel","patterns","edge functions","integrations","api","data","scheduler","architecture","layer","css",{"skillNo":125,"name":126,"nameZh":6,"description":127,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":128,"categories":129,"keywords":130,"publishedAt":28},"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",[],[131,132,133,134,26,135,93,136,137,138,139],"virtual list","virtual","list","performance","dom","rendering","recycling","chunk","implement",{"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":28},"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",[],[147,148,149,150,151,152,21,153,154,155],"verify","structure","verify directory structure","directory","access","first","issues","diagnose","file access",{"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":28},"01M6XCC3HAJNFB6WZAHV6YW5AV","verify-directory-structure-parallel-audit","Diagnose and resolve file access issues by verifying directory structure, then reading multiple files in parallel batches for efficient auditing, with built-in guidance for validating TypeScript import patterns.","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fverify-directory-structure-parallel-audit\u002FSKILL.md",[],[150,149,163,148,164,147,165,93,26,166,167,168,169,75,151,21,153,154,77,155],"verify directory structure parallel audit","parallel","audit","batches","reading","import","guidance"]