Skip to content
Documentation
Command

/start-10-3.en

Lesson command

From plugin
ai-agent-camp
345200 skills8 agents200 commands
Install
$ npx -y skills add minicoohei/ai-agent-camp --agent claude-code

How 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.md
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);
  if
Read more
Ships withai-agent-camp

AI 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

Get the whole plugin