[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6XCCT7E3J922Q345PBGSHPN":3,"skill-same:01M6XCCT7E3J922Q345PBGSHPN":66},{"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":35,"linkOnly":36,"markdownContent":37,"markdownBody":38,"frontMatter":39,"refName":40,"commitSha":41,"skillDirectory":42,"forksCount":13,"repositoryHtmlUrl":43,"repositoryHomepageUrl":6,"ownerHtmlUrl":44,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":45,"install":46,"resources":59},"01M6XCCT7E3J922Q345PBGSHPN","write-special-chars-readback",null,"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.","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-readback\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"write special chars readback","readback","write","via","characters","for","script","with","helper","post","python","scripts","read","template","file","verification","cleanup","2026-11-10 10:12:30",false,"---\nname: write-special-chars-readback\ndescription: 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.\n---\n\n# Write File Special Characters Workaround (Verified)\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`\n4. **Verify** the written file with `read_file` to confirm contents are correct.\n5. **Clean up** the `\u002Ftmp` helper script: `rm \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 with `read_file`:**\n\nUse `read_file` with path `\u002Fapp\u002Fsrc\u002Fgreeting.ts` to confirm the file content\nis exactly what was intended. This catches silent truncation or encoding\nissues that shell `cat` output might obscure.\n\n**Step 4 — Clean up the helper:**\n\n```bash\nrm \u002Ftmp\u002Fwrite_greeting.py\n```\n\nThis keeps `\u002Ftmp` tidy and prevents stale helper scripts from being confused\nwith current ones on subsequent runs.\n\n## Standard Post-Write Checklist\n\nAfter every use of this pattern, always complete **all three** of these steps:\n\n| Step | Action | Why |\n|------|---------|-----|\n| ✅ Execute | `python3 \u002Ftmp\u002Fwrite_\u003Cname>.py` | Writes the target file |\n| ✅ Verify | `read_file` on the target path | Confirms content integrity |\n| ✅ Clean up | `rm \u002Ftmp\u002Fwrite_\u003Cname>.py` | Prevents stale helper accumulation |\n\nSkipping verification risks silently shipping a truncated or malformed file.\nSkipping cleanup risks confusion when the same helper name is reused later.\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\nAfter running the multi-file script:\n\n1. Use `read_file` on **each** target path to verify all files were written\n   correctly.\n2. Then clean up: `rm \u002Ftmp\u002Fwrite_\u003Cname>.py`\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 (required):** `rm \u002Ftmp\u002Fwrite_*.py` after all files are written —\n  this is a mandatory step, not optional.\n- **Verified** — always follow up with `read_file` on the target file to\n  confirm content integrity before considering the task complete.\n","# Write File Special Characters Workaround (Verified)\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`\n4. **Verify** the written file with `read_file` to confirm contents are correct.\n5. **Clean up** the `\u002Ftmp` helper script: `rm \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 with `read_file`:**\n\nUse `read_file` with path `\u002Fapp\u002Fsrc\u002Fgreeting.ts` to confirm the file content\nis exactly what was intended. This catches silent truncation or encoding\nissues that shell `cat` output might obscure.\n\n**Step 4 — Clean up the helper:**\n\n```bash\nrm \u002Ftmp\u002Fwrite_greeting.py\n```\n\nThis keeps `\u002Ftmp` tidy and prevents stale helper scripts from being confused\nwith current ones on subsequent runs.\n\n## Standard Post-Write Checklist\n\nAfter every use of this pattern, always complete **all three** of these steps:\n\n| Step | Action | Why |\n|------|---------|-----|\n| ✅ Execute | `python3 \u002Ftmp\u002Fwrite_\u003Cname>.py` | Writes the target file |\n| ✅ Verify | `read_file` on the target path | Confirms content integrity |\n| ✅ Clean up | `rm \u002Ftmp\u002Fwrite_\u003Cname>.py` | Prevents stale helper accumulation |\n\nSkipping verification risks silently shipping a truncated or malformed file.\nSkipping cleanup risks confusion when the same helper name is reused later.\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\nAfter running the multi-file script:\n\n1. Use `read_file` on **each** target path to verify all files were written\n   correctly.\n2. Then clean up: `rm \u002Ftmp\u002Fwrite_\u003Cname>.py`\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 (required):** `rm \u002Ftmp\u002Fwrite_*.py` after all files are written —\n  this is a mandatory step, not optional.\n- **Verified** — always follow up with `read_file` on the target file to\n  confirm content integrity before considering the task complete.\n",{"name":5,"description":7},"main","0650921d63895de3997bc81f1ff1d0ac67032072","showcase\u002Fskills\u002Fwrite-special-chars-readback","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":47,"prompt":57,"zipAvailable":58},[48,51,54],{"tool":49,"command":50},"npx","npx skills add UF-gzj\u002Fopenspace-claude-evolution --skill write-special-chars-readback",{"tool":52,"command":53},"bunx","bunx skills add UF-gzj\u002Fopenspace-claude-evolution --skill write-special-chars-readback",{"tool":55,"command":56},"pnpm","pnpm dlx skills add UF-gzj\u002Fopenspace-claude-evolution --skill write-special-chars-readback","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-readback\u002FSKILL.md",true,[60],{"path":61,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":64,"sourceHtmlUrl":65},".skill_id","OTHER","其他",65,"https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-readback\u002F.skill_id",[67,85,94,119,135,151],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":35},"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",[],[20,74,75,76,23,22,77,78,79,24,80,81,28,32,31,82,83,84],"check","write special chars ts check","type-checking","Existing","only","errors","output","typescript","type","files","filters",{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":35},"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",[],[92,20,31,93,32,28,21,24,23,22],"write special chars heredoc","shell",{"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":100,"publishedAt":35},"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",[],[101,102,103,104,105,23,106,107,108,109,110,111,112,113,114,115,116,117,81,118],"worldmonitor reference","worldmonitor","reference","hierarchy","source","layer","extracting","panel","architecture","css","edge functions","integrations","open","api","data","scheduler","dashboard","patterns",{"skillNo":120,"name":121,"nameZh":6,"description":122,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":123,"categories":124,"keywords":125,"publishedAt":35},"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",[],[126,127,128,23,129,25,130,131,132,133,134],"virtual","list","virtual list","dom","rendering","recycling","chunk","implement","performance",{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":141,"publishedAt":35},"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",[],[142,143,144,145,146,32,147,148,149,150],"directory","structure","verify directory structure","verify","first","issues","diagnose","file access","access",{"skillNo":152,"name":153,"nameZh":6,"description":154,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":155,"categories":156,"keywords":157,"publishedAt":35},"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",[],[158,144,142,159,143,145,160,161,23,162,163,25,164,83,150,32,147,148,81,149],"verify directory structure parallel audit","audit","parallel","import","batches","reading","guidance"]