/fe-sa-automation:weekly-planning-reportfrom fe-sa-automation
Generate and EMAIL a comprehensive weekly planning report for the upcoming week. Reads Google Calendar for Mon-Fri, pulls account context from Salesforce and Logfood, sends a detailed HTML email with day-by-day schedule, account briefings, and action items, and optionally updates a shared Google Doc to-do list. Distinct from sa-planner (which outputs to terminal/doc, not email). Use when the user says 'email me a weekly prep report', 'send weekly planning email', 'weekly prep email with account briefings', 'email next week schedule', or wants a weekly briefing delivered via email.
Ships in fe-sa-automation. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Generates and emails a comprehensive weekly planning report covering next week's meetings, account briefings, and to-do list management. Reads Google Calendar for Mon–Fri, pulls Salesforce UCO and Logfood spend data, sends a detailed HTML prep email with day-by-day schedule and account briefings, and optionally updates a shared Google Doc to-do list.
How this differs from
sa-planner: Thesa-plannerskill generates a terminal-based brief and updates a Google Doc interactively. This skill produces a self-contained HTML email with embedded day-by-day schedule tables, account briefing sections with UCO tables and spend data, and action items — designed for async consumption (e.g., scheduled to arrive Sunday evening so you're prepped Monday morning). Usesa-plannerfor interactive terminal planning; use this skill when you want an email report delivered to yourself or your team.
Announce at start: "I'm using the weekly-planning-report skill to build and email your weekly prep report."
"Email me a weekly planning report for next week"
"Send a weekly prep email with account briefings and spend data"
"Weekly planning email — send to me and my manager, focus on Acme and GlobalCorp"
"Email next week's schedule with UCO context and action items"
Run all 3 auth checks in a single message as parallel Bash calls:
# Call 1 — Google auth
GOOGLE_AUTH=$(ls ~/.claude/plugins/cache/fe-vibe/fe-google-tools/*/skills/google-auth/resources/google_auth.py 2>/dev/null | sort -V | tail -1)
python3 "$GOOGLE_AUTH" token 2>/dev/null
# Call 2 — Salesforce auth
sf org display 2>/dev/null
# Call 3 — Logfood auth (for spend data)
databricks auth describe --profile logfood 2>/dev/null
If any auth fails, tell the user to run /google-auth, /salesforce-authentication, or /databricks-authentication (logfood profile) first. Continue with whichever sources are available — degrade gracefully.
| Parameter | Required | Description |
|---|---|---|
| recipients | Yes | Email addresses to send the weekly report to |
| accounts | No | Focus on specific accounts only (skip others) |
| todo_doc_id | No | Google Doc ID for shared to-do list (enables Step 7) |
| uco_sheet_url | No | Link to UCO tracking sheet (included in Quick Links bar) |
Parse these from the user's message. If recipients is not provided, ask for it before proceeding.
Step 1 → Step 2 → Step 3 → Step 4 → Step 5 → Step 6 → Step 7 (optional)
Auth Calendar Classify Account Build Send Update
Mon-Fri & Detect Context HTML Email To-Do Doc
Issues Email
Run the prerequisite auth checks above. Identify the user from their vibe profile:
cat ~/.vibe/profile 2>/dev/null
Extract user.name, user.email, user.salesforce_id. If the profile is missing, fall back to:
sf org display --json 2>/dev/null
Fetch all calendar events for next week (Monday through Friday) using gcal_builder.py with singleEvents=true to expand recurring events.
GOOGLE_AUTH=$(ls ~/.claude/plugins/cache/fe-vibe/fe-google-tools/*/skills/google-auth/resources/google_auth.py 2>/dev/null | sort -V | tail -1)
TOKEN=$(python3 "$GOOGLE_AUTH" token)
GCAL_BUILDER=$(ls ~/.claude/plugins/cache/fe-vibe/fe-google-tools/*/skills/google-calendar/resources/gcal_builder.py 2>/dev/null | sort -V | tail -1)
Compute next week's Monday and Friday:
NEXT_MONDAY=$(python3 -c "
from datetime import datetime, timedelta
today = datetime.now()
days_until_monday = (7 - today.weekday()) % 7
if days_until_monday == 0:
days_until_monday = 7
monday = today + timedelta(days=days_until_monday)
print(monday.strftime('%Y-%m-%dT00:00:00Z'))
")
NEXT_FRIDAY=$(python3 -c "
from datetime import datetime, timedelta
today = datetime.now()
days_until_monday = (7 - today.weekday()) % 7
if days_until_monday == 0:
days_until_monday = 7
friday = today + timedelta(days=days_until_monday + 4)
print(friday.strftime('%Y-%m-%dT23:59:59Z'))
")
python3 "$GCAL_BUILDER" list \
--time-min "$NEXT_MONDAY" \
--time-max "$NEXT_FRIDAY" \
--single-events true \
--max-results 50
Filter declined events: Remove any event where the user's responseStatus is "declined".
Capture htmlLink for every event — these are used to hyperlink meeting titles in the email.
Classify each event into one of these categories:
| Category | Badge Color | Detection Rule |
|---|---|---|
| Customer | #1B7F37 green | Has non-@databricks.com attendees |
| Internal | #0B5394 blue | All attendees are @databricks.com |
| 1:1 | #6A329F purple | Exactly 2 attendees |
| Travel | #B45F06 orange | Title contains "flight", "travel", "airport", or location keywords |
| PTO | #CC0000 red | Title contains "PTO", "OOO", "vacation", "out of office" |
| Focus | #434343 gray | Title contains "focus time", "no meetings", "blocked" |
Travel logistics detection:
PTO rules:
Overlap detection: Check all events across all types for time overlaps. Flag any pair of overlapping events.
For each account that has customer meetings next week, pull context from Salesforce and Logfood.
Salesforce — Active UCOs (U1–U5):
sf data query --query "SELECT Id, Name, Account__r.Name, Use_Case_Stage__c, Status__c, Next_Steps__c, Next_Steps_Date__c, Technical_Win__c, POC_Start_Date__c, POC_End_Date__c, (SELECT Id, Name, Status__c, Priority__c FROM Blockers__r WHERE Status__c != 'Closed') FROM UseCase__c WHERE Account__r.Name = '<ACCOUNT_NAME>' AND (OwnerId = '<USER_SF_ID>' OR Primary_Solution_Architect__c = '<USER_SF_ID>' OR Solution_Architect__c = '<USER_SF_ID>') AND Use_Case_Stage__c IN ('U1 - Identified','U2 - Evaluated','U3 - PoC/Testing','U4 - Production Approved','U5 - Scaled') ORDER BY Use_Case_Stage__c LIMIT 50" --json
Capture the UCO Id for each — these are used to build SFDC hyperlinks: https://<instance>.lightning.force.com/lightning/r/UseCase__c/<Id>/view
Logfood — 30-day and 7-day spend:
SELECT
SUM(CASE WHEN date >= CURRENT_DATE - 30 THEN list_cost_dollars ELSE 0 END) AS last_30d_dollars,
SUM(CASE WHEN date >= CURRENT_DATE - 7 THEN list_cost_dollars ELSE 0 END) AS last_7d_dollars
FROM main.fin_live_gold.daily_workspace_sku_aggregated
WHERE sfdc_account_id = '<ACCOUNT_ID>'
AND date >= CURRENT_DATE - 30
Run via the logfood profile:
databricks api post /api/2.0/sql/statements \
--profile logfood \
--json '{"warehouse_id": "<WAREHOUSE_ID>", "statement": "<SQL>", "wait_timeout": "30s"}'
Match meetings to UCOs: For each customer meeting, match it to relevant UCOs by keyword overlap between the meeting title/description and UCO names. Include matched UCOs in the meeting's Notes column.
Build the email as a single HTML string. The template structure is locked — follow this exact layout:
Dark header bar (background: #1B3A4B; color: white; padding: 16px 24px;):
Light blue bar (background: #E3F2FD; padding: 12px 24px;):
todo_doc_id provided): https://docs.google.com/document/d/<todo_doc_id>/edituco_sheet_url provided)Yellow banner (background: #FFF3CD; border-left: 4px solid #FFC107; padding: 12px 16px;):
4-column summary grid (display: grid; grid-template-columns: repeat(4, 1fr);):
| Total Meetings | Customer Meetings | Busiest Day | Top Account Spend |
|---|---|---|---|
| Count of all events | Count of customer events | Day name + count | Account name + 30d spend |
For each day, render:
Day header bar (background: #1B3A4B; color: white; padding: 8px 16px;):
Schedule table (width: 100%; border-collapse: collapse;):
| Time | Meeting | Type | Notes |
|---|---|---|---|
| 9:00 AM | Meeting Title | <badge> | UCO links, conflict warnings |
htmlLinkbackground: #1B7F37; color: white; padding: 2px 8px; border-radius: 4px;background: #0B5394; color: white;background: #6A329F; color: white;background: #B45F06; color: white;background: #CC0000; color: white;background: #434343; color: white;<a href="https://<instance>.lightning.force.com/lightning/r/UseCase__c/<Id>/view">UCO Name (Stage)</a>)<span style="color: #CC0000; font-weight: bold;">⚠ Overlaps with [other meeting]</span><span style="color: #B45F06;">✈ Travel window — may need to reschedule</span>For each account with customer meetings, render a briefing section:
Account header (background: #F5F5F5; padding: 12px 16px; border-left: 4px solid #1B7F37;):
Meetings subsection:
Spend subsection:
UCO Table:
| UCO Name | Stage | Next Steps | Next Steps Date | Related Meeting | Blockers |
|---|---|---|---|---|---|
| Name | U3 | ... | 3/18 | Tuesday 2pm call | 1 open |
Talking Points:
Numbered list of recommended actions for the week:
Light gray footer (background: #F5F5F5; padding: 12px 24px; font-size: 12px; color: #666;):
Send the HTML email using gmail_builder.py:
GMAIL_BUILDER=$(ls ~/.claude/plugins/cache/fe-vibe/fe-google-tools/*/skills/gmail/resources/gmail_builder.py 2>/dev/null | sort -V | tail -1)
Write the HTML to a temp file and send:
python3 "$GMAIL_BUILDER" send \
--to "<RECIPIENTS>" \
--subject "Weekly Planning Report — <WEEK_DATE_RANGE>" \
--html-file /tmp/weekly_planning_report.html
If gmail_builder.py doesn't support --html-file, use --body-html with the file content, or use the raw Gmail API as a last resort:
GOOGLE_AUTH=$(ls ~/.claude/plugins/cache/fe-vibe/fe-google-tools/*/skills/google-auth/resources/google_auth.py 2>/dev/null | sort -V | tail -1)
TOKEN=$(python3 "$GOOGLE_AUTH" token)
python3 << 'PYEOF'
import base64, json, urllib.request, os
token = os.environ.get("TOKEN") or open("/tmp/gauth_token.txt").read().strip()
html = open("/tmp/weekly_planning_report.html").read()
recipients = "<RECIPIENTS>"
subject = "Weekly Planning Report — <WEEK_DATE_RANGE>"
raw = f"To: {recipients}\r\nSubject: {subject}\r\nContent-Type: text/html; charset=utf-8\r\n\r\n{html}"
body = json.dumps({"raw": base64.urlsafe_b64encode(raw.encode()).decode()}).encode()
req = urllib.request.Request(
"https://gmail.googleapis.com/gmail/v1/users/me/messages/send",
data=body,
headers={"Authorization": f"Bearer {token}", "Content-Type": "application/json"},
method="POST"
)
resp = urllib.request.urlopen(req)
print(json.loads(resp.read()))
PYEOF
Before running, export the token: export TOKEN=$(python3 "$GOOGLE_AUTH" token)
Confirm to the user: "Weekly planning report sent to ."
Only run if todo_doc_id is provided. This step intelligently updates a shared Google Doc to-do list.
GOOGLE_AUTH=$(ls ~/.claude/plugins/cache/fe-vibe/fe-google-tools/*/skills/google-auth/resources/google_auth.py 2>/dev/null | sort -V | tail -1)
TOKEN=$(python3 "$GOOGLE_AUTH" token)
curl -s "https://docs.googleapis.com/v1/documents/<TODO_DOC_ID>" \
-H "Authorization: Bearer $TOKEN" \
-H "x-goog-user-project: gcp-sandbox-field-eng"
Parse the document structure. Identify:
☑ prefix)☐ or - [ ] prefix)For items that are checked/completed:
[3/15] ☑ Original task textGenerate new tasks from the weekly report data:
Deduplication: Before adding a new task, check if a similar task already exists in the doc (fuzzy match on account name + action verb). Skip duplicates.
Merge into existing sections:
Add hyperlinks:
htmlLink)Maintain this section order in the to-do doc:
Each section uses a Heading 2. Tasks within sections are bulleted lists with ☐ / ☑ prefixes.
Before writing any changes, present a summary to the user and wait for approval:
To-do doc changes pending:
- Archive: N completed items → Archive section
- Add: M new tasks (list them)
- Sections affected: [list sections]
Proceed with updating the to-do doc? (yes/no)
Only after the user confirms, apply the batch update:
curl -s -X POST "https://docs.googleapis.com/v1/documents/<TODO_DOC_ID>:batchUpdate" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-H "x-goog-user-project: gcp-sandbox-field-eng" \
-d '<BATCH_UPDATE_JSON>'
Confirm to the user: "To-do doc updated — archived N completed items, added M new tasks."
Detecting scheduled (non-interactive) mode: If the skill is invoked via claude --print (which is how fe-macos-scheduler runs skills), there is no interactive user to confirm with. In this case, skip the confirmation prompt and proceed automatically. The email report will include a summary of to-do doc changes made. You can detect non-interactive mode by checking if --print or --dangerously-skip-permissions flags are present in the invocation context.
This skill can be scheduled to run automatically every Sunday evening using the fe-macos-scheduler plugin:
Schedule weekly-planning-report to run every Sunday at 6pm — send to [email protected]
This uses macos-scheduler to create a launchd job that triggers the skill on a weekly cadence, so the prep email is waiting in your inbox Monday morning.
/sa-planner — daily/weekly todo and prioritized brief (proactive signals, not email-based)/customer-meeting-prep — deep-dive prep for individual meetings flagged in the report/google-calendar — direct calendar operations/gmail — direct email operations/salesforce-actions — update UCO next steps or create new UCOs/logfood-querier — ad-hoc consumption queries/uco-blockers — manage blocker lifecycle on flagged UCOsWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
5 skills in this plugin
/account-consumption-reportGenerate a comprehensive weekly or monthly consumption trend report for any Databricks customer account. Includes 16 embedded charts covering spend trends, product breakdown, workspace analysis, contract burndown, user adoption, competitive landscape, BI tool ecosystem, and whitespace opportunities. Delivered as an HTML email with inline charts. Use when the user says 'consumption report', 'account health email', 'weekly consumption email', 'spending report', 'consumption trend', or wants to generate a recurring consumption analysis for a customer./customer-question-monitorAutomated inbox scanning for customer questions with research-backed draft replies. Scans Gmail/Teams, researches via Glean/Slack/docs, creates Gmail drafts (never sends). Uses checkpoint dedup for scheduled runs. Use when the user says 'monitor inbox for customer questions', 'auto-scan and draft replies', or 'check for unanswered customer emails'./daily-meeting-prepGenerate and EMAIL a daily meeting prep brief for tomorrow. Reads Google Calendar, classifies meetings (customer/internal/1:1/travel/PTO), detects conflicts and travel logistics, pulls Salesforce UCO context, and sends a formatted HTML email to specified recipients. Distinct from sa-planner (which outputs to terminal/doc, not email). Use when the user says 'email me tomorrow prep', 'send daily prep email', 'daily meeting prep email', 'email me what I have tomorrow', or wants a daily briefing delivered via email.npx claudepluginhub sarah-hord-db/vibe --plugin fe-sa-automation