[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KK735XSN28EPZXGVT2C3GB":3,"skill-same:01M6KK735XSN28EPZXGVT2C3GB":75},{"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":48,"linkOnly":49,"markdownContent":50,"markdownBody":51,"frontMatter":52,"refName":53,"commitSha":54,"skillDirectory":55,"forksCount":56,"repositoryHtmlUrl":57,"repositoryHomepageUrl":58,"ownerHtmlUrl":59,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":60,"install":61,"resources":74},"01M6KK735XSN28EPZXGVT2C3GB","offer-letter-docx",null,"Fill Word offer letter templates with employee data, replacing {{PLACEHOLDER}} tokens and handling {{IF_CONDITION}}...{{END_IF_CONDITION}} conditional blocks. Use this skill whenever the user asks to generate, fill, or produce an offer letter from a .docx template and a JSON data file, or whenever you need to merge HR data into a Word document template with placeholders and optional sections (e.g. relocation package, signing bonus).","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-sonnet-4-6\u002Foffer-letter-generator\u002Foffer-letter-docx\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,41,42,43,44,45,46,47],"offer letter docx","offer letter","docx","end","conditional","fill","signing","you","with","hr","condition","tokens","document","use","Word","file","package","produce","generate","placeholder","2026-11-10 10:12:30",false,"---\nname: offer-letter-docx\ndescription: >\n  Fill Word offer letter templates with employee data, replacing {{PLACEHOLDER}}\n  tokens and handling {{IF_CONDITION}}...{{END_IF_CONDITION}} conditional blocks.\n  Use this skill whenever the user asks to generate, fill, or produce an offer\n  letter from a .docx template and a JSON data file, or whenever you need to\n  merge HR data into a Word document template with placeholders and optional\n  sections (e.g. relocation package, signing bonus).\n---\n\n# Offer Letter Template Filling\n\n## Overview\n\nFill a `.docx` offer letter template by:\n1. Replacing every `{{KEY}}` placeholder with values from a JSON data file.\n2. Handling `{{IF_KEY}}...{{END_IF_KEY}}` conditional blocks — keep content\n   (and strip markers) when the data field equals `\"Yes\"`, else remove the\n   entire block.\n3. Saving the result to a new `.docx` file.\n\n## Key Technical Notes\n\n- Use the **paragraph-level rebuild** strategy (see `docx` skill) to handle\n  placeholders that Word has split across XML runs.\n- Process: main body paragraphs → table cells (recursive) → headers\u002Ffooters.\n- Conditional blocks may span **multiple paragraphs**, so collect paragraphs\n  between IF\u002FEND_IF markers and remove or keep them as a group.\n\n## Algorithm\n\n### 1. Load document and data\n\n```python\nfrom docx import Document\nimport json, re\n\nwith open('employee_data.json') as f:\n    data = json.load(f)\n\ndoc = Document('offer_letter_template.docx')\n```\n\n### 2. Handle multi-paragraph conditional blocks first\n\nConditional blocks often span several paragraphs. Scan all paragraphs, track\nstate, and remove or keep the block:\n\n```python\ndef process_conditionals(paragraphs, data):\n    \"\"\"\n    Walk paragraph list; for each IF\u002FEND_IF pair decide to keep or drop.\n    Returns list of paragraphs to DELETE from the document.\n    \"\"\"\n    to_delete = []\n    in_block = False\n    condition_met = False\n    block_paras = []\n    condition_key = None\n\n    for para in paragraphs:\n        text = para.text\n\n        # Detect opening marker  (may also contain content on same line)\n        if_match = re.search(r'\\{\\{IF_([A-Z_]+)\\}\\}', text)\n        end_match = re.search(r'\\{\\{END_IF_([A-Z_]+)\\}\\}', text)\n\n        if if_match and not in_block:\n            condition_key = if_match.group(1)\n            condition_met = data.get(condition_key, '').strip().lower() == 'yes'\n            in_block = True\n            block_paras = [para]\n\n        elif end_match and in_block and end_match.group(1) == condition_key:\n            block_paras.append(para)\n            if condition_met:\n                # Keep content but strip IF\u002FEND_IF markers\n                for p in block_paras:\n                    clean = p.text\n                    clean = re.sub(r'\\{\\{IF_[A-Z_]+\\}\\}', '', clean)\n                    clean = re.sub(r'\\{\\{END_IF_[A-Z_]+\\}\\}', '', clean)\n                    if p.runs:\n                        p.runs[0].text = clean.strip()\n                        for r in p.runs[1:]:\n                            r.text = ''\n            else:\n                to_delete.extend(block_paras)\n            in_block = False\n            block_paras = []\n\n        elif in_block:\n            block_paras.append(para)\n\n    return to_delete\n\n\ndef delete_paragraphs(para_list):\n    \"\"\"Remove paragraphs from the document XML.\"\"\"\n    from docx.oxml.ns import qn\n    for para in para_list:\n        p = para._element\n        p.getparent().remove(p)\n```\n\n### 3. Replace placeholders in a paragraph\n\n```python\ndef replace_in_para(para, data):\n    text = para.text\n    if not re.search(r'\\{\\{[A-Z_]+\\}\\}', text):\n        return\n    new_text = text\n    for key, val in data.items():\n        new_text = new_text.replace('{{' + key + '}}', str(val))\n    if new_text != text and para.runs:\n        para.runs[0].text = new_text\n        for run in para.runs[1:]:\n            run.text = ''\n```\n\n### 4. Process all locations\n\n```python\ndef process_table(table, data):\n    for row in table.rows:\n        for cell in row.cells:\n            to_del = process_conditionals(cell.paragraphs, data)\n            delete_paragraphs(to_del)\n            for para in cell.paragraphs:\n                replace_in_para(para, data)\n            for nested in cell.tables:\n                process_table(nested, data)\n\n# Main body\nto_del = process_conditionals(list(doc.paragraphs), data)\ndelete_paragraphs(to_del)\n\nfor para in doc.paragraphs:\n    replace_in_para(para, data)\n\nfor table in doc.tables:\n    process_table(table, data)\n\n# Headers \u002F footers\nfor section in doc.sections:\n    for para in section.header.paragraphs:\n        replace_in_para(para, data)\n    for para in section.footer.paragraphs:\n        replace_in_para(para, data)\n```\n\n### 5. Save\n\n```python\ndoc.save('\u002Froot\u002Foffer_letter_filled.docx')\n```\n\n## Conditional Field Mapping\n\n| JSON field            | Condition key  | Trigger value |\n|-----------------------|----------------|---------------|\n| RELOCATION_PACKAGE    | RELOCATION     | Yes           |\n\nCheck `data.get('RELOCATION_PACKAGE')` against `'Yes'` (case-insensitive) to\ndecide whether to keep `{{IF_RELOCATION}}...{{END_IF_RELOCATION}}` blocks.\n\n## Common Pitfalls\n\n- Conditional markers may appear inline with other text on the same paragraph.\n- Always process conditionals **before** placeholder replacement so markers\n  are gone before the final text pass.\n- `doc.paragraphs` is a flat list; tables have their own paragraph trees.\n- Deleting paragraphs modifies the XML tree — build the delete list first,\n  then remove after the scan loop.\n","# Offer Letter Template Filling\n\n## Overview\n\nFill a `.docx` offer letter template by:\n1. Replacing every `{{KEY}}` placeholder with values from a JSON data file.\n2. Handling `{{IF_KEY}}...{{END_IF_KEY}}` conditional blocks — keep content\n   (and strip markers) when the data field equals `\"Yes\"`, else remove the\n   entire block.\n3. Saving the result to a new `.docx` file.\n\n## Key Technical Notes\n\n- Use the **paragraph-level rebuild** strategy (see `docx` skill) to handle\n  placeholders that Word has split across XML runs.\n- Process: main body paragraphs → table cells (recursive) → headers\u002Ffooters.\n- Conditional blocks may span **multiple paragraphs**, so collect paragraphs\n  between IF\u002FEND_IF markers and remove or keep them as a group.\n\n## Algorithm\n\n### 1. Load document and data\n\n```python\nfrom docx import Document\nimport json, re\n\nwith open('employee_data.json') as f:\n    data = json.load(f)\n\ndoc = Document('offer_letter_template.docx')\n```\n\n### 2. Handle multi-paragraph conditional blocks first\n\nConditional blocks often span several paragraphs. Scan all paragraphs, track\nstate, and remove or keep the block:\n\n```python\ndef process_conditionals(paragraphs, data):\n    \"\"\"\n    Walk paragraph list; for each IF\u002FEND_IF pair decide to keep or drop.\n    Returns list of paragraphs to DELETE from the document.\n    \"\"\"\n    to_delete = []\n    in_block = False\n    condition_met = False\n    block_paras = []\n    condition_key = None\n\n    for para in paragraphs:\n        text = para.text\n\n        # Detect opening marker  (may also contain content on same line)\n        if_match = re.search(r'\\{\\{IF_([A-Z_]+)\\}\\}', text)\n        end_match = re.search(r'\\{\\{END_IF_([A-Z_]+)\\}\\}', text)\n\n        if if_match and not in_block:\n            condition_key = if_match.group(1)\n            condition_met = data.get(condition_key, '').strip().lower() == 'yes'\n            in_block = True\n            block_paras = [para]\n\n        elif end_match and in_block and end_match.group(1) == condition_key:\n            block_paras.append(para)\n            if condition_met:\n                # Keep content but strip IF\u002FEND_IF markers\n                for p in block_paras:\n                    clean = p.text\n                    clean = re.sub(r'\\{\\{IF_[A-Z_]+\\}\\}', '', clean)\n                    clean = re.sub(r'\\{\\{END_IF_[A-Z_]+\\}\\}', '', clean)\n                    if p.runs:\n                        p.runs[0].text = clean.strip()\n                        for r in p.runs[1:]:\n                            r.text = ''\n            else:\n                to_delete.extend(block_paras)\n            in_block = False\n            block_paras = []\n\n        elif in_block:\n            block_paras.append(para)\n\n    return to_delete\n\n\ndef delete_paragraphs(para_list):\n    \"\"\"Remove paragraphs from the document XML.\"\"\"\n    from docx.oxml.ns import qn\n    for para in para_list:\n        p = para._element\n        p.getparent().remove(p)\n```\n\n### 3. Replace placeholders in a paragraph\n\n```python\ndef replace_in_para(para, data):\n    text = para.text\n    if not re.search(r'\\{\\{[A-Z_]+\\}\\}', text):\n        return\n    new_text = text\n    for key, val in data.items():\n        new_text = new_text.replace('{{' + key + '}}', str(val))\n    if new_text != text and para.runs:\n        para.runs[0].text = new_text\n        for run in para.runs[1:]:\n            run.text = ''\n```\n\n### 4. Process all locations\n\n```python\ndef process_table(table, data):\n    for row in table.rows:\n        for cell in row.cells:\n            to_del = process_conditionals(cell.paragraphs, data)\n            delete_paragraphs(to_del)\n            for para in cell.paragraphs:\n                replace_in_para(para, data)\n            for nested in cell.tables:\n                process_table(nested, data)\n\n# Main body\nto_del = process_conditionals(list(doc.paragraphs), data)\ndelete_paragraphs(to_del)\n\nfor para in doc.paragraphs:\n    replace_in_para(para, data)\n\nfor table in doc.tables:\n    process_table(table, data)\n\n# Headers \u002F footers\nfor section in doc.sections:\n    for para in section.header.paragraphs:\n        replace_in_para(para, data)\n    for para in section.footer.paragraphs:\n        replace_in_para(para, data)\n```\n\n### 5. Save\n\n```python\ndoc.save('\u002Froot\u002Foffer_letter_filled.docx')\n```\n\n## Conditional Field Mapping\n\n| JSON field            | Condition key  | Trigger value |\n|-----------------------|----------------|---------------|\n| RELOCATION_PACKAGE    | RELOCATION     | Yes           |\n\nCheck `data.get('RELOCATION_PACKAGE')` against `'Yes'` (case-insensitive) to\ndecide whether to keep `{{IF_RELOCATION}}...{{END_IF_RELOCATION}}` blocks.\n\n## Common Pitfalls\n\n- Conditional markers may appear inline with other text on the same paragraph.\n- Always process conditionals **before** placeholder replacement so markers\n  are gone before the final text pass.\n- `doc.paragraphs` is a flat list; tables have their own paragraph trees.\n- Deleting paragraphs modifies the XML tree — build the delete list first,\n  then remove after the scan loop.\n",{"name":5,"description":7},"main","726e1f79b96b0cb3d729d0e55a1c847e0b5353ae","skills\u002Fb4-skill-creator-claude-sonnet-4-6\u002Foffer-letter-generator\u002Foffer-letter-docx",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":62,"prompt":72,"zipAvailable":73},[63,66,69],{"tool":64,"command":65},"npx","npx skills add cxcscmu\u002FSkillLearnBench --skill offer-letter-docx",{"tool":67,"command":68},"bunx","bunx skills add cxcscmu\u002FSkillLearnBench --skill offer-letter-docx",{"tool":70,"command":71},"pnpm","pnpm dlx skills add cxcscmu\u002FSkillLearnBench --skill offer-letter-docx","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fb4-skill-creator-claude-sonnet-4-6\u002Foffer-letter-generator\u002Foffer-letter-docx\u002FSKILL.md",true,[],[76,92,117,134,154,166],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":85,"publishedAt":48},"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",[82],{"categoryNo":83,"categoryName":84,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000016","图像与多媒体",[86,87,88,89,90,91],"object counter","object","vision","computer","Computer Vision","image",{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":101,"publishedAt":48},"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",[98],{"categoryNo":99,"categoryName":100,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000023","Skill与智能体开发",[102,103,104,105,106,107,108,109,110,111,112,113,114,115,116],"workflow","planning","planning workflow","travel","travel planning","travel planning workflow","structured","performing","plan","for","user","it","requirements","essential","itineraries",{"skillNo":118,"name":119,"nameZh":6,"description":120,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":48},"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",[],[124,125,126,127,128,129,130,105,131,132,106,35,111,133,103],"search","tool","dataset","bundled dataset search tool","restaurants","Tools","up","look","flights","database",{"skillNo":135,"name":136,"nameZh":6,"description":137,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":138,"categories":139,"keywords":140,"publishedAt":48},"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",[],[141,142,143,111,144,145,146,147,148,149,150,151,35,152,153],"glm output","output","glm","tasks","metrics","json","basics","guidance","matching","verifier","processing","root","calibration",{"skillNo":155,"name":156,"nameZh":6,"description":157,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":158,"categories":159,"keywords":161,"publishedAt":48},"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",[160],{"categoryNo":99,"categoryName":100,"taxonomyType":20,"taxonomyTypeDesc":21},[162,153,143,142,148,147,144,163,164,111,165],"glm calibration","setup","companion","metric",{"skillNo":167,"name":168,"nameZh":6,"description":169,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":170,"categories":171,"keywords":172,"publishedAt":48},"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",[],[173,143,147,174,162,153,111,142,175,176,177,41,178,179,144],"glm basics","inspect","relevant","files","good","how","Evaluation"]