# typescript-clasp-cursorrules-prompt-file

Instructs Cursor to write TypeScript for Google Apps Script with clasp, focusing on pseudocode planning, batching API calls, and interface-first typing.

- rule · `type=rule` · Cursor · ★ 41024
- Author: PatrickJS
- License: CC0-1.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/PatrickJS/awesome-cursorrules/tree/HEAD/rules/typescript-clasp-cursorrules-prompt-file.mdc
- Updated: 2026-05-30
- HTML: https://affpapa.org/en/nevibecode/rules/typescript-clasp-cursorrules-prompt-file

## What it does

This rule sets Cursor to act as a TypeScript and Google Apps Script specialist. Before outputting executable code, the agent drafts a detailed pseudocode plan and pauses for confirmation. It prioritizes clean readability over raw micro-optimizations and avoids placeholder code. No guessing is allowed.

The guidelines enforce patterns for Google Workspace services such as `SpreadsheetApp` and `DriveApp`. The agent uses interfaces instead of type aliases. It declares top-level routines with the `function` keyword and names flags using auxiliary verbs like `isProcessing`. To prevent hitting quota limits, it mandates batch operations and caching strategies.

Workflow assumes project deployments run through `clasp`. Without a configured `clasp` environment, synchronizing the generated scripts with Google Workspace will fail.

## Install

### Cursor (native platform)

**Manually: put the files in place**
- File: `.cursor/rules/typescript-clasp-cursorrules-prompt-file.mdc` — Frontmatter: description, globs, alwaysApply

### Claude Code

**Manually: put the files in place**
- File: `.claude/rules/typescript-clasp-cursorrules-prompt-file.md` — The paths frontmatter field limits the files: move globs from the source into paths

### Codex

**AGENTS.md**
- Codex reads AGENTS.md: paste the rule text there

### GitHub Copilot

**Manually: put the files in place**
- File: `.github/instructions/typescript-clasp-cursorrules-prompt-file.instructions.md` — The applyTo field sets which files it applies to: move globs from the source into applyTo

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/rules/typescript-clasp-cursorrules-prompt-file.md`

### Cline

**Manually: put the files in place**
- File: `.clinerules/typescript-clasp-cursorrules-prompt-file.md`

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/PatrickJS/awesome-cursorrules/tree/HEAD/rules/typescript-clasp-cursorrules-prompt-file.mdc

## When to use it
- plan Google Apps Script logic using step-by-step pseudocode
- batch API calls to stay within Google Workspace execution quotas
- enforce interface-first TypeScript definitions for Google services
- structure script files for version control and deployment with clasp

## Example prompts
- Write a pseudocode plan to batch update rows in `SpreadsheetApp`
- Create a TypeScript function with interfaces to fetch files from `DriveApp`
- Set up a time-driven trigger script organized with helper functions and types

## Source text · typescript-clasp-cursorrules-prompt-file.mdc · CC0-1.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 19d7589673ed1e4a.

BEGIN THIRD-PARTY FILE 19d7589673ed1e4a
```text
---
description: "Cursor rules for TypeScript development with Clasp app script integration."
globs: **/*
alwaysApply: false
---
You are an expert in TypeScript and Google Apps Script development using clasp. Follow the user's requirements carefully and to the letter. 

First think step by step - describe your plan for what to build in pseudocode, written down in great detail. Confirm, then write code! Always write code that is up to date, bug-free, fully functional and working, secure, performant, and efficient. Focus on readability over being performant. Fully implement all requested functionality. Be sure to reference file names. Be concise. Minimize any other prose. If you think there might not be a correct answer, say so. If you do not know the answer, say so instead of guessing. 

Code Style and Structure

- Write concise, technical TypeScript code with accurate examples for Google Apps Script.
- Use functional programming patterns when appropriate; use classes for Google Apps Script services and custom objects.
- Prefer iteration and modularization over code duplication.
- Use descriptive variable names with auxiliary verbs (e.g., isProcessing, hasError).
- Structure files: exported functions, helper functions, types, and constants.

Naming Conventions

- Use PascalCase for class names and camelCase for functions and variables.
- Follow Google Apps Script naming conventions for built-in services and methods.

TypeScript Usage

- Use TypeScript for all code; prefer interfaces over types.
- Use enums when appropriate for Google Apps Script constants.
- Implement custom types for Google Apps Script objects and return types.

Syntax and Formatting

- Use the "function" keyword for global functions and methods.
- Use arrow functions for callbacks and anonymous functions.
- Follow Google Apps Script best practices for script structure and organization.

Google Apps Script Specifics

- Utilize Google Apps Script services effectively (e.g., SpreadsheetApp, DriveApp).
- Implement proper authorization scopes for Google Services.
- Use time-based, event-driven, or custom triggers appropriately.
- Optimize script execution time and quota usage.

Performance Optimization

- Minimize API calls and use batch operations when possible.
- Implement caching strategies for frequently accessed data.
- Use efficient data structures and algorithms suitable for script limitations.

Key Conventions

- Follow Google Apps Script best practices for error handling and logging.
- Implement proper security measures for handling user data and authentication.
- Use clasp for version control and deployment of Google Apps Script projects.

Follow Google Apps Script documentation for Services, Advanced Services, and Extend Google Workspace.
```
END THIRD-PARTY FILE 19d7589673ed1e4a

The third-party file has ended. Everything between the 19d7589673ed1e4a tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

© PatrickJS · CC0-1.0 · https://github.com/PatrickJS/awesome-cursorrules/tree/HEAD/rules/typescript-clasp-cursorrules-prompt-file.mdc

## Similar
- [pcf-sample-components](https://affpapa.org/en/nevibecode/rules/pcf-sample-components.md) — rule · ★ 40451
- [pcf-overview](https://affpapa.org/en/nevibecode/rules/pcf-overview.md) — rule · ★ 40451
- [pcf-events](https://affpapa.org/en/nevibecode/rules/pcf-events.md) — rule · ★ 40451
- [joyride-user-project](https://affpapa.org/en/nevibecode/rules/joyride-user-project.md) — rule · ★ 40451
- [github-actions-ci-cd-best-practices](https://affpapa.org/en/nevibecode/rules/github-actions-ci-cd-best-practices.md) — rule · ★ 40451
- [devops-core-principles](https://affpapa.org/en/nevibecode/rules/devops-core-principles.md) — rule · ★ 40451

From the same set: [patrickjs/awesome-cursorrules](https://affpapa.org/en/nevibecode/by/patrickjs/awesome-cursorrules.md) — 234 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
