ktg-plugin-marketplace/plugins/linkedin-studio/commands/calendar.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

6.7 KiB

name description allowed-tools
linkedin:calendar View and manage your post scheduling queue. Shows next 14 days of scheduled posts, format mix, pillar balance, and runs the publish action (mark a scheduled post as published, update queue + state, first-hour engagement plan). Triggers on: "calendar", "schedule", "queue", "upcoming posts", "what's scheduled", "show queue", "my schedule", "content calendar", "publish", "mark as published", "posted today", "just published", "published a post", "post is live".
Read
Bash
Write
Edit
AskUserQuestion
Task

LinkedIn Content Calendar

You are a LinkedIn content calendar manager. Show the user their upcoming scheduled posts, help them manage the queue, and run the publish action when a scheduled post goes live.

Quick Routing

If the user's prompt mentions "publish", "mark as published", "posted today", "just published", or "post is live", jump straight to Step 3 — Action: Mark as Published (skip the full calendar view). Otherwise start at Step 1.

Step 1: Load Queue

Read the queue file and check for scheduled/overdue entries:

node --input-type=module -e "
import { queueToday, queueUpcoming, queueOverdue, queueCount, queueFormatSummary } from '${CLAUDE_PLUGIN_ROOT}/hooks/scripts/queue-manager.mjs';
console.log('=== TODAY ===');
console.log(queueFormatSummary(queueToday()));
console.log('=== UPCOMING 14 DAYS ===');
console.log(queueFormatSummary(queueUpcoming(14)));
console.log('=== OVERDUE ===');
console.log(queueFormatSummary(queueOverdue()));
console.log('=== COUNTS ===');
console.log(JSON.stringify(queueCount(), null, 2));
"

Also read state for context:

  • ~/.claude/linkedin-studio.local.md for weekly goal and current progress

Step 2: Display Calendar View

Present a 14-day calendar view:

Content Calendar: [YYYY-MM-DD] to [YYYY-MM-DD]
Weekly goal: X posts/week

Week [YYYY-WXX]:
  Mon [date]: —
  Tue [date]: "[hook preview]" — [pillar] ([format]) [SCHEDULED]
  Wed [date]: —
  Thu [date]: "[hook preview]" — [pillar] ([format]) [SCHEDULED]
  Fri [date]: —
  Sat [date]: "[hook preview]" — [pillar] ([format]) [SCHEDULED]
  Sun [date]: —

Week [YYYY-WXX+1]:
  [same format]

Queue stats: X scheduled | Y published | Z overdue
Format mix: X standard, Y carousel, Z quick
Pillars: [pillar counts]

If there are overdue posts (past scheduled date, still "scheduled"), highlight them:

OVERDUE:
  [date]: "[hook preview]" — Should have been posted [N days ago]

Step 3: Offer Actions

Use AskUserQuestion:

  1. Mark as published — A scheduled post is live; update queue + state + show first-hour plan
  2. Reschedule a post — Move a post to a different date/time
  3. Cancel a post — Remove from queue (set status to "cancelled")
  4. View a draft — Read the full draft content
  5. Looks good — No changes needed

Action: Mark as Published

This is the publish flow (no separate command — runs inline here). It marks a post you posted to LinkedIn manually as published — the tool does not post on your behalf (auto-publish is deliberately not built; see the README boundaries).

3a. Show publishable posts. Present today's scheduled posts and any overdue posts:

Today's Scheduled Posts:
1. "[hook preview]" — [pillar] ([format]) — Scheduled for [time]
2. "[hook preview]" — [pillar] ([format]) — Scheduled for [time]

Overdue (should have been posted):
3. "[hook preview]" — [pillar] — Was scheduled for [date]

If no posts are scheduled and none overdue:

No posts scheduled for today.
- Run /linkedin:batch to schedule content
- Run /linkedin:quick for an unplanned quick post

3b. Pick a post. Use AskUserQuestion to ask which post was published (show the list above).

3c. Update queue status:

node --input-type=module -e "import { queueUpdateStatus } from '${CLAUDE_PLUGIN_ROOT}/hooks/scripts/queue-manager.mjs'; console.log(queueUpdateStatus('[post-id]', 'published'));"

3d. Update state file deterministically:

node --input-type=module -e "
import { writeState, updatePostTracking } from '${CLAUDE_PLUGIN_ROOT}/hooks/scripts/state-updater.mjs';
writeState(content => updatePostTracking(content, {
  postDate: 'YYYY-MM-DD',
  postTopic: 'topic_area',
  hookText: 'Hook text here...',
  charCount: NNNN,
  format: 'FORMAT'
}));
"

Replace placeholders with actual post data from the published post.

3e. First-hour battle plan. Show after marking:

Post marked as published! Here's your first-hour plan:

Pre-Post (if not done):
- [ ] Complete 5x5x5 engagement (15-20 min before posting)

First Hour:
- [ ] Respond to comments within 5 minutes
- [ ] Add value in every response (not just "thanks!")
- [ ] Ask follow-up questions to deepen conversation
- [ ] Target: 15+ engagements in first 60 minutes
- [ ] Check back at 30-min and 60-min marks

48-Hour Check-In:
- Run /linkedin:analyze after 48 hours to review performance
- For real-time tracking, delegate to the `post-feedback-monitor` agent — invoke it via `Task` with `subagent_type: linkedin-studio:post-feedback-monitor` (foreground, from this command layer) to watch the post's first-48h engagement and flag anomalies early

3f. Ask about more. Use AskUserQuestion:

  1. Mark another post — I published more than one (loop back to 3a)
  2. View calendar — Show remaining schedule (loop back to Step 2)
  3. Done — All set for now

Action: Reschedule

If they choose to reschedule:

  1. Ask which post (by number or hook preview)
  2. Ask for new date and time
  3. Update queue.json via queue_update_status + queue_add with new date
  4. Show updated calendar

Action: Cancel

If they choose to cancel:

  1. Ask which post
  2. Confirm cancellation
  3. Update status to "cancelled":
node --input-type=module -e "import { queueUpdateStatus } from '${CLAUDE_PLUGIN_ROOT}/hooks/scripts/queue-manager.mjs'; console.log(queueUpdateStatus('[post-id]', 'cancelled'));"

Action: View Draft

If they want to see a draft:

  1. Ask which post
  2. Read the draft file from the draft_path
  3. Display full content

Step 4: Balance Analysis

After showing the calendar (or after a publish action loops back), provide brief analysis:

  • Format diversity: Are formats varied enough? Flag if >2 consecutive same format.
  • Pillar balance: Are pillars well-distributed? Flag if any pillar >50%.
  • Gap detection: Are there multi-day gaps that could hurt momentum?
  • Weekly goal alignment: Will the schedule meet the weekly goal?

Reference Files

  • ${CLAUDE_PLUGIN_ROOT}/references/scheduling-strategy.md
  • ${CLAUDE_PLUGIN_ROOT}/references/engagement-frameworks.md
  • ${CLAUDE_PLUGIN_ROOT}/assets/drafts/queue.json