agentsclimarketplace

Docx handler

Skill cxcscmu/SkillLearnBench/skills/b4-skill-creator-gemini-3.1-flash-lite-preview/offer-letter-generator/docx-handler

Handles reading, populating, and saving .docx files using the python-docx library. Use this skill for any tasks involving template filling or modifying Word documents.From its SKILL.md

Install
npx -y skills add cxcscmu/SkillLearnBench --skill docx-handler

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

SKILL.md

1.5 KB, 285 tokens by cl100k_base, as published. Nobody here has run it

DOCX Handler

Use this skill when you need to manipulate .docx files.

Basic Workflow

  1. Load document: doc = Document('path/to/template.docx')
  2. Iterate paragraphs/tables and replace placeholder text.
  3. Save document: doc.save('path/to/output.docx')

Handling Placeholders

Use a simple text replacement for paragraphs and tables:

from docx import Document

def replace_text(doc, old_text, new_text):
    for paragraph in doc.paragraphs:
        if old_text in paragraph.text:
            paragraph.text = paragraph.text.replace(old_text, new_text)
    
    for table in doc.tables:
        for row in table.rows:
            for cell in row.cells:
                for paragraph in cell.paragraphs:
                    if old_text in paragraph.text:
                        paragraph.text = paragraph.text.replace(old_text, new_text)

doc = Document('template.docx')
replace_text(doc, '{{NAME}}', 'John Doe')
doc.save('output.docx')

Handling Conditional Blocks

For conditional sections (e.g., {{IF_TAG}}...{{END_IF_TAG}}):

  1. Identify the paragraph(s) containing the opening and closing tags.
  2. If condition is true: remove tags, keep content.
  3. If condition is false: remove paragraph(s) containing the tags and everything between them.

What ships with it: 1 file

3.9 KB alongside SKILL.md, 1 of them executable

scripts/

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.