/start-10-2.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-2.en
Context preview
What this command does when you run it.
Lesson command
Command definition
start-10-2.en.mddescription: "Lesson command"
chapter: "courses/aiagent/lesson03-core/module10-gas"
prerequisites: ["start-10-1"]
duration: "~30 min"
level: "intermediate"
tags: ["gas", "calendar", "google", "automation"]
nonInteractiveMode: deferred
๐ Lesson 10-2: Spreadsheet Automation with GAS
๐ What You'll Do
**Lesson 10-2: GAS and Google Calendar Integration**!
| Item | Details | |------|------| | Goal | Automate event operations from GAS using the Google Calendar API | | Duration | ~30 min | | Skills used | gas-clasp-ops, Google Calendar API, gogcli | | Prerequisites | Lesson 10-1 completed, GAS project created, Apps Script API enabled | | Course page | [Module 10: GAS](https://ai-agent.camp/en/course/module-10) alongside this lesson |
**Session flow:** 1. Create a calendar retrieval script 2. Create, update, and delete events 3. Configure triggers and notifications
By the end of this session, you will be able to automate calendar 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: Calendar Retrieval Script
**Prerequisite check (auto-run):** Verify the following before proceeding:
1. **Check for `.clasp.json`**: Verify that `gas-example/.clasp.json` exists. If not, complete 4-1 first. 2. **Verify Apps Script API is enabled**: Check that "Google Apps Script API" is ON at https://script.google.com/home/usersettings. 3. **`appsscript.json` oauthScopes configuration**: Add the following scopes to `gas-example/appsscript.json` to use the Calendar API:
{
"timeZone": "Asia/Tokyo",
"dependencies": {},
"exceptionLogging": "STACKDRIVER",
"runtimeVersion": "V8",
"oauthScopes": [
"https://www.googleapis.com/auth/calendar",
"https://www.googleapis.com/auth/script.external_request"
]
}> **Important**: If oauthScopes are not configured, a "Permission denied" error will occur when calling the Calendar API.
Use AskQuestion to choose "Proceed / Just review the example / Skip".
**AskQuestion configuration:**
{
"title": "๐ Step 1: Calendar Retrieval Script",
"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 Calendar.gs file in the gas-example directory with the following content:
function getDefaultCalendar() {
const calendar = CalendarApp.getDefaultCalendar();
Logger.log("Calendar name: " + calendar.getName());
Logger.log("Calendar ID: " + calendar.getId());
return calendar;
}
function getAllCalendars() {
const calendars = CalendarApp.getAllCalendars();
Logger.log("Total calendars: " + calendars.length);
calendars.forEach(calendar => {
Logger.log("- " + calendar.getName());
});
return calendars;
}
Please sync with clasp push.**Expected result:** Calendar.gs is synced to Google Drive, and you can retrieve the calendar list.
---
๐ Step 2: Event Creation Function
Use AskQuestion to choose "Proceed / Just review the example / Skip".
**AskQuestion configuration:**
{
"title": "๐ Step 2: Event Creation Function",
"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 event creation function to Calendar.gs:
function createSimpleEvent(title, startTime, endTime) {
const calendar = CalendarApp.getDefaultCalendar();
const event = calendar.createEvent(title, startTime, endTime);
Logger.log("Event created: " + title);
Logger.log("Event ID: " + event.getId());
return event.getId();
}
function createTomorrowEvent() {
const tomorrow = new Date();
tomorrow.setDate(tomorrow.getDate() + 1);
const startTime = new Date(tomorrow.getFullYear(), tomorrow.getMonth(), tomorrow.getDate(), 14, 0, 0);
const endTime = new Date(startTime.getTime() + 60 * 60 * 1000);
return createSimpleEvent("Test Event", startTime, endTime);
}
Please clasp push and run createTomorrowEvent in the GAS editor.**Expected result:** A one-hour "Test Event" starting at 14:00 tomorrow is added to the calendar.
---
๐ Step 3: Get Event List
Use AskQuestion to choose "Proceed / Just review the example / Skip".
**AskQuestion configuration:**
{
"title": "๐ Step 3: Get Event List",
"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 event retrieval function to Calendar.gs:
function getTodayEvents() {
const calendar = CalendarApp.getDefaultCalendar();
const today = new Date();
const dayStart = new Date(today.getFullYear(), today.getMonth(), today.getDate(), 0, 0, 0);
const dayRead more
description: "Lesson command" chapter: "courses/aiagent/lesson03-core/module10-gas" prerequisites: ["start-10-1"] duration: "~30 min" level: "intermediate" tags: ["gas", "calendar", "google", "automation"] nonInteractiveMode: deferred
๐ Lesson 10-2: Spreadsheet Automation with GAS
๐ What You'll Do
**Lesson 10-2: GAS and Google Calendar Integration**!
| Item | Details | |------|------| | Goal | Automate event operations from GAS using the Google Calendar API | | Duration | ~30 min | | Skills used | gas-clasp-ops, Google Calendar API, gogcli | | Prerequisites | Lesson 10-1 completed, GAS project created, Apps Script API enabled | | Course page | [Module 10: GAS](https://ai-agent.camp/en/course/module-10) alongside this lesson |
**Session flow:** 1. Create a calendar retrieval script 2. Create, update, and delete events 3. Configure triggers and notifications
By the end of this session, you will be able to automate calendar 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: Calendar Retrieval Script
**Prerequisite check (auto-run):** Verify the following before proceeding:
1. **Check for `.clasp.json`**: Verify that `gas-example/.clasp.json` exists. If not, complete 4-1 first. 2. **Verify Apps Script API is enabled**: Check that "Google Apps Script API" is ON at https://script.google.com/home/usersettings. 3. **`appsscript.json` oauthScopes configuration**: Add the following scopes to `gas-example/appsscript.json` to use the Calendar API:
{
"timeZone": "Asia/Tokyo",
"dependencies": {},
"exceptionLogging": "STACKDRIVER",
"runtimeVersion": "V8",
"oauthScopes": [
"https://www.googleapis.com/auth/calendar",
"https://www.googleapis.com/auth/script.external_request"
]
}> **Important**: If oauthScopes are not configured, a "Permission denied" error will occur when calling the Calendar API.
Use AskQuestion to choose "Proceed / Just review the example / Skip".
**AskQuestion configuration:**
{
"title": "๐ Step 1: Calendar Retrieval Script",
"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 Calendar.gs file in the gas-example directory with the following content:
function getDefaultCalendar() {
const calendar = CalendarApp.getDefaultCalendar();
Logger.log("Calendar name: " + calendar.getName());
Logger.log("Calendar ID: " + calendar.getId());
return calendar;
}
function getAllCalendars() {
const calendars = CalendarApp.getAllCalendars();
Logger.log("Total calendars: " + calendars.length);
calendars.forEach(calendar => {
Logger.log("- " + calendar.getName());
});
return calendars;
}
Please sync with clasp push.**Expected result:** Calendar.gs is synced to Google Drive, and you can retrieve the calendar list.
---
๐ Step 2: Event Creation Function
Use AskQuestion to choose "Proceed / Just review the example / Skip".
**AskQuestion configuration:**
{
"title": "๐ Step 2: Event Creation Function",
"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 event creation function to Calendar.gs:
function createSimpleEvent(title, startTime, endTime) {
const calendar = CalendarApp.getDefaultCalendar();
const event = calendar.createEvent(title, startTime, endTime);
Logger.log("Event created: " + title);
Logger.log("Event ID: " + event.getId());
return event.getId();
}
function createTomorrowEvent() {
const tomorrow = new Date();
tomorrow.setDate(tomorrow.getDate() + 1);
const startTime = new Date(tomorrow.getFullYear(), tomorrow.getMonth(), tomorrow.getDate(), 14, 0, 0);
const endTime = new Date(startTime.getTime() + 60 * 60 * 1000);
return createSimpleEvent("Test Event", startTime, endTime);
}
Please clasp push and run createTomorrowEvent in the GAS editor.**Expected result:** A one-hour "Test Event" starting at 14:00 tomorrow is added to the calendar.
---
๐ Step 3: Get Event List
Use AskQuestion to choose "Proceed / Just review the example / Skip".
**AskQuestion configuration:**
{
"title": "๐ Step 3: Get Event List",
"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 event retrieval function to Calendar.gs:
function getTodayEvents() {
const calendar = CalendarApp.getDefaultCalendar();
const today = new Date();
const dayStart = new Date(today.getFullYear(), today.getMonth(), today.getDate(), 0, 0, 0);
const dayAI 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

