---
name: "openpyxl-conditional-formatting"
description: "Apply automated conditional formatting, data bars, and color scales with openpyxl."
metadata:
  author: "openpyxl"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "apply conditional formatting openpyxl"
  - "create excel heatmap python"
  - "add data bars in excel"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# openpyxl Conditional Formatting Rules

Configures dynamic spreadsheet formatting: ColorScaleRule (heatmaps), DataBarRule, IconSetRule, and cell value highlight rules (e.g. flagging negative margins in red).

## When to Invoke
Invoke this skill whenever you need to:
- apply conditional formatting openpyxl
- create excel heatmap python
- add data bars in excel

## Execution SOP & Rules
1. Import rule classes from openpyxl.formatting.rule (ColorScaleRule, CellIsRule).
2. Define range strings: ws.conditional_formatting.add("B2:B50", rule).
3. Use 3-color scales with min, mid, and max percentile anchors for statistical normalization.
4. Verify formatting rules render accurately across Microsoft Excel and LibreOffice Calc.

## 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.
