[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KFERD40037X9P8ZK526ZRM":3,"skill-same:01M6KFERD40037X9P8ZK526ZRM":73},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":28,"publishedAt":40,"linkOnly":41,"markdownContent":42,"markdownBody":43,"frontMatter":44,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":14,"repositoryHtmlUrl":48,"repositoryHomepageUrl":6,"ownerHtmlUrl":49,"ownerBlogUrl":50,"ownerDescription":51,"updatedAt":52,"install":53,"resources":66},"01M6KFERD40037X9P8ZK526ZRM","docx-shell-workaround",null,"Handle docx files using shell-based XML extraction and python-docx via run_shell when standard tools fail","xyliu-cs\u002FOpenSpace-GDPval","xyliu-cs","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F89236536?v=4","01M6KF8Z1V4TXS86CKSH48BY8T","xy","01M6KF8Z67443W0SHXM85JEF0B",0,"MIT","https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fdocx-shell-workaround\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000002","文档处理","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000034","行政与办公人员","PROFESSION","适用职业",[29,30,31,32,33,34,35,36,37,38,39],"docx","shell","docx shell workaround","python","run","extraction","xml","Tools","files","via","python-docx","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","af1b40a42167d09c30b3a63000aa14ace4c1e229","gdpval_bench\u002Fskills\u002Fdocx-shell-workaround","https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval","https:\u002F\u002Fgithub.com\u002Fxyliu-cs","https:\u002F\u002Fxyliu-cs.github.io","PhD Student in CS, CUHK-Shenzhen.","2026-04-06 20:32:15",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add xyliu-cs\u002FOpenSpace-GDPval --skill docx-shell-workaround",{"tool":59,"command":60},"bunx","bunx skills add xyliu-cs\u002FOpenSpace-GDPval --skill docx-shell-workaround",{"tool":62,"command":63},"pnpm","pnpm dlx skills add xyliu-cs\u002FOpenSpace-GDPval --skill docx-shell-workaround","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fdocx-shell-workaround\u002FSKILL.md",true,[67],{"path":68,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":72},".skill_id","OTHER","其他",35,"https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fdocx-shell-workaround\u002F.skill_id",[74,87,95,111,133,152],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":40},"01M6KG8MF1S664SWBDENYRSCK8","zip-export-deliverable","Ensures codebase deliverables are properly exported as ZIP archives through a dedicated finalization step","https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fzip-export-deliverable\u002FSKILL.md",[],[81,82,83,84,85,86],"zip export deliverable","zip","export","deliverables","codebase","as",{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":40},"01M6KG8GAZWHHEK7VNJDW0ME21","zip-deliverable-finalization","Ensure codebase deliverables are properly packaged as ZIP exports in a dedicated final step","https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fzip-deliverable-finalization\u002FSKILL.md",[],[94,82,84,85,86],"zip deliverable finalization",{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":40},"01M6KG8CMQQ1PYMNTSRZ9VS1MD","zero-iteration-failure-analysis","Identify and handle agent failures with 0 iterations as pre-execution system issues","https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fzero-iteration-failure-analysis\u002FSKILL.md",[],[102,103,104,105,106,107,108,109,86,110],"failure analysis","ZeRO","analysis","iteration","zero iteration failure analysis","with","issues","execution","system",{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":118,"publishedAt":40},"01M6KG86W3PA07FT9W58YHHERM","write-file-fallback-report","Generate professional documents using write_file when primary data sources fail, leveraging embedded domain knowledge instead of external retrieval","https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fwrite-file-fallback-report\u002FSKILL.md",[117],{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},[119,120,121,122,123,124,125,126,127,128,129,130,131,132],"fallback","write","file","report","write file fallback report","domain","professional","sources","retrieval","generate","embedded","documents","data","knowledge",{"skillNo":134,"name":135,"nameZh":6,"description":136,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":137,"categories":138,"keywords":142,"publishedAt":40},"01M6KG82GAEY3GG77CMGCK1C2T","fallback-doc-with-delegation","Generate professional documents after tool failures using shell_agent for complex formats or write_file for simple text\u002Fmarkdown","https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fwrite-file-fallback-report-enhanced\u002FSKILL.md",[139],{"categoryNo":140,"categoryName":141,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[143,107,119,144,145,30,130,128,121,146,147,148,120,149,125,150,151],"fallback doc with delegation","doc","delegation","markdown","tool","text","simple","formats","for",{"skillNo":153,"name":154,"nameZh":6,"description":155,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":156,"categories":157,"keywords":159,"publishedAt":40},"01M6KG7WT7GX5NYCGEFHW22NV7","context-anchored-fallback-report","Generate documents with write_file when retrieval tools fail, with explicit guardrails against task context drift","https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fwrite-file-fallback-report-enhanced-4bc5c2\u002FSKILL.md",[158],{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},[119,122,160,161,128,121,162,36,120,163,164,127,107,165,130],"context","context anchored fallback report","Guardrails","task","drift","context drift"]