# Marketing Skill

> Skill: Parallel Tab Batch Processing for YouTube Comments

- Skill: `zshellxu/marketing-skill` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add zshellxu/marketing-skill`
- Raw SKILL.md: https://api.skillmd.com/api/skills/zshellxu/marketing-skill/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Marketing & Growth
- Author: ZShellXu (https://skillmd.com/u/zshellxu)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/zshellxu/marketing-skill

---

# Skill: Parallel Tab Batch Processing for YouTube Comments

## Overview

This skill enables you to **open, read, and act on 10+ YouTube videos simultaneously** instead of one at a time — dramatically cutting execution time. The core idea: *launch all tabs in parallel, then process them in parallel batches.*

---

## Phase 1: Search & Extract Video IDs

**Goal:** Get a list of video IDs from a YouTube search results page.

```javascript
// Run this in javascript_tool on the search results tab
const videos = document.querySelectorAll('a#video-title');
const results = [...videos].slice(0, 15).map(v => ({
  title: v.title,
  id: v.href?.split('v=')[1]?.split('&')[0]
})).filter(v => v.id && !v.id.startsWith('http')); // filter out Shorts/playlists

// Output as readable list
results.map(v => `${v.title} --> ${v.id}`).join('\n');
```

**Tips:**
- Grab 15 IDs to have backups in case some videos are unavailable
- Filter out Shorts (check that `v.href` contains `/watch?v=`, not `/shorts/`)
- Store the full list before opening any tabs

---

## Phase 2: Open All Tabs in Parallel

**Goal:** Create N tabs simultaneously using `browser_batch`.

```
Step 1 — Create all tabs at once:
  browser_batch:
    - tabs_create (×10 — one per video slot)

Step 2 — Navigate all tabs in one batch:
  browser_batch:
    - navigate tab1 → youtube.com/watch?v=ID_1
    - navigate tab2 → youtube.com/watch?v=ID_2
    - navigate tab3 → youtube.com/watch?v=ID_3
    ... (all 10 in the same batch call)
```

**Why this works:** `browser_batch` executes sequentially per batch, but by launching all navigations together you avoid the serial wait of "open one → wait → open next."

---

## Phase 3: Read All Tabs in Parallel

**Goal:** Extract descriptions and check for prior comments on all tabs at once.

```
Step 1 — Read all page text simultaneously:
  browser_batch:
    - get_page_text(tab1)
    - get_page_text(tab2)
    ...
    - get_page_text(tab10)

Step 2 — Scroll all tabs to load comments section:
  browser_batch:
    - scroll(tab1, direction=down, amount=15)
    - scroll(tab2, direction=down, amount=15)
    ...
    - scroll(tab10, direction=down, amount=15)
```

**What to look for in the page text:**
- `@YOUR_CHANNEL_HANDLE` → skip this video (already commented)
- Video title & description → use to craft your tailored comment
- "Video unavailable" → skip and use a backup ID from your list

---

## Phase 4: Craft Tailored Comments

**Goal:** Write one unique comment per video based on its specific description.

**Comment Formula:**
```
[1 custom sentence about THIS video's specific topic or key insight]. [Your base promotional/informational text here.]
```

**Tips for the custom sentence:**
- Pull a specific detail from the description (a number, a date, a product name, a key claim)
- Connect it naturally to your base message's theme
- Keep it to 1–2 sentences max — don't over-write

**Example:**
```
Video topic: Company X announces 45 new satellite launches for 2025
Custom sentence: "Announcing 45 new satellite launches while also securing government contracts shows Company X is scaling fast — and understanding the broader market context matters more than ever."
```

---

## Phase 5: Confirm with User (Required)

**Goal:** Present ALL proposed comments to the user before posting anything.

Format your proposal like this:

```
Here are the 10 comments I'd like to post:

**1. [Video Title]** (`video_id`)
> [Full proposed comment text]

**2. [Video Title]** (`video_id`)
> [Full proposed comment text]

...

Reply "yes" to post all comments.
```

**Always wait for an explicit "yes" or confirmation before proceeding to Phase 6.**

---

## Phase 6: Post Comments in Batch

**Goal:** Submit all comments efficiently across all tabs.

For each tab (process 3–4 at a time to avoid rate limits):

```
Step A — Click the comment input box:
  find(tab, "Add a comment...")  → get element ref
  computer.left_click(ref)

Step B — Type the comment:
  computer.type(full_comment_text)

Step C — Submit:
  find(tab, "Comment submit button") → get element ref
  computer.left_click(ref)

Step D — Verify:
  computer.screenshot(tab)
  → confirm "@YOUR_CHANNEL_HANDLE just now" or "0 seconds ago" appears
```

**Rate limit handling:** If YouTube shows a posting error or rate limit, wait 10–15 seconds and retry. Process 3–4 tabs, pause briefly, then continue the next group.

---

## Phase 7: Verification & Report

**Goal:** Confirm all comments are live and report to user.

```
✅ Posted: [Video Title] — @YOUR_CHANNEL_HANDLE confirmed (0 seconds ago)
✅ Posted: [Video Title] — @YOUR_CHANNEL_HANDLE confirmed (0 seconds ago)
...

Total: 10/10 comments posted successfully.
```

---

## Decision Flowchart

```
Search YouTube for topic query
          ↓
Extract 15 video IDs via JavaScript
          ↓
Open 10 tabs in parallel (browser_batch: tabs_create × 10)
          ↓
Navigate all tabs in parallel (browser_batch: navigate × 10)
          ↓
Read all descriptions in parallel (browser_batch: get_page_text × 10)
          ↓
Scroll all tabs to load comments (browser_batch: scroll × 10)
          ↓
For each video:
  ├─ "Video unavailable" → skip, use backup ID from list
  ├─ "@YOUR_CHANNEL_HANDLE" found in comments → skip (already posted)
  └─ OK → craft tailored comment using description
          ↓
Present ALL proposed comments to user → WAIT for "yes"
          ↓
Post comments in groups of 3–4 (pause between groups)
          ↓
Screenshot-verify each → Report full completion
```

---

## Key Efficiency Principles

| Principle | Implementation |
|-----------|----------------|
| **Open tabs in parallel** | One `browser_batch` with all `tabs_create` + `navigate` calls |
| **Read in parallel** | One `browser_batch` with all `get_page_text` calls |
| **Scroll in parallel** | One `browser_batch` with all scroll actions |
| **Never wait serially** | Avoid open-one → read-one → open-next patterns |
| **Backup IDs ready** | Always extract 15 IDs, use top 10, keep 5 as fallback |
| **Rate limit awareness** | Post in groups of 3–4 with short pauses between groups |
| **Always verify** | Screenshot after each post to confirm comment appears |

---

## Common Errors & Fixes

| Error | Fix |
|-------|-----|
| Video shows "This video isn't available" | Skip it; use one of your 5 backup IDs |
| JavaScript returns playlist/channel links instead of video IDs | Add `.filter(v => v.id && !v.id.startsWith('http'))` to your JS |
| Comments section shows black screen / not loading | Scroll up slightly after scrolling down to trigger reload |
| Rate limit error when submitting comment | Wait 10–15 seconds, then retry; process remaining tabs in smaller groups |
| "Add a comment..." input box not visible | Scroll to the correct position first; use `find` with ref to locate the element |
| Comment button not found after typing | Use `find(tab, "Comment submit button")` to locate the blue submit button by ref |

---

## Customization Guide

This skill works for **any YouTube topic and any comment template**. To adapt it:

1. **Change the search query** → swap `search_query=` parameter in the YouTube URL
2. **Change the comment base text** → update your fixed promotional/informational message
3. **Change the channel handle** → replace `@YOUR_CHANNEL_HANDLE` with your actual handle
4. **Change the number of tabs** → adjust from 10 to any number (5–15 is practical)
5. **Change the skip logic** → update the duplicate-check string to match your channel handle

---

## Notes

- This skill was developed and validated through live YouTube commenting sessions across 24 videos in 3 topic categories (SpaceX IPO, ASTS, Rocket Lab).
- Always confirm with the user before posting — never auto-post without explicit approval.
- YouTube's comment rate limits vary; if you hit errors, space out your submissions.
- This pattern generalizes beyond YouTube to any multi-tab read-then-act workflow.

