[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KJZ4G39ZAR39BSQJBFRCDB":3,"skill-same:01M6KJZ4G39ZAR39BSQJBFRCDB":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},"01M6KJZ4G39ZAR39BSQJBFRCDB","docx-template-fill",null,"Fill Word document (.docx) templates that use placeholder syntax like {{PLACEHOLDER}}. Handles split placeholders (where Word splits a placeholder across multiple XML runs), conditional sections ({{IF_X}}...{{END_IF_X}}), and preserves formatting. Use this skill whenever the user asks to fill a Word template, generate a document from a template, or replace placeholders in a .docx file.","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-claude-opus-4-6\u002Foffer-letter-generator\u002Fdocx-template-fill\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"docx template fill","fill","template","docx","use","conditional","splits","split","end","formatting","across","document","user","syntax","Word","templates","file","xml","generate","placeholder","2026-11-10 10:12:30",false,"---\nname: docx-template-fill\ndescription: >\n  Fill Word document (.docx) templates that use placeholder syntax like {{PLACEHOLDER}}.\n  Handles split placeholders (where Word splits a placeholder across multiple XML runs),\n  conditional sections ({{IF_X}}...{{END_IF_X}}), and preserves formatting.\n  Use this skill whenever the user asks to fill a Word template, generate a document\n  from a template, or replace placeholders in a .docx file.\n---\n\n# DOCX Template Fill\n\n## Core Challenge: Split Placeholders\n\nWord internally splits text into \"runs\" based on formatting changes, spell-check boundaries,\nor editing history. A placeholder like `{{COMPANY_NAME}}` may become three runs:\n`{{COMP` + `ANY_` + `NAME}}`. Naive per-run replacement will fail.\n\n## Strategy\n\n1. **Merge-then-replace at the run level**: For each paragraph (and header\u002Ffooter\u002Ftable cell\n   paragraph), concatenate all run texts, perform regex replacements on the merged string,\n   then redistribute text back to runs — putting all text in the first run and clearing the rest.\n   This preserves the first run's formatting.\n\n2. **Process all text containers**: Paragraphs live in the document body, but also in:\n   - Table cells (iterate `doc.tables[*].rows[*].cells[*].paragraphs`)\n   - Section headers (`doc.sections[*].header.paragraphs`)\n   - Section footers (`doc.sections[*].footer.paragraphs`)\n\n3. **Conditional sections**: For `{{IF_KEY}}...content...{{END_IF_KEY}}`:\n   - If condition is true (value is \"Yes\"), remove only the markers, keep content\n   - If condition is false, remove markers and all content between them\n   - Conditionals may span a single paragraph or the markers may be in separate runs\n\n## Implementation Pattern\n\n```python\nimport re, json\nfrom docx import Document\n\ndef replace_in_paragraph(paragraph, replacements):\n    \"\"\"Replace placeholders in a paragraph, handling split runs.\"\"\"\n    full_text = \"\".join(run.text for run in paragraph.runs)\n    if not full_text:\n        return\n    new_text = full_text\n    for key, value in replacements.items():\n        new_text = new_text.replace(\"{{\" + key + \"}}\", value)\n    if new_text != full_text:\n        # Put all text in first run, clear the rest (preserves first run's formatting)\n        for i, run in enumerate(paragraph.runs):\n            if i == 0:\n                run.text = new_text\n            else:\n                run.text = \"\"\n\ndef handle_conditional(paragraph, key, keep):\n    \"\"\"Handle {{IF_key}}...{{END_IF_key}} within a single paragraph.\"\"\"\n    full_text = \"\".join(run.text for run in paragraph.runs)\n    pattern = r\"\\{\\{IF_\" + key + r\"\\}\\}(.*?)\\{\\{END_IF_\" + key + r\"\\}\\}\"\n    if re.search(pattern, full_text):\n        if keep:\n            new_text = re.sub(pattern, r\"\\1\", full_text)\n        else:\n            new_text = re.sub(pattern, \"\", full_text)\n        for i, run in enumerate(paragraph.runs):\n            run.text = new_text if i == 0 else \"\"\n\ndef process_all_paragraphs(doc, func, *args):\n    \"\"\"Apply a function to every paragraph in the document.\"\"\"\n    for p in doc.paragraphs:\n        func(p, *args)\n    for table in doc.tables:\n        for row in table.rows:\n            for cell in row.cells:\n                for p in cell.paragraphs:\n                    func(p, *args)\n    for section in doc.sections:\n        for p in section.header.paragraphs:\n            func(p, *args)\n        for p in section.footer.paragraphs:\n            func(p, *args)\n```\n\n## Workflow\n\n1. Load data (JSON) and template (docx)\n2. Handle conditionals first (before placeholder replacement)\n3. Replace all `{{KEY}}` placeholders with values from data\n4. Save the filled document\n","# DOCX Template Fill\n\n## Core Challenge: Split Placeholders\n\nWord internally splits text into \"runs\" based on formatting changes, spell-check boundaries,\nor editing history. A placeholder like `{{COMPANY_NAME}}` may become three runs:\n`{{COMP` + `ANY_` + `NAME}}`. Naive per-run replacement will fail.\n\n## Strategy\n\n1. **Merge-then-replace at the run level**: For each paragraph (and header\u002Ffooter\u002Ftable cell\n   paragraph), concatenate all run texts, perform regex replacements on the merged string,\n   then redistribute text back to runs — putting all text in the first run and clearing the rest.\n   This preserves the first run's formatting.\n\n2. **Process all text containers**: Paragraphs live in the document body, but also in:\n   - Table cells (iterate `doc.tables[*].rows[*].cells[*].paragraphs`)\n   - Section headers (`doc.sections[*].header.paragraphs`)\n   - Section footers (`doc.sections[*].footer.paragraphs`)\n\n3. **Conditional sections**: For `{{IF_KEY}}...content...{{END_IF_KEY}}`:\n   - If condition is true (value is \"Yes\"), remove only the markers, keep content\n   - If condition is false, remove markers and all content between them\n   - Conditionals may span a single paragraph or the markers may be in separate runs\n\n## Implementation Pattern\n\n```python\nimport re, json\nfrom docx import Document\n\ndef replace_in_paragraph(paragraph, replacements):\n    \"\"\"Replace placeholders in a paragraph, handling split runs.\"\"\"\n    full_text = \"\".join(run.text for run in paragraph.runs)\n    if not full_text:\n        return\n    new_text = full_text\n    for key, value in replacements.items():\n        new_text = new_text.replace(\"{{\" + key + \"}}\", value)\n    if new_text != full_text:\n        # Put all text in first run, clear the rest (preserves first run's formatting)\n        for i, run in enumerate(paragraph.runs):\n            if i == 0:\n                run.text = new_text\n            else:\n                run.text = \"\"\n\ndef handle_conditional(paragraph, key, keep):\n    \"\"\"Handle {{IF_key}}...{{END_IF_key}} within a single paragraph.\"\"\"\n    full_text = \"\".join(run.text for run in paragraph.runs)\n    pattern = r\"\\{\\{IF_\" + key + r\"\\}\\}(.*?)\\{\\{END_IF_\" + key + r\"\\}\\}\"\n    if re.search(pattern, full_text):\n        if keep:\n            new_text = re.sub(pattern, r\"\\1\", full_text)\n        else:\n            new_text = re.sub(pattern, \"\", full_text)\n        for i, run in enumerate(paragraph.runs):\n            run.text = new_text if i == 0 else \"\"\n\ndef process_all_paragraphs(doc, func, *args):\n    \"\"\"Apply a function to every paragraph in the document.\"\"\"\n    for p in doc.paragraphs:\n        func(p, *args)\n    for table in doc.tables:\n        for row in table.rows:\n            for cell in row.cells:\n                for p in cell.paragraphs:\n                    func(p, *args)\n    for section in doc.sections:\n        for p in section.header.paragraphs:\n            func(p, *args)\n        for p in section.footer.paragraphs:\n            func(p, *args)\n```\n\n## Workflow\n\n1. Load data (JSON) and template (docx)\n2. Handle conditionals first (before placeholder replacement)\n3. Replace all `{{KEY}}` placeholders with values from data\n4. Save the filled document\n",{"name":5,"description":7},"main","726e1f79b96b0cb3d729d0e55a1c847e0b5353ae","skills\u002Fb4-skill-creator-claude-opus-4-6\u002Foffer-letter-generator\u002Fdocx-template-fill",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-fill",{"tool":57,"command":58},"bunx","bunx skills add cxcscmu\u002FSkillLearnBench --skill docx-template-fill",{"tool":60,"command":61},"pnpm","pnpm dlx skills add cxcscmu\u002FSkillLearnBench --skill docx-template-fill","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fb4-skill-creator-claude-opus-4-6\u002Foffer-letter-generator\u002Fdocx-template-fill\u002FSKILL.md",true,[],[66,79,100,118,138,149],{"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,30,96,97,98,99],"workflow","planning","planning workflow","travel","travel planning","travel planning workflow","structured","performing","plan","for","it","requirements","essential","itineraries",{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"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",[],[107,108,109,110,111,112,113,89,114,115,90,116,95,117,87],"search","tool","dataset","bundled dataset search tool","restaurants","Tools","up","look","flights","you","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,130,131,132,133,134,135,116,136,137],"glm output","output","glm","tasks","metrics","json","basics","guidance","matching","verifier","processing","root","calibration",{"skillNo":139,"name":140,"nameZh":6,"description":141,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":142,"categories":143,"keywords":144,"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",[],[145,137,127,126,132,131,128,146,147,95,148],"glm calibration","setup","companion","metric",{"skillNo":150,"name":151,"nameZh":6,"description":152,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":153,"categories":154,"keywords":155,"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",[],[156,127,131,157,145,137,95,126,158,159,160,22,161,162,128],"glm basics","inspect","relevant","files","good","how","Evaluation"]