[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6XBJKG4BP5Z49RF7EV5PQBN":3,"skill-same:01M6XBJKG4BP5Z49RF7EV5PQBN":72},{"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":27,"publishedAt":41,"linkOnly":42,"markdownContent":43,"markdownBody":44,"frontMatter":45,"refName":46,"commitSha":47,"skillDirectory":48,"forksCount":13,"repositoryHtmlUrl":49,"repositoryHomepageUrl":6,"ownerHtmlUrl":50,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":51,"install":52,"resources":65},"01M6XBJKG4BP5Z49RF7EV5PQBN","docx-shell-workaround",null,"Handle docx files using shell-based XML extraction and python-docx via run_shell when standard tools fail","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\u002Fgdpval_bench\u002Fskills\u002Fdocx-shell-workaround\u002FSKILL.md",[17,22],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000002","文档处理","SCENARIO","使用场景",{"categoryNo":23,"categoryName":24,"taxonomyType":25,"taxonomyTypeDesc":26},"01JBSEEDCAT000000000000034","行政与办公人员","PROFESSION","适用职业",[28,29,30,31,32,33,34,35,36,37,38,39,40],"docx","shell","docx shell workaround","python","run","extraction","xml","Tools","files","via","python-docx","standard","when","2026-11-10 10:12:30",false,"---\nname: docx-shell-workaround\ndescription: Handle docx files using shell-based XML extraction and python-docx via run_shell when standard tools fail\n---\n\n# DOCX Shell Workaround\n\n## When to Use\n\nUse this skill when:\n- `read_file` cannot extract content from .docx files\n- `execute_code_sandbox` encounters failures when creating or modifying docx files\n- You need a reliable fallback for docx file manipulation\n\n## Reading DOCX Files\n\n### Step 1: Extract document.xml using unzip\n\nUse `run_shell` to unzip the .docx file (which is a ZIP archive) and extract the main document XML:\n\n```bash\nunzip -p input.docx word\u002Fdocument.xml > document.xml\n```\n\n### Step 2: Parse XML with ElementTree via run_shell\n\nExtract text content by parsing the XML. Use `run_shell` to execute Python code:\n\n```bash\npython3 \u003C\u003C 'EOF'\nimport xml.etree.ElementTree as ET\n\ntree = ET.parse('document.xml')\nroot = tree.getroot()\nnamespace = {'w': 'http:\u002F\u002Fschemas.openxmlformats.org\u002Fwordprocessingml\u002F2006\u002Fmain'}\n\ntext_content = []\nfor elem in root.iter():\n    if elem.tag.endswith('t'):\n        if elem.text:\n            text_content.append(elem.text)\n\ntext = ''.join(text_content)\nprint(text)\nEOF\n```\n\n### Step 3: Optional - More robust XML parsing\n\nFor better text extraction that handles paragraphs:\n\n```bash\npython3 \u003C\u003C 'EOF'\nimport xml.etree.ElementTree as ET\n\ntree = ET.parse('document.xml')\nroot = tree.getroot()\nns = {'w': 'http:\u002F\u002Fschemas.openxmlformats.org\u002Fwordprocessingml\u002F2006\u002Fmain'}\n\nparagraphs = []\nfor p in root.findall('.\u002F\u002Fw:p', ns):\n    para_text = []\n    for t in p.findall('.\u002F\u002Fw:t', ns):\n        if t.text:\n            para_text.append(t.text)\n    if para_text:\n        paragraphs.append(''.join(para_text))\n\nfor para in paragraphs:\n    print(para)\nEOF\n```\n\n## Creating DOCX Files\n\n### Use python-docx via run_shell (NOT execute_code_sandbox)\n\nWhen `execute_code_sandbox` fails for docx operations, use `run_shell` instead:\n\n```bash\npython3 \u003C\u003C 'EOF'\nfrom docx import Document\nfrom docx.shared import Inches, Pt\nfrom docx.enum.text import WD_ALIGN_PARAGRAPH\n\ndoc = Document()\n\n# Add heading\ndoc.add_heading('Document Title', 0)\n\n# Add paragraph\ndoc.add_paragraph('Your content here.')\n\n# Add section with heading\ndoc.add_heading('Section Title', level=1)\ndoc.add_paragraph('Section content with multiple paragraphs.')\n\n# Add table if needed\ntable = doc.add_table(rows=3, cols=3)\ntable.style = 'Table Grid'\n\n# Save document\ndoc.save('output.docx')\nprint(\"Document created successfully\")\nEOF\n```\n\n### Example: Creating a structured business document\n\n```bash\npython3 \u003C\u003C 'EOF'\nfrom docx import Document\nfrom docx.shared import Pt\n\ndoc = Document()\n\n# Title\ntitle = doc.add_heading('Business Strategy Memo', 0)\ntitle.alignment = 1  # Center\n\n# Executive Summary\ndoc.add_heading('Executive Summary', level=1)\ndoc.add_paragraph('Brief overview of key points and recommendations.')\n\n# Market Overview\ndoc.add_heading('Market Overview', level=1)\ndoc.add_paragraph('Analysis of current market conditions and trends.')\n\n# Recommendations\ndoc.add_heading('Recommendations', level=1)\ndoc.add_paragraph('Actionable recommendations based on analysis.')\n\ndoc.save('Strategy_Memo.docx')\nEOF\n```\n\n## Full Workflow Example\n\nComplete example showing extraction and creation:\n\n```bash\n# Step 1: Extract content from existing docx\nunzip -p existing.docx word\u002Fdocument.xml > doc.xml\n\n# Step 2: Parse and transform content\npython3 \u003C\u003C 'EOF'\nimport xml.etree.ElementTree as ET\n\ntree = ET.parse('doc.xml')\nroot = tree.getroot()\nns = {'w': 'http:\u002F\u002Fschemas.openxmlformats.org\u002Fwordprocessingml\u002F2006\u002Fmain'}\n\ncontent = []\nfor p in root.findall('.\u002F\u002Fw:p', ns):\n    para_text = []\n    for t in p.findall('.\u002F\u002Fw:t', ns):\n        if t.text:\n            para_text.append(t.text)\n    if para_text:\n        content.append(''.join(para_text))\n\n# Write extracted content to file for reference\nwith open('extracted.txt', 'w') as f:\n    for line in content:\n        f.write(line + '\\n')\nEOF\n\n# Step 3: Create new docx with modified content\npython3 \u003C\u003C 'EOF'\nfrom docx import Document\n\ndoc = Document()\ndoc.add_heading('Updated Document', 0)\n\nwith open('extracted.txt', 'r') as f:\n    for line in f:\n        if line.strip():\n            doc.add_paragraph(line.strip())\n\ndoc.save('updated.docx')\nEOF\n```\n\n## Key Points\n\n1. **Always use `run_shell`** - Not `execute_code_sandbox` for docx operations\n2. **DOCX is a ZIP archive** - Contains XML files including word\u002Fdocument.xml\n3. **Use `unzip -p`** - The `-p` flag outputs to stdout, useful for piping\n4. **Handle XML namespaces** - Word XML uses the `w:` namespace prefix\n5. **Install python-docx if needed** - Run `pip install python-docx` in the shell if not available\n\n## Troubleshooting\n\nIf python-docx is not installed:\n```bash\npip install python-docx\n```\n\nIf unzip is not available:\n```bash\n# Use Python's zipfile module instead\npython3 -c \"import zipfile; z=zipfile.ZipFile('file.docx'); print(z.read('word\u002Fdocument.xml').decode('utf-8', errors='ignore'))\"\n```\n\nIf XML parsing fails:\n- Check the namespace URI matches your document version\n- Use `.endswith('t')` instead of full namespace matching for flexibility\n- Handle encoding issues with `errors='ignore'` parameter","# DOCX Shell Workaround\n\n## When to Use\n\nUse this skill when:\n- `read_file` cannot extract content from .docx files\n- `execute_code_sandbox` encounters failures when creating or modifying docx files\n- You need a reliable fallback for docx file manipulation\n\n## Reading DOCX Files\n\n### Step 1: Extract document.xml using unzip\n\nUse `run_shell` to unzip the .docx file (which is a ZIP archive) and extract the main document XML:\n\n```bash\nunzip -p input.docx word\u002Fdocument.xml > document.xml\n```\n\n### Step 2: Parse XML with ElementTree via run_shell\n\nExtract text content by parsing the XML. Use `run_shell` to execute Python code:\n\n```bash\npython3 \u003C\u003C 'EOF'\nimport xml.etree.ElementTree as ET\n\ntree = ET.parse('document.xml')\nroot = tree.getroot()\nnamespace = {'w': 'http:\u002F\u002Fschemas.openxmlformats.org\u002Fwordprocessingml\u002F2006\u002Fmain'}\n\ntext_content = []\nfor elem in root.iter():\n    if elem.tag.endswith('t'):\n        if elem.text:\n            text_content.append(elem.text)\n\ntext = ''.join(text_content)\nprint(text)\nEOF\n```\n\n### Step 3: Optional - More robust XML parsing\n\nFor better text extraction that handles paragraphs:\n\n```bash\npython3 \u003C\u003C 'EOF'\nimport xml.etree.ElementTree as ET\n\ntree = ET.parse('document.xml')\nroot = tree.getroot()\nns = {'w': 'http:\u002F\u002Fschemas.openxmlformats.org\u002Fwordprocessingml\u002F2006\u002Fmain'}\n\nparagraphs = []\nfor p in root.findall('.\u002F\u002Fw:p', ns):\n    para_text = []\n    for t in p.findall('.\u002F\u002Fw:t', ns):\n        if t.text:\n            para_text.append(t.text)\n    if para_text:\n        paragraphs.append(''.join(para_text))\n\nfor para in paragraphs:\n    print(para)\nEOF\n```\n\n## Creating DOCX Files\n\n### Use python-docx via run_shell (NOT execute_code_sandbox)\n\nWhen `execute_code_sandbox` fails for docx operations, use `run_shell` instead:\n\n```bash\npython3 \u003C\u003C 'EOF'\nfrom docx import Document\nfrom docx.shared import Inches, Pt\nfrom docx.enum.text import WD_ALIGN_PARAGRAPH\n\ndoc = Document()\n\n# Add heading\ndoc.add_heading('Document Title', 0)\n\n# Add paragraph\ndoc.add_paragraph('Your content here.')\n\n# Add section with heading\ndoc.add_heading('Section Title', level=1)\ndoc.add_paragraph('Section content with multiple paragraphs.')\n\n# Add table if needed\ntable = doc.add_table(rows=3, cols=3)\ntable.style = 'Table Grid'\n\n# Save document\ndoc.save('output.docx')\nprint(\"Document created successfully\")\nEOF\n```\n\n### Example: Creating a structured business document\n\n```bash\npython3 \u003C\u003C 'EOF'\nfrom docx import Document\nfrom docx.shared import Pt\n\ndoc = Document()\n\n# Title\ntitle = doc.add_heading('Business Strategy Memo', 0)\ntitle.alignment = 1  # Center\n\n# Executive Summary\ndoc.add_heading('Executive Summary', level=1)\ndoc.add_paragraph('Brief overview of key points and recommendations.')\n\n# Market Overview\ndoc.add_heading('Market Overview', level=1)\ndoc.add_paragraph('Analysis of current market conditions and trends.')\n\n# Recommendations\ndoc.add_heading('Recommendations', level=1)\ndoc.add_paragraph('Actionable recommendations based on analysis.')\n\ndoc.save('Strategy_Memo.docx')\nEOF\n```\n\n## Full Workflow Example\n\nComplete example showing extraction and creation:\n\n```bash\n# Step 1: Extract content from existing docx\nunzip -p existing.docx word\u002Fdocument.xml > doc.xml\n\n# Step 2: Parse and transform content\npython3 \u003C\u003C 'EOF'\nimport xml.etree.ElementTree as ET\n\ntree = ET.parse('doc.xml')\nroot = tree.getroot()\nns = {'w': 'http:\u002F\u002Fschemas.openxmlformats.org\u002Fwordprocessingml\u002F2006\u002Fmain'}\n\ncontent = []\nfor p in root.findall('.\u002F\u002Fw:p', ns):\n    para_text = []\n    for t in p.findall('.\u002F\u002Fw:t', ns):\n        if t.text:\n            para_text.append(t.text)\n    if para_text:\n        content.append(''.join(para_text))\n\n# Write extracted content to file for reference\nwith open('extracted.txt', 'w') as f:\n    for line in content:\n        f.write(line + '\\n')\nEOF\n\n# Step 3: Create new docx with modified content\npython3 \u003C\u003C 'EOF'\nfrom docx import Document\n\ndoc = Document()\ndoc.add_heading('Updated Document', 0)\n\nwith open('extracted.txt', 'r') as f:\n    for line in f:\n        if line.strip():\n            doc.add_paragraph(line.strip())\n\ndoc.save('updated.docx')\nEOF\n```\n\n## Key Points\n\n1. **Always use `run_shell`** - Not `execute_code_sandbox` for docx operations\n2. **DOCX is a ZIP archive** - Contains XML files including word\u002Fdocument.xml\n3. **Use `unzip -p`** - The `-p` flag outputs to stdout, useful for piping\n4. **Handle XML namespaces** - Word XML uses the `w:` namespace prefix\n5. **Install python-docx if needed** - Run `pip install python-docx` in the shell if not available\n\n## Troubleshooting\n\nIf python-docx is not installed:\n```bash\npip install python-docx\n```\n\nIf unzip is not available:\n```bash\n# Use Python's zipfile module instead\npython3 -c \"import zipfile; z=zipfile.ZipFile('file.docx'); print(z.read('word\u002Fdocument.xml').decode('utf-8', errors='ignore'))\"\n```\n\nIf XML parsing fails:\n- Check the namespace URI matches your document version\n- Use `.endswith('t')` instead of full namespace matching for flexibility\n- Handle encoding issues with `errors='ignore'` parameter",{"name":5,"description":7},"main","0650921d63895de3997bc81f1ff1d0ac67032072","gdpval_bench\u002Fskills\u002Fdocx-shell-workaround","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":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add UF-gzj\u002Fopenspace-claude-evolution --skill docx-shell-workaround",{"tool":58,"command":59},"bunx","bunx skills add UF-gzj\u002Fopenspace-claude-evolution --skill docx-shell-workaround",{"tool":61,"command":62},"pnpm","pnpm dlx skills add UF-gzj\u002Fopenspace-claude-evolution --skill docx-shell-workaround","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fdocx-shell-workaround\u002FSKILL.md",true,[66],{"path":67,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":70,"sourceHtmlUrl":71},".skill_id","OTHER","其他",35,"https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fdocx-shell-workaround\u002F.skill_id",[73,96,112,120,148,164],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":41},"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",[],[80,81,82,83,84,85,86,87,88,89,90,91,92,36,93,94,95,31],"check","write","write special chars ts check","typescript","filters","characters","Existing","type-checking","for","errors","script","output","type","only","template","file",{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":41},"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",[],[103,104,81,95,105,31,106,37,107,108,109,94,110,111,85,88,90],"readback","write special chars readback","helper","post","scripts","cleanup","read","verification","with",{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":41},"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",[],[119,81,85,29,90,37,94,95,31,88],"write special chars heredoc",{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":129,"publishedAt":41},"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",[126],{"categoryNo":127,"categoryName":128,"taxonomyType":25,"taxonomyTypeDesc":26},"01JBSEEDCAT000000000000033","数据分析师",[130,131,132,133,134,83,135,136,137,138,139,88,140,141,142,143,144,145,146,147],"reference","worldmonitor","worldmonitor reference","architecture","dashboard","css","scheduler","layer","hierarchy","source","extracting","panel","patterns","edge functions","integrations","open","api","data",{"skillNo":149,"name":150,"nameZh":6,"description":151,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":152,"categories":153,"keywords":154,"publishedAt":41},"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",[],[155,156,157,158,88,159,111,160,161,162,163],"virtual list","list","virtual","chunk","dom","rendering","recycling","implement","performance",{"skillNo":165,"name":166,"nameZh":6,"description":167,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":168,"categories":169,"keywords":170,"publishedAt":41},"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",[],[171,172,173,174,175,176,95,177,178,179],"directory","verify directory structure","structure","verify","access","first","issues","diagnose","file access"]