
Google Apps Script
Generate Google Apps Script for Sheets menus, triggers, sidebars, email batches, PDF export, and external API calls without leaving Workspace.
Overview
Google-apps-script is an agent skill most often used in Build integrations (also Operate iterate, Grow lifecycle) that produces Google Apps Script automation for Sheets and Workspace.
Install
npx skills add https://github.com/jezweb/claude-skills --skill google-apps-scriptWhat is this skill?
- Structured workflow: clarify automation, generate script from template, then Extensions > Apps Script install steps
- Supports onOpen menus, onEdit / time-driven / form-submit triggers, dialogs, and sidebars
- Covers email notifications, PDF export, and external API integrations from sheet data
- Every script template expects header comment, top-level config constants, and `onOpen()` for menus
- Three-step workflow: understand automation, generate script, installation instructions
Adoption & trust: 1.2k installs on skills.sh; 841 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need repeatable Sheet automation—menus, triggers, email, PDFs, or API hooks—but do not want to hand-write Apps Script boilerplate from scratch.
Who is it for?
Solo builders automating Google Sheets workflows who are comfortable pasting code into Extensions > Apps Script.
Skip if: Teams needing a standalone Node backend, complex multi-tenant SaaS auth outside Google Workspace, or Claude-incompatible agents only—skill lists claude-code compatibility.
When should I use this skill?
User wants to automate a Google Sheet, build menus/sidebars/dialogs, schedule Sheet workflows, or asks how to script something in Sheets.
What do I get? / Deliverables
You get structured Apps Script with constants, `onOpen()`, trigger handlers, and step-by-step paste-into-Sheet installation guidance.
- Paste-ready Apps Script project
- Custom menu and trigger handlers
- Installation steps for the bound Sheet
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
First shelf placement is Build integrations because output is deployable script pasted into Extensions > Apps Script. Automations bind Sheets to email, webhooks, and scheduled jobs—integration work on Google's hosted runtime.
Where it fits
Add a custom menu that exports a tab to PDF and emails stakeholders from Sheet rows.
Fix a nightly time-driven trigger that syncs sheet metrics to an external webhook.
Send form-submit trigger emails to new leads captured in a linked Google Form.
Prototype a sidebar for manual CRM entries before building a full app backend.
How it compares
Workspace-hosted script generator—not an MCP server or local CLI for Google APIs.
Common Questions / FAQ
Who is google-apps-script for?
Indie operators and Claude Code users who automate Sheets with menus, triggers, sidebars, and outbound integrations.
When should I use google-apps-script?
In Build when wiring Sheet automations; in Operate when extending triggers or scheduled jobs; in Grow when sheet-driven email or reports support customer lifecycle.
Is google-apps-script safe to install?
Generated scripts may request Google scopes and external API access—review the Security Audits panel on this page and audit OAuth permissions before deploying.
SKILL.md
READMESKILL.md - Google Apps Script
# Google Apps Script Build automation scripts for Google Sheets and Workspace apps. Scripts run server-side on Google's infrastructure with a generous free tier. ## What You Produce - Apps Script code pasted into Extensions > Apps Script - Custom menus, dialogs, sidebars - Automated triggers (on edit, time-driven, form submit) - Email notifications, PDF exports, API integrations ## Workflow ### Step 1: Understand the Automation Ask what the user wants automated. Common scenarios: - Custom menu with actions (report generation, data processing) - Auto-triggered behaviour (on edit, on form submit, scheduled) - Sidebar app for data entry - Email notifications from sheet data - PDF export and distribution ### Step 2: Generate the Script Follow the structure template below. Every script needs a header comment, configuration constants at top, and `onOpen()` for menu setup. ### Step 3: Provide Installation Instructions All scripts install the same way: 1. Open the Google Sheet 2. **Extensions > Apps Script** 3. Delete any existing code in the editor 4. Paste the script 5. Click **Save** 6. Close the Apps Script tab 7. **Reload the spreadsheet** (onOpen runs on page load) ### Step 4: First-Time Authorisation Each user gets a Google OAuth consent screen on first run. For unverified scripts (most internal scripts), users must click: **Advanced > Go to [Project Name] (unsafe) > Allow** This is a one-time step per user. Warn users about this in your output. --- ## Script Structure Template Every script should follow this pattern: ```javascript /** * [Project Name] - [Brief Description] * * [What it does, key features] * * INSTALL: Extensions > Apps Script > paste this > Save > Reload sheet */ // --- CONFIGURATION --- const SOME_SETTING = 'value'; // --- MENU SETUP --- function onOpen() { const ui = SpreadsheetApp.getUi(); ui.createMenu('My Menu') .addItem('Do Something', 'myFunction') .addSeparator() .addSubMenu(ui.createMenu('More Options') .addItem('Option A', 'optionA')) .addToUi(); } // --- FUNCTIONS --- function myFunction() { // Implementation } ``` --- ## Critical Rules ### Public vs Private Functions Functions ending with `_` (underscore) are **private** and CANNOT be called from client-side HTML via `google.script.run`. This is a silent failure -- the call simply doesn't work with no error. ```javascript // WRONG - dialog can't call this, fails silently function doWork_() { return 'done'; } // RIGHT - dialog can call this function doWork() { return 'done'; } ``` **Also applies to**: Menu item function references must be public function names as strings. ### Batch Operations (Critical for Performance) Read/write data in bulk, never cell-by-cell. The difference is 70x. ```javascript // SLOW (70 seconds on 100x100) - reads one cell at a time for (let i = 1; i <= 100; i++) { const val = sheet.getRange(i, 1).getValue(); } // FAST (1 second) - reads all at once const allData = sheet.getRange(1, 1, 100, 1).getValues(); for (const row of allData) { const val = row[0]; } ``` Always use `getRange().getValues()` / `setValues()` for bulk reads/writes. ### V8 Runtime V8 is the **only** runtime (Rhino was removed January 2026). Supports modern JavaScript: `const`, `let`, arrow functions, template literals, destructuring, classes, async/generators. **NOT available** (use Apps Script alternatives): | Missing API | Apps Script Alternative | |-------------|------------------------| | `setTimeout` / `setInterval`