agentleFS
ethosagentethosagent/ethos/skills/document/export-excel/SKILL.md

export-excel

Skill22 starsChanged 9 days agoMITView on GitHub

Export structured tabular data to an Excel .xlsx file using a Node.js script and the exceljs library. The skill writes a generator script to gen-excel.js in the working directory, installs exceljs locally under .ethos-work/tools in the workspace if needed, then runs the script to produce the workbook. Handles multiple sheets, column headers, and typed cell values.

  • Installs packages

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 6 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If not found, stop and tell the user:

    line 50
  2. Distinctive:

    Do not proceed further.

    line 54
  3. Very specific:

    Use write_file to write a Node.js script to the relative path gen-excel.js, which resolves inside the working directory.

    line 66
  4. Very specific:

    Use exceljs to create a workbook with one sheet per logical table.

    line 69
  5. Distinctive:

    Write each row of data.

    line 71
  6. Distinctive:

    If not found, install it locally:

    line 110
  7. Distinctive:

    If install fails (no npm, no network, permission denied), stop and tell the user:

    line 116
  8. Very specific:

    All generated files go to the working directory.

    line 145
  9. Distinctive:

    Always tell the user the exact output path after completion.

    line 146
  10. Very specific:

    If node is not installed, show the fallback message verbatim — do not proceed.

    line 147
  11. Very specific:

    If exceljs install fails, show the fallback message verbatim — do not proceed.

    line 148

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Export Excel

Export structured tabular data to an Excel .xlsx file. A Node.js script using exceljs is written to a temp path, exceljs is installed locally if missing, and the script is run to produce the workbook. Output is written to the working directory as <filename>.xlsx.

When to use this skill

  • User asks to export data to Excel, save as .xlsx, create a spreadsheet, or produce a file they can open in Excel or Google Sheets.
  • The data is tabular (rows and columns) — query results, lists, comparison tables, reports.
  • User says "I need an Excel file", "export this as a spreadsheet", "make an xlsx".

When NOT to use this skill

  • User wants CSV — use the export-csv skill (simpler, no installation needed).
  • User wants a PDF or HTML report — use make-pdf or make-html-report.
  • The data is not tabular (free-form prose, charts only).
  • User wants formulas or charts in the workbook — this skill produces data-only workbooks; complex Excel features are out of scope.

Workflow

Step 1: Check that Node.js is available

which node 2>/dev/null || echo "not found"

If not found, stop and tell the user:

"This skill requires Node.js. Install it from https://nodejs.org, then try again."

Do not proceed further.

Step 2: Create the tools directory

mkdir -p .ethos-work/tools

.ethos-work/ is the workspace's scratch directory for agent work. The Ethos state dir (~/.ethos) is not usable from the terminal: the terminal guard refuses any command that names it.

Step 3: Write the generator script

Use write_file to write a Node.js script to the relative path gen-excel.js, which resolves inside the working directory. The script should:

  • Embed the data directly (as a JavaScript object literal).
  • Use exceljs to create a workbook with one sheet per logical table.
  • Set column headers from the data keys.
  • Write each row of data.
  • Save to the relative path <filename>.xlsx.

Minimal script template:

const ExcelJS = require('exceljs');

async function main() {
  const workbook = new ExcelJS.Workbook();
  const sheet = workbook.addWorksheet('Sheet1');

  // Set headers
  sheet.columns = [
    { header: 'Column A', key: 'colA', width: 20 },
    { header: 'Column B', key: 'colB', width: 20 },
  ];

  // Add rows
  const rows = [
    { colA: 'value1', colB: 'value2' },
  ];
  rows.forEach(row => sheet.addRow(row));

  await workbook.xlsx.writeFile('<filename>.xlsx');
  console.log('Done');
}

main().catch(err => { console.error(err); process.exit(1); });

Replace <filename> with a lowercase-hyphenated slug derived from the user's request (e.g. sales-data-2026-06). Embed the actual data in the rows array.

Step 4: Check if exceljs is available

test -d .ethos-work/tools/node_modules/exceljs && echo found || echo "not found"

If not found, install it locally:

npm install exceljs --prefix .ethos-work/tools

If install fails (no npm, no network, permission denied), stop and tell the user:

"This skill requires the exceljs npm package. Run: npm install exceljs --prefix .ethos-work/tools If npm is unavailable, ask your system administrator to install it."

Do not proceed further.

Step 5: Run the generator script

NODE_PATH="$PWD/.ethos-work/tools/node_modules" node gen-excel.js

Step 6: Confirm to the user

Tell the user:

"Excel file created at: <filename>.xlsx in the working directory — visible in the Documents tab."

Anti-patterns

  • Do not install exceljs globally — use --prefix .ethos-work/tools to keep it isolated and avoid permission issues.
  • Do not use an absolute output path in the script — write to a bare relative filename so the workbook lands in the working directory.
  • Do not write a generic script and ask the user to fill in the data — embed the actual data in the script before running it.
  • Do not produce an empty workbook — always include at least a header row.
  • Do not reuse a stale gen-excel.js from a previous run without overwriting it with the current data.

Hard rules

  • All generated files go to the working directory. Always write a relative path — never write the .xlsx outside the working directory.
  • Always tell the user the exact output path after completion.
  • If node is not installed, show the fallback message verbatim — do not proceed.
  • If exceljs install fails, show the fallback message verbatim — do not proceed.
  • The filename slug must be lowercase, hyphen-separated, and contain no spaces or special characters.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.