Xlsx

From HybridAIOne/hybridclaw · View interactive version

Xlsx is an AI agent skill from the GitHub repository HybridAIOne/hybridclaw. Create, edit, inspect, and analyze `.xlsx` spreadsheets and Excel workbooks. Use this skill whenever the user asks to make a spreadsheet, generate an Excel file, create a table as xlsx, import CSV/TSV to xlsx, or work with any `.xlsx` file.

How to use this skill

Skill file

XLSX

Use this skill whenever the user asks to create, inspect, analyze, or edit an .xlsx workbook, or to turn delimited tabular data into a polished .xlsx file.

Default Workflow

  1. For creation tasks, use skills/xlsx/scripts/create_xlsx.cjs to create a new workbook from headers/rows or JSON data. Fall back to a workspace .cjs script only when the bundled script cannot handle the requirement.
  2. Use skills/xlsx/scripts/import_delimited.cjs for messy CSV or TSV inputs when it saves time, then polish the workbook with xlsx-populate.
  3. Do table reshaping in plain JavaScript, then write the final workbook with xlsx-populate.
  4. After meaningful formula edits, run LibreOffice-backed recalculation when soffice is available so cached values and error checks are current.
  5. Save the finished workbook inside the workspace and return the .xlsx artifact.

Rules

Variant Guidance

Useful Commands

node skills/xlsx/scripts/create_xlsx.cjs output.xlsx --headers "Name,Age,City" --rows "Alice,30,NYC;Bob,25,LA" --json
node skills/xlsx/scripts/recalc.cjs workbook.xlsx --json
node skills/xlsx/scripts/import_delimited.cjs raw.csv cleaned.xlsx --json

Starter Pattern

const XlsxPopulate = require("xlsx-populate");

async function main() {
  const workbook = await XlsxPopulate.fromBlankAsync();
  const sheet = workbook.sheet(0).name("Summary");

  sheet.cell("A1").value("Revenue");
  sheet.cell("B1").value("Cost");
  sheet.cell("C1").value("Profit");
  sheet.cell("A2").value(120000);
  sheet.cell("B2").value(45000);
  sheet.cell("C2").formula("A2-B2");

  sheet.range("A1:C1").style({
    bold: true,
    horizontalAlignment: "center",
    fill: "D9EAF7"
  });

  sheet.freezePanes("A2");
  sheet.column("A").width(16);
  sheet.column("B").width(16);
  sheet.column("C").width(16);

  await workbook.toFileAsync("profit-summary.xlsx");
}

main();

Create a New Workbook

Use skills/xlsx/scripts/create_xlsx.cjs to create a professionally styled .xlsx from scratch. This is the preferred method for creation tasks.

With headers and rows

node skills/xlsx/scripts/create_xlsx.cjs output.xlsx --headers "Name,Age,City" --rows "Alice,30,NYC;Bob,25,LA" --json

With JSON data

node skills/xlsx/scripts/create_xlsx.cjs output.xlsx --json-data '[{"Name":"Alice","Age":30},{"Name":"Bob","Age":25}]' --json

With formulas

node skills/xlsx/scripts/create_xlsx.cjs output.xlsx --headers "Revenue,Cost,Profit" --rows "120000,45000,=A2-B2" --sheet-name "Summary" --json

The script applies professional styling automatically: bold headers with fill color, freeze panes at row 2, auto-filter, and auto-sized column widths. Numbers are auto-detected and written as numbers, not strings. Values starting with = are written as formulas.

CSV / TSV Import

Recalculation And Templates

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.