/start-10-3.en
Lesson command
$ npx -y skills add minicoohei/ai-agent-camp --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/start-10-3.en
Context preview
What this command does when you run it.
Lesson command
Command definition
start-10-3.en.mddescription: "Lesson command"
chapter: "courses/aiagent/lesson03-core/module10-gas"
prerequisites: ["start-10-1", "start-10-2"]
duration: "~30 min"
level: "intermediate"
tags: ["gas", "sheets", "google", "automation"]
nonInteractiveMode: deferred
๐ Lesson 10-3: Scheduled Execution and Trigger Setup
๐ What You'll Do
**Lesson 10-3: GAS and Google Sheets Integration**!
| Item | Details | |------|------| | Goal | Automate spreadsheet reading/writing, data processing, and report generation from GAS | | Duration | ~30 min | | Skills used | gas-clasp-ops, Google Sheets API, gogcli | | Prerequisites | Lesson 10-1 and Lesson 10-2 completed, GAS project created | | Course page | [Module 10: GAS](https://ai-agent.camp/en/course/module-10) alongside this lesson |
**Session flow:** 1. Spreadsheet access 2. Data reading functionality 3. Data writing functionality 4. Report generation functionality 5. Automation workflow
By the end of this session, you will be able to automate Sheets integration.
> **๐ก Hint**: If the AI response stops midway, type "please continue" or "keep going" to resume. This is a Cursor behavior, not a malfunction.
---
๐ฏ Readiness Check
Let's first check that everything is ready.
**AskQuestion configuration:**
{
"title": "๐ฏ Pre-session check",
"questions": [{
"id": "readiness",
"prompt": "Are you ready?",
"options": [
{"id": "ready", "label": "Ready! Let's start"},
{"id": "check_prereq", "label": "Check prerequisites"},
{"id": "view_html", "label": "View the course page first"},
{"id": "different_lesson", "label": "Go to a different lesson"}
]
}]
}(ready โ Go to Step 1) (check_prereq โ Run prerequisite verification) (view_html โ Show course page path) (different_lesson โ Display module list)
---
๐ Step 1: Spreadsheet Access
Use AskQuestion to choose "Proceed / Just review the example / Skip".
**AskQuestion configuration:**
{
"title": "๐ Step 1: Spreadsheet Access",
"questions": [{
"id": "step_action",
"prompt": "What would you like to do with this step?",
"options": [
{"id": "practice", "label": "Proceed"},
{"id": "review", "label": "Just review the example"},
{"id": "skip", "label": "Skip"}
]
}]
}**Guidance after selection:** Input:
Please create a Sheets.gs file in the gas-example directory with the following content:
function getActiveSpreadsheet() {
const ss = SpreadsheetApp.getActiveSpreadsheet();
if (!ss) {
Logger.log("No active spreadsheet. Please create a new one.");
return null;
}
Logger.log("Spreadsheet: " + ss.getName());
Logger.log("Spreadsheet ID: " + ss.getId());
return ss;
}
function getAllSheets() {
const ss = SpreadsheetApp.getActiveSpreadsheet();
if (!ss) return [];
const sheets = ss.getSheets();
Logger.log("Total sheets: " + sheets.length);
sheets.forEach(sheet => {
Logger.log("- " + sheet.getName() + " (" + sheet.getLastRow() + " rows)");
});
return sheets;
}
Please sync with clasp push.**Expected result:** Sheets.gs is synced to Google Drive.
---
๐ Step 2: Data Reading Functions
Use AskQuestion to choose "Proceed / Just review the example / Skip".
**AskQuestion configuration:**
{
"title": "๐ Step 2: Data Reading Functions",
"questions": [{
"id": "step_action",
"prompt": "What would you like to do with this step?",
"options": [
{"id": "practice", "label": "Proceed"},
{"id": "review", "label": "Just review the example"},
{"id": "skip", "label": "Skip"}
]
}]
}**Guidance after selection:** Input:
Please add the following data reading functions to Sheets.gs:
function getDataRange(sheetName, range) {
const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheetByName(sheetName);
if (!sheet) {
Logger.log("Sheet not found: " + sheetName);
return [];
}
const data = sheet.getRange(range).getValues();
Logger.log("Data retrieved: " + range + " (" + data.length + " rows)");
return data;
}
function getAllData(sheetName) {
const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheetByName(sheetName);
if (!sheet) return [];
const lastRow = sheet.getLastRow();
const lastColumn = sheet.getLastColumn();
if (lastRow < 1) {
Logger.log("No data available");
return [];
}
return sheet.getRange(1, 1, lastRow, lastColumn).getValues();
}
Please sync with clasp push.**Expected result:** A function to read data from the spreadsheet is added.
---
๐ Step 3: Data Writing Functions
Use AskQuestion to choose "Proceed / Just review the example / Skip".
**AskQuestion configuration:**
{
"title": "๐ Step 3: Data Writing Functions",
"questions": [{
"id": "step_action",
"prompt": "What would you like to do with this step?",
"options": [
{"id": "practice", "label": "Proceed"},
{"id": "review", "label": "Just review the example"},
{"id": "skip", "label": "Skip"}
]
}]
}**Guidance after selection:** Input:
Please add the following data writing functions to Sheets.gs:
function writeSingleCell(sheetName, cell, value) {
const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheetByName(sheetName);
if (!sheet) {
Logger.log("Sheet not found: " + sheetName);
return false;
}
sheet.getRange(cell).setValue(value);
Logger.log("Cell write: " + cell + " = " + value);
return true;
}
function appendRow(sheetName, rowData) {
const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheetByName(sheetName);
if (!sheet) {
Logger.log("Sheet not found: " + sheetName);
return false;
}
sheet.appendRow(rowData);
Logger.log("Row added: " + rowData.join(", "));
return true;
}
function writeDataRange(sheetName, startCell, data) {
const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheetByName(sheetName);
ifRead more
description: "Lesson command" chapter: "courses/aiagent/lesson03-core/module10-gas" prerequisites: ["start-10-1", "start-10-2"] duration: "~30 min" level: "intermediate" tags: ["gas", "sheets", "google", "automation"] nonInteractiveMode: deferred
๐ Lesson 10-3: Scheduled Execution and Trigger Setup
๐ What You'll Do
**Lesson 10-3: GAS and Google Sheets Integration**!
| Item | Details | |------|------| | Goal | Automate spreadsheet reading/writing, data processing, and report generation from GAS | | Duration | ~30 min | | Skills used | gas-clasp-ops, Google Sheets API, gogcli | | Prerequisites | Lesson 10-1 and Lesson 10-2 completed, GAS project created | | Course page | [Module 10: GAS](https://ai-agent.camp/en/course/module-10) alongside this lesson |
**Session flow:** 1. Spreadsheet access 2. Data reading functionality 3. Data writing functionality 4. Report generation functionality 5. Automation workflow
By the end of this session, you will be able to automate Sheets integration.
> **๐ก Hint**: If the AI response stops midway, type "please continue" or "keep going" to resume. This is a Cursor behavior, not a malfunction.
---
๐ฏ Readiness Check
Let's first check that everything is ready.
**AskQuestion configuration:**
{
"title": "๐ฏ Pre-session check",
"questions": [{
"id": "readiness",
"prompt": "Are you ready?",
"options": [
{"id": "ready", "label": "Ready! Let's start"},
{"id": "check_prereq", "label": "Check prerequisites"},
{"id": "view_html", "label": "View the course page first"},
{"id": "different_lesson", "label": "Go to a different lesson"}
]
}]
}(ready โ Go to Step 1) (check_prereq โ Run prerequisite verification) (view_html โ Show course page path) (different_lesson โ Display module list)
---
๐ Step 1: Spreadsheet Access
Use AskQuestion to choose "Proceed / Just review the example / Skip".
**AskQuestion configuration:**
{
"title": "๐ Step 1: Spreadsheet Access",
"questions": [{
"id": "step_action",
"prompt": "What would you like to do with this step?",
"options": [
{"id": "practice", "label": "Proceed"},
{"id": "review", "label": "Just review the example"},
{"id": "skip", "label": "Skip"}
]
}]
}**Guidance after selection:** Input:
Please create a Sheets.gs file in the gas-example directory with the following content:
function getActiveSpreadsheet() {
const ss = SpreadsheetApp.getActiveSpreadsheet();
if (!ss) {
Logger.log("No active spreadsheet. Please create a new one.");
return null;
}
Logger.log("Spreadsheet: " + ss.getName());
Logger.log("Spreadsheet ID: " + ss.getId());
return ss;
}
function getAllSheets() {
const ss = SpreadsheetApp.getActiveSpreadsheet();
if (!ss) return [];
const sheets = ss.getSheets();
Logger.log("Total sheets: " + sheets.length);
sheets.forEach(sheet => {
Logger.log("- " + sheet.getName() + " (" + sheet.getLastRow() + " rows)");
});
return sheets;
}
Please sync with clasp push.**Expected result:** Sheets.gs is synced to Google Drive.
---
๐ Step 2: Data Reading Functions
Use AskQuestion to choose "Proceed / Just review the example / Skip".
**AskQuestion configuration:**
{
"title": "๐ Step 2: Data Reading Functions",
"questions": [{
"id": "step_action",
"prompt": "What would you like to do with this step?",
"options": [
{"id": "practice", "label": "Proceed"},
{"id": "review", "label": "Just review the example"},
{"id": "skip", "label": "Skip"}
]
}]
}**Guidance after selection:** Input:
Please add the following data reading functions to Sheets.gs:
function getDataRange(sheetName, range) {
const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheetByName(sheetName);
if (!sheet) {
Logger.log("Sheet not found: " + sheetName);
return [];
}
const data = sheet.getRange(range).getValues();
Logger.log("Data retrieved: " + range + " (" + data.length + " rows)");
return data;
}
function getAllData(sheetName) {
const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheetByName(sheetName);
if (!sheet) return [];
const lastRow = sheet.getLastRow();
const lastColumn = sheet.getLastColumn();
if (lastRow < 1) {
Logger.log("No data available");
return [];
}
return sheet.getRange(1, 1, lastRow, lastColumn).getValues();
}
Please sync with clasp push.**Expected result:** A function to read data from the spreadsheet is added.
---
๐ Step 3: Data Writing Functions
Use AskQuestion to choose "Proceed / Just review the example / Skip".
**AskQuestion configuration:**
{
"title": "๐ Step 3: Data Writing Functions",
"questions": [{
"id": "step_action",
"prompt": "What would you like to do with this step?",
"options": [
{"id": "practice", "label": "Proceed"},
{"id": "review", "label": "Just review the example"},
{"id": "skip", "label": "Skip"}
]
}]
}**Guidance after selection:** Input:
Please add the following data writing functions to Sheets.gs:
function writeSingleCell(sheetName, cell, value) {
const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheetByName(sheetName);
if (!sheet) {
Logger.log("Sheet not found: " + sheetName);
return false;
}
sheet.getRange(cell).setValue(value);
Logger.log("Cell write: " + cell + " = " + value);
return true;
}
function appendRow(sheetName, rowData) {
const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheetByName(sheetName);
if (!sheet) {
Logger.log("Sheet not found: " + sheetName);
return false;
}
sheet.appendRow(rowData);
Logger.log("Row added: " + rowData.join(", "));
return true;
}
function writeDataRange(sheetName, startCell, data) {
const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheetByName(sheetName);
ifAI Agent Training for Non-Engineers - Complete Guide to Claude Code / Cursor / Codex ### โ ๏ธ Before you clone Official repository (maintained by the authors): Running AI agents from this repo grants them shell, file-write, and external-API permissions on your
Other commands on ai-agent-camp.
- /check-setup.en
Top-level alias โ see lesson/check-setup.en.md for the full body.
Open command - /check-setup.es
Alias de nivel superior โ el cuerpo completo estรก en lesson/check-setup.es.md.
Open command - /check-setup
Top-level alias โ see lesson/check-setup.md for the full body.
Open command - /check-security.en
Lesson command
Open command - /check-security.es
Lesson command
Open command - /check-security
Lesson command
Open command

