Skip to content
Back to skills

Write Spreadsheet Automation

ASecurity

Writes a VBA macro or Google Apps Script that automates a repetitive spreadsheet task, with a backup step, clear comments and a safe test run. Use when you repeat the same clicks every week.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 26, 2026
ai-agentsgo

Works with

  • cli

Security analysis

A100/100

Scanned November 26, 2026

npx -y skills add hermes-hq/hodios-dist --skill write-spreadsheet-automation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Write Spreadsheet Automation?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Write Spreadsheet Automation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hermes-hq-write-spreadsheet-automation/badge)](https://www.skillsdirectory.com/skills/hermes-hq-write-spreadsheet-automation)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: write-spreadsheet-automation
description: Writes a VBA macro or Google Apps Script that automates a repetitive spreadsheet task, with a backup step, clear comments and a safe test run. Use when you repeat the same clicks every week.
license: CC0-1.0
arguments:
  - task
  - app
  - sheet_layout
argument-hint: <task> [app] [sheet_layout]
disable-model-invocation: true
metadata:
  version: 1.0.0
  kind: prompt
  category: spreadsheets
  source: https://hermes-ide.com/prompts/write-spreadsheet-automation
  catalog: 2026.1014.1
---

# Write a spreadsheet automation

## Inputs

- `task` (required): The repetitive task step by step, as you do it by hand today, including how often and what triggers it.
- `app` (optional; one of: excel-vba, google-apps-script; default: google-apps-script): Which scripting environment to write for.
- `sheet_layout` (optional): Sheet names, header rows, column letters and where results should go. A few sample rows help.

Arguments fill these in order. If a required value is empty, take it from the user’s message or ask for it once.

<context>
You write spreadsheet automation for people who are not developers and who will run it on data that matters. A macro that overwrites the only copy of a month's numbers is worse than no macro. So every script you write backs up before it changes anything, can be tried in a dry run first, fails with a clear message instead of half-finishing, and is commented well enough that the next person can change it.
</context>

<task>
Write a $app script that automates this task:

<task_description>
$task
</task_description>

<sheet_layout>
$sheet_layout
</sheet_layout>

1. Restate the task as numbered steps the script will perform, with inputs and outputs for each. If the steps, sheet names or columns are unclear and would change the code, ask up to three specific questions and stop. If the layout is empty but the task names the sheets and columns, proceed and put every name in a configuration block at the top.
2. Write the script with this structure:
   - A configuration block at the top: sheet names, header row, columns, and a `DRY_RUN` flag set to true.
   - Validation first: required sheets and headers exist; stop with a clear message naming what is missing.
   - A backup step before any write: copy the affected sheet (or the file, for destructive bulk changes) with a timestamp in the name.
   - The work itself, reading and writing in bulk (read a range into an array, process it, write it back once), not cell by cell.
   - In dry-run mode, write nothing to the data; log or show what would change and how many rows.
   - A short summary at the end: rows processed, changed, skipped.
3. Find columns by header name, not fixed position, so inserting a column does not break the script.
4. Add comments that explain why, not what.
</task>

<constraints>
- If a built-in feature does the job without code (conditional formatting, a filter view, a pivot, Power Query), say so in one line first, then write the script only if the task still needs it.
- Excel VBA: use `Option Explicit`, declared types, error handling that restores `Application.ScreenUpdating` and `Application.Calculation` on exit, and no `Select` or `Activate`. Say that the file must be saved as .xlsm and that macros must be enabled.
- Google Apps Script: use V8 syntax (`const`, `let`, arrow functions), `getValues` and `setValues` on whole ranges, `SpreadsheetApp.getUi().alert` or `console.log` for messages, and `LockService` if the script can be triggered while someone edits. If it needs a time-driven or on-edit trigger, give the trigger setup and name the authorisation scopes it will request.
- Respect platform limits: Apps Script has a six-minute execution limit for most accounts; for large data, process in batches and say so.
- Never send email, call external URLs, delete sheets or files, or share anything unless the task explicitly asks for it. If it does, make that action off by default in the configuration and say so in Limits.
- Do not include credentials, tokens or personal data in the code.
</constraints>

<output_format>
## What it will do
Numbered steps in plain language, including what it changes and what it leaves alone.

## Script
The complete script in one code block.

## Install and run
Numbered steps for $app: where to paste it, how to run it, how to approve permissions, and how to add a button or trigger if useful.

## Test plan
Run with `DRY_RUN` on a copy of the file, what to check in the log, then the first real run and how to restore from the backup.

## Limits
Bullets: data size, edge cases not handled, and anything the user must keep stable (sheet names, headers).
</output_format>

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.