Run3 Save Modified Word Document to Disk
[COLM'26] SkillLearnBench is the first benchmark for evaluating continual learning methods that automatically generate agent skills.
npx -y skills add cxcscmu/SkillLearnBench --skill run3_Save-Modified-Word-Document-to-DiskAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
What its author says it does
Copied from the file, not written here
Use this skill to write a modified python-docx Document object back to a .docx file, handling file paths and permissions correctly.
SKILL.md
0.7 KB, as published. Nobody here has run it
Algorithm
def save_document(doc, output_path):
try:
doc.save(output_path)
return True
except Exception as e:
raise IOError(f"Failed to save document to {output_path}: {e}")
Key Details
- The output path should be an absolute or relative path to the desired
.docxfile doc.save()overwrites existing files- Ensure the output directory exists or the parent path is writable
- Catch and report errors explicitly for debugging