[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KKDWJ6YX0PRDTZYV2S6SSY":3,"skill-same:01M6KKDWJ6YX0PRDTZYV2S6SSY":65},{"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":46,"repositoryHtmlUrl":47,"repositoryHomepageUrl":48,"ownerHtmlUrl":49,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":50,"install":51,"resources":64},"01M6KKDWJ6YX0PRDTZYV2S6SSY","docx-template-filling",null,"Robustly fill Word (.docx) templates with JSON data. Handles split placeholders, nested tables, headers\u002Ffooters, and conditional logic like IF\u002FEND_IF blocks. Use this skill whenever you need to generate professional documents from templates.","cxcscmu\u002FSkillLearnBench","cxcscmu","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F142838272?v=4","01M6KCQDFQWPDSN0MKZY96MSQP","01M6KCQDM7G70TKJ28NTSQC0RZ",93,"MIT","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fb4-skill-creator-gemini-3-flash-preview\u002Foffer-letter-generator\u002Fdocx-template-filling\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"docx template filling","template","docx","end","conditional","fill","split","headers","you","with","blocks","professional","logic","nested","use","Word","json","templates","generate","documents","2026-11-10 10:12:30",false,"---\nname: docx-template-filling\ndescription: Robustly fill Word (.docx) templates with JSON data. Handles split placeholders, nested tables, headers\u002Ffooters, and conditional logic like IF\u002FEND_IF blocks. Use this skill whenever you need to generate professional documents from templates.\n---\n\n# docx-template-filling\n\n## Overview\nThis skill provides a robust framework for filling Microsoft Word templates using the `python-docx` library. It specifically addresses the \"Split Placeholder\" problem and supports conditional content blocks.\n\n## Core Principles\n1. **Paragraph-Level Processing**: Always modify text at the paragraph level (`para.text`) rather than the run level (`run.text`) to avoid issues where Word splits placeholders like `{{NAME}}` into multiple runs (e.g., `{{NA` and `ME}}`).\n2. **Formatting Preservation**: When replacing text in a paragraph, clear all runs except the first one. Update the first run's text to the new content to preserve the paragraph's initial formatting.\n3. **Comprehensive Traversal**: Process the main document body, tables (including nested ones), and headers\u002Ffooters of all sections.\n\n## Handling Conditional Sections\nConditional sections are marked with `{{IF_CONDITION}}...{{END_IF_CONDITION}}`.\n- **If condition is True**: Remove the markers but keep the content in between.\n- **If condition is False**: Remove the entire block including markers and content.\n\n### Implementation Pattern for Conditionals\n```python\ndef process_conditionals(doc, condition_key, is_enabled):\n    start_marker = f\"{{{{IF_{condition_key}}}}}\"\n    end_marker = f\"{{{{END_IF_{condition_key}}}}}\"\n    \n    # Track paragraphs to delete if condition is False\n    paras_to_delete = []\n    in_block = False\n    \n    for para in doc.paragraphs:\n        if start_marker in para.text:\n            in_block = True\n            # Remove marker from this paragraph\n            para.text = para.text.replace(start_marker, \"\")\n        \n        if in_block and not is_enabled:\n            paras_to_delete.append(para)\n            \n        if end_marker in para.text:\n            in_block = False\n            # Remove marker from this paragraph\n            para.text = para.text.replace(end_marker, \"\")\n```\n\n## Handling Split Placeholders\nUse a regex-based replacement strategy at the paragraph level.\n\n```python\nimport re\n\ndef replace_placeholders(para, data):\n    text = para.text\n    pattern = r\"\\{\\{([A-Z_0-9]+)\\}\\}\"\n    matches = re.findall(pattern, text)\n    \n    if not matches:\n        return False\n        \n    new_text = text\n    for key in matches:\n        placeholder = f\"{{{{{key}}}}}\"\n        if key in data:\n            new_text = new_text.replace(placeholder, str(data[key]))\n            \n    if new_text != text:\n        # Preserve first run formatting\n        if para.runs:\n            para.runs[0].text = new_text\n            for run in para.runs[1:]:\n                run.text = \"\"\n        else:\n            para.text = new_text\n        return True\n    return False\n```\n\n## Traversal Logic\nEnsure all parts of the document are reached:\n- `doc.paragraphs`\n- `doc.tables` (recurse into `cell.paragraphs` and `cell.tables`)\n- `doc.sections` (iterate `section.header.paragraphs` and `section.footer.paragraphs`)\n","# docx-template-filling\n\n## Overview\nThis skill provides a robust framework for filling Microsoft Word templates using the `python-docx` library. It specifically addresses the \"Split Placeholder\" problem and supports conditional content blocks.\n\n## Core Principles\n1. **Paragraph-Level Processing**: Always modify text at the paragraph level (`para.text`) rather than the run level (`run.text`) to avoid issues where Word splits placeholders like `{{NAME}}` into multiple runs (e.g., `{{NA` and `ME}}`).\n2. **Formatting Preservation**: When replacing text in a paragraph, clear all runs except the first one. Update the first run's text to the new content to preserve the paragraph's initial formatting.\n3. **Comprehensive Traversal**: Process the main document body, tables (including nested ones), and headers\u002Ffooters of all sections.\n\n## Handling Conditional Sections\nConditional sections are marked with `{{IF_CONDITION}}...{{END_IF_CONDITION}}`.\n- **If condition is True**: Remove the markers but keep the content in between.\n- **If condition is False**: Remove the entire block including markers and content.\n\n### Implementation Pattern for Conditionals\n```python\ndef process_conditionals(doc, condition_key, is_enabled):\n    start_marker = f\"{{{{IF_{condition_key}}}}}\"\n    end_marker = f\"{{{{END_IF_{condition_key}}}}}\"\n    \n    # Track paragraphs to delete if condition is False\n    paras_to_delete = []\n    in_block = False\n    \n    for para in doc.paragraphs:\n        if start_marker in para.text:\n            in_block = True\n            # Remove marker from this paragraph\n            para.text = para.text.replace(start_marker, \"\")\n        \n        if in_block and not is_enabled:\n            paras_to_delete.append(para)\n            \n        if end_marker in para.text:\n            in_block = False\n            # Remove marker from this paragraph\n            para.text = para.text.replace(end_marker, \"\")\n```\n\n## Handling Split Placeholders\nUse a regex-based replacement strategy at the paragraph level.\n\n```python\nimport re\n\ndef replace_placeholders(para, data):\n    text = para.text\n    pattern = r\"\\{\\{([A-Z_0-9]+)\\}\\}\"\n    matches = re.findall(pattern, text)\n    \n    if not matches:\n        return False\n        \n    new_text = text\n    for key in matches:\n        placeholder = f\"{{{{{key}}}}}\"\n        if key in data:\n            new_text = new_text.replace(placeholder, str(data[key]))\n            \n    if new_text != text:\n        # Preserve first run formatting\n        if para.runs:\n            para.runs[0].text = new_text\n            for run in para.runs[1:]:\n                run.text = \"\"\n        else:\n            para.text = new_text\n        return True\n    return False\n```\n\n## Traversal Logic\nEnsure all parts of the document are reached:\n- `doc.paragraphs`\n- `doc.tables` (recurse into `cell.paragraphs` and `cell.tables`)\n- `doc.sections` (iterate `section.header.paragraphs` and `section.footer.paragraphs`)\n",{"name":5,"description":7},"main","726e1f79b96b0cb3d729d0e55a1c847e0b5353ae","skills\u002Fb4-skill-creator-gemini-3-flash-preview\u002Foffer-letter-generator\u002Fdocx-template-filling",8,"https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench","https:\u002F\u002Fcxcscmu.github.io\u002FSkillLearnBench","https:\u002F\u002Fgithub.com\u002Fcxcscmu","2026-10-02 22:55:36",{"source":8,"skillName":5,"commands":52,"prompt":62,"zipAvailable":63},[53,56,59],{"tool":54,"command":55},"npx","npx skills add cxcscmu\u002FSkillLearnBench --skill docx-template-filling",{"tool":57,"command":58},"bunx","bunx skills add cxcscmu\u002FSkillLearnBench --skill docx-template-filling",{"tool":60,"command":61},"pnpm","pnpm dlx skills add cxcscmu\u002FSkillLearnBench --skill docx-template-filling","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fb4-skill-creator-gemini-3-flash-preview\u002Foffer-letter-generator\u002Fdocx-template-filling\u002FSKILL.md",true,[],[66,79,101,118,137,148],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":38},"01M6KM5KH175P5ABP5JMX2SBDQ","object_counter","Count occurrences of an object in the image using computer vision algorithm.","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fhuman_authored\u002Fvideo-object-counting\u002Fobject_counter\u002FSKILL.md",[],[73,74,75,76,77,78],"object counter","object","vision","computer","Computer Vision","image",{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":38},"01M6KM51TMVXG79MMPCS6Y8G86","travel-planning-workflow","Invoke this skill when performing travel planning. It defines a structured workflow for generating itineraries. Following this workflow is essential to ensure the final plan satisfies user requirements.","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fhuman_authored\u002Ftravel-planning\u002Ftravel-planning-workflow\u002FSKILL.md",[],[86,87,88,89,90,91,92,93,94,95,96,97,98,99,100],"workflow","planning","planning workflow","travel","travel planning","travel planning workflow","structured","performing","plan","for","user","it","requirements","essential","itineraries",{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":38},"01M6KM4DY820XHS9YTSK5QP5HD","bundled-dataset-search-tool","invoke this skill when you need to perform database search for travel planning. This skill provides some useful pre-packaged tools to look up accommodations, attractions, cities, driving distance, flights, and restaurants from the bundled dataset.","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fhuman_authored\u002Ftravel-planning\u002Fbundled-dataset-search-tool\u002FSKILL.md",[],[108,109,110,111,112,113,114,89,115,116,90,26,95,117,87],"search","tool","dataset","bundled dataset search tool","restaurants","Tools","up","look","flights","database",{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":38},"01M6KM465BB9PQ0B548HQSVAWZ","glm-output","Output-processing guidance for GLM tasks. Especially useful after glm-basics and glm-calibration when you need verifier-matching metrics from output.nc and a final \u002Froot\u002Fmetrics.json.","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fhuman_authored\u002Ftemperature-simulation\u002Fglm-output\u002FSKILL.md",[],[125,126,127,95,128,129,34,130,131,132,133,134,26,135,136],"glm output","output","glm","tasks","metrics","basics","guidance","matching","verifier","processing","root","calibration",{"skillNo":138,"name":139,"nameZh":6,"description":140,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":141,"categories":142,"keywords":143,"publishedAt":38},"01M6KM40KY3QWDW5W97S39R2BC","glm-calibration","Calibration guidance for GLM tasks. Often most effective after glm-basics has clarified the setup; glm-output is the companion skill for exact final metric computation.","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fhuman_authored\u002Ftemperature-simulation\u002Fglm-calibration\u002FSKILL.md",[],[144,136,127,126,131,130,128,145,146,95,147],"glm calibration","setup","companion","metric",{"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":38},"01M6KM3VHHVSGMGHJQB3PPT6YG","glm-basics","A good starting point for GLM calibration tasks. Use to inspect glm3.nml, confirm how GLM runs, and identify the relevant files before moving on to calibration and output evaluation.","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fhuman_authored\u002Ftemperature-simulation\u002Fglm-basics\u002FSKILL.md",[],[155,127,130,156,144,136,95,126,157,158,159,32,160,161,128],"glm basics","inspect","relevant","files","good","how","Evaluation"]