Skill: Session Handoff
Purpose
Preserve critical state when a session approaches context limits, so the next
session (or /resume-pipeline) can pick up seamlessly. Prevents lost work when
context compaction occurs or the user starts a new conversation.
When to Apply
Automatically when:
- A long multi-step workflow is in progress
- A multi-step Google Workspace workflow is in progress
- The pipeline involves external resource IDs (doc IDs, slide IDs, Drive folders)
- Before any pause point where the user might come back later
What to Save
Write to the EXACT path working/session_state.yaml (not session_state_handoff.yaml or any variant). The /resume-pipeline command looks for this specific file path.
This file MUST be comprehensive, regardless of how simple the handoff seems. Capture ALL of the following information:
Required Fields (always include):
- ✅ Dataset name and connection details
- ✅ Task description (what analysis/work is in progress)
- ✅ Pipeline progress (what's complete, what's next)
- ✅ All external resource IDs (Google Docs, Slides, Drive files) with URLs
- ✅ Local file inventory (working/ and outputs/ directories)
- ✅ Auth state (user email, last verified date)
- ✅ Known issues or blockers (write "None" if no issues)
- ✅ Resume instructions (step-by-step guide)
The Template (Use This Every Time)
Use the complete template. Fill every section (an empty section is "None"), because the next session has no other context.
Template:
# Session State — auto-generated by session-handoff skill
# Last updated: {{DATE}} {{TIME}}
dataset: "{{DATASET_NAME}}"
task: "brief description of what we're doing"
# External resource IDs (Google Workspace, etc.)
resources:
google_doc:
id: "18MTagnf_z5..."
title: "Document Title"
url: "https://docs.google.com/document/d/18MTagnf.../edit"
status: "content complete, needs formatting review"
google_slides:
id: "1in6mkRf..."
title: "Deck Title"
url: "https://docs.google.com/presentation/d/1in6mkRf.../edit"
status: "12 slides built, reviewer passed"
drive_folder:
id: "1PV9ols..."
name: "Folder Name"
drive_files:
- id: "1abc..."
name: "01_chart.png"
- id: "2def..."
name: "02_chart.png"
# Pipeline progress
pipeline:
last_completed_step: "chart generation"
current_step_status: "narrative draft 80% complete — context and findings done, recommendations need 2 more paragraphs" # Use this for partially-complete steps
next_step: "Google Doc creation"
steps_remaining:
- "Create Google Doc with proper image placement"
- "Run Google Doc Reviewer"
- "Final review of both deliverables"
# Local file inventory
local_files:
charts:
- outputs/charts/01_height_crossover.png
- outputs/charts/02_height_gap.png
data:
- outputs/ms_case_study/data.csv
working:
- working/narrative_draft.md
- working/storyboard.md
# Auth state (REQUIRED)
auth:
google_email: "user@example.com" # If not provided by user, check working files or note "unknown — verify at resume"
last_verified: "2026-03-05"
notes: "Tokens expire between sessions — expect re-auth"
# Known issues or blockers (REQUIRED — use "None" if no issues)
issues:
- "Google Doc images overlap with text — needs rebuild with proper placement"
- "Doc heading formatting was applied manually, may need re-check"
# OR if no issues:
# - "None — all work completed successfully"
# Resume instructions (REQUIRED)
resume:
command: "/resume-pipeline"
steps:
- "Verify auth for {{auth.google_email}}"
- "Load external resources"
- "Continue from: {{pipeline.next_step}}"
When to Write
Proactive triggers (write automatically):
- After creating any Google resource (doc, slides, Drive file)
- After completing a major pipeline phase (analysis, charting, doc creation)
- After any long stretch of tool calls in one workflow (the same trigger as "When to Apply" above)
- Before any operation that might run long (batch chart generation, etc.)
Reactive triggers (write when prompted):
- User says "save state", "let's pause", "I'll come back later"
- Context compaction warning from the system
/resume-pipeline is likely needed
How to Resume
At session start, check for existing state:
- Read
working/session_state.yaml if it exists
- Verify external resources still exist (quick API call to check doc/slides)
- Check auth (run auth-preflight skill)
- Report status to user:
Resuming from previous session:
- Google Doc: [title] — [status]
- Google Slides: [title] — [status]
- Charts: [N] uploaded to Drive
- Next step: [description]
- Auth: [OK/needs re-auth]
Rules
Write state after every external resource creation. A Google Doc ID is
impossible to recover if lost — save it immediately.
Include URLs, not just IDs. The user needs clickable links to verify
their resources.
Describe status in plain English. "content complete, needs formatting
review" is more useful than a boolean flag.
Reference, don't copy. Point at file paths instead of pasting narratives
or data into the state file.
Overwrite, don't append. Each write is a complete snapshot. The file
should reflect current state, not a history log.
Auth email is critical state. Always include the exact email used for
Google Workspace MCP calls — this is the #1 source of auth failures. If the
user hasn't mentioned their email, check for it in working files or previous
MCP calls. If truly unknown, note "email unknown — verify at resume time".
1---2name: session-handoff3description: Preserve critical state when a session approaches context limits so the next session can pick up seamlessly. Use this skill whenever you're in a long, multi-step workflow, working with Google Workspace resources (Docs, Slides, Drive), creating external resources that have IDs you need to track, running multi-step pipelines that might need to be resumed, approaching context limits, or when the user says things like "save state", "let's pause", "I'll come back later", "save progress", "I need to stop for now", "bookmark this", "save my work", or when you detect that a workflow involves multiple phases and the user might return later. This skill is CRITICAL after creating Google Docs, Slides, or Drive files — those resource IDs are impossible to recover if lost. Also apply proactively during analysis pipelines after major phases complete (data exploration done, charts generated, narrative written, deck created) so users can resume at natural checkpoints. Write session state immediately after any external resourc4---56# Skill: Session Handoff78## Purpose910Preserve critical state when a session approaches context limits, so the next11session (or `/resume-pipeline`) can pick up seamlessly. Prevents lost work when12context compaction occurs or the user starts a new conversation.1314## When to Apply1516Automatically when:17- A long multi-step workflow is in progress18- A multi-step Google Workspace workflow is in progress19- The pipeline involves external resource IDs (doc IDs, slide IDs, Drive folders)20- Before any pause point where the user might come back later2122---2324## What to Save2526Write to the EXACT path `working/session_state.yaml` (not `session_state_handoff.yaml` or any variant). The `/resume-pipeline` command looks for this specific file path.2728This file MUST be comprehensive, regardless of how simple the handoff seems. Capture ALL of the following information:2930**Required Fields (always include):**31- ✅ Dataset name and connection details32- ✅ Task description (what analysis/work is in progress)33- ✅ Pipeline progress (what's complete, what's next)34- ✅ All external resource IDs (Google Docs, Slides, Drive files) with URLs35- ✅ Local file inventory (working/ and outputs/ directories)36- ✅ Auth state (user email, last verified date)37- ✅ Known issues or blockers (write "None" if no issues)38- ✅ Resume instructions (step-by-step guide)3940---4142## The Template (Use This Every Time)4344**Use the complete template.** Fill every section (an empty section is "None"), because the next session has no other context.4546**Template:**4748```yaml49# Session State — auto-generated by session-handoff skill50# Last updated: {{DATE}} {{TIME}}5152dataset: "{{DATASET_NAME}}"53task: "brief description of what we're doing"5455# External resource IDs (Google Workspace, etc.)56resources:57 google_doc:58 id: "18MTagnf_z5..."59 title: "Document Title"60 url: "https://docs.google.com/document/d/18MTagnf.../edit"61 status: "content complete, needs formatting review"62 google_slides:63 id: "1in6mkRf..."64 title: "Deck Title"65 url: "https://docs.google.com/presentation/d/1in6mkRf.../edit"66 status: "12 slides built, reviewer passed"67 drive_folder:68 id: "1PV9ols..."69 name: "Folder Name"70 drive_files:71 - id: "1abc..."72 name: "01_chart.png"73 - id: "2def..."74 name: "02_chart.png"7576# Pipeline progress77pipeline:78 last_completed_step: "chart generation"79 current_step_status: "narrative draft 80% complete — context and findings done, recommendations need 2 more paragraphs" # Use this for partially-complete steps80 next_step: "Google Doc creation"81 steps_remaining:82 - "Create Google Doc with proper image placement"83 - "Run Google Doc Reviewer"84 - "Final review of both deliverables"8586# Local file inventory87local_files:88 charts:89 - outputs/charts/01_height_crossover.png90 - outputs/charts/02_height_gap.png91 data:92 - outputs/ms_case_study/data.csv93 working:94 - working/narrative_draft.md95 - working/storyboard.md9697# Auth state (REQUIRED)98auth:99 google_email: "user@example.com" # If not provided by user, check working files or note "unknown — verify at resume"100 last_verified: "2026-03-05"101 notes: "Tokens expire between sessions — expect re-auth"102103# Known issues or blockers (REQUIRED — use "None" if no issues)104issues:105 - "Google Doc images overlap with text — needs rebuild with proper placement"106 - "Doc heading formatting was applied manually, may need re-check"107 # OR if no issues:108 # - "None — all work completed successfully"109110# Resume instructions (REQUIRED)111resume:112 command: "/resume-pipeline"113 steps:114 - "Verify auth for {{auth.google_email}}"115 - "Load external resources"116 - "Continue from: {{pipeline.next_step}}"117```118119---120121## When to Write122123### Proactive triggers (write automatically):124- After creating any Google resource (doc, slides, Drive file)125- After completing a major pipeline phase (analysis, charting, doc creation)126- After any long stretch of tool calls in one workflow (the same trigger as "When to Apply" above)127- Before any operation that might run long (batch chart generation, etc.)128129### Reactive triggers (write when prompted):130- User says "save state", "let's pause", "I'll come back later"131- Context compaction warning from the system132- `/resume-pipeline` is likely needed133134---135136## How to Resume137138At session start, check for existing state:1391401. Read `working/session_state.yaml` if it exists1412. Verify external resources still exist (quick API call to check doc/slides)1423. Check auth (run auth-preflight skill)1434. Report status to user:144145```146Resuming from previous session:147- Google Doc: [title] — [status]148- Google Slides: [title] — [status]149- Charts: [N] uploaded to Drive150- Next step: [description]151- Auth: [OK/needs re-auth]152```153154---155156## Rules1571581. **Write state after every external resource creation.** A Google Doc ID is159 impossible to recover if lost — save it immediately.1601612. **Include URLs, not just IDs.** The user needs clickable links to verify162 their resources.1631643. **Describe status in plain English.** "content complete, needs formatting165 review" is more useful than a boolean flag.1661674. **Reference, don't copy.** Point at file paths instead of pasting narratives168 or data into the state file.1691705. **Overwrite, don't append.** Each write is a complete snapshot. The file171 should reflect current state, not a history log.1721736. **Auth email is critical state.** Always include the exact email used for174 Google Workspace MCP calls — this is the #1 source of auth failures. If the175 user hasn't mentioned their email, check for it in working files or previous176 MCP calls. If truly unknown, note "email unknown — verify at resume time".