skills/google/google-drive-management/SKILL.md
Manages Google Drive files and folders through the Drive API. Search for files, read content, create and update documents, organize folders, manage permissions, and sync files. Use when working with Google Drive, uploading/downloading files, searching Drive content, or managing Drive organization.
npx skillsauth add astoreyai/claude-skills google-drive-managementInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Comprehensive Google Drive integration enabling search, file operations, folder management, permissions control, and content synchronization through the Google Drive API v3.
When asked to work with Google Drive:
1. Enable Google Drive API:
# Visit Google Cloud Console
# https://console.cloud.google.com/
# Enable Drive API for your project
# APIs & Services > Enable APIs and Services > Google Drive API
2. Create OAuth2 Credentials:
# In Google Cloud Console:
# APIs & Services > Credentials > Create Credentials > OAuth client ID
# Application type: Desktop app
# Download credentials as credentials.json
3. Install Dependencies:
pip install google-auth google-auth-oauthlib google-auth-httplib2 google-api-python-client --break-system-packages
4. Initial Authentication:
python scripts/authenticate.py
# Opens browser for Google sign-in
# Saves token.json for future use
See reference/setup-guide.md for detailed setup instructions.
Basic search:
python scripts/search_files.py --query "name contains 'report'"
Search patterns:
# By name
query = "name contains 'Q4 Report'"
# By type
query = "mimeType = 'application/vnd.google-apps.spreadsheet'"
# By folder
query = "'FOLDER_ID' in parents"
# Modified recently
query = "modifiedTime > '2025-01-01T00:00:00'"
# Combination
query = "name contains 'budget' and mimeType contains 'spreadsheet'"
Common searches:
# Find all PDFs
python scripts/search_files.py --type pdf
# Find files modified today
python scripts/search_files.py --modified-today
# Find files in specific folder
python scripts/search_files.py --folder "Project Documents"
# Search file content (for Google Docs/Sheets)
python scripts/search_files.py --content "quarterly review"
See reference/search-patterns.md for comprehensive query syntax.
Download files:
# Google Docs/Sheets/Slides
python scripts/download_file.py --file-id FILE_ID --format pdf
python scripts/download_file.py --file-id FILE_ID --format docx
python scripts/download_file.py --file-id FILE_ID --format xlsx
# Binary files (PDFs, images, etc.)
python scripts/download_file.py --file-id FILE_ID --output ./local-file.pdf
Read Google Docs as text:
# Export as plain text
python scripts/read_doc.py --file-id FILE_ID
# Export as markdown
python scripts/read_doc.py --file-id FILE_ID --format markdown
Read Sheets data:
# Get sheet as CSV
python scripts/read_sheet.py --file-id FILE_ID --sheet "Sheet1"
# Get specific range
python scripts/read_sheet.py --file-id FILE_ID --range "A1:D10"
Create Google Docs:
# Create new Doc
python scripts/create_doc.py --title "Meeting Notes" --content "..."
# Create from template
python scripts/create_from_template.py --template-id TEMPLATE_ID --title "Q4 Report"
Upload files:
# Upload any file
python scripts/upload_file.py --file ./local-file.pdf --folder-id FOLDER_ID
# Upload with metadata
python scripts/upload_file.py --file ./data.csv --name "Sales Data Q4" --description "Quarterly sales figures"
Create Sheets:
# Create with data
python scripts/create_sheet.py --title "Budget 2025" --data data.csv
# Create from scratch
python scripts/create_sheet.py --title "Tracking Sheet" --headers "Date,Task,Status,Owner"
Update Google Docs:
# Append content
python scripts/update_doc.py --file-id FILE_ID --append "New section..."
# Replace content
python scripts/update_doc.py --file-id FILE_ID --content "Complete new content"
# Update specific paragraph
python scripts/update_doc.py --file-id FILE_ID --find "old text" --replace "new text"
Update Sheets:
# Update range
python scripts/update_sheet.py --file-id FILE_ID --range "A1:B10" --values data.csv
# Append rows
python scripts/update_sheet.py --file-id FILE_ID --append --values new_data.csv
Create folders:
# Create folder
python scripts/create_folder.py --name "Project Alpha" --parent PARENT_ID
# Create nested structure
python scripts/create_folder.py --path "Projects/2025/Q1/Project Alpha"
Move files:
# Move to folder
python scripts/move_file.py --file-id FILE_ID --folder-id FOLDER_ID
# Move multiple files
python scripts/move_files.py --files file1_id,file2_id,file3_id --folder-id FOLDER_ID
List folder contents:
# List files in folder
python scripts/list_folder.py --folder-id FOLDER_ID
# Recursive listing
python scripts/list_folder.py --folder-id FOLDER_ID --recursive
Share files:
# Share with specific user
python scripts/share_file.py --file-id FILE_ID --email [email protected] --role writer
# Share with anyone with link
python scripts/share_file.py --file-id FILE_ID --anyone --role reader
# Share with domain
python scripts/share_file.py --file-id FILE_ID --domain company.com --role commenter
Permission roles:
owner - Full controlorganizer - Can organize files (Drive folders)fileOrganizer - Can organize fileswriter - Can editcommenter - Can commentreader - View onlyList permissions:
# View who has access
python scripts/list_permissions.py --file-id FILE_ID
Revoke access:
# Remove permission
python scripts/revoke_permission.py --file-id FILE_ID --email [email protected]
Scenario: Keep local project synced with Drive folder
# Download entire folder
python scripts/sync_folder.py --folder-id FOLDER_ID --local ./project --download
# Upload changes
python scripts/sync_folder.py --folder-id FOLDER_ID --local ./project --upload
# Bidirectional sync
python scripts/sync_folder.py --folder-id FOLDER_ID --local ./project --sync
Scenario: Convert all Docs in folder to PDF
# Export all docs
python scripts/batch_export.py --folder-id FOLDER_ID --format pdf --output ./exports/
Scenario: Move files to type-specific folders
# Auto-organize
python scripts/organize_files.py --source-folder FOLDER_ID --by-type
Scenario: Create local backup of Drive files
# Full backup
python scripts/backup_drive.py --output ./backup/ --include-versions
# Incremental backup
python scripts/backup_drive.py --output ./backup/ --since-last-backup
Scenario: Find all spreadsheets with "budget" and export data
# Search and process
python scripts/search_and_process.py \
--query "name contains 'budget' and mimeType contains 'spreadsheet'" \
--action export \
--format csv \
--output ./budgets/
Google Workspace:
MIME_TYPES = {
'doc': 'application/vnd.google-apps.document',
'sheet': 'application/vnd.google-apps.spreadsheet',
'slide': 'application/vnd.google-apps.presentation',
'form': 'application/vnd.google-apps.form',
'folder': 'application/vnd.google-apps.folder',
}
Export formats:
EXPORT_FORMATS = {
'doc': ['pdf', 'docx', 'odt', 'rtf', 'txt', 'html', 'epub'],
'sheet': ['pdf', 'xlsx', 'ods', 'csv', 'tsv', 'html'],
'slide': ['pdf', 'pptx', 'odp', 'txt'],
}
Common MIME types:
'application/pdf' - PDF
'image/jpeg' - JPEG image
'image/png' - PNG image
'text/plain' - Plain text
'application/zip' - ZIP archive
'video/mp4' - MP4 video
# Equals
"name = 'Budget.xlsx'"
# Contains
"name contains 'report'"
# Not equals
"mimeType != 'application/vnd.google-apps.folder'"
# Greater/Less than (dates)
"modifiedTime > '2025-01-01T00:00:00'"
"createdTime < '2024-12-31T23:59:59'"
# In (parents, owners)
"'FOLDER_ID' in parents"
"'[email protected]' in owners"
# Logical operators
"name contains 'Q4' and mimeType contains 'spreadsheet'"
"name contains 'draft' or name contains 'review'"
"not name contains 'old'"
# File properties
name, mimeType, fullText, modifiedTime, createdTime
trashed, starred, hidden, viewed
# Ownership/sharing
owners, writers, readers, parents
# Special
sharedWithMe, visibility
See reference/search-patterns.md for complete query reference.
Drive API quotas:
Best practices:
Common errors:
# 401 - Authentication failed
# Solution: Re-run authentication, check token.json
# 403 - Insufficient permissions
# Solution: Check OAuth scopes, request additional permissions
# 404 - File not found
# Solution: Verify file ID, check if file was deleted
# 429 - Rate limit exceeded
# Solution: Implement exponential backoff, reduce request frequency
# 500 - Backend error
# Solution: Retry with exponential backoff
Retry logic:
import time
from googleapiclient.errors import HttpError
def retry_request(request, max_retries=3):
for attempt in range(max_retries):
try:
return request.execute()
except HttpError as e:
if e.resp.status in [429, 500, 503]:
wait = (2 ** attempt) + random.random()
time.sleep(wait)
else:
raise
raise Exception("Max retries exceeded")
Never commit credentials:
# Add to .gitignore
credentials.json
token.json
client_secret*.json
Use minimal scopes:
# Only request needed permissions
SCOPES = ['https://www.googleapis.com/auth/drive.readonly']
Secure token storage:
# Set proper permissions
chmod 600 token.json
Rotate credentials regularly:
# Delete old token to force re-authentication
rm token.json
python scripts/authenticate.py
Available scopes:
# Full access
'https://www.googleapis.com/auth/drive'
# Read-only
'https://www.googleapis.com/auth/drive.readonly'
# File access (create/modify files created by app)
'https://www.googleapis.com/auth/drive.file'
# Metadata only
'https://www.googleapis.com/auth/drive.metadata.readonly'
# App data folder
'https://www.googleapis.com/auth/drive.appdata'
# Specific types
'https://www.googleapis.com/auth/drive.photos.readonly'
Choose the most restrictive scope that meets your needs.
The scripts/ directory contains utilities for all operations:
Authentication:
authenticate.py - Initial OAuth setuprefresh_token.py - Refresh expired tokenSearch:
search_files.py - Search Drive with queriesfind_by_name.py - Quick name-based searchfind_recent.py - Find recently modified filesFile Operations:
download_file.py - Download filesupload_file.py - Upload filesread_doc.py - Read Google Doc contentread_sheet.py - Read Sheets datacreate_doc.py - Create new Doccreate_sheet.py - Create new Sheetupdate_doc.py - Update Doc contentupdate_sheet.py - Update Sheet dataOrganization:
create_folder.py - Create foldersmove_file.py - Move fileslist_folder.py - List folder contentsorganize_files.py - Auto-organize by typeSharing:
share_file.py - Share files/folderslist_permissions.py - View permissionsrevoke_permission.py - Remove accessAdvanced:
sync_folder.py - Sync foldersbackup_drive.py - Backup Drive contentbatch_export.py - Batch operationssearch_and_process.py - Search with actionsSee individual scripts for detailed usage.
See examples/ for complete workflows:
"Token has been expired or revoked"
rm token.json
python scripts/authenticate.py
"Insufficient permissions"
"File not found"
"Rate limit exceeded"
For detailed information:
tools
# YouTube Transcriber Pipeline - Claude Code Skill **Version**: 1.0.0 | **Status**: Ready for Claude Code Integration ## Overview Complete 4-skill pipeline for extracting, formatting, organizing, and archiving YouTube transcripts. Integrates with Claude Code CLI using the system's configured API keys (no manual key management needed). ## Capabilities This skill provides a complete workflow: 1. **Extract Facts** - AI-powered fact extraction from transcripts (uses Claude API via Claude Code)
content-media
# YouTube Transcriber Skill Extract transcripts from YouTube videos, playlists, and channels with automatic intelligent processing. ## Overview One unified command that intelligently assesses input and handles everything—single videos, batch files, playlist expansion, channel extraction. No need to choose between commands; it figures out what to do. ## Capabilities - **Auto-Detect Input**: Single URL, file of URLs, playlist, channel - **Smart Expansion**: Automatically expands playlists/cha
development
# Trading Analysis Skill **Version**: 1.0.0 **Category**: Financial Analysis / Trading **Author**: Claude Code **Last Updated**: November 22, 2025 ## Overview Comprehensive trading performance analysis and edge identification system for Interactive Brokers accounts. Analyzes CSV statements to identify trading patterns, position sizing issues, time-of-day edges, and risk management problems. ## Features ### 1. **CSV Statement Parsing** - Parse Interactive Brokers activity statements (CSV for
development
# System Health Check & Cleanup Skill **Version**: 1.0.0 **Category**: System Administration / Performance Optimization **Author**: Claude Code **Last Updated**: November 22, 2025 ## Overview Automated system health monitoring and cleanup workflow. Diagnoses performance issues, identifies resource bottlenecks, fixes orphaned services, kills stale processes, and cleans cache bloat. Designed for archimedes (32c/125GB) but works on any Linux system. ## Features ### 1. **System Diagnostics** -