1.3 KiB
1.3 KiB
AGENTS.md
This document provides context for AI agents operating on the mail_forwarding infrastructure in this repository.
Architecture
This directory contains Google Apps Script code configured as Infrastructure as Code (IaC). It automates the creation of email forwarding in Google Workspace by reading from a Google Sheet and dynamically creating/managing Workspace Groups.
Tooling
- We use
@google/claspto manage the deployment of the.tsfiles to Google Apps Script. - The entrypoint is
src/Code.ts. - The manifest is
src/appsscript.json.
Rules & Safeguards (CRITICAL)
- Never alter the
GROUP_DESCRIPTION_TAGlogic. The script achieves declarative state management by finding and deleting Workspace Groups that are NOT present in the Google Sheet. To prevent the catastrophic deletion of real, human-managed groups (e.g.,board@haumdaucher.de), the script relies on the[Auto-Forwarder] Managed by Google Sheetsstring in the group's description. The script must ALWAYS filter for this exact string before issuing any deletion API calls. - Always deploy via
clasp. Do not instruct the user to copy-paste code manually ifclaspis available. - Trigger: We use an
onChangetrigger instead ofonEditbecause the source sheet is populated automatically via Google Forms.onEditdoes not fire on Form submissions.