Agent skill
office-docs-error-handling
Sub-skill of office-docs: Error Handling (+2).
Install this agent skill to your Project
npx add-skill https://github.com/vamseeachanta/workspace-hub/tree/main/.claude/skills/_archive/data/office/office-docs/error-handling
SKILL.md
Error Handling (+2)
Error Handling
from pathlib import Path
def safe_document_generation(template_path, context, output_path):
"""Generate document with comprehensive error handling."""
try:
if not Path(template_path).exists():
raise FileNotFoundError(f"Template not found: {template_path}")
doc = DocxTemplate(template_path)
*See sub-skills for full details.*
## Temporary File Handling
```python
import tempfile
from contextlib import contextmanager
@contextmanager
def temp_document():
"""Create temporary document that auto-cleans."""
with tempfile.NamedTemporaryFile(suffix='.docx', delete=False) as f:
temp_path = f.name
try:
yield temp_path
finally:
Path(temp_path).unlink(missing_ok=True)
Streaming Large Files
def process_large_excel(file_path, chunk_size=1000):
"""Process large Excel files in chunks."""
from openpyxl import load_workbook
wb = load_workbook(file_path, read_only=True)
ws = wb.active
chunk = []
for row in ws.iter_rows(values_only=True):
*See sub-skills for full details.*
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
gsd-complete-milestone
Archive completed milestone and prepare for next version
gsd-reapply-patches
Reapply local modifications after a GSD update
gsd-verify-work
Validate built features through conversational UAT
gsd-thread
Manage persistent context threads for cross-session work
clinical-trial-protocol
Generate clinical trial protocols for medical devices or drugs through a modular, waypoint-based architecture with research-only and full protocol modes.
single-cell-rna-qc
Performs quality control on single-cell RNA-seq data (.h5ad or .h5 files) using scverse best practices with MAD-based filtering and comprehensive visualizations.
Didn't find tool you were looking for?