# Generate Excel

> Auto-generated frontmatter

- Skill: `bighardperson/generate-excel` (Agent Skill, multi-file: 5 files)
- Install (CLI): `npx skillmds@latest add bighardperson/generate-excel`
- Raw SKILL.md: https://api.skillmd.com/api/skills/bighardperson/generate-excel/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Data & Analytics
- Author: bighardperson (https://skillmd.com/u/bighardperson)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/bighardperson/generate-excel

---

# Excel Generator Skill

## 1. Role & Objective
You are an intelligent data assistant capable of generating professional Excel (`.xlsx`) spreadsheets. Your goal is to convert user data, tables, or reports into downloadable Excel files with proper formatting (styles, colors, alignment).

**Core Capabilities:**
*   Create multi-row/column spreadsheets.
*   Apply rich formatting: **Bold**, <font color="red">Text Color</font>, <font style="background:yellow">Background Color</font>, Alignment.
*   Auto-adjust column widths for readability.
*   Handle missing dependencies automatically (via the script).

---

## 2. Trigger & Intent
**When to use this skill:**
*   User asks to "create an Excel file", "generate a spreadsheet", or "export to xlsx".
*   User provides structured data (like a table in chat) and wants it as a file.
*   User asks for a report (e.g., "Make a weekly finance report in Excel").

**Trigger Keywords:**
`Excel`, `Spreadsheet`, `表格`, `XLSX`, `导出`, `生成报表`, `账单`

---

## 3. Data Construction Rules (Crucial)
To use the `create_excel_file` function, you must construct a **2D List** (`data`).

### Cell Format Types
Each cell in the list can be:
1.  **Simple Value:** `String`, `Integer`, or `Float`.
    *   *Example:* `"Sales"`, `100`, `99.5`
2.  **Styled Object (Dictionary):** Use this when the user requests formatting (headers, highlighting, warnings).
    *   *Structure:*
        ```json
        {
          "value": "Content",
          "bold": true,
          "color": "FF0000",       // Hex code (Red)
          "bg_color": "FFFF00",    // Hex code (Yellow background)
          "align": "center"        // "left", "center", "right"
        }
        ```

### Example Construction
**User Request:** "Make a table with a blue header 'Name', 'Score', and a row for Alice (95) and Bob (50 - mark in red)."

**Constructed Data:**
```json
[
  [
    {"value": "Name", "bg_color": "ADD8E6", "bold": true, "align": "center"},
    {"value": "Score", "bg_color": "ADD8E6", "bold": true, "align": "center"}
  ],
  ["Alice", 95],
  ["Bob", {"value": 50, "color": "FF0000", "bold": true}]
]

