Deploy Google Apps Script with Clasp

VerifiedCaution

Deploy a Google Apps Script web app using clasp, covering deployment ID hygiene, /exec vs /dev, archiving stale deployments, and authentication traps.

Sby Skills Guide Bot
DevOpsIntermediate
7/24/2026
Claude Code
#google-apps-script#clasp#deployment#release-management#web-app

Recommended for

Automated summary

Guides deployment of a Google Apps Script web app with clasp, focusing on deployment-ID hygiene, the /exec versus /dev distinction, and authentication pitfalls.

Strengths

  • Explicit pre-flight procedure (clasp version, push, checking that .clasp.json is gitignored)
  • Names four concrete, common traps: /exec vs /dev, ID drift, stale deployments, and caching or account mismatches
  • Insists on verifying the /exec URL in incognito instead of trusting a deploy exit code
  • Ties into a project runbook and CHANGELOG so deployment IDs and changes are recorded

Limitations

  • Assumes the repo has a docs/deploy-runbook.md with the deployment and script IDs
  • Does not cover installing clasp or setting up OAuth beyond checking the logged-in account
  • Command behavior depends on the installed clasp version
When to use it

Use it when deploying or redeploying an Apps Script web app while keeping previously shared /exec links working.

When not to use it

Avoid it for purely local development, or when no deployment runbook or clasp project exists yet.

Security analysis

Caution
Quality score90/100

No exfiltration, obfuscated payloads, destructive shell commands, or safety-disabling instructions. It uses Bash and network access to run clasp for legitimate deployments and is unusually careful (refuses to npm install -g, refuses to deploy unasked, verifies on /exec in incognito, warns about undeploying the live ID). The only real risk is that deploying is an outward-facing, partially irreversible production action, so it warrants 'caution' rather than 'safe'.

Findings
  • •Uses Bash to run clasp push/deploy, which publishes code to a live Google Apps Script project — an outward-facing, hard-to-reverse action (mitigated by explicit 'confirm before first deploy each session' rule)
  • •Defers to repo-local docs (docs/deploy-runbook.md, CLAUDE.md) as authoritative, with 'where they disagree, the runbook wins' — a mild instruction-source precedence/injection consideration since those files are untrusted input
  • •clasp undeploy can take a live app down; skill warns about it and requires confirmation but the capability remains
How this analysis is made

Examples

Redeploy existing web app
Push the latest changes to our gas-webapp and redeploy it, keeping the existing /exec URL working.
Check why the link is stale
clasp deploy succeeded but the shared link still shows the old version — figure out what's going on with this Apps Script deployment.
Clean up old deployments
List our Apps Script deployments and archive the stale ones, but make sure you don't undeploy the live one.

name: gas-deploy description: Deploy a Google Apps Script web app with clasp — deployment-ID hygiene, /exec versus /dev, archiving stale deployments, and the auth traps. Use when the user says "deploy", "push to Apps Script", "clasp deploy", or names a gas-webapp project. allowed-tools:

  • Bash
  • Read
  • Grep

gas-deploy

Apps Script deployment is a recurring source of lost time, almost always for one of four reasons below rather than anything to do with the code.

Read the repo's docs/deploy-runbook.md first — it holds this project's deployment IDs, script ID, and any project-specific steps. This skill is the procedure and the traps; the runbook is the specifics. Where they disagree, the runbook wins.

Never deploy unasked

~/.claude/CLAUDE.md and every scaffolded CLAUDE.md say it: run verify before every push, never deploy without being asked. Deployment is outward-facing. Confirm before the first clasp deploy of a session, every session.

1. Pre-flight

clasp --version
clasp push --watch=false

If clasp is not on PATH, stop and report the install command. Never npm install -g on the user's behalf.

Confirm .clasp.json exists and is gitignored, and that .clasp.json.example is committed with the script ID redacted (repo-standards §2.1 layer 3). A real script ID in a tracked file is the same class of mistake as a committed key.

2. The four traps, in the order they bite

  1. /exec versus /dev. /dev serves the current saved code to the owner and nobody else. /exec serves a specific numbered deployment to everyone. Testing on /dev and announcing on /exec is the single most common false "it works". Always verify on the /exec URL you are about to hand over.

  2. Deployment-ID drift. clasp deploy without -i creates a new deployment with a new ID and a new /exec URL. Every previously shared link keeps serving the old code. Redeploy the existing ID:

    clasp deployments
    clasp deploy -i <deployment-id> -d "<what changed>"
    

    Record the ID in docs/deploy-runbook.md and never create a second long-lived one.

  3. Stale deployments accumulate. Apps Script caps deployments per project. Archive with clasp undeploy <id> — but read clasp deployments first and confirm the ID is not the live one. Undeploying the live deployment takes the app down, and it is not undoable from the CLI.

  4. Auth and caching. A logged-in Google account that is not the script owner sees a stale or permission-denied page that looks like a deploy failure. Verify in an incognito window, signed in as the intended audience. clasp login --status confirms which account clasp itself is using; it is frequently not the one in the browser.

3. Verify

Open the /exec URL in incognito. Confirm the change is visible and the version string, if the app has one, matches what was just deployed. Do not report success from a clasp deploy exit code alone — it reports that the deployment was created, not that the app works.

4. Record

Append to CHANGELOG.md under Unreleased if the deployment carries a user-visible change, and update docs/deploy-runbook.md if any ID changed.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/deploy-google-apps-script-with-clasp-mryiqgn8/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/deploy-google-apps-script-with-clasp-mryiqgn8' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/deploy-google-apps-script-with-clasp-mryiqgn8/download' --output '.skill-downloads/deploy-google-apps-script-with-clasp-mryiqgn8/SKILL.md.part' && mv '.skill-downloads/deploy-google-apps-script-with-clasp-mryiqgn8/SKILL.md.part' '.skill-downloads/deploy-google-apps-script-with-clasp-mryiqgn8/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/deploy-google-apps-script-with-clasp-mryiqgn8/SKILL.md' && test -s '.skill-downloads/deploy-google-apps-script-with-clasp-mryiqgn8/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/gas-deploy' && cp -R '.skill-downloads/deploy-google-apps-script-with-clasp-mryiqgn8' '.claude/skills/gas-deploy'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/deploy-google-apps-script-with-clasp-mryiqgn8'

openskills read 'deploy-google-apps-script-with-clasp-mryiqgn8'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/deploy-google-apps-script-with-clasp-mryiqgn8/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills