linkedin-post-generator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

LinkedIn Post Generator

LinkedIn 帖子生成器

Generate LinkedIn posts from shared source material, written in each user's personal style.
根据共享素材生成LinkedIn帖子,且帖子风格匹配每位用户的个人写作风格。

How It Works

工作原理

  1. Personal style profile — stored locally at
    ~/.config/casper/linkedin-style.md
    (never committed)
  2. Source config — stored locally at
    ~/.config/casper/linkedin-sources.md
    (never committed)
  3. Shared source material — meeting transcripts, Slack dumps, docs in
    source-material/
  4. Prompt template — extraction rules, voice guidelines, few-shot examples in
    references/prompt-template.md
  1. 个人风格配置文件 — 本地存储于
    ~/.config/casper/linkedin-style.md
    (不会被提交)
  2. 素材配置文件 — 本地存储于
    ~/.config/casper/linkedin-sources.md
    (不会被提交)
  3. 共享素材 — 会议记录、Slack内容导出文件、
    source-material/
    目录下的文档
  4. 提示词模板 — 提取规则、语气指南、少样本示例位于
    references/prompt-template.md

First Run: Style Setup

首次运行:风格设置

Check if
~/.config/casper/linkedin-style.md
exists.
If it does NOT exist, run the style setup flow:
  1. Say: "Welcome to the LinkedIn Post Generator! Before we start, I need to understand your writing style."
  2. Say: "Share 3 LinkedIn posts that match the style you want. You can either paste the post links (e.g.
    https://linkedin.com/posts/...
    ) or paste the text directly."
  3. Wait for the user to provide 3 posts
  4. If the user provides LinkedIn URLs, fetch the post content using the apify-scrapers skill:
    bash
    python ${CLAUDE_PLUGIN_ROOT}/skills/apify-scrapers/scripts/scrape_linkedin_posts.py search "{url}" --max-posts 1
    Extract the post text from the JSON output. If a URL fails to fetch, ask the user to paste that post's text instead.
  5. Analyze the posts for: tone, sentence length, vocabulary, formatting habits, hook style, CTA style, use of questions, paragraph length, overall energy
  6. Create
    ~/.config/casper/
    directory if it doesn't exist
  7. Save the analysis to
    ~/.config/casper/linkedin-style.md
    using this format:
markdown
undefined
检查
~/.config/casper/linkedin-style.md
是否存在。
若不存在,运行风格设置流程:
  1. 提示:"欢迎使用LinkedIn帖子生成器!开始之前,我需要了解你的写作风格。"
  2. 提示:"请分享3篇符合你期望风格的LinkedIn帖子。你可以粘贴帖子链接(例如
    https://linkedin.com/posts/...
    )或直接粘贴帖子文本。"
  3. 等待用户提供3篇帖子
  4. 若用户提供LinkedIn链接,使用apify-scrapers技能获取帖子内容:
    bash
    python ${CLAUDE_PLUGIN_ROOT}/skills/apify-scrapers/scripts/scrape_linkedin_posts.py search "{url}" --max-posts 1
    从JSON输出中提取帖子文本。若链接获取失败,请用户直接粘贴该帖子的文本。
  5. 分析帖子的以下维度:语气、句子长度、词汇、格式习惯、开头钩子风格、结尾CTA风格、提问使用情况、段落长度、整体活力
  6. ~/.config/casper/
    目录不存在则创建
  7. 将分析结果保存至
    ~/.config/casper/linkedin-style.md
    ,格式如下:
markdown
undefined

LinkedIn 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:
  1. Check if
    source-material/
    contains any
    .md
    files besides
    README.md
  2. 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
        --setup-sources
        flow to configure Fireflies, Slack, or Google Drive auto-pulling
      • "Paste something manually" — run the
        --add-source
        flow to let the user paste a transcript, notes, or other content
    • Wait for user choice and proceed with the selected flow
  3. If source material exists, proceed with generation
