Skip to main content
rule

typescript-clasp-cursorrules-prompt-file — Cursor rule: setup & use

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

Install into Cursor · Manually: put the files in place All methods and platforms ↓
.cursor/rules/typescript-clasp-cursorrules-prompt-file.mdc
Open on GitHub

What typescript-clasp-cursorrules-prompt-file 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.

What it helps with

  • 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 for the agent

  • 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

How to install typescript-clasp-cursorrules-prompt-file

Manually: put the files in place

.cursor/rules/typescript-clasp-cursorrules-prompt-file.mdc

Frontmatter: description, globs, alwaysApply

Step by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules

Questions about typescript-clasp-cursorrules-prompt-file

How do I install typescript-clasp-cursorrules-prompt-file in Cursor?

Create .cursor/rules/typescript-clasp-cursorrules-prompt-file.mdc in your workspace root and paste the rule contents into it.

What does typescript-clasp-cursorrules-prompt-file do?

It configures Cursor to generate TypeScript for Google Apps Script, requiring pseudocode planning first and enforcing batch API operations with clasp workflows.

Which TypeScript conventions does the rule mandate?

The rule prefers interfaces over types, enums for Google Apps Script constants, and explicit function keywords for global functions.

Source text

typescript-clasp-cursorrules-prompt-file.mdc · CC0-1.0
---
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.

© PatrickJS · CC0-1.0 · PatrickJS/awesome-cursorrules

Similar IDE rules

All IDE rules for Automation and no-code: n8n, Zapier, Make →

From the same set234

The whole set →
typescript-nextjs-cursorrules-prompt-file This rule sets coding conventions for TypeScript and Next.js App Router, with guidance for React and Daisy UI with Tailwind. Use it to steer Cursor toward those patterns in a project. ★ 41,024repo stars typescript-llm-tech-stack-cursorrules-prompt-file Cursor rule for TypeScript projects integrating LLM stacks. Enforces functional programming, type aliases over interfaces, and strict library conventions. ★ 41,024repo stars typescript-expo-jest-detox-cursorrules-prompt-file A Cursor rule that points the assistant at TypeScript, React Native, Expo and mobile UI work. Useful when your app runs on Expo and you test it with Jest and Detox. ★ 41,024repo stars typescript-code-convention-cursorrules-prompt-file A Cursor rule that pins down TypeScript code style for Next.js App Router, React, Expo, tRPC and Tailwind projects. Useful when the agent writes code inconsistently. ★ 41,024repo stars toss-style-design-system This Cursor rule guides the agent toward restrained product interfaces with clear hierarchy, grayscale structure, and limited accent color. Use it when editing UI components or styles. ★ 41,024repo stars tokrepo-agent-discovery-cursorrules-prompt-file This Cursor rule makes the agent search TokRepo for existing skills, prompts and MCP configs before writing new ones, and verify every candidate before install. ★ 41,024repo stars testrail-test-case-cursorrules-prompt-file Sets up a QA engineer persona in Cursor to generate standardized TestRail test cases or convert automated specs into import-ready CSV files. ★ 41,024repo stars tensorflow-deep-learning This rule guides Cursor through TensorFlow project structure, data checks, model training, evaluation, and export. Use it when you want these practices applied to your Python files and notebooks. ★ 41,024repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor