smk-labs/claude-config/appscript
- community
- ext:[{"type":"plugin","description":"Custom plugin integration"}]
Checking that the SKILL.md file is still in the repository.
Use this skill whenever the user wants to develop, edit, push, deploy, debug, or manage Google Apps Script (GAS) projects using the clasp CLI. Triggers on any mention of clasp, Apps Script, .gs files, script.google.com, appsscript.json, Google Sheets/Docs/Forms/Slides/Drive automation, GAS triggers, or local GAS development. Also use this when someone wants to automate Google Workspace, build a Sheet macro, create a web app on GAS, set up a time trigger, write any script that runs in Google's cloud, use TypeScript with Apps Script, create a GAS library, or integrate Gemini AI into a Sheet — even if they don't say "clasp" explicitly.
Install
npx vskill@latest install smk-labs/claude-config/appscriptSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
appscript — Google Apps Script via clasp
Develop, edit, and deploy Google Apps Script projects from the terminal. Full lifecycle: create/clone → edit locally → push → test → deploy. No browser copy-paste.
Quick Start
Edit your .gs files locally, then clasp push. That's the core loop.
Script Types: Bound vs. Standalone
This distinction matters for how you create, clone, and access data.
Standalone scripts — Created via script.google.com or clasp create-script. Live independently in Drive. Access Google services through explicit IDs (e.g., SpreadsheetApp.openById('...')).
Container-bound scripts — Created via "Extensions → Apps Script" from inside a Sheet, Doc, Form, or Slide. Tightly coupled to the parent file. Can call SpreadsheetApp.getActiveSpreadsheet() with no arguments because GAS knows which file the script belongs to. Triggers like onEdit(e) only work for bound scripts.
To work locally on a bound script:
- Open the Sheet/Doc → Extensions → Apps Script
- Gear icon (Project Settings) → copy the Script ID
clasp clone-script <scriptId>— now you have local files
Key behavioral difference:
Project Structure
All .gs files share a global scope — there are no modules, no import/export. A function defined in Utils.gs is automatically available in Code.gs. File load order matters for top-level declarations; control it with filePushOrder in .clasp.json if needed.
Always use V8 runtime in appsscript.json. V8 unlocks ES6+ (arrow functions, async/await syntax, destructuring). Without it you're on ES5 Rhino.
Daily Workflow
Running & Debugging
clasp run-function requires the project to be deployed as an API Executable or have a GCP project linked with Apps Script API enabled. Without that setup, push and test directly via the Apps Script editor at script.google.com, or trigger from a linked Sheet.
Versions & Deployments
Versions are immutable snapshots. Deployments point to a version and expose the script externally.
Deployment types (configured in appsscript.json):
- Web App —
doGet(e)/doPost(e)required; accessible via a public URL - API Executable — enables
clasp run-functionfrom external callers - Add-on — distributable via Google Workspace Marketplace
Authentication
API Management
TypeScript
Clasp v3 removed built-in TypeScript transpilation. The recommended pattern is to compile externally and push the output.
Setup:
rollup.config.js:
`.clasp.json` — point rootDir at the compiled output:
Build and push:
Type hints without TypeScript — install types for autocomplete in VS Code:
GAS Libraries
Libraries let you share code between GAS projects without copying files.
Using a library:
- Get the library's Script ID from its author
- Add to
appsscript.json:
- Access it as
MyLib.functionName()in your code
Creating a library:
- Write your script as normal
- Deploy as a "Library" type (in the script editor: Deploy → New Deployment → Library)
- Share the Script ID with consumers; they add a version number after each new deployment
Note: libraries add ~50ms of overhead per function call since GAS resolves them at runtime. For performance-critical hot paths, inline the code instead.
GAS Code Quality
Batch all Sheets operations
Every call to a Google service (Sheets, Drive, Gmail, etc.) is an HTTP round-trip costing ~100–500ms. In a loop, 100 individual cell reads become 100 serial requests — often enough to hit the 6-minute execution timeout. Read and write in bulk instead.
❌ 100 API calls — slow, risks timeout:
✅ 2 API calls — fast:
SpreadsheetApp.flush() is needed because GAS buffers writes. Skipping it means a read immediately after a write may return stale data.
Language limits
Store config in PropertiesService
Hardcoding API keys or settings in .gs files means they're pushed to Google and visible to script editors. Store them in PropertiesService instead — it persists across deployments and stays out of source files.
Common Patterns
Web app (HTTP handler):
Time-based trigger:
External HTTP request:
Cache expensive fetches (up to 6 hours):
Rate limit protection with sleep:
Gemini AI (via Ai service — GAS native):
Note: Ai service requires the project to have a linked GCP project with the Vertex AI or Generative Language API enabled. Alternatively, call the Gemini REST API via UrlFetchApp.fetch() with your own API key.
Troubleshooting
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/appscript/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Extension points
pluginCustom plugin integration
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/smk-labs/claude-config/appscript)