风格设置完成后(或风格配置存在但source-material/为空时),检查素材情况:
  1. 检查
    source-material/
    目录下是否包含除
    README.md
    外的其他
    .md
    文件
  2. 若为空,引导用户:
    • 提示:"你目前没有任何素材。我需要内容来生成帖子 — 比如会议记录、笔记、Slack对话等。"
    • 提供选项:
      • 「连接集成工具」 — 运行
        --setup-sources
        流程配置Fireflies、Slack或Google Drive自动拉取
      • 「手动粘贴内容」 — 运行
        --add-source
        流程让用户粘贴记录、笔记或其他内容
    • 等待用户选择并执行对应流程
  3. 若素材存在,继续生成流程

Normal Run: Post Generation

常规运行:帖子生成

If style config exists and source material is available, proceed with generation:
  1. Read
    ~/.config/casper/linkedin-style.md
  2. Read ALL files in
    ${CLAUDE_PLUGIN_ROOT}/skills/linkedin-post-generator/source-material/
    (excluding README.md)
  3. Read
    ${CLAUDE_PLUGIN_ROOT}/skills/linkedin-post-generator/references/prompt-template.md
  4. Apply the confidentiality rules from the prompt template (no financials, no client names, no pipeline, no team member names)
  5. Generate 2-4 post options based on the source material, written in the user's personal style
  6. Present them in a clean, copy-paste-ready format
当风格配置存在且素材可用时,执行生成流程:
  1. 读取
    ~/.config/casper/linkedin-style.md
  2. 读取
    ${CLAUDE_PLUGIN_ROOT}/skills/linkedin-post-generator/source-material/
    目录下的所有文件(排除README.md)
  3. 读取
    ${CLAUDE_PLUGIN_ROOT}/skills/linkedin-post-generator/references/prompt-template.md
  4. 应用提示词模板中的保密规则(不得包含财务信息、客户名称、业务管线、团队成员姓名)
  5. 根据素材生成2-4个符合用户个人风格的帖子选项
  6. 以简洁、可直接复制粘贴的格式展示

Flags

命令标志

FlagBehavior
(none)Normal generation flow
--setup
Re-run style setup, overwrite existing config
--setup-sources
Configure which Fireflies, Slack, and Drive sources to pull from
--refresh
Pull fresh source material from configured integrations, then generate
--view-style
Read and display
~/.config/casper/linkedin-style.md
--view-sources
List and summarize all files in
source-material/
--add-source
Prompt user to paste new content, save as new
.md
file in
source-material/
标志行为
常规生成流程
--setup
重新运行风格设置,覆盖现有配置
--setup-sources
配置要从中拉取素材的Fireflies、Slack和Drive源
--refresh
从已配置的集成工具拉取最新素材,然后生成帖子
--view-style
读取并展示
~/.config/casper/linkedin-style.md
--view-sources
列出并总结source-material/目录下的所有文件
--add-source
提示用户粘贴新内容,保存为source-material/目录下的新
.md
文件

Flag Details

标志详情

--setup-sources

--setup-sources

Interactive setup for automatic source pulling. Read
references/source-integrations.md
for full details.
  1. Ask: "What's your work email address? This is used to filter transcripts to only meetings you attended."
    • Save as
      user_email
      in the config
  2. Ask: "Which sources do you want to connect?" Present options:
    • Fireflies.ai — pulls meeting transcripts (needs
      FIREFLIES_API_KEY
      env var)
    • Slack — pulls messages from channels (needs
      SLACK_BOT_TOKEN
      env var)
    • Google Drive — pulls docs and transcripts (needs OAuth setup via google-workspace skill)
  3. For each selected source, check if the required env var / credentials exist. If missing, provide setup instructions:
    • Fireflies: "Set
      FIREFLIES_API_KEY
      in your environment. Get your API key from https://app.fireflies.ai/api"
    • Slack: "Set
      SLACK_BOT_TOKEN
      in your environment. Create a Slack app at https://api.slack.com/apps"
    • Google Drive: "Run the google-workspace skill setup to configure OAuth."
  4. 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
  5. Save to
    ~/.config/casper/linkedin-sources.md
  6. Confirm: "Source config saved. Run
    /casper:generate-linkedin-post --refresh
    to pull fresh content."
