diff --git a/.claude-plugin/manifest.json b/.claude-plugin/manifest.json index 61c5b0a..8570dfb 100644 --- a/.claude-plugin/manifest.json +++ b/.claude-plugin/manifest.json @@ -29,6 +29,11 @@ "name": "gemini-image-generator", "description": "Generate, edit, or transform images with Gemini using bundled Python scripts (Flash or Pro) including aspect ratio, resolution, image-to-image edits, logo overlays, and reference images. Use when users request image generation, image edits, image-to-image transformations, logo placement, or specific aspect ratios or resolutions.", "path": "skills/gemini-image-generator" + }, + { + "name": "create-chime-mtd-performance", + "description": "Automated MTD Performance data block creation in Chime Internal Pacing Sheet. Asks user for block size, duplicates the top data block, and updates date ranges. Use at the start of new tracking periods for fast, accurate updates.", + "path": "skills/create-chime-mtd-performance" } ] } diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 92a64e3..4519be8 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -21,11 +21,12 @@ }, { "name": "data-processing-tools", - "description": "Data processing utilities for URL parsing and analysis", + "description": "Data processing utilities for URL parsing, analysis, and Chime MTD performance tracking", "source": "./", "strict": false, "skills": [ - "./skills/url-parameter-parser" + "./skills/url-parameter-parser", + "./skills/create-chime-mtd-performance" ] }, { @@ -47,4 +48,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 027677f..5cbefef 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -6,7 +6,10 @@ "WebFetch(domain:github.com)", "WebFetch(domain:raw.githubusercontent.com)", "WebSearch", - "Skill(ai-news-tools:ai-news-daily)" + "Skill(ai-news-tools:ai-news-daily)", + "Bash(source:*)", + "Bash(nvm current:*)", + "Bash(node:*)" ] } } diff --git a/skills/create-chime-mtd-performance/IMPLEMENTATION.md b/skills/create-chime-mtd-performance/IMPLEMENTATION.md new file mode 100644 index 0000000..5875c44 --- /dev/null +++ b/skills/create-chime-mtd-performance/IMPLEMENTATION.md @@ -0,0 +1,269 @@ +--- +name: create-chime-mtd-performance +description: Implementation guide for the automated MTD Performance data block workflow +--- + +# Implementation Guide: Create Chime MTD Performance + +## Pseudo-Code Workflow + +``` +FUNCTION automateChimeMTDBlock(): + + // STEP 1: Initialize and Access Sheet + tab = openNewBrowserTab() + navigateToURL(sheetURL) + waitForSheetToLoad() + + // STEP 2: Ask User for Block Size + // CRITICAL: The most recent block ALWAYS starts at row 1 + // Instead of complex detection, ask user directly + PRINT "How many rows should I copy? (e.g., 17, 20, 25)" + blockHeight = getUserInput() + + IF blockHeight <= 0: + RETURN error("Invalid row count provided") + + // Define block boundaries based on user input + blockStartRow = 1 // Always row 1 + blockEndRow = blockHeight // User-specified row count + + // STEP 3: Select and Copy the Data Block + // Select entire rows (not just cells) for better formatting preservation + selectRows(startRow=blockStartRow, endRow=blockEndRow) + // blockStartRow is always 1, blockEndRow is user-specified (e.g., 17) + + copySelection() + // Verify: Clipboard should contain the selected rows + + // STEP 4: Insert Copied Rows at Top (CRITICAL STEP) + // Method 1 (Recommended): Use "Insert copied rows above" feature + rightClickOnRow(rowNumber=1) + selectContextMenuOption("Insert X copied rows above") + // This automatically inserts AND pastes in one operation + // All existing content shifts down by blockHeight rows + + // Method 2 (Alternative): Manual insert then paste + // insertRows(rowPosition=1, numberOfRows=blockHeight) + // navigateToCell(A1) + // pasteData() + + // STEP 5: Update Date Range in A1 + headerCell = getCell(A1) + headerCell.clear() // Delete existing data + newDateRange = calculateMTDDateRange(yesterday) // Calculate new date range + headerCell.setValue(newDateRange) // Write new date range + + // STEP 6: Save Sheet + saveSheet() + + RETURN success("MTD block created and updated successfully") + +END FUNCTION + + +// ============================================ +// HELPER FUNCTIONS +// ============================================ + +FUNCTION getUserInput(): + /* + Prompts the user to provide the number of rows to copy. + Returns: Integer representing the number of rows in the data block + */ + + DISPLAY "How many rows should I copy from the top?" + DISPLAY "Typical sizes: 15-25 rows depending on campaign count" + DISPLAY "Example: If your data block has 17 rows, enter: 17" + + userInput = READ_INPUT() + + // Validate input + IF userInput is not a valid integer OR userInput <= 0: + RETURN error("Please provide a valid positive number") + END IF + + RETURN userInput + +END FUNCTION + + +FUNCTION calculateMTDDateRange(yesterdayDate): + /* + Calculates the MTD (Month-to-Date) date range based on yesterday's date. + Start date is always the 1st of yesterday's month. + End date is yesterday's date. + + Format: M/DD-M/DD/YYYY (no spaces) + + Examples: + - Yesterday: Jan 10, 2026 → "1/01-1/10/2026" + - Yesterday: Jan 1, 2025 → "1/01-1/01/2025" + - Yesterday: Feb 2, 2026 → "2/01-2/02/2026" + - Yesterday: Dec 31, 2025 → "12/01-12/31/2025" + */ + + // Extract components from yesterday's date + year = yesterdayDate.getFullYear() + month = yesterdayDate.getMonth() + 1 // JavaScript months are 0-indexed + day = yesterdayDate.getDate() + + // Start date is always the 1st of the month + startMonth = month + startDay = "01" + + // End date is yesterday + endMonth = month + endDay = padWithZero(day) // Ensure 2-digit format (01, 02, etc.) + + // Construct date range string: M/DD-M/DD/YYYY + dateRange = startMonth + "/" + startDay + "-" + endMonth + "/" + endDay + "/" + year + + RETURN dateRange + +END FUNCTION + + +// ============================================ +// UTILITY FUNCTIONS +// ============================================ + + +FUNCTION padWithZero(number): + /* + Pads a number with leading zero if it's single digit + Examples: 1 → "01", 10 → "10", 5 → "05" + */ + IF number < 10: + RETURN "0" + number + ELSE: + RETURN string(number) + END IF +END FUNCTION +``` + +## Implementation Steps for Browser Automation + +### Using Claude in Chrome Extension + +1. **Open New Tab** + - Execute: Click "+" button to open new tab + - Verify: New blank tab appears + +2. **Navigate to Sheet** + - Execute: Paste URL into address bar + - Verify: Google Sheets loads with the target spreadsheet + - Wait: Sheet data fully loads (may take 2-3 seconds) + +3. **Ask User for Block Size** + - Execute: Display prompt "How many rows should I copy? (e.g., 17, 20, 25)" + - Wait: User provides row count + - Validate: Ensure input is a positive integer + - Record: User-specified row count (e.g., 17) + +4. **Select Entire Rows (Not Just Cells)** + - Execute: Click on row number 1 (left side gray area with row numbers) + - Hold Shift and click on end row number (e.g., row 17) + - Alternative: Click row 1, then Shift+Click row 17 + - Verify: Entire rows 1-17 are highlighted (blue/gray background) + - **Critical**: Select ROWS not cells - this preserves all formatting + +5. **Copy Selected Rows** + - Execute: Ctrl+C (Windows/Linux) or Cmd+C (Mac) + - Alternative: Right-click on selected rows → "Copy" + - Verify: Moving dotted border appears around selected rows (marching ants animation) + +6. **Insert Copied Rows at Top (CRITICAL OPERATION)** + - **Method 1 (Recommended - One-Step Operation):** + - Right-click on row number 1 + - Select: "Insert X copied rows above" where X = number of copied rows + - This inserts AND pastes in one operation + - Verify: New rows appear at top with copied data + + - **Method 2 (Two-Step Alternative):** + - Right-click on row number 1 + - Select: "Insert X rows above" to create empty rows + - Click cell A1 + - Press Ctrl+V (or Cmd+V) to paste + - Verify: Data appears in new rows + +7. **Verify Insertion Success** + - Check: New block appears at rows 1-17 (or user-specified row count) + - Check: Original first block now starts at row 18 (= blockHeight + 1) + - Check: All data intact, no overwrites + - Check: Formatting preserved (colors, borders, fonts) + +8. **Update Date Range in A1** + - Execute: Click on cell A1 to select it + - Execute: Press Delete or Backspace to clear existing data + - Calculate the new date range: + - Yesterday: If today is 1/8/2026, yesterday is 1/7/2026 + - Start date: 1st of yesterday's month = 1/01 + - End date: Yesterday's date = 1/07 + - Format: M/DD-M/DD/YYYY (no spaces) + - Execute: Type the new date range: "1/01-1/07/2026" + - Execute: Press Enter to save + - Verify: A1 shows the new date range in correct format + +9. **Save and Verify Complete Operation** + - Execute: Google Sheets auto-saves (wait for "Saved to Drive" message) + - OR press Ctrl+S / Cmd+S if needed + - Final verification checklist: + - [ ] New block at rows 1-17 with updated date in A1 + - [ ] Original block now at rows 18-34 + - [ ] Second original block at rows 35+ + - [ ] All data present, no loss + - [ ] Formatting preserved + - [ ] Sheet saved successfully + +## Key Data Points to Track + +When implementing, track these variables: + +``` +blockStartRow = ALWAYS 1 (most recent block starts at row 1) +blockEndRow = user-provided row count (e.g., 17) +blockHeight = blockEndRow (same as user input) +headerText = the full text in cell A1 before update +yesterday = today's date - 1 day +newEndDate = formatted yesterday's date (M/D format) +``` + +## Error Handling + +Handle these scenarios: + +1. **Invalid User Input for Row Count** + - Action: Re-prompt with clear instructions + - Message: "Please provide a valid positive number (e.g., 17, 20, 25)" + - Note: Ensure input is an integer greater than 0 + +2. **User Unsure of Row Count** + - Action: Provide guidance on how to find the row count + - Message: "Look at column A and find where the next date range pattern appears. Count rows from 1 to that row minus 1." + - Note: Typical sizes are 15-25 rows + +3. **Date Format Mismatch** + - Action: Analyze existing date format and match it + - Message: "Adapting date format to match existing data" + +4. **Sheet Not Accessible** + - Action: Verify permissions and retry + - Message: "Unable to access sheet, check permissions" + +5. **Copy/Paste Failure** + - Action: Retry operation + - Message: "Operation failed, retrying..." + +## Verification Checklist + +Before completing, verify: + +- [ ] User provided valid row count +- [ ] New block appears at row 1 +- [ ] All data from original block is present (no missing rows/columns) +- [ ] Previous row 1 is now at row (blockHeight + 1) +- [ ] Cell A1 contains updated header with yesterday's date +- [ ] Date format in A1 matches format of existing blocks +- [ ] No data loss or overwrites occurred +- [ ] Sheet is saved successfully diff --git a/skills/create-chime-mtd-performance/QUICK_REFERENCE.md b/skills/create-chime-mtd-performance/QUICK_REFERENCE.md new file mode 100644 index 0000000..675ab7c --- /dev/null +++ b/skills/create-chime-mtd-performance/QUICK_REFERENCE.md @@ -0,0 +1,241 @@ +# Create Chime MTD Performance - Quick Reference + +## What This Skill Does + +Asks you for the data block size, then duplicates the most recent MTD Performance data block (which is ALWAYS at row 1) to create a new block at the top of the Chime Internal Pacing Sheet, updates its date range, and pushes all existing data down. + +## When to Use + +- Start of a new tracking period/month +- Need to create a fresh MTD block with today's date range +- Automating monthly report generation +- Quick data refresh without manual copying + +## The 6-Step Process + +### 1️⃣ Open Sheet +``` +Action: Open new tab and navigate to Chime Internal Pacing Sheet +URL: https://docs.google.com/spreadsheets/d/1lar11y52pOYfbzlequ6cgeB3aMzvDWbcjmpyoaHC8pc/edit?gid=57802555#gid=57802555 +Check: Sheet fully loaded +``` + +### 2️⃣ Ask User for Block Size +``` +Action: Prompt "How many rows should I copy? (e.g., 17, 20, 25)" +Wait: User provides row count +Validate: Ensure it's a positive number +Example: User says "17" → Will copy rows 1-17 + +CRITICAL: Most recent block ALWAYS starts at row 1 +Typical sizes: 15-25 rows depending on number of campaigns +``` + +### 3️⃣ Select and Copy Entire Rows +``` +Selection: + - Click row number 1 (left side gray area) + - Hold Shift + Click row number specified by user (e.g., row 17) + - Result: Rows 1-17 highlighted in blue/gray + +Copy: + - Press Ctrl+C (Windows) or Cmd+C (Mac) + - OR Right-click → "Copy" + - Verify: Moving dotted border appears (marching ants) + +IMPORTANT: Select ROWS not cells - this preserves all formatting +``` + +### 4️⃣ Insert Copied Rows at Top +``` +CRITICAL: Use "Insert copied rows above" feature + +Method 1 (Recommended): + 1. Right-click on row number 1 + 2. Select "Insert 17 copied rows above" (X = your block height) + 3. Done! This inserts AND pastes in one operation + +Method 2 (Alternative): + 1. Right-click row 1 → "Insert X rows above" + 2. Click cell A1 + 3. Press Ctrl+V or Cmd+V to paste + +Verify: + - New block appears at rows 1-17 + - Original block moved to rows 18-34 + - All formatting preserved +``` + +### 5️⃣ Update Date Range in A1 +``` +Edit: + 1. Click cell A1 + 2. Press Delete or Backspace to clear existing data + 3. Calculate the new MTD date range: + - Today: 1/8/2026 → Yesterday: 1/7/2026 + - Start date: 1st of yesterday's month = 1/01 + - End date: Yesterday's date = 1/07 + 4. Type new date range: "1/01-1/07/2026" + 5. Press Enter + +Format: M/DD-M/DD/YYYY (no spaces) + +Examples: + - Yesterday = Jan 10, 2026 → Type: "1/01-1/10/2026" + - Yesterday = Jan 1, 2025 → Type: "1/01-1/01/2025" + - Yesterday = Feb 2, 2026 → Type: "2/01-2/02/2026" + +Verify: + - A1 shows new date range + - Format is M/DD-M/DD/YYYY (no spaces) + - Start date is always 1st of the month + - End date is yesterday's date +``` + +## Data Block Structure Pattern + +``` +Row 1: 1/01-1/02/2026 ← FIRST block (MOST RECENT, 2 days) +Row 2: MTD performance +Row 3: [Column headers or empty] +Row 4-17: [Campaign data rows] +Row 18: 1/01-1/01/2026 ← SECOND block (OLDER, 1 day) +Row 19: MTD performance +Row 20+: [Older campaign data] +``` + +**Key Understanding**: +- Row 1 = Most recent data (widest date range, e.g., 2 days: 1/01-1/02) +- Row 18+ = Older data (narrower date range, e.g., 1 day: 1/01-1/01) +- Date ranges get NARROWER as you go down (older = fewer days covered) + +## What to Look For + +### Header Characteristics +- ALWAYS in cell A1 for the most recent block +- Contains date range pattern in format "M/D-M/D/YYYY" or "M/DD-M/DD/YYYY" +- Examples: "1/01-1/02/2026" (2 days), "1/01-1/07/2026" (7 days) +- Must include full 4-digit year at the end +- Recent blocks have WIDER date ranges (more days) +- Older blocks have NARROWER date ranges (fewer days) + +### Data Rows +- Multiple rows with campaign information below the header +- Consistent column structure across rows +- Usually 15-50 rows of campaign data per block +- May include platforms: Android, iOS, Web, TV Universal + +### How to Determine Block Size +- Look at column A and find where the next date range pattern appears +- Count rows from row 1 to the row before the next date pattern +- Example: A1 has "1/01-1/02/2026", A18 has "1/01-1/01/2026" → First block = 17 rows +- If unsure, typical block sizes are 15-25 rows + +## Date Calculation + +Yesterday's date is calculated as: +``` +Today's Date - 1 day + +Example: + Today: January 8, 2026 + Yesterday: January 7, 2026 + Format in cell: "1/7" +``` + +## Common Challenges & Solutions + +| Challenge | Solution | +|-----------|----------| +| Don't know how many rows to copy | Look at column A, find second date pattern, count rows from 1 to row before it | +| Unsure of block size | Typical: 15-25 rows; you can visually count the campaign data rows | +| Can't find date range pattern at A1 | Sheet structure is incorrect; verify this is the right sheet | +| Selected cells not rows | Click row NUMBERS (left gray area), not cells | +| Copy didn't work | Look for marching ants border after Ctrl+C | +| "Insert copied rows" not showing | Make sure you copied ROWS not cells; right-click on ROW number | +| Paste overwrote data | Use "Insert copied rows above" NOT regular paste | +| Formatting lost | Select entire ROWS before copying, not individual cells | +| Confused which block is newest | ALWAYS row 1 = newest (widest date range) | + +## Variables to Track + +``` +blockStartRow = ALWAYS 1 (most recent block is always at row 1) +userRowCount = number of rows user specified (e.g., 17) +blockHeight = same as userRowCount (e.g., 17 rows) +headerText = original text in A1 before update +newHeaderText = updated text with yesterday's date +``` + +## Before & After Example + +### BEFORE (Today is 1/8/2026) +``` +Row 1: 1/01-1/02/2026 ← FIRST block (MOST RECENT, 2 days) +Row 2: MTD performance +Row 3: [data] +... +Row 17: [last row of data] +Row 18: 1/01-1/01/2026 ← SECOND block (OLDER, 1 day) +Row 19: MTD performance +Row 20: [older data] +... +``` + +### AFTER (New block created with updated date) +``` +Row 1: 1/01-1/07/2026 ← NEW block (updated to yesterday) +Row 2: MTD performance +Row 3: [data - copied from original row 1 block] +... +Row 17: [last row of copied data] +Row 18: 1/01-1/02/2026 ← ORIGINAL first block (pushed down) +Row 19: MTD performance +Row 20: [data] +... +Row 34: [end of original first block] +Row 35: 1/01-1/01/2026 ← ORIGINAL second block (pushed down) +Row 36: MTD performance +... +``` + +**What Happened**: +1. Copied rows 1-17 (the most recent block) +2. Inserted them at the top +3. Updated A1 from "1/01-1/02/2026" to "1/01-1/07/2026" +4. Everything else shifted down by 17 rows + +## Supported Campaign Partners + +- Samsung +- PerforMarkt +- Pointblank +- AdsPostX +- True Finance +- T-Mobile +- Thanks.co + +## Supported Platforms + +- Android +- iOS +- Web +- TV Universal + +## Sheet Access + +**Required**: Google account with access to FeedMob's Chime Internal Pacing Sheet + +If you get "Access Denied" error: +1. Check if you're logged into the correct Google account +2. Verify sheet sharing permissions +3. Contact FeedMob administrator if needed + +## Success Indicators + +✅ New block appears at row 1 +✅ All data copied without loss +✅ Date updated to yesterday +✅ Original block pushed down +✅ Sheet saved successfully +✅ No error messages appear diff --git a/skills/create-chime-mtd-performance/README.md b/skills/create-chime-mtd-performance/README.md new file mode 100644 index 0000000..64ccacd --- /dev/null +++ b/skills/create-chime-mtd-performance/README.md @@ -0,0 +1,317 @@ +# Create Chime MTD Performance Skill + +## Overview + +This skill automates the creation of new MTD (Month-to-Date) Performance data blocks in FeedMob's Chime Internal Pacing Sheet. It asks the user for the block size, copies the most recent data block from the top of the sheet, and updates the date range to reflect the current tracking period. + +## Key Features + +✨ **User-Guided Block Size** - Asks user for row count, eliminating complex detection logic +✨ **Fast Processing** - No need to read and analyze 50+ rows +✨ **Automated Data Copying** - Duplicates entire data blocks with formatting preserved +✨ **Smart Insertion** - Inserts new rows at the top without data loss +✨ **Date Management** - Automatically updates date ranges to reflect current period +✨ **Error Handling** - Includes validation and safeguards + +## Files in This Skill + +### 1. `SKILL.md` +The main skill definition document describing: +- Overall purpose and workflow +- Step-by-step instructions +- Important notes and best practices +- Target sheet information + +### 2. `IMPLEMENTATION.md` +Detailed technical implementation guide including: +- Complete pseudo-code for the automation logic +- Helper functions for block detection +- Data analysis algorithms +- Error handling procedures +- Verification checklist + +### 3. `QUICK_REFERENCE.md` +Quick reference guide for: +- 6-step process overview +- Data block structure patterns +- Common challenges and solutions +- Before/after examples +- Success indicators + +### 4. `README.md` (this file) +Overview and navigation guide for the skill + +## Use Cases + +### Primary Use Cases +- **Monthly Transitions** - Create new MTD blocks at the start of each month +- **Daily Updates** - Refresh MTD data with new tracking dates +- **Automated Reporting** - Part of monthly report generation pipeline +- **Data Organization** - Keep most recent data at the top of sheet + +### Supported Campaigns +- Samsung +- PerforMarkt +- Pointblank +- AdsPostX +- True Finance +- T-Mobile +- Thanks.co + +### Supported Platforms +- Android +- iOS +- Web +- TV Universal + +## Quick Start + +### For Users +1. Read `QUICK_REFERENCE.md` for a 30-second overview +2. Understand the 6-step process +3. Learn what to look for in the data structure +4. Execute with Claude in Chrome browser extension + +### For Developers/Implementers +1. Read `SKILL.md` for workflow overview +2. Study `IMPLEMENTATION.md` for technical details +3. Review the pseudo-code and helper functions +4. Implement using your preferred automation tool +5. Refer to error handling section for edge cases + +## The 6-Step Automation Process + +``` +1. Open Sheet → Navigate to Chime Internal Pacing Sheet +2. Ask User → Prompt for number of rows to copy (e.g., 17) +3. Copy Block → Select and copy rows 1 to user-specified row +4. Insert & Paste → Insert copied rows at top +5. Update Date → Replace A1 with MTD date range (month start - yesterday) +6. Save → Auto-save sheet +``` + +## Target Sheet + +**Chime Internal Pacing Sheet** +``` +URL: https://docs.google.com/spreadsheets/d/1lar11y52pOYfbzlequ6cgeB3aMzvDWbcjmpyoaHC8pc/edit?gid=57802555#gid=57802555 +``` + +## Data Block Structure + +### Header Format (Date Range Pattern) +``` +[START_DATE]-[END_DATE]/YEAR +Example: "1/01-1/02/2026" +Format: M/D-M/D/YYYY or M/DD-M/DD/YYYY +``` + +### Typical Layout +``` +Row 1: 1/01-1/02/2026 ← FIRST block header (MOST RECENT, 2 days) +Row 2: MTD performance +Row 3: [Column headers or empty] +Row 4-17: [Campaign data rows] +Row 18: 1/01-1/01/2026 ← SECOND block header (OLDER, 1 day) +Row 19: MTD performance +Row 20+: [Older campaign data] +``` + +**Critical Understanding**: +- Row 1 = Most recent data (widest date range) +- Subsequent blocks below = Historical data (narrower date ranges) +- No empty rows separate blocks - date range patterns are the delimiters + +### Key Variables +- **blockStartRow** - Row number of header (ALWAYS 1 for most recent block) +- **userRowCount** - Number of rows user specified (e.g., 17) +- **blockHeight** - Same as userRowCount (e.g., 17 rows) + +## How Block Size is Determined + +The automation uses a user-guided approach: + +1. **CRITICAL ASSUMPTION** - The most recent MTD block is ALWAYS at row 1 + - No searching needed for block start + - Row 1 ALWAYS contains the date range pattern (e.g., "1/01-1/02/2026") + - This is maintained by each operation pushing older data down + +2. **User Input** - The user provides the block size: + - Prompt: "How many rows should I copy?" + - User knows their current data structure (typically 15-25 rows) + - Example: User says "17" → Copy rows 1-17 + - This eliminates complex scanning and pattern detection logic + +3. **Validation** - Simple checks: + - Input must be a positive integer + - If user is unsure, guidance is provided on how to count rows + - Typical block sizes are 15-25 rows depending on campaign count + +**Key Insight**: By asking the user, we eliminate the need to read 50+ rows, scan for date patterns, and handle edge cases. This makes the automation faster and more reliable. + +## Date Update Logic + +When updating the date in cell A1: + +``` +Today: January 8, 2026 +Yesterday: January 7, 2026 +Start date: January 1, 2026 (1st of yesterday's month) +End date: January 7, 2026 (yesterday) +Result in A1: "1/01-1/07/2026" +``` + +Date calculation rules: +- **Delete existing data** in A1 first +- **Start date**: Always the 1st day of yesterday's month +- **End date**: Yesterday's date +- **Format**: M/DD-M/DD/YYYY (no spaces around dash) + +Examples: +- Yesterday = Jan 10, 2026 → Type: `1/01-1/10/2026` +- Yesterday = Jan 1, 2025 → Type: `1/01-1/01/2025` +- Yesterday = Feb 2, 2026 → Type: `2/01-2/02/2026` +- Yesterday = Dec 31, 2025 → Type: `12/01-12/31/2025` + +## Error Handling + +The automation includes safeguards for: + +| Scenario | Handling | +|----------|----------| +| Invalid row count input | Re-prompt with guidance and examples | +| User unsure of row count | Provide instructions on how to count rows | +| Zero or negative row count | Validation error, request positive number | +| Date format mismatch | Detect and adapt to existing format | +| Copy/paste failure | Retry operation with verification | +| Sheet not accessible | Check permissions and authentication | + +## Verification Checklist + +Before considering the operation complete, verify: + +- [ ] User provided valid row count +- [ ] Correct number of rows copied (matches user input) +- [ ] New block appears at row 1 of sheet +- [ ] All rows from original block are present (no missing data) +- [ ] All columns from original block are present +- [ ] Cell A1 header updated with yesterday's date +- [ ] Date format matches existing format in sheet +- [ ] Previous row 1 is now at row (userRowCount + 1) +- [ ] No data was lost or overwritten +- [ ] Sheet is saved successfully + +## Common Patterns in Data + +### Campaign Data Format +``` +Campaign Name | Platform | Enrollments | Spend | Additional Metrics... +Samsung | Android | 1500 | $45,000 | ... +Samsung | iOS | 2100 | $63,000 | ... +PerforMarkt | Web | 980 | $15,400 | ... +``` + +### Date Range Format +``` +Required format for block detection: +- "1/01-1/02/2026" (M/D-M/D/YYYY format - required for detection) +- "12/1-12/31/2025" (M/DD-M/DD/YYYY format - required for detection) + +The pattern MUST include the full year at the end to be detected. +Block detection looks specifically for this pattern in column A. +``` + +## Related Skills + +This skill integrates with: +- **feedmob-chime-report-downloader** - Downloads latest Chime Media Plan Reports +- Other FeedMob automation tools for data management + +## Support & Troubleshooting + +### If Unsure How Many Rows to Copy +1. Look at the Google Sheet +2. Find column A (first column) +3. Locate the SECOND date range pattern (e.g., row 18 might have "1/01-1/01/2026") +4. Count rows from row 1 to the row before the second pattern +5. Example: If second pattern is at row 18, first block = 17 rows +6. Typical block sizes: 15-25 rows + +### If Data Doesn't Copy or Paste Correctly +1. **Selection Issue**: Make sure you selected entire ROWS (click row numbers), not cells +2. **Copy Verification**: After Ctrl+C, look for moving dotted border (marching ants) +3. **Insert Method**: Use "Insert X copied rows above" - NOT regular paste (Ctrl+V) +4. **Context Menu**: Right-click on ROW NUMBER (not cells) to see "Insert copied rows" option +5. **Hidden Content**: Verify no rows/columns are hidden +6. **Protection**: Check that rows aren't protected from editing +7. **If Formatting Lost**: Always copy ROWS not cells - click row numbers on left side + +### If Date Format is Wrong +1. Check format of other MTD blocks in sheet +2. Match that format exactly +3. Ensure date calculation is correct (yesterday's date) +4. Verify no extra characters or spaces + +### Sheet Access Issues +1. Confirm you're logged into correct Google account +2. Check that you have edit permissions on sheet +3. Verify sheet isn't in read-only mode +4. Contact FeedMob admin if access denied + +## Performance Notes + +- **User Input**: Instant - no need to read/analyze rows +- **Copy/Paste**: Operation time depends on block size (usually <5 seconds) +- **Date Update**: Minimal processing, near-instantaneous +- **Save**: May take 1-2 seconds for sheet to save +- **Overall**: Significantly faster than previous approach (no 50-row scan needed) + +## Future Enhancements + +Potential improvements: +- [ ] Support for multiple MTD blocks in single operation +- [ ] Automatic backup creation before operation +- [ ] Email notification upon completion +- [ ] Scheduling for automatic monthly execution +- [ ] Custom date range calculation +- [ ] Block validation and quality checks + +## Document Navigation + +**For Quick Overview:** +→ Start with `QUICK_REFERENCE.md` + +**For Full Instructions:** +→ Read `SKILL.md` + +**For Technical Implementation:** +→ Study `IMPLEMENTATION.md` + +**For This Overview:** +→ You're reading `README.md` + +## Version History + +**v1.0** (Current) +- Initial skill creation +- Full workflow documentation +- Comprehensive error handling +- Quick reference guide + +## License & Usage + +This skill is designed for FeedMob internal use. All workflows operate on FeedMob's Chime Internal Pacing Sheet. + +## Questions or Issues? + +Refer to the appropriate document: +- "How does it work?" → `SKILL.md` +- "How do I use it?" → `QUICK_REFERENCE.md` +- "How do I implement it?" → `IMPLEMENTATION.md` +- "What's the technical approach?" → `IMPLEMENTATION.md` (pseudo-code section) + +--- + +**Last Updated:** January 2026 +**Status:** Active +**Maintainer:** FeedMob Team diff --git a/skills/create-chime-mtd-performance/SKILL.md b/skills/create-chime-mtd-performance/SKILL.md new file mode 100644 index 0000000..d4e22a3 --- /dev/null +++ b/skills/create-chime-mtd-performance/SKILL.md @@ -0,0 +1,230 @@ +--- +name: create-chime-mtd-performance +description: Automated MTD Performance data block creation in Chime Internal Pacing Sheet. Asks user for block size, duplicates the top data block, and updates date ranges. Use at the start of new tracking periods for fast, accurate updates. +--- + +# Create Chime MTD Performance + +This skill provides fast, user-guided automation for managing MTD (Month-to-Date) Performance data blocks in the Chime Internal Pacing Sheet. By asking the user for the block size, it eliminates complex detection logic and ensures accurate, quick updates. + +## Target Sheet + +Operations are performed on the Chime Internal Pacing Sheet: +https://docs.google.com/spreadsheets/d/1lar11y52pOYfbzlequ6cgeB3aMzvDWbcjmpyoaHC8pc/edit?gid=57802555#gid=57802555 + +## Workflow Overview + +The automation follows this streamlined process: + +### Step 1: Open and Access the Sheet +- Open a new browser tab +- Navigate to the target Google Sheet URL +- Ensure the sheet is fully loaded and accessible + +### Step 2: Determine Block Size +- **CRITICAL RULE**: The most recent MTD Performance data block is ALWAYS at the top of the sheet (starting from row 1) +- **Ask the user**: "How many rows should I copy?" (e.g., 17, 20, 25) + - The user knows their current data block size + - Typical block sizes range from 15-25 rows depending on the number of campaigns +- **Block Structure**: + - Row 1 contains the date range pattern "M/D-M/D/YYYY" (e.g., "1/01-1/02/2026") + - Subsequent rows contain campaign data +- Once the user provides the row count, proceed to copy that many rows starting from row 1 + +### Step 3: Select and Copy the Data Block +**Selection:** +- Click on row number 1 (on the left side) to select the entire row 1 +- Hold Shift and click on the row number provided by the user (e.g., row 17 if user said "17 rows") + - Example: If user said 17 rows → Click row 1, hold Shift, click row 17 → Rows 1-17 are now selected +- **Important**: Always select from row 1, as this is where the most recent data resides +- Verify: All rows should be highlighted in blue/gray + +**Copy:** +- Press Ctrl+C (Windows/Linux) or Cmd+C (Mac) to copy +- OR right-click on the selected rows and choose "Copy" +- Verify: You should see a moving dotted border around the selected rows (marching ants) + +### Step 4: Insert Copied Rows at the Top +**CRITICAL: Use "Insert Copied Rows" NOT Regular Paste** + +**Method 1 (Recommended):** +1. Right-click on row number 1 (the first row) +2. Select "Insert X copied rows above" from the context menu + - X will be the number of rows you copied (e.g., "Insert 17 copied rows above") +3. This will insert the copied data AND shift all existing content down automatically + +**Method 2 (Alternative):** +1. Right-click on row number 1 +2. Select "Insert 1 row above" (repeat this X times where X = number of rows in the block) +3. After inserting empty rows, click cell A1 +4. Press Ctrl+V (Windows/Linux) or Cmd+V (Mac) to paste + +**Verification after insertion:** +- The new block should appear at rows 1-17 (or your block size) +- The original first block should now start at row 18 (or blockHeight + 1) +- All data should be intact with no overwriting + +### Step 5: Update Date Range in A1 +**Replace the Date Range:** +1. Click on cell A1 to select it +2. Press Delete or Backspace to clear the existing data +3. Calculate the new date range based on yesterday's date: + - **Start Date**: Always the 1st day of yesterday's month + - **End Date**: Yesterday's date + - **Format**: M/DD-M/DD/YYYY (no spaces around the dash) +4. Type the new date range and press Enter + +**Date Range Calculation Examples:** +- If yesterday is January 10, 2026 → Type: `1/01-1/10/2026` +- If yesterday is January 1, 2025 → Type: `1/01-1/01/2025` +- If yesterday is February 2, 2026 → Type: `2/01-2/02/2026` +- If yesterday is December 31, 2025 → Type: `12/01-12/31/2025` + +**Complete Example:** +- Today: January 8, 2026 +- Yesterday: January 7, 2026 +- Start date: January 1, 2026 (1st of yesterday's month) +- End date: January 7, 2026 (yesterday) +- **Type in A1**: `1/01-1/07/2026` + +**Verification:** +- Cell A1 shows the new date range +- Format is M/DD-M/DD/YYYY (no spaces) +- Start date is always the 1st of the month +- End date is yesterday's date +- Year is included at the end + +## Data Block Characteristics + +### Block Structure +- **Header Row**: Row 1 contains date range pattern "M/D-M/D/YYYY" in column A (e.g., "1/01-1/02/2026") +- **Campaign Data**: Subsequent rows contain campaign metrics (names, enrollments, spending, etc.) +- **Block Size**: Typically 15-25 rows depending on the number of active campaigns + +### Example Structure +``` +Row 1: 1/01-1/02/2026 ← FIRST block (MOST RECENT) - starts here +Row 2: MTD performance +Row 3: [Column headers] +Row 4-17: [Campaign data rows] ← User specifies this range (e.g., "17 rows") +Row 18: 1/01-1/01/2026 ← SECOND block (OLDER) +Row 19+: [Older campaign data rows] +``` + +**Key Points**: +- Row 1 ALWAYS contains the most recent data block +- The user knows their current block size and will provide it when asked +- Each operation adds a new block at the top, pushing older blocks down + +## Important Operational Notes + +- **CRITICAL RULE**: The most recent data block ALWAYS starts at row 1 +- **Block Position Logic**: + - Row 1 = Most recent data (widest date range) + - Rows below = Historical data (narrower date ranges) + - Each new operation adds a newer block at the top, pushing older ones down +- **User Input**: Always ask the user for the number of rows to copy at Step 2 +- **Data Integrity**: Verify the complete data block is selected before copying +- **Column Coverage**: Ensure all columns with data are included (select entire rows, not cells) +- **Verification Checklist**: + - Correct number of rows selected (as specified by user) + - All rows highlighted in blue/gray + - Copy operation shows marching ants border + - "Insert copied rows above" used (not regular paste) + - Date in A1 updated to yesterday's date + - Format maintained: M/D-M/D/YYYY + +## Automation Context + +This skill is designed for: +- Daily MTD tracking updates +- Monthly period transitions +- Automated report generation workflows +- Multi-partner campaign performance monitoring + +## Integration Points + +This automation works with campaign data from partners including: +- Samsung, PerforMarkt, Pointblank, AdsPostX +- True Finance, T-Mobile, Thanks.co +- Platforms: Android, iOS, Web, TV Universal + +## Detailed Troubleshooting Guide + +### Problem: Copy/Insert Operation Fails + +**Symptom**: Data gets overwritten or paste doesn't work correctly + +**Root Cause**: Using regular paste (Ctrl+V) instead of "Insert copied rows above" + +**Solution**: +1. ALWAYS select entire ROWS (click row numbers 1-17, not cells) +2. Copy with Ctrl+C (verify marching ants appear) +3. Right-click on row number 1 (NOT on a cell) +4. Select "Insert 17 copied rows above" from menu +5. This inserts AND pastes in one operation - existing data shifts down + +**What NOT to do**: +- ❌ Don't select cells (like A1:E17) - select ROWS +- ❌ Don't use regular paste (Ctrl+V) - use "Insert copied rows" +- ❌ Don't right-click on cells - right-click on row NUMBERS + +### Problem: "Insert Copied Rows" Option Not Showing + +**Symptom**: Context menu doesn't show "Insert X copied rows above" + +**Root Cause**: Copied cells instead of rows, or didn't copy at all + +**Solution**: +1. Verify you copied ROWS: Click row number 1, Shift+Click row 17 +2. Press Ctrl+C and confirm marching ants border appears +3. Right-click on the row NUMBER (gray area on left), not on cells +4. The option should appear as "Insert 17 copied rows above" + +### Problem: Formatting Lost After Paste + +**Symptom**: Colors, borders, or fonts don't match original + +**Root Cause**: Selected and copied cells instead of entire rows + +**Solution**: +- Always click on ROW NUMBERS (left gray area) to select entire rows +- This preserves all formatting, column widths, and styling +- Never select just cells (like A1:E17) when you need to preserve formatting + +### Problem: Data Overwritten Instead of Inserted + +**Symptom**: Original data at row 1 was replaced, not shifted down + +**Root Cause**: Used paste (Ctrl+V) without inserting rows first + +**Solution**: +- Use "Insert copied rows above" - this is ONE operation that inserts AND pastes +- If you must use two-step method: + 1. First: Insert X empty rows at top + 2. Then: Paste with Ctrl+V +- Never paste directly without inserting rows first + +### Problem: Unsure How Many Rows to Copy + +**Symptom**: Don't know the current block size + +**Solutions**: +1. Look at the sheet - find where the next date range pattern appears in column A +2. Count the rows from row 1 to the row before the next date pattern +3. Typical sizes: 15-25 rows depending on number of campaigns +4. You can always check the sheet visually to count the data block + +### Quick Verification Checklist + +Before considering operation complete: +- [ ] Asked user for number of rows to copy +- [ ] Selected ROWS (not cells) - row numbers highlighted +- [ ] Copy shows marching ants border +- [ ] Right-clicked on ROW NUMBER (not cells) +- [ ] Used "Insert copied rows above" option +- [ ] New block appears at top (rows 1-X where X is user-provided row count) +- [ ] Original block moved down (starts at row X+1) +- [ ] All formatting preserved (colors, borders) +- [ ] Date in A1 updated correctly to yesterday's date +- [ ] No data loss or overwriting occurred