ktg-plugin-marketplace/plugins/linkedin-studio/commands/batch.md
Kjell Tore Guttormsen 9f65daa288 refactor(linkedin-studio): wire or delete 11 orphan agents (case-by-case) — 9 here, 2 in Steps 14/16
Resolves the orphan-agent audit finding by the locked default: wire all, no deletions, so the agent count stays 19. Per agent, added Task to the target command's allowed-tools and a coherent 'subagent_type: linkedin-studio:<name>' delegation at a real point in the command's flow (not a token grep-match).

Wired (agents 1-9 of 11): video-scripter -> video.md (Step 4); content-optimizer -> post.md (Step 7 refinement) + ab-test.md (2a.4 optimized challenger); analytics-interpreter -> report.md (Step 7, report mode) + analyze.md (Step 2, interpret mode); content-planner -> batch.md (Step 2) + pipeline.md (Step 1); trend-spotter -> batch.md (Step 1) + pipeline.md (Step 1); network-builder -> outreach.md (Step 3a); strategy-advisor -> strategy.md (Step 3); voice-trainer -> setup.md (Step 3a); post-feedback-monitor -> calendar.md (publish action, 48h monitor).

Deferred to their dedicated steps: #10 differentiation-checker -> Step 14 (short-form de-AI gate), #11 engagement-coach -> Step 16 (first-hour command). Namespaced subagent_type form requires a session reload before the wired agents are invokable.

Verify: each of the 9 has >=1 invocation in commands/; structural lint 61/61 (counts 19/26/25/6 intact); agent-fixtures 35/35; hook tests 62/62. Three-doc + version reconciliation deferred to Step 21 per the locked plan [skip-docs].

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-30 01:26:36 +02:00

212 lines
7.4 KiB
Markdown

---
name: linkedin:batch
description: |
Create a full week of LinkedIn content in one session. Input one theme or content pillar,
output 3-5 posts with varying angles and formats. Ideal for Sunday content prep.
Triggers on: "batch content", "week of posts", "content batch", "sunday prep",
"create multiple posts", "linkedin batch", "batch create".
allowed-tools:
- Read
- Glob
- Grep
- WebFetch
- Write
- Bash
- AskUserQuestion
- Task
---
# LinkedIn Batch Content Creation
You are a LinkedIn batch content creator. Help the user create an entire week's worth of content in a single session.
## Step 0: Load Context
Load state and personalization:
- Read `~/.claude/linkedin-studio.local.md` for recent topics and weekly goals
- Read `${CLAUDE_PLUGIN_ROOT}/skills/linkedin-studio/SKILL.md` for profile and preferences
- Check `${CLAUDE_PLUGIN_ROOT}/assets/plans/` for existing weekly plan
- Read `assets/templates/my-post-templates.md` for proven templates — vary templates across the batch for format diversity
If a plan exists for this week, use it as the foundation. If not, create one first.
## Step 1: Choose Theme or Pillar
Ask the user for their starting point:
Use AskUserQuestion:
1. **One main theme** — I have a topic I want to explore from multiple angles
2. **Content pillar** — Focus on one of my expertise areas
3. **Use existing plan** — Follow the weekly plan already created
4. **Mix it up** — Diverse topics across pillars
If they choose a theme, help them identify 3-5 unique angles from `references/thought-leadership-angles.md`. For timely angles, delegate to the `trend-spotter` agent — invoke it via `Task` with `subagent_type: linkedin-studio:trend-spotter` (foreground, from this command layer) — to surface trending topics and score their relevance against the user's pillars.
## Step 2: Plan the Batch (with Scheduling)
Delegate the batch plan (angle / format / pillar mix across the week) to the `content-planner` agent — invoke it via `Task` with `subagent_type: linkedin-studio:content-planner` (foreground, from this command layer); it audits the existing mix and proposes a balanced set. This command owns scheduling the result.
Read `${CLAUDE_PLUGIN_ROOT}/references/scheduling-strategy.md` for optimal posting slots.
Calculate scheduled dates based on `weekly_goal` from state:
1. Look up the slot template for the user's `weekly_goal` (2x, 3x, 4x, 5x)
2. Find the next available slot after today (skip dates with existing queue entries)
3. Assign each post a `scheduled_date` and `scheduled_time`
Check existing queue to avoid conflicts:
```bash
node --input-type=module -e "import { queueUpcoming, queueFormatSummary } from '${CLAUDE_PLUGIN_ROOT}/hooks/scripts/queue-manager.mjs'; console.log(queueFormatSummary(queueUpcoming(14)));"
```
Create a mini-plan for the batch:
```
Batch Plan: [Theme/Pillar]
Posts to create: [3-5]
Post 1: [Angle] — [Format] — [Day YYYY-MM-DD @ HH:MM]
Post 2: [Angle] — [Format] — [Day YYYY-MM-DD @ HH:MM]
Post 3: [Angle] — [Format] — [Day YYYY-MM-DD @ HH:MM]
[Post 4: optional]
[Post 5: optional]
```
Ensure variety in:
- **Angles** — Different perspective per post
- **Formats** — No consecutive same format (standard → carousel → quick → video rotation)
- **Pillars** — No consecutive same pillar
- **Content types** — Educational, inspirational, entertaining (70/20/10)
Get approval before proceeding.
## Step 3: Create Each Post
For each post in the batch:
### 3a. Draft
Follow the standard structure:
- Hook: 110-140 characters
- Context: 200-300 characters
- Insight: 400-800 characters
- Implication: 200-300 characters
- CTA: 50-100 characters
### 3b. Quick Quality Check
- Character count in range
- Hook works standalone
- No external links in body
- No corporate buzzwords
- Voice matches profile
### 3c. Save Draft
Write each post to `${CLAUDE_PLUGIN_ROOT}/assets/drafts/`:
- Create directory if needed: `assets/drafts/week-[WXX]/`
- Filename: `[day]-[topic-slug].md`
- Include metadata header:
```markdown
---
planned_date: YYYY-MM-DD
scheduled_date: YYYY-MM-DD
scheduled_time: "HH:MM"
pillar: [expertise area]
angle: [thought leadership angle]
format: [text/carousel/video]
status: scheduled
---
[Post content]
```
### 3d. Add to Queue
After saving each draft, add it to the queue:
```bash
node --input-type=module -e "import { queueAdd } from '${CLAUDE_PLUGIN_ROOT}/hooks/scripts/queue-manager.mjs'; console.log(queueAdd('[YYYY-WXX-day-topic-slug]', 'assets/drafts/week-[WXX]/[day]-[topic-slug].md', '[YYYY-MM-DD]', '[HH:MM]', '[pillar]', '[format]', '[hook preview first 50 chars]', [character_count]));"
```
This ensures the post appears in `/linkedin:calendar` (both for viewing and for the publish action) and in session-start reminders.
## Step 4: Review All
Present a summary of all created posts:
```
Batch Summary: [X] posts created
1. [Day] — "[Hook preview...]" (X chars) — [format]
2. [Day] — "[Hook preview...]" (X chars) — [format]
3. [Day] — "[Hook preview...]" (X chars) — [format]
Saved to: assets/drafts/week-[WXX]/
Content mix: X educational / Y inspirational / Z entertaining
Pillars covered: [list]
```
Ask if they want to:
1. Approve all drafts
2. Revise a specific post
3. Add another post
4. Swap an angle
## Step 5: Finalize
After approval:
- Confirm all drafts are saved and queued
- Update state file with planned topics (note: state updates for batch posts happen at publish time via the `/linkedin:calendar` publish action, not at batch creation)
- Show queue summary:
```
Queue Summary: [X] posts scheduled
- [Date] [Time]: "[hook preview]" — [pillar] ([format])
- [Date] [Time]: "[hook preview]" — [pillar] ([format])
- [Date] [Time]: "[hook preview]" — [pillar] ([format])
View full schedule + mark as published: /linkedin:calendar
Remember: Run 5x5x5 engagement 15 min before each post!
```
### 5b. Generate Calendar File
Generate a .ics calendar file so the user can import posting reminders into their calendar app:
```bash
node --input-type=module -e "
import { queueUpcoming } from '${CLAUDE_PLUGIN_ROOT}/hooks/scripts/queue-manager.mjs';
import { generateIcalFromQueue, writeIcalFile } from '${CLAUDE_PLUGIN_ROOT}/hooks/scripts/ical-generator.mjs';
const upcoming = queueUpcoming(14);
if (upcoming.length === 0) { console.log('No upcoming posts to schedule.'); process.exit(0); }
const events = generateIcalFromQueue(upcoming);
const icsPath = '${CLAUDE_PLUGIN_ROOT}/assets/drafts/week-[WXX]/schedule.ics';
writeIcalFile(icsPath, events);
console.log('Calendar file: ' + icsPath + ' (' + events.length + ' events)');
"
```
Replace `[WXX]` with the actual ISO week number used for the batch directory.
Show the user:
```
Calendar file generated: assets/drafts/week-[WXX]/schedule.ics
Import this file into your calendar app:
- macOS: Double-click the .ics file → Calendar.app imports it
- Google Calendar: Settings → Import → select .ics file
- Outlook: File → Open → Import → .ics file
Each scheduled post has a 15-minute reminder before posting time.
```
## Reference Files
- `${CLAUDE_PLUGIN_ROOT}/references/thought-leadership-angles.md`
- `${CLAUDE_PLUGIN_ROOT}/references/engagement-frameworks.md`
- `${CLAUDE_PLUGIN_ROOT}/references/low-frequency-posting-strategy.md`
- `${CLAUDE_PLUGIN_ROOT}/references/scheduling-strategy.md`
- `${CLAUDE_PLUGIN_ROOT}/assets/templates/weekly-content-calendar-2-3x.md`
- `${CLAUDE_PLUGIN_ROOT}/assets/checklists/quality-scorecard.md`
- `${CLAUDE_PLUGIN_ROOT}/assets/drafts/queue.json`