/fe-draft-replies-docs:draft-replies-docsfrom fe-draft-replies-docs
Scan Google Drive documents, JIRA tickets, and Confluence pages for open action items assigned to you — comments, assigned questions, meeting note tasks — and create a summary Google Doc. Use when the user mentions open action items, document comments, things assigned to me, meeting notes tasks, JIRA action items, Confluence tasks, document review, or doc inbox.
Ships in fe-draft-replies-docs. 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.
Scan Google Drive documents, JIRA tickets, and Confluence pages for open action items assigned to you, then create a summary Google Doc with a linked table of all items.
Run /google-auth first to authenticate with Google Workspace.
GOOGLE_AUTH=$(find ~/.claude/plugins/cache/fe-vibe/fe-google-tools/*/skills/google-auth/resources/google_auth.py 2>/dev/null | head -1)
python3 "$GOOGLE_AUTH" status || python3 "$GOOGLE_AUTH" login
TOKEN=$(python3 "$GOOGLE_AUTH" token)
For JIRA/Confluence scanning, the fe-jira-tools plugin must be configured with valid credentials.
The skill accepts optional arguments for timeframe and source filter:
7, 30, 1401-01-2025 09-03-2026Examples:
/draft-replies-docs — prompts for timeframe, then scans all sources/draft-replies-docs 30 — scan last 30 days, all sources/draft-replies-docs 10 gdrive — scan last 10 days, Google Drive only/draft-replies-docs 01-01-2025 09-03-2026 — scan Jan 2025 to Mar 2026, all sources/draft-replies-docs 30 jira — last 30 days, JIRA onlyGOOGLE_AUTH=$(find ~/.claude/plugins/cache/fe-vibe/fe-google-tools/*/skills/google-auth/resources/google_auth.py 2>/dev/null | head -1)
python3 "$GOOGLE_AUTH" status || python3 "$GOOGLE_AUTH" login
TOKEN=$(python3 "$GOOGLE_AUTH" token)
curl -s "https://www.googleapis.com/oauth2/v1/userinfo" \
-H "Authorization: Bearer $TOKEN" \
-H "x-goog-user-project: gcp-sandbox-field-eng"
Store: user_email, user_name, user_id (Google account ID). These are needed to match comment mentions, JIRA assignees, and action item ownership.
For JIRA/Confluence, identify the user's Atlassian account:
# Use the fe-jira-tools plugin's authentication
# The JIRA skill handles auth — invoke it to get the user's JIRA identity
The writing style analysis helps classify items and generate contextual action summaries. To save time and cost, the result is cached locally and only regenerated quarterly or on first use.
Cache location: ~/.claude/personal-plugins/style-cache/docs-style-profile.md
Check for cached profile:
~/.claude/personal-plugins/style-cache/docs-style-profile.mdgenerated_date in its YAML frontmattergenerated_date is less than 90 days old → use the cached profile, skip to Phase 3generated_date is more than 90 days old → regenerate (continue below)Regenerate style profile (only when cache is missing or stale):
comment ~ "user_name" AND updated >= "-90d"Save the profile to cache:
~/.claude/personal-plugins/style-cache/docs-style-profile.md with YAML frontmatter:---
generated_date: YYYY-MM-DD
platform: docs
comment_count: <number of comments analyzed>
---
<style profile summary text>
Use the style profile (cached or freshly generated) to guide classification in Phase 5 and action item summarization in Phase 6.
# List files the user owns or that are shared with them, modified within timeframe
# For relative timeframe (e.g. 30 days): calculate the ISO date
SINCE_DATE=$(date -v-${DAYS}d +%Y-%m-%dT00:00:00 2>/dev/null || date -d "${DAYS} days ago" +%Y-%m-%dT00:00:00)
# Search for Google Docs, Sheets, and Slides modified in the timeframe
curl -s "https://www.googleapis.com/drive/v3/files?q=(mimeType='application/vnd.google-apps.document'+or+mimeType='application/vnd.google-apps.spreadsheet'+or+mimeType='application/vnd.google-apps.presentation')+and+modifiedTime>'${SINCE_DATE}'&fields=files(id,name,mimeType,modifiedTime,owners,webViewLink)&pageSize=100&orderBy=modifiedTime+desc" \
-H "Authorization: Bearer $TOKEN" \
-H "x-goog-user-project: gcp-sandbox-field-eng"
# Batch approach: collect file IDs, then fetch comments in groups of 10
# For each batch of 10 files, make parallel requests (or sequential in a tight loop)
# For each file in the batch:
curl -s "https://www.googleapis.com/drive/v3/files/${FILE_ID}/comments?fields=comments(id,content,author(displayName,emailAddress),createdTime,modifiedTime,resolved,replies(content,author(displayName,emailAddress),createdTime),anchor,quotedFileContent)&includeDeleted=false" \
-H "Authorization: Bearer $TOKEN" \
-H "x-goog-user-project: gcp-sandbox-field-eng"
Optimization: Before fetching comments, pre-filter files to reduce the batch size:
modifiedTime older than the timeframe AND no comment activitymodifiedTime (more likely to have pending comments)Batch processing implementation:
# Process files in batches of 10
for batch_start in range(0, len(file_ids), 10):
batch = file_ids[batch_start:batch_start + 10]
# Fetch comments for all 10 files in this batch
for file_id in batch:
comments = fetch_comments(file_id, token)
# Filter and collect relevant comments
# Brief pause between batches to respect rate limits
Filter comments to find those relevant to the user:
+user_email or user's name in comment content)_Assigned to [user]_ or similar)resolved: true)replies array — if the user has already replied to the comment, it may still be unresolved but the user has already responded. Flag these as lower priority.For each matching comment, extract:
document_name — the file namedocument_link — webViewLink to the filecomment_text — the comment contentcommenter_name — who wrote the commentcommenter_email — their emailcreated_date — when the comment was createdquoted_content — the text the comment is anchored to (if available from quotedFileContent)has_user_reply — whether the user already replied in the comment thread# Search for meeting notes documents in the timeframe
curl -s "https://www.googleapis.com/drive/v3/files?q=mimeType='application/vnd.google-apps.document'+and+modifiedTime>'${SINCE_DATE}'+and+(name+contains+'meeting'+or+name+contains+'notes'+or+name+contains+'agenda'+or+name+contains+'minutes'+or+name+contains+'action+items'+or+name+contains+'sync'+or+name+contains+'standup'+or+name+contains+'1:1'+or+name+contains+'Protokoll')&fields=files(id,name,modifiedTime,webViewLink)&pageSize=50&orderBy=modifiedTime+desc" \
-H "Authorization: Bearer $TOKEN" \
-H "x-goog-user-project: gcp-sandbox-field-eng"
# Export Google Doc as plain text to search for action items
curl -s "https://www.googleapis.com/drive/v3/files/${FILE_ID}/export?mimeType=text/plain" \
-H "Authorization: Bearer $TOKEN" \
-H "x-goog-user-project: gcp-sandbox-field-eng"
Parse action items from the document text. Look for patterns like:
[ ] @matthias ... or [ ] Matthias: ... (unchecked checkbox with user's name)Action: Matthias — ... or AI: Matthias — ...TODO: Matthias ... or TODO (@matthias) ...Owner: Matthias patterns in table rowsAufgabe: Matthias, Verantwortlich: Matthias[x], [X], For each action item found, extract:
document_name — the meeting note file namedocument_link — webViewLinkaction_text — the action item descriptionassigned_by — infer from meeting context (document owner or meeting organizer if identifiable)created_date — document modified date or meeting date if parseable from the documentdue_date — if a date/deadline is mentioned alongside the action item (e.g. "by Friday", "due 2025-03-15", "EOW")# Get suggestions for a document — use the Google Docs API
curl -s "https://docs.googleapis.com/v1/documents/${FILE_ID}?fields=suggestedDocumentStyleChanges,suggestedNamedStylesChanges,body" \
-H "Authorization: Bearer $TOKEN" \
-H "x-goog-user-project: gcp-sandbox-field-eng"
suggestedInsertionIds, suggestedDeletionIds), flag it as having pending suggestions. Record:
document_name, document_linksuggestion_count — how many suggestions are pendingcreated_date — approximate from document modification timeUse the fe-jira-tools JIRA skill to query for open items. Important: The user may not be directly assigned or mentioned in JIRA tickets. The most effective approach is a multi-layered search that also covers tickets from the user's direct reports and team members.
JQL: assignee = currentUser() AND status NOT IN (Done, Closed, Resolved) AND created >= "YYYY-MM-DD" ORDER BY priority DESC, updated DESC
JQL: project = ES AND (assignee = currentUser() OR text ~ "user_email" OR text ~ "user_first_name.user_last_name") AND status NOT IN (Done, Closed, Resolved) AND created >= "YYYY-MM-DD" ORDER BY priority DESC, updated DESC
ticket_key — e.g. "ES-12345"ticket_link — direct URL to the JIRA ticket (https://databricks.atlassian.net/browse/{ticket_key})summary — ticket title/summaryreporter — who created/assigned the ticket (the "assigner")created_date — when the ticket was createddue_date — if a due date is set on the ticketpriority — JIRA priority (Blocker, Critical, Major, Minor, Trivial)status — current status (Open, In Progress, etc.)last_comment — the most recent comment text (if it contains a question or request directed at the user)JQL: comment ~ "user_last_name" AND status NOT IN (Done, Closed, Resolved) AND updated >= "YYYY-MM-DD" ORDER BY updated DESC
For each ticket found, fetch comments and check for:
Deduplicate: If a ticket is already found in 3a, merge the information rather than creating a duplicate entry. Add comment context to the existing item.
Leaders are often not directly tagged on ES tickets, but they need visibility into heated escalations from their team. This step searches for open ES tickets filed by or involving the user's direct reports that show signs of being stuck or escalated.
Identify team members: Get the user's direct reports from their profile or org data. Common sources:
~/.vibe/profile for team member listfe-internal-tools:databricks-org skill to look up direct reportsSearch for open ES tickets from team members:
JQL: project = ES AND status NOT IN (Done, Closed, Resolved) AND reporter IN ("[email protected]", "[email protected]", ...) AND updated >= "YYYY-MM-DD" ORDER BY priority DESC, updated DESC
Also search by watcher:
JQL: project = ES AND status NOT IN (Done, Closed, Resolved) AND watcher IN ("[email protected]", "[email protected]", ...) AND updated >= "YYYY-MM-DD" ORDER BY priority DESC, updated DESC
Identify "heated" tickets — tickets that need leadership attention. A ticket is heated if:
Also search Gmail for ES ticket threads sent TO the user (escalation emails):
curl -s "https://gmail.googleapis.com/gmail/v1/users/me/messages?q=subject:%22ES-%22+to:${USER_EMAIL}+after:${SINCE_DATE}+-subject:%22Confidential%22&maxResults=30" \
-H "Authorization: Bearer $TOKEN" \
-H "x-goog-user-project: gcp-sandbox-field-eng"
For each email thread, check the ES ticket status in JIRA. If still open, add to findings.
team_member — which direct report is involvedcustomer — affected customer (from ticket description or labels)escalation_indicators — list of reasons this is flagged as heateddays_open — how long the ticket has been opendays_since_eng_response — how long since an engineering (non-FE) person respondedUse the mcp__confluence__* MCP tools for all Confluence operations. The approach is multi-layered: use the tasks API first (most reliable), then fall back to page-level searches for <ac:task> markup, and finally check inline comments.
# Via mcp__confluence__search_confluence_pages with task-specific CQL
CQL: type = "task" AND assignee = currentUser() AND status = "incomplete" AND created >= "YYYY-MM-DD" ORDER BY created DESC
If the tasks CQL type is not available, use the Confluence REST API through the MCP tool:
GET /wiki/rest/tasks/1.0/tasks?status=incomplete&assignee={user_account_id}&limit=100
currentUser() doesn't resolve):CQL: type = "task" AND text ~ "user_email" AND status = "incomplete" AND created >= "YYYY-MM-DD"
<ac:task> elements mentioning the userFull-text CQL search for the user's name is unreliable (returns role/reference pages). Instead, search for pages with <ac:task> markup that reference the user.
CQL: type = page AND space IN ("FE", "FEEMEA", "SA", "ENG", "DAIS") AND lastmodified >= "YYYY-MM-DD" AND (text ~ "ac:task" OR text ~ "action item") ORDER BY lastmodified DESC
For each candidate page, use mcp__confluence__get_confluence_page_content to fetch the page body and parse for:
<ac:task> elements where the <ri:user> matches the user's account ID or email<ac:task-status> is incomplete<ac:task-body> elements[ ] @matthias, AI: Matthias, TODO: MatthiasLimit page scanning to 30 most recently modified pages to avoid excessive API calls.
CQL: type = comment AND text ~ "user_first_name" AND container.lastmodified >= "YYYY-MM-DD" ORDER BY created DESC
For each comment found, check:
Get the parent page context for each relevant comment using mcp__confluence__get_confluence_page_content to provide surrounding context.
For each Confluence item found (tasks, comments), extract:
page_title — the Confluence page namepage_link — direct URL to the page (e.g. https://databricks.atlassian.net/wiki/spaces/{space}/pages/{pageId}/{title})task_text or comment_text — the action item or comment contentassigned_by — who created the task or commentcreated_date — when it was createddue_date — if a due date is set on the Confluence taskspace_name — the Confluence spacesource_type — "task_api", "ac_task_markup", or "inline_comment"Deduplicate: Tasks found via both the Tasks API (4a) and page scanning (4b) should be merged.
Search for comments or replies the user wrote that contain follow-up language — promises the user made but may not have kept.
Search for promise comments in Google Drive:
Search for promise comments in JIRA:
JQL: comment ~ "user_name" AND comment ~ "will" AND updated >= "YYYY-MM-DD"Check for follow-through: For each promise found:
Classify unfollowed promises:
promise_text, source_type, source_link, promise_date, days_ago, recipient (who the promise was made to)Combine all items from Google Drive, JIRA, and Confluence and classify into priority tiers:
HIGH PRIORITY — Direct action required:
MEDIUM PRIORITY — Response or action warranted:
LOW PRIORITY — Informational or quick action:
Before creating the summary document, validate that EVERY item has a clickable source_url. Items without a link are useless in the summary doc because the user cannot navigate to the original.
Validation gate: Iterate over ALL collected items and verify each has a non-empty source_url:
Google Drive items: Must have webViewLink from the Drive API. If missing, construct as https://docs.google.com/document/d/{fileId}/edit (for Docs) or https://docs.google.com/spreadsheets/d/{fileId}/edit (for Sheets) or https://docs.google.com/presentation/d/{fileId}/edit (for Slides).
JIRA items: Must have ticket_link. If missing, construct as https://databricks.atlassian.net/browse/{ticket_key}.
Confluence items: Must have page_link. If missing, construct as https://databricks.atlassian.net/wiki/spaces/{space_key}/pages/{pageId}.
Unfollowed promises: Must have the source_link from the original promise location (Google Drive comment URL, JIRA ticket URL, or Confluence page URL).
For any item missing a link, construct it using the fallback formulas above. Log a warning but do NOT skip the item.
For every item collected, draft a meaningful, detailed suggested response that the user can copy-paste into the original source (Google Doc comment reply, JIRA comment, Confluence reply, or email). These responses are a core deliverable of the skill — they should be high quality, substantive, and directly actionable.
Quality guidelines — responses should be detailed and meaningful, not generic placeholders:
Drafting rules by source type:
Google Drive comments (questions directed at the user):
quotedFileContent), address that content directlyMeeting note action items:
JIRA tickets:
Confluence tasks/comments:
Unfollowed promises (from Phase 4e):
Store the suggested response alongside each item as suggested_response. This field is REQUIRED — every item in the summary doc must have one. If the context is insufficient to draft a meaningful response, explicitly say what's missing and draft a response that commits to a timeline (e.g., "I'll review this by [day] and get back to you with [specific deliverable].").
CRITICAL — Clickable links: Every link in the summary document — especially in the "Document / Ticket" table column and in the detail sections — MUST be a clickable hyperlink, not plain text. The user needs to click directly from the summary doc to the source.
Preferred approach: Use the mcp__google__docs_document_create_from_markdown tool with a markdown file. This tool supports [display text](url) links in table cells. However, if links inside table cells are not rendered as clickable hyperlinks, apply a follow-up batchUpdate to add link formatting:
# Fix non-clickable links in table cells after doc creation
requests.append({"updateTextStyle": {
"range": {"startIndex": link_start, "endIndex": link_end},
"textStyle": {"link": {"url": source_url}},
"fields": "link"
}})
Alternative approach: Use the Google Docs API batchUpdate directly (described in Steps 2a-2g below) which gives full control over hyperlink formatting. This is more verbose but guarantees clickable links.
Verification: After creating the doc, confirm at least one link is clickable. If not, re-create using the batchUpdate approach.
# Create a new Google Doc
curl -s -X POST "https://www.googleapis.com/drive/v3/files" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-H "x-goog-user-project: gcp-sandbox-field-eng" \
-d '{
"name": "Open Action Items — [DATE]",
"mimeType": "application/vnd.google-apps.document"
}'
batchUpdate. Use a Python script for reliable construction. The document has three sections: header, main table, and detail sections per source.IMPORTANT: All text insertion must happen via insertText requests. After inserting text, apply formatting via updateTextStyle and updateParagraphStyle using character index ranges. Insert content bottom-up (last content first) or track indices carefully, since insertions shift all subsequent indices.
# Build requests list for batchUpdate
requests = []
# Insert title at index 1 (start of document)
title_text = "Open Action Items — [DATE]\n"
requests.append({"insertText": {"location": {"index": 1}, "text": title_text}})
# Format title as Heading 1
requests.append({"updateParagraphStyle": {
"range": {"startIndex": 1, "endIndex": 1 + len(title_text)},
"paragraphStyle": {"namedStyleType": "HEADING_1"},
"fields": "namedStyleType"
}})
# Insert metadata line
meta_text = f"Scanned: {start_date} to {end_date} | Sources: {sources} | Total: {total} (High: {high}, Medium: {med}, Low: {low})\n\n"
meta_start = 1 + len(title_text)
requests.append({"insertText": {"location": {"index": meta_start}, "text": meta_text}})
# Format metadata as grey, smaller font
requests.append({"updateTextStyle": {
"range": {"startIndex": meta_start, "endIndex": meta_start + len(meta_text)},
"textStyle": {"fontSize": {"magnitude": 9, "unit": "PT"}, "foregroundColor": {"color": {"rgbColor": {"red": 0.5, "green": 0.5, "blue": 0.5}}}},
"fields": "fontSize,foregroundColor"
}})
Insert a table with columns: #, Priority, Source, Item, Document / Ticket, Assigned By, Date, Suggested Response.
The Suggested Response column contains the drafted response from Phase 5c. This is the most valuable column — it gives the user a ready-to-use reply they can copy-paste into the original source.
# Insert table after metadata
table_start = meta_start + len(meta_text)
num_rows = len(all_items) + 1 # +1 for header
num_cols = 8 # Last column is now "Suggested Response" instead of "Status"
requests.append({"insertTable": {
"rows": num_rows,
"columns": num_cols,
"location": {"index": table_start}
}})
After inserting the table, read back the document structure (documents.get) to get the exact cell indices, then populate each cell:
# Get document structure to find table cell indices
doc = get_document(doc_id, token)
table = doc['body']['content'][table_element_index]['table']
# For each cell, insert text and apply formatting
for row_idx, row in enumerate(table['tableRows']):
for col_idx, cell in enumerate(row['tableCells']):
cell_start = cell['content'][0]['startIndex']
# ... insert text at cell_start
# Bold the header row
for cell in header_row_cells:
requests.append({"updateTextStyle": {
"range": {"startIndex": cell['start'], "endIndex": cell['end']},
"textStyle": {"bold": True},
"fields": "bold"
}})
# Set header row background to dark grey
for cell in header_row_cells:
requests.append({"updateTableCellStyle": {
"tableCellStyle": {"backgroundColor": {"color": {"rgbColor": {"red": 0.2, "green": 0.2, "blue": 0.2}}}},
"tableStartLocation": {"index": table_start_index},
"rowSpan": 1, "columnSpan": 1,
"fields": "backgroundColor"
}})
# Set header text to white
for cell in header_row_cells:
requests.append({"updateTextStyle": {
"range": {"startIndex": cell['start'], "endIndex": cell['end']},
"textStyle": {"foregroundColor": {"color": {"rgbColor": {"red": 1.0, "green": 1.0, "blue": 1.0}}}},
"fields": "foregroundColor"
}})
Apply background colors to priority cells based on the priority level:
PRIORITY_COLORS = {
"HIGH": {"red": 0.8, "green": 0.0, "blue": 0.0}, # Red #CC0000
"MEDIUM": {"red": 1.0, "green": 0.55, "blue": 0.0}, # Orange #FF8C00
"LOW": {"red": 0.13, "green": 0.55, "blue": 0.13}, # Green #228B22
}
for item in all_items:
priority_cell = get_cell(table, item['row_idx'], 1) # Column 1 = Priority
color = PRIORITY_COLORS[item['priority']]
# Set cell background color
requests.append({"updateTableCellStyle": {
"tableCellStyle": {"backgroundColor": {"color": {"rgbColor": color}}},
"tableStartLocation": {"index": table_start_index},
"rowSpan": 1, "columnSpan": 1,
"fields": "backgroundColor"
}})
# Set priority text to white for contrast
requests.append({"updateTextStyle": {
"range": {"startIndex": priority_cell['start'], "endIndex": priority_cell['end']},
"textStyle": {"foregroundColor": {"color": {"rgbColor": {"red": 1.0, "green": 1.0, "blue": 1.0}}}, "bold": True},
"fields": "foregroundColor,bold"
}})
Every reference in the "Document / Ticket" column must be a clickable hyperlink to the source:
for item in all_items:
link_cell = get_cell(table, item['row_idx'], 4) # Column 4 = Document / Ticket
link_text = item['display_name'] # e.g. "ES-12345" or "Meeting Notes Q1"
link_url = item['source_url'] # e.g. "https://databricks.atlassian.net/browse/ES-12345"
# Insert the display text
requests.append({"insertText": {
"location": {"index": link_cell['start']},
"text": link_text
}})
# Apply hyperlink formatting
requests.append({"updateTextStyle": {
"range": {"startIndex": link_cell['start'], "endIndex": link_cell['start'] + len(link_text)},
"textStyle": {"link": {"url": link_url}},
"fields": "link"
}})
Link URL patterns:
webViewLink from the Drive API (e.g. https://docs.google.com/document/d/{fileId}/edit)https://databricks.atlassian.net/browse/{ticket_key}https://databricks.atlassian.net/wiki/spaces/{space}/pages/{pageId}/{title}Apply light grey background to even rows for readability:
for row_idx in range(2, num_rows + 1, 2): # Even rows (0-indexed: 2, 4, 6...)
for col_idx in range(num_cols):
requests.append({"updateTableCellStyle": {
"tableCellStyle": {"backgroundColor": {"color": {"rgbColor": {"red": 0.95, "green": 0.95, "blue": 0.95}}}},
"tableStartLocation": {"index": table_start_index},
"rowSpan": 1, "columnSpan": 1,
"fields": "backgroundColor"
}})
After the table, add expandable detail sections for each source. Since Google Docs doesn't support collapsible sections natively, use Heading 2 section headers with horizontal rules as visual separators.
# After table, insert source detail sections
detail_start = table_end_index + 1
# --- Google Drive Details ---
section_text = "\nGoogle Drive Details\n"
requests.append({"insertText": {"location": {"index": detail_start}, "text": section_text}})
requests.append({"updateParagraphStyle": {
"range": {"startIndex": detail_start + 1, "endIndex": detail_start + len(section_text)},
"paragraphStyle": {"namedStyleType": "HEADING_2"},
"fields": "namedStyleType"
}})
# For each Google Drive item, add context block WITH suggested response:
for item in gdrive_items:
context = f"\n{item['display_name']}\n"
context += f"Comment by {item['commenter_name']} ({item['created_date']}):\n"
context += f" \"{item['comment_text']}\"\n"
if item.get('quoted_content'):
context += f" On: \"{item['quoted_content']}\"\n"
if item.get('has_user_reply'):
context += f" (You already replied in this thread)\n"
# Add the suggested response — this is the key deliverable
context += f"\n ✏️ Suggested response:\n"
context += f" {item['suggested_response']}\n"
# Insert and format with hyperlink on the display name
# Format the suggested response in italic to visually distinguish it
# ... (same insertText + updateTextStyle pattern as above)
# --- JIRA Details ---
# Same pattern: Heading 2, then for each ticket:
# ticket_key (hyperlinked), summary, status, priority
# Latest comment text if it contains a question
# For heated ES tickets: escalation indicators, customer, days_open
# ✏️ Suggested response: the drafted JIRA comment from Phase 5c
# (formatted in italic, indented under the ticket context)
# --- Confluence Details ---
# Same pattern: Heading 2, then for each task/comment:
# page_title (hyperlinked), task text, space name
# Surrounding page context if available
# ✏️ Suggested response: the drafted reply from Phase 5c
# --- Unfollowed Promises ---
# Heading 2: "Unfollowed Promises"
# For each unfollowed promise:
# source_link (hyperlinked), original promise text, days_ago
# ✏️ Suggested follow-up: the drafted follow-up message from Phase 5c
# IMPORTANT: Refresh the token right before the API call (tokens expire during long scripts)
TOKEN=$(python3 "$GOOGLE_AUTH" token)
curl -s -X POST "https://docs.googleapis.com/v1/documents/${DOC_ID}:batchUpdate" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-H "x-goog-user-project: gcp-sandbox-field-eng" \
-d "{\"requests\": $REQUESTS_JSON}"
Token refresh note: If the script takes >30 minutes to build the requests, refresh the token immediately before the final API call using subprocess.run() inside the Python script rather than shell variable expansion.
Print a summary to the user in the CLI:
Open Action Items Summary — [DATE]
Scanned: [START_DATE] to [END_DATE]
Google Drive: [X] items found
- [Y] open comments
- [Z] meeting note action items
- [W] pending suggestions
JIRA: [X] items found
- [Y] assigned tickets
- [Z] comment mentions
Confluence: [X] items found
- [Y] incomplete tasks
- [Z] inline comments
| # | Priority | Source | Item Summary | Suggested Response |
|---|---|---|---|---|
| 1 | HIGH | Google Docs | Review architecture section — [Doc Name] | "Good point about the Q2 timeline — I think we should push..." |
| 2 | HIGH | JIRA | ES-12345: Fix pipeline timeout | "Reviewed the logs — this looks like WAP-429. Workaround is..." |
| 3 | MEDIUM | Confluence | Update ops runbook | "Updated sections 3.1 and 3.2 with the new failover steps..." |
| ... | ... | ... | ... | ... |
Summary document created: [LINK TO GOOGLE DOC]
Open it to see all items with links, details, and suggested responses.
Each suggested response can be copy-pasted into the original source.
pageToken — fetch all pages until no nextPageToken is returned. Use pageSize=100 per request.startAt, maxResults) for JQL queries. Default maxResults=50.start and limit parameters for CQL queries.batchUpdate call.User says: "what action items are assigned to me?" Result: Asks "What timeframe should I check?", then scans all sources and creates summary doc
User says: "/draft-replies-docs 30" Result: Scans last 30 days across Google Drive, JIRA, and Confluence, creates summary doc
User says: "/draft-replies-docs 30 jira" Result: Scans last 30 days in JIRA only, creates summary doc
User says: "/draft-replies-docs 01-01-2025 09-03-2026" Result: Scans 14+ months across all sources, creates comprehensive summary doc
User says: "do I have any open comments on docs?" Result: Parses as Google Drive scan, asks for timeframe, creates summary doc
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub sarah-hord-db/vibe --plugin fe-draft-replies-docs