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

@ -150,12 +150,20 @@ Then confirm: "Copied to clipboard."
Do NOT proactively offer alternative versions. Only generate alternatives if the user asks.
**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 and add entry to "## Recent Posts"
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: 'quick'
}));
"
```
Replace placeholders with actual post data. This replaces manual YAML editing.
## Common Mistakes to Avoid