linkedin-post-generator
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLinkedIn Post Generator
LinkedIn 帖子生成器
Generate LinkedIn posts from shared source material, written in each user's personal style.
根据共享素材生成LinkedIn帖子,且帖子风格匹配每位用户的个人写作风格。
How It Works
工作原理
- Personal style profile — stored locally at (never committed)
~/.config/casper/linkedin-style.md - Source config — stored locally at (never committed)
~/.config/casper/linkedin-sources.md - Shared source material — meeting transcripts, Slack dumps, docs in
source-material/ - Prompt template — extraction rules, voice guidelines, few-shot examples in
references/prompt-template.md
- 个人风格配置文件 — 本地存储于 (不会被提交)
~/.config/casper/linkedin-style.md - 素材配置文件 — 本地存储于 (不会被提交)
~/.config/casper/linkedin-sources.md - 共享素材 — 会议记录、Slack内容导出文件、目录下的文档
source-material/ - 提示词模板 — 提取规则、语气指南、少样本示例位于
references/prompt-template.md
First Run: Style Setup
首次运行:风格设置
Check if exists.
~/.config/casper/linkedin-style.mdIf it does NOT exist, run the style setup flow:
- Say: "Welcome to the LinkedIn Post Generator! Before we start, I need to understand your writing style."
- Say: "Share 3 LinkedIn posts that match the style you want. You can either paste the post links (e.g. ) or paste the text directly."
https://linkedin.com/posts/... - Wait for the user to provide 3 posts
- If the user provides LinkedIn URLs, fetch the post content using the apify-scrapers skill:
Extract the post text from the JSON output. If a URL fails to fetch, ask the user to paste that post's text instead.bash
python ${CLAUDE_PLUGIN_ROOT}/skills/apify-scrapers/scripts/scrape_linkedin_posts.py search "{url}" --max-posts 1 - Analyze the posts for: tone, sentence length, vocabulary, formatting habits, hook style, CTA style, use of questions, paragraph length, overall energy
- Create directory if it doesn't exist
~/.config/casper/ - Save the analysis to using this format:
~/.config/casper/linkedin-style.md
markdown
undefined检查 是否存在。
~/.config/casper/linkedin-style.md若不存在,运行风格设置流程:
- 提示:"欢迎使用LinkedIn帖子生成器!开始之前,我需要了解你的写作风格。"
- 提示:"请分享3篇符合你期望风格的LinkedIn帖子。你可以粘贴帖子链接(例如 )或直接粘贴帖子文本。"
https://linkedin.com/posts/... - 等待用户提供3篇帖子
- 若用户提供LinkedIn链接,使用apify-scrapers技能获取帖子内容:
从JSON输出中提取帖子文本。若链接获取失败,请用户直接粘贴该帖子的文本。bash
python ${CLAUDE_PLUGIN_ROOT}/skills/apify-scrapers/scripts/scrape_linkedin_posts.py search "{url}" --max-posts 1 - 分析帖子的以下维度:语气、句子长度、词汇、格式习惯、开头钩子风格、结尾CTA风格、提问使用情况、段落长度、整体活力
- 若 目录不存在则创建
~/.config/casper/ - 将分析结果保存至 ,格式如下:
~/.config/casper/linkedin-style.md
markdown
undefinedLinkedIn Style Profile
LinkedIn 风格配置文件
Generated: [date]
生成日期:[日期]
Tone
语气
[analysis]
[分析内容]
Structure Patterns
结构模式
[paragraph length, line breaks, formatting habits]
[段落长度、换行、格式习惯]
Hook Style
开头钩子风格
[how they open posts]
[帖子开头方式]
CTA / Closing Style
CTA/结尾风格
[how they end posts — questions, challenges, etc.]
[帖子结尾方式 — 提问、挑战等]
Vocabulary & Phrases
词汇与短语
[distinctive phrases, word choices, energy level]
[独特短语、词汇选择、活力水平]
Sample Posts
示例帖子
[the 3 original posts, for reference]
8. Confirm: "Got it! Your style profile is saved. You can update it anytime with `/casper:generate-linkedin-post --setup`"[3篇原始帖子,用于参考]
8. 确认提示:"已完成!你的风格配置文件已保存。随时可以通过 `/casper:generate-linkedin-post --setup` 更新配置。"First Run: Source Material Check
首次运行:素材检查
After style setup completes (or if style exists but source-material/ is empty), check for source material:
- Check if contains any
source-material/files besides.mdREADME.md - If empty, guide the user:
- Say: "You don't have any source material yet. I need content to generate posts from — meeting transcripts, notes, Slack conversations, etc."
- Present options:
- "Connect integrations" — run the flow to configure Fireflies, Slack, or Google Drive auto-pulling
--setup-sources - "Paste something manually" — run the flow to let the user paste a transcript, notes, or other content
--add-source
- "Connect integrations" — run the
- Wait for user choice and proceed with the selected flow
- If source material exists, proceed with generation
风格设置完成后(或风格配置存在但source-material/为空时),检查素材情况:
- 检查 目录下是否包含除
source-material/外的其他README.md文件.md - 若为空,引导用户:
- 提示:"你目前没有任何素材。我需要内容来生成帖子 — 比如会议记录、笔记、Slack对话等。"
- 提供选项:
- 「连接集成工具」 — 运行 流程配置Fireflies、Slack或Google Drive自动拉取
--setup-sources - 「手动粘贴内容」 — 运行 流程让用户粘贴记录、笔记或其他内容
--add-source
- 「连接集成工具」 — 运行
- 等待用户选择并执行对应流程
- 若素材存在,继续生成流程
Normal Run: Post Generation
常规运行:帖子生成
If style config exists and source material is available, proceed with generation:
- Read
~/.config/casper/linkedin-style.md - Read ALL files in (excluding README.md)
${CLAUDE_PLUGIN_ROOT}/skills/linkedin-post-generator/source-material/ - Read
${CLAUDE_PLUGIN_ROOT}/skills/linkedin-post-generator/references/prompt-template.md - Apply the confidentiality rules from the prompt template (no financials, no client names, no pipeline, no team member names)
- Generate 2-4 post options based on the source material, written in the user's personal style
- Present them in a clean, copy-paste-ready format
当风格配置存在且素材可用时,执行生成流程:
- 读取
~/.config/casper/linkedin-style.md - 读取 目录下的所有文件(排除README.md)
${CLAUDE_PLUGIN_ROOT}/skills/linkedin-post-generator/source-material/ - 读取
${CLAUDE_PLUGIN_ROOT}/skills/linkedin-post-generator/references/prompt-template.md - 应用提示词模板中的保密规则(不得包含财务信息、客户名称、业务管线、团队成员姓名)
- 根据素材生成2-4个符合用户个人风格的帖子选项
- 以简洁、可直接复制粘贴的格式展示
Flags
命令标志
| Flag | Behavior |
|---|---|
| (none) | Normal generation flow |
| Re-run style setup, overwrite existing config |
| Configure which Fireflies, Slack, and Drive sources to pull from |
| Pull fresh source material from configured integrations, then generate |
| Read and display |
| List and summarize all files in |
| Prompt user to paste new content, save as new |
| 标志 | 行为 |
|---|---|
| 无 | 常规生成流程 |
| 重新运行风格设置,覆盖现有配置 |
| 配置要从中拉取素材的Fireflies、Slack和Drive源 |
| 从已配置的集成工具拉取最新素材,然后生成帖子 |
| 读取并展示 |
| 列出并总结source-material/目录下的所有文件 |
| 提示用户粘贴新内容,保存为source-material/目录下的新 |
Flag Details
标志详情
--setup-sources
--setup-sources--setup-sources
--setup-sourcesInteractive setup for automatic source pulling. Read for full details.
references/source-integrations.md- Ask: "What's your work email address? This is used to filter transcripts to only meetings you attended."
- Save as in the config
user_email
- Save as
- Ask: "Which sources do you want to connect?" Present options:
- Fireflies.ai — pulls meeting transcripts (needs env var)
FIREFLIES_API_KEY - Slack — pulls messages from channels (needs env var)
SLACK_BOT_TOKEN - Google Drive — pulls docs and transcripts (needs OAuth setup via google-workspace skill)
- Fireflies.ai — pulls meeting transcripts (needs
- For each selected source, check if the required env var / credentials exist. If missing, provide setup instructions:
- Fireflies: "Set in your environment. Get your API key from https://app.fireflies.ai/api"
FIREFLIES_API_KEY - Slack: "Set in your environment. Create a Slack app at https://api.slack.com/apps"
SLACK_BOT_TOKEN - Google Drive: "Run the google-workspace skill setup to configure OAuth."
- Fireflies: "Set
- For each enabled source, gather configuration:
- Fireflies: search terms (or leave empty for all recent) and days_back
- Slack: which channels to pull from — list available channels if possible, otherwise ask the user
- Google Drive: search terms, days_back
- Save to
~/.config/casper/linkedin-sources.md - Confirm: "Source config saved. Run to pull fresh content."
/casper:generate-linkedin-post --refresh
自动拉取素材的交互式设置。完整细节请参考 。
references/source-integrations.md- 提问:"你的工作邮箱地址是什么?这将用于筛选仅你参加过的会议记录。"
- 将邮箱保存至配置文件的 字段
user_email
- 将邮箱保存至配置文件的
- 提问:"你想连接哪些源?" 提供选项:
- Fireflies.ai — 拉取会议记录(需要环境变量 )
FIREFLIES_API_KEY - Slack — 拉取频道消息(需要环境变量 )
SLACK_BOT_TOKEN - Google Drive — 拉取文档和记录(需要通过google-workspace技能完成OAuth配置)
- Fireflies.ai — 拉取会议记录(需要环境变量
- 对于每个选中的源,检查是否存在所需的环境变量/凭证。若缺失,提供设置说明:
- Fireflies:"在环境中设置 。可从https://app.fireflies.ai/api获取你的API密钥"
FIREFLIES_API_KEY - Slack:"在环境中设置 。可在https://api.slack.com/apps创建Slack应用"
SLACK_BOT_TOKEN - Google Drive:"运行google-workspace技能设置来配置OAuth。"
- Fireflies:"在环境中设置
- 为每个启用的源收集配置信息:
- Fireflies:搜索关键词(留空则拉取所有近期内容)和days_back(回溯天数)
- Slack:要拉取的频道 — 若可能则列出可用频道,否则询问用户
- Google Drive:搜索关键词、days_back(回溯天数)
- 将配置保存至
~/.config/casper/linkedin-sources.md - 确认提示:"源配置已保存。运行 拉取最新内容。"
/casper:generate-linkedin-post --refresh
--refresh
--refresh--refresh
--refreshPull fresh source material from all configured integrations before generating posts. Read for the full integration workflow.
references/source-integrations.mdSummary of the flow:
- Read — if missing, run
~/.config/casper/linkedin-sources.mdfirst--setup-sources - For each enabled source, call the existing Casper skill scripts:
- Fireflies:
python ${CLAUDE_PLUGIN_ROOT}/skills/transcript-search/scripts/fireflies_transcript_search.py "{term}" --days-back {N} --content --json- After fetching, filter results to only transcripts where (from source config) appears in the transcript's
user_emailarrayparticipants
- After fetching, filter results to only transcripts where
- Slack:
python ${CLAUDE_PLUGIN_ROOT}/skills/slack-automation/scripts/slack_search.py read "{channel}" --days {N} - Google Drive:
python ${CLAUDE_PLUGIN_ROOT}/skills/google-workspace/scripts/gdrive_search.py files "{term}" --modified-days {N} --json
- Fireflies:
- Convert JSON output to clean markdown and save to :
source-material/- Fireflies:
fireflies-{YYYY-MM-DD}-{title-slug}.md - Slack:
slack-{channel}-{YYYY-MM-DD}.md - Google Drive:
gdrive-{title-slug}-{YYYY-MM-DD}.md
- Fireflies:
- Proceed with normal generation
生成帖子前,从所有已配置的集成工具拉取最新素材。完整集成工作流请参考 。
references/source-integrations.md流程概要:
- 读取 — 若缺失,先运行
~/.config/casper/linkedin-sources.md--setup-sources - 对每个启用的源,调用现有Casper技能脚本:
- Fireflies:
python ${CLAUDE_PLUGIN_ROOT}/skills/transcript-search/scripts/fireflies_transcript_search.py "{term}" --days-back {N} --content --json- 拉取后,筛选出记录的数组中包含源配置里
participants的记录user_email
- 拉取后,筛选出记录的
- Slack:
python ${CLAUDE_PLUGIN_ROOT}/skills/slack-automation/scripts/slack_search.py read "{channel}" --days {N} - Google Drive:
python ${CLAUDE_PLUGIN_ROOT}/skills/google-workspace/scripts/gdrive_search.py files "{term}" --modified-days {N} --json
- Fireflies:
- 将JSON输出转换为清晰的Markdown格式并保存至source-material/:
- Fireflies:
fireflies-{YYYY-MM-DD}-{title-slug}.md - Slack:
slack-{channel}-{YYYY-MM-DD}.md - Google Drive:
gdrive-{title-slug}-{YYYY-MM-DD}.md
- Fireflies:
- 执行常规生成流程
--view-style
--view-style--view-style
--view-styleRead and display it. If it doesn't exist, say "No style profile found. Run to create one."
~/.config/casper/linkedin-style.md/casper:generate-linkedin-post --setup读取并展示 。若文件不存在,提示"未找到风格配置文件。运行 创建配置。"
~/.config/casper/linkedin-style.md/casper:generate-linkedin-post --setup--view-sources
--view-sources--view-sources
--view-sourcesList all files in (excluding ). For each file, show the filename and a 1-line summary of its contents.
.md${CLAUDE_PLUGIN_ROOT}/skills/linkedin-post-generator/source-material/README.md列出 目录下的所有 文件(排除)。对每个文件,显示文件名及内容的一行摘要。
${CLAUDE_PLUGIN_ROOT}/skills/linkedin-post-generator/source-material/.mdREADME.md--add-source
--add-source--add-source
--add-source- Ask: "Paste the content you want to add as source material (meeting transcript, Slack dump, notes, etc.)"
- Ask: "What should I name this source file? (e.g., )"
team-standup-jan-2025 - Save as
${CLAUDE_PLUGIN_ROOT}/skills/linkedin-post-generator/source-material/[name].md - Confirm: "Source material saved. It will be included in future post generation."
- 提示:"请粘贴要添加为素材的内容(会议记录、Slack导出内容、笔记等)"
- 提示:"这个素材文件的名称是什么?(例如 )"
team-standup-jan-2025 - 保存为
${CLAUDE_PLUGIN_ROOT}/skills/linkedin-post-generator/source-material/[name].md - 确认提示:"素材已保存。未来生成帖子时会包含该素材。"
Reference Files
参考文件
| File | When to Read |
|---|---|
| Every generation run — contains voice rules, few-shot examples, confidentiality rules |
| When running |
| When running |
| Every generation run — raw content to extract post ideas from |
| 文件 | 读取时机 |
|---|---|
| 每次生成流程 — 包含语气规则、少样本示例、保密规则 |
| 运行 |
| 运行 |
| 每次生成流程 — 用于提取帖子创意的原始内容 |