feat(linkedin): integrate state-updater.mjs across all commands and hooks

Replace manual YAML editing instructions with deterministic
state-updater.mjs calls in 8 content commands (post, quick, react,
pipeline, first-post, video, publish, carousel) and 2 hook prompts
(state-update-reminder, post-creation-automation). Batch.md gets note
that state updates happen at publish time.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-04-11 00:42:17 +02:00
commit 1474948ef8
11 changed files with 141 additions and 72 deletions

View file

@ -148,14 +148,20 @@ Wait for the user to respond naturally.
## Step 8: State Update
After the post is finalized, update `~/.claude/linkedin-thought-leadership.local.md`:
- Set `last_post_date` to today's date (YYYY-MM-DD)
- Set `last_post_topic` to the main topic
- Check if ISO week changed — if so, reset `posts_this_week` to 0, update `current_week`
- Increment `posts_this_week`
- Update streak: increment if consecutive day, reset to 1 if gap > 2 days
- Update `longest_streak` if current exceeds it
- Add entry to "## Recent Posts": [YYYY-MM-DD] "Hook text..." (char count) - topic
After the post is finalized, update state deterministically:
```bash
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: 'react'
}));
"
```
Replace placeholders with actual post data. This replaces manual YAML editing.
---
@ -245,7 +251,7 @@ Offer same refinement options as Step 7.
### Step 8b: State Update
Same as Step 8 — update state file with topic, increment counts, etc.
Same as Step 8 — run `state-updater.mjs` with actual post data.
---