---
name: "xlsxwriter-formatted-workbook"
description: "Generate multi-megabyte formatted Excel spreadsheets at blazing speeds with XlsxWriter."
metadata:
  author: "John McNamara"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "create large excel file xlsxwriter"
  - "add sparkline in excel python"
  - "protect worksheet xlsxwriter"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# XlsxWriter High-Speed Formatted Workbooks

Leverages XlsxWriter in Python for memory-optimized Excel generation: native charting, sparklines, rich string formatting, worksheet protection, and autofilter tables.

## When to Invoke
Invoke this skill whenever you need to:
- create large excel file xlsxwriter
- add sparkline in excel python
- protect worksheet xlsxwriter

## Execution SOP & Rules
1. Enable constant memory mode with workbook = xlsxwriter.Workbook(filename, {'constant_memory': True}).
2. Create reusable format objects with workbook.add_format({'bold': True, 'num_format': '$#,##0'}).
3. Add column autofilters with worksheet.autofilter('A1:G1000') for instant filtering.
4. Always close the workbook instance explicitly with workbook.close() to write data to disk.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