自动拉取素材的交互式设置。完整细节请参考
references/source-integrations.md
  1. 提问:"你的工作邮箱地址是什么?这将用于筛选仅你参加过的会议记录。"
    • 将邮箱保存至配置文件的
      user_email
      字段
  2. 提问:"你想连接哪些源?" 提供选项:
    • Fireflies.ai — 拉取会议记录(需要环境变量
      FIREFLIES_API_KEY
    • Slack — 拉取频道消息(需要环境变量
      SLACK_BOT_TOKEN
    • Google Drive — 拉取文档和记录(需要通过google-workspace技能完成OAuth配置)
  3. 对于每个选中的源,检查是否存在所需的环境变量/凭证。若缺失,提供设置说明:
  4. 为每个启用的源收集配置信息:
    • Fireflies:搜索关键词(留空则拉取所有近期内容)和days_back(回溯天数)
    • Slack:要拉取的频道 — 若可能则列出可用频道,否则询问用户
    • Google Drive:搜索关键词、days_back(回溯天数)
  5. 将配置保存至
    ~/.config/casper/linkedin-sources.md
  6. 确认提示:"源配置已保存。运行
    /casper:generate-linkedin-post --refresh
    拉取最新内容。"

--refresh

--refresh

Pull fresh source material from all configured integrations before generating posts. Read
references/source-integrations.md
for the full integration workflow.
Summary of the flow:
  1. Read
    ~/.config/casper/linkedin-sources.md
    — if missing, run
    --setup-sources
    first
  2. 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
        user_email
        (from source config) appears in the transcript's
        participants
        array
    • 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
  3. 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
  4. Proceed with normal generation
生成帖子前,从所有已配置的集成工具拉取最新素材。完整集成工作流请参考
references/source-integrations.md
流程概要:
  1. 读取
    ~/.config/casper/linkedin-sources.md
    — 若缺失,先运行
    --setup-sources
  2. 对每个启用的源,调用现有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
  3. 将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
  4. 执行常规生成流程

--view-style

--view-style

Read
~/.config/casper/linkedin-style.md
and display it. If it doesn't exist, say "No style profile found. Run
/casper:generate-linkedin-post --setup
to create one."
读取并展示
~/.config/casper/linkedin-style.md
。若文件不存在,提示"未找到风格配置文件。运行
/casper:generate-linkedin-post --setup
创建配置。"

--view-sources

--view-sources

List all
.md
files in
${CLAUDE_PLUGIN_ROOT}/skills/linkedin-post-generator/source-material/
(excluding
README.md
). For each file, show the filename and a 1-line summary of its contents.
列出
${CLAUDE_PLUGIN_ROOT}/skills/linkedin-post-generator/source-material/
目录下的所有
.md
文件(排除
README.md
)。对每个文件,显示文件名及内容的一行摘要。

--add-source

--add-source

  1. Ask: "Paste the content you want to add as source material (meeting transcript, Slack dump, notes, etc.)"
  2. Ask: "What should I name this source file? (e.g.,
    team-standup-jan-2025
    )"
  3. Save as
    ${CLAUDE_PLUGIN_ROOT}/skills/linkedin-post-generator/source-material/[name].md
  4. Confirm: "Source material saved. It will be included in future post generation."
  1. 提示:"请粘贴要添加为素材的内容(会议记录、Slack导出内容、笔记等)"
  2. 提示:"这个素材文件的名称是什么?(例如
    team-standup-jan-2025
    )"
  3. 保存为
    ${CLAUDE_PLUGIN_ROOT}/skills/linkedin-post-generator/source-material/[name].md
  4. 确认提示:"素材已保存。未来生成帖子时会包含该素材。"

Reference Files

参考文件

FileWhen to Read
references/prompt-template.md
Every generation run — contains voice rules, few-shot examples, confidentiality rules
references/source-integrations.md
When running
--refresh
or
--setup-sources
— contains script paths, arguments, output conversion
references/style-setup.md
When running
--setup
— contains analysis framework for style profiling
source-material/*.md
Every generation run — raw content to extract post ideas from
文件读取时机
references/prompt-template.md
每次生成流程 — 包含语气规则、少样本示例、保密规则
references/source-integrations.md
运行
--refresh
--setup-sources
时 — 包含脚本路径、参数、输出转换规则
references/style-setup.md
运行
--setup
时 — 包含风格分析框架
source-material/*.md
每次生成流程 — 用于提取帖子创意的原始内容