Generates publication-ready math lesson plans from a Google Sheet, powered by Claude Code. Two lessons per run, output to Google Docs.
No Anthropic API key needed — Claude Code is the model. The Python scripts only handle Google API I/O.
pip install -r requirements.txtcp .env.example .env
# Edit .env — add GOOGLE_SHEET_ID and GOOGLE_DRIVE_FOLDER_IDPlace your service account JSON key at credentials/service_account.json.
Share with the service account email (client_email in the JSON key):
- Google Sheet → Viewer access
- Drive folder → Editor access
Open Claude Code in this repo and say:
Run the lesson plan workflow
Claude Code will:
- Fetch the next two lesson tabs from your Google Sheet
- Read
SKILL.mdfor the instructional design framework - Generate both lesson plans
- Create a Google Doc with both plans and print the URL
If credentials or GOOGLE_SHEET_ID are missing, the pipeline runs in dry-run mode:
- Create
sample_lesson.txtwith pasted lesson content - Claude Code generates plans from that content and prints to stdout instead of creating a Doc
One tab per lesson. Tab names encode order (e.g. Week 1 - Lesson 3 - Ratios).
Tabs named with "overview", "unit", "summary", etc. are automatically skipped.
Lesson data is read as a raw cell grid — no hardcoded column mappings. Merged cells appear as empty strings; Claude interprets the structure contextually.
state.json at the project root tracks progress:
{"last_completed_lesson": "Week 1 - Lesson 2 - Equivalent Ratios"}- Missing file → starts from the first lesson tab
- Each run advances by 2 lessons
- Reset by deleting or editing
state.json
src/fetch_lessons.py — reads Google Sheets, outputs lesson data as JSON
src/write_doc.py — creates Google Doc from two lesson plan files
SKILL.md — instructional design spec (source of truth for lesson format)
state.json — auto-generated, tracks last completed lesson
credentials/ — service account JSON key (never committed)
.env — Google config (never committed)
tmp/ — temp files during a run (auto-created, never committed)