Skip to main content

seo-sheets-export

"You are the **SEOSONA Sheets Export Agent** โ€” you take completed SEO analysis reports from `3_MEMORY/seo_data/` and push them into a beautifully formatted Google Spreadsheet with color coding, charts, and shareable links."

Source facts

Repository
LongLeo287/SEOSONA-OS
Last source activity
August 4, 2026 at 05:01
Detected SKILL.md language
English
Stars
2
Forks
1

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.

Showing SKILL.md

SKILL.md
Source instructions ยท Read-only preview
name
seo_sheets_export
description
"You are the **SEOSONA Sheets Export Agent** โ€” you take completed SEO analysis reports from `3_MEMORY/seo_data/` and push them into a beautifully formatted Google Spreadsheet with color coding, charts, and shareable links."
# SEO Google Sheets Export ## Identity You are the **SEOSONA Sheets Export Agent** โ€” you take completed SEO analysis reports from `3_MEMORY/seo_data/` and push them into a beautifully formatted Google Spreadsheet with color coding, charts, and shareable links. --- ## Prerequisites Uses the **same service account** as `seo_gsc_integration`: ``` Config: 3_MEMORY/specs/gsc_config.json Service Account: 3_MEMORY/specs/gsc_service_account.json ``` Additional scope needed in service account: - `http~/.seosona/path/` - `http~/.seosona/path/` --- ## Spreadsheet Structure For each domain audited, create **1 master spreadsheet** with tabs: | Tab | Contents | Color Theme | |-----|----------|-------------| | **๐Ÿ“Š Overview** | SEO Health Score, key metrics summary | Blue header | | **๐Ÿ”‘ Keywords** | Keyword clusters, intent, volume, priority | Green | | **๐Ÿ” SERP Analysis** | Top 10 competitor breakdown, gaps | Orange | | **๐Ÿ”— Backlinks** | Referring domains, DR, toxic flags, gap | Red for toxic | | **๐Ÿ“ˆ Rank Tracking** | Position history, deltas, alerts | Conditional formatting | | **๐Ÿ”Ž GSC Data** | Queries, CTR opportunities, quick wins | Purple | --- ## API Calls Sequence ### Step 1: Create Spreadsheet ``` POST http~/.seosona/path/ { "properties": { "title": "SEO Report โ€” {domain} โ€” {date}" }, "sheets": [ { "properties": { "title": "Overview" } }, { "properties": { "title": "Keywords" } }, { "properties": { "title": "SERP Analysis" } }, { "properties": { "title": "Backlinks" } }, { "properties": { "title": "Rank Tracking" } }, { "properties": { "title": "GSC Data" } } ] } โ†’ Returns: spreadsheetId ``` ### Step 2: Write Data (batchUpdate) ``` POST http~/.seosona/path/:batchUpdate { "valueInputOption": "USER_ENTERED", "data": [ { "range": "Keywords!A1", "values": [[headers...], [row1...], ...] }, { "range": "Backlinks!A1", "values": [...] }, ... ] } ``` ### Step 3: Apply Formatting ``` POST http~/.seosona/path/:batchUpdate โ†’ Bold headers, freeze row 1, auto-resize columns โ†’ Conditional formatting: - Rank Delta < -5: RED background - Rank Delta > 5: GREEN background - CTR < 3%: YELLOW background (opportunity) - Toxic = true: RED text ``` ### Step 4: Share & Return Link ``` POST http~/.seosona/path/ { "role": "reader", "type": "anyone" } โ†’ Return shareable link: http~/.seosona/path/ ``` --- ## Node.js Implementation Save execution script to `3_MEMORY/ingestion_zone/seo_sheets_push.js`: ```javascript const { google } = require('googleapis'); const fs = require('fs'); const path = require('path'); async function pushToSheets(domain) { // Auth const keyFile = path.join(__dirname, '..', 'specs', 'gsc_service_account.json'); const auth = new google.auth.GoogleAuth({ keyFile, scopes: [ 'http~/.seosona/path/', 'http~/.seosona/path/' ] }); const sheets = google.sheets({ version: 'v4', auth }); const drive = google.drive({ version: 'v3', auth }); // 1. Create spreadsheet const { data: ss } = await sheets.spreadsheets.create({ requestBody: { properties: { title: `SEO Report โ€” ${domain} โ€” ${new Date().toISOString().split('T')[0]}` }, sheets: [ { properties: { title: '๐Ÿ“Š Overview' } }, { properties: { title: '๐Ÿ”‘ Keywords' } }, { properties: { title: '๐Ÿ” SERP Analysis' } }, { properties: { title: '๐Ÿ”— Backlinks' } }, { properties: { title: '๐Ÿ“ˆ Rank Tracking' } }, { properties: { title: '๐Ÿ”Ž GSC Data' } } ] } }); const id = ss.spreadsheetId; // 2. Write data from CSV exports const exportDir = path.join(__dirname, '..', 'seo_exports'); const updates = []; const csvFiles = { '๐Ÿ”‘ Keywords': `keyword_research_${domain}`, '๐Ÿ” SERP Analysis': `serp_analysis_`, '๐Ÿ”— Backlinks': `backlink_report_${domain}`, '๐Ÿ“ˆ Rank Tracking': `rank_tracking_${domain}`, '๐Ÿ”Ž GSC Data': `gsc_report_${domain}` }; for (const [tab, prefix] of Object.entries(csvFiles)) { const files = fs.readdirSync(exportDir).filter(f => f.startsWith(prefix) && f.endsWith('.csv')); if (files.length === 0) continue; const csv = fs.readFileSync(path.join(exportDir, files[files.length - 1]), 'utf-8'); const rows = csv.split('\r\n').map(line => line.split(',').map(c => c.replace(/^"|"$/g, ''))); updates.push({ range: `${tab}!A1`, values: rows }); } if (updates.length > 0) { await sheets.spreadsheets.values.batchUpdate({ spreadsheetId: id, requestBody: { valueInputOption: 'USER_ENTERED', data: updates } }); } // 3. Share publicly (view only) await drive.permissions.create({ fileId: id, requestBody: { role: 'reader', type: 'anyone' } }); const link = `http~/.seosona/path/${id}`; console.log(`\nโœ… Google Sheet created!\n๐Ÿ”— ${link}\n`); return link; } const domain = process.argv[2] || 'unknown'; pushToSheets(domain).catch(console.error); ``` --- ## Quick Commands ```bash # First export CSVs, then push to Sheets: node 3_MEMORY/ingestion_zone/seo_export.js node 3_MEMORY/ingestion_zone/seo_sheets_push.js yourdomain.com ``` --- ## Output ``` โœ… Google Sheet created! ๐Ÿ”— http~/.seosona/path/ ``` --- ## Activation Examples - "Export SEO report cแปงa domain X ra Google Sheet" - "Tแบกo Spreadsheet SEO cho website Y" - "Share bรกo cรกo keyword research dแบกng Google Sheets" - "Push rank tracking data lรชn Sheet"
View on GitHub