weekly-performance-advisor

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Weekly Performance Advisor

Weekly Performance Advisor

Generate the user's own Weekly Performance Advisor: a two-tab live artifact built from their La Growth Machine (LGM) data. This skill is fully self-contained — every rule needed to detect the environment, score campaigns, classify replies, and fill the dashboard is written below. It references no other document.
Two hard rules, always:
  1. Only ever show the downloading user's data. Pull exclusively from their connected MCPs. Never inject numbers, campaign names, replies, or examples from anyone else. The template ships empty; it is filled at runtime with their live values. If you cannot pull a value, render the documented empty state — never a placeholder number and never a value borrowed from somewhere else.
  2. The output is a LIVE ARTIFACT, not a saved HTML file. In Generate mode you fill the template in memory and render it as a live artifact using the available artifact tool (whatever the current Cowork build exposes for creating/updating an artifact — do not hard-code a tool name). On a refresh, update the existing artifact rather than creating a new one. The
    assets/dashboard-template.html
    file is the build source only.

为用户生成专属的Weekly Performance Advisor:一个基于用户自身La Growth Machine(LGM)数据构建的双标签页实时工件。该技能完全独立——检测环境、为营销活动评分、分类回复及填充仪表盘所需的所有规则均已在下文列出,无需参考其他文档。
两条硬性规则,始终遵守:
  1. 仅展示下载用户自身的数据。仅从用户已连接的MCP拉取数据,绝不注入任何其他用户的数字、营销活动名称、回复内容或示例。模板初始状态为空白,仅在运行时填充用户的实时数据。若无法拉取某个值,则渲染文档中指定的空状态——绝不能使用占位数字或借用其他来源的值。
  2. 输出结果为实时工件,而非保存的HTML文件。在生成模式下,需在内存中填充模板,并使用可用的工件工具(当前Cowork构建版本提供的用于创建/更新工件的工具,请勿硬编码工具名称)将其渲染为实时工件。刷新时,需更新现有工件而非创建新工件。
    assets/dashboard-template.html
    文件仅作为构建源文件使用。

Two modes

两种模式

  • Setup mode (first run, or when LGM isn't connected / no identity chosen yet): interactive. Detect the environment, guide install if needed, ask the scoping questions. Conversational.
  • Generate mode (every run once setup is done): run the engine, fill the template, emit the artifact + a short handoff. Apply output discipline here — return the artifact and a few lines of handoff, no step-by-step narration.
If setup was already done in this project (a
./.lgm-wpa/
snapshot exists and LGM is connected), skip straight to Generate mode; only re-ask a question if something is missing.

  • 设置模式(首次运行,或LGM未连接/未选择身份时):交互式模式。检测环境、引导安装(若需)、询问范围相关问题,全程采用对话式交互。
  • 生成模式(完成设置后的每次运行):运行引擎、填充模板、生成工件并提供简短交接说明。此阶段需严格控制输出——仅返回工件及几句交接语,无需分步说明
若当前项目已完成设置(存在
./.lgm-wpa/
快照且LGM已连接),则直接进入生成模式;仅当缺失必要信息时才重新询问相关问题。

Phase 0 — Detect (silent, no questions)

阶段0 — 检测(静默执行,无需提问)

Check your own tool list — do not ask the user what they have installed.
  • LGM MCP present? True if tools named
    mcp__*
    for La Growth Machine are available, i.e. any of
    list_identities
    ,
    list_campaigns
    ,
    get_campaign_stats
    ,
    get_conversations_to_reply
    ,
    get_conversation_messages
    ,
    search_conversations
    . (In a terminal you could also confirm with
    claude mcp list
    showing an LGM server, but tool presence is enough — never ask the user.)
  • CRM / deal MCP present? Is a HubSpot MCP available (deal/company/contact tools)?
  • campaign-impact-analyzer
    skill available?
    (used to build the optional deal/€ layer.)
Record these three booleans and move on. Do not announce the detection.

检查自身工具列表——无需询问用户已安装的工具。
  • 是否存在LGM MCP? 若存在名称为
    mcp__*
    的La Growth Machine工具(即
    list_identities
    list_campaigns
    get_campaign_stats
    get_conversations_to_reply
    get_conversation_messages
    search_conversations
    中的任意一个),则判定为存在。(在终端中也可通过
    claude mcp list
    显示LGM服务器来确认,但工具存在性已足够——绝不询问用户。)
  • 是否存在CRM/交易MCP? 是否有HubSpot MCP可用(包含交易/公司/联系人工具)?
  • 是否存在
    campaign-impact-analyzer
    技能?
    (用于构建可选的交易/金额层。)
记录这三个布尔值后继续执行,无需告知用户检测结果。

Phase 1 — LGM MCP gate

阶段1 — LGM MCP准入检查

If the LGM MCP is present: say "LGM connected ✓" in one line and go to Phase 2.
If the LGM MCP is absent: the dashboard is built entirely from LGM data, so it can't run yet. Explain that in one sentence, then guide the install (do not ask "is it installed?" — you already know it isn't):
  1. From the
    gtm-system
    repo, run the installer and complete browser sign-in:
    bash
    sh install.sh
    (or the curl one-liner the repo's README provides). Auth is browser OAuth — there is no API key to paste.
  2. No LGM account yet → point them to register at https://app.lagrowthmachine.com and then re-run the installer.
  3. After they've run it, re-detect (Phase 0). Loop until the LGM tools appear, then continue.
Keep this friendly and short; it's a gate, not a lecture.

若LGM MCP存在: 用一行文字告知“LGM已连接 ✓”,然后进入阶段2。
若LGM MCP不存在: 仪表盘完全基于LGM数据构建,因此无法运行。用一句话解释原因,然后引导安装(无需询问“是否已安装?”——你已确认未安装):
  1. gtm-system
    仓库运行安装程序并完成浏览器登录:
    bash
    sh install.sh
(或使用仓库README中提供的curl单行命令)。身份验证采用浏览器OAuth——无需粘贴API密钥。 2. 若尚未拥有LGM账户 → 引导用户前往https://app.lagrowthmachine.com注册,然后重新运行安装程序。 3. 用户完成安装后,重新检测(阶段0)。循环直至LGM工具出现,再继续执行。
保持友好且简洁的语气,这是准入检查而非教程讲解。

Phase 2 — Identity scope (a real question)

阶段2 — 身份范围选择(需用户回答)

Call
list_identities
. Then, to pick a sensible default, get each identity's campaign load: call
list_campaigns {status:"RUNNING"}
(paginate) and count RUNNING campaigns per
identity.id
.
Ask which identity to track, defaulting to the identity running the most RUNNING campaigns (name it, and ask them to confirm or switch). Mention they can add more identities later for a team-wide view (the dashboard supports multiple identities — union their campaigns and replies).
Store the selected identity id(s) and display name(s); every LGM pull below is scoped to them.

调用
list_identities
接口。然后,为选择合理的默认值,获取每个身份的营销活动负载:调用
list_campaigns {status:"RUNNING"}
(支持分页)并统计每个
identity.id
对应的运行中营销活动数量。
询问用户要跟踪哪个身份,默认选择运行中营销活动数量最多的身份(告知该身份名称,并询问用户确认或切换)。提示用户后续可添加更多身份以获取团队视角(仪表盘支持多身份——合并其营销活动和回复内容)。
存储所选身份的ID和显示名称;后续所有LGM数据拉取操作均限定于这些身份。

Phase 3 — Deal layer (optional, additive — never blocks)

阶段3 — 交易层(可选,附加功能——绝不阻塞流程)

The dashboard ships a "Deals from campaigns" box. Without a CRM it shows
and the note "connect HubSpot to pull deal data". Offer the richer layer, but never block the build on it.
  • CRM/deal MCP present → offer now: "Want me to add the deals/€ layer (which campaigns actually drove pipeline), or ship the dashboard first and add it later?"
  • No CRM MCP → ask "What do you track deals in?" (HubSpot / Salesforce / Sheets / other / none).
    • HubSpot but not connected → offer to connect it (then it becomes "present").
    • Salesforce / Sheets / other / complex → dashboard-first; add the deal layer later.
Delegation (do not re-implement the join here):
  • If
    campaign-impact-analyzer
    is available → delegate the LGM×CRM cross-reference to it to populate the "Deals from campaigns" box (deal count + €, this week, portfolio-wide). Use its output to fill
    {{DEALS_VALUE}}
    /
    {{DEALS_NOTE}}
    .
  • If
    campaign-impact-analyzer
    is not available → do not block and do not inline a join cascade. Ship the LGM-only dashboard (deals box shows
    ) and, in the handoff, add the pointer: "For the deals/€ layer, install
    campaign-impact-analyzer
    from gtm-system, then re-run."

仪表盘包含一个**“营销活动转化的交易”模块。若未连接CRM,则显示
及提示文字
“连接HubSpot以拉取交易数据”
。提供更丰富的交易层功能,但绝不因该功能阻塞仪表盘构建
  • 若CRM/交易MCP存在 → 立即询问:“是否需要添加交易/金额层(展示哪些营销活动实际推动了销售线索),还是先生成仪表盘后续再添加该功能?”
  • 若CRM MCP不存在 → 询问“你使用什么工具跟踪交易?”(HubSpot / Salesforce / Sheets / 其他 / 不使用)。
    • 若使用HubSpot但未连接 → 提供连接引导(连接后即视为“存在”)。
    • 若使用Salesforce / Sheets / 其他复杂工具 → 优先生成仪表盘;后续再添加交易层。
任务委托(请勿在此处重新实现关联逻辑):
  • campaign-impact-analyzer
    可用 → 将LGM×CRM交叉引用任务委托给该技能,以填充“营销活动转化的交易”模块(交易数量+金额,本周数据,全组合范围)。使用其输出结果填充
    {{DEALS_VALUE}}
    /
    {{DEALS_NOTE}}
  • campaign-impact-analyzer
    不可用 → 绝不阻塞流程,也不手动实现关联逻辑。先交付仅含LGM数据的仪表盘(交易模块显示
    ),并在交接语中添加提示:“如需交易/金额层,请从gtm-system安装
    campaign-impact-analyzer
    ,然后重新运行本技能。”

Phase 4 — Build

阶段4 — 构建

Run the engine (below) on the user's live data → fill every placeholder in
assets/dashboard-template.html
render as a live artifact (2 tabs) using the available artifact tool (create on the first run, update the existing artifact on later runs) → write this week's snapshot to
./.lgm-wpa/
.
基于用户的实时数据运行引擎(下文详述)→ 填充
assets/dashboard-template.html
中的所有占位符 → 使用可用的工件工具将其渲染为实时工件(两个标签页)(首次运行时创建,后续运行时更新现有工件)→ 将本周快照写入
./.lgm-wpa/
目录。

Phase 4.5 — Wire the weekly refresh (routine)

阶段4.5 — 配置每周刷新(常规操作)

The dashboard has a ↻ Refresh button. It only works once a weekly routine exists to re-pull the data and update the artifact — so offer to build it now (do it only if they say yes):
Ask (English, verbatim-ish): "To make the ↻ Refresh button live, I can set up a weekly routine that re-pulls your La Growth Machine data and updates this dashboard every Monday morning. Want me to set it up?"
  • Yes → create a scheduled task with the available scheduling tool, cadence Monday morning (weekly), whose prompt re-runs THIS skill in Generate mode for the same identity/identities and updates the existing artifact (it does not create a new one). Suggested task prompt to store:
    "Re-run the weekly-performance-advisor skill in Generate mode for identity/identities [<ids>]: pull fresh La Growth Machine data, recompute the engine, update the existing Weekly Performance Advisor artifact, and write this week's snapshot to ./.lgm-wpa/. Do not ask questions; setup is already done."
    • Capture the task id the tool returns at runtime and pass it into the template as
      {{REFRESH_TASK_ID}}
      so the ↻ button triggers this user's task. The id is resolved per user at creation time — never hard-code an id in the shipped files.
    • The button already calls
      runScheduledTask(<that id>)
      and shows a graceful message if it can't run.
  • No / skip → fill
    {{REFRESH_TASK_ID}}
    with an empty string. The ↻ button then falls back to a friendly alert (nothing breaks); mention they can enable the routine anytime by re-running the skill.
仪表盘设有一个↻刷新按钮。该按钮仅在存在每周例行任务以重新拉取数据并更新工件时才生效——因此现在询问用户是否需要配置该任务(仅在用户同意时执行):
询问内容(英文,大致表述一致即可): “为使↻刷新按钮生效,我可以设置一项每周例行任务,在每周一上午重新拉取你的La Growth Machine数据并更新此仪表盘。是否需要我进行设置?”
  • 同意 → 使用可用的调度工具创建定时任务,执行频率为每周一上午,任务提示语为重新以生成模式运行本技能,针对相同身份并更新现有工件(不创建新工件)。建议存储的任务提示语:
    “针对身份[<ids>]以生成模式重新运行weekly-performance-advisor技能:拉取最新La Growth Machine数据、重新计算引擎、更新现有Weekly Performance Advisor工件,并将本周快照写入./.lgm-wpa/。无需提问;设置已完成。”
    • 捕获工具运行时返回的任务ID,并将其传入模板作为
      {{REFRESH_TASK_ID}}
      ,以便↻按钮触发用户专属的任务。任务ID需在创建时为每个用户单独解析——绝不在交付的文件中硬编码ID
    • 按钮已内置调用
      runScheduledTask(<该ID>)
      的逻辑,若无法运行则显示友好提示。
  • 拒绝/跳过 →
    {{REFRESH_TASK_ID}}
    填充为空字符串。此时↻按钮会显示友好提示(不会出现功能故障);提示用户可随时重新运行本技能以启用例行任务。

Phase 5 — Handoff

阶段5 — 交接说明

After the artifact renders, give a short handoff (no step narration):
  • To do tab = your week: the moves to make, replies to handle (urgency-sorted), and the only-🔴 campaigns to fix. Weekly performance tab = the stats: count KPIs with WoW/30-day deltas, volume-weighted health gauges, and the full campaign panorama.
  • Refresh weekly: if they enabled the routine (Phase 4.5), the ↻ button and the Monday task keep the dashboard fresh; otherwise they can re-run this skill anytime (and enable the routine then). Deltas and the 30-day trend come alive after 2+ weeks of snapshots.
  • Routine status: confirm whether the Monday auto-refresh was set up (Phase 4.5). If they skipped it, remind them the ↻ button stays inert until the routine exists.
  • Classify replies in LGM: nudge them to tag replies (interested / not) in the LGM inbox — it makes next week's positive-reply count and trend sharper.
  • Fix-this buttons in the artifact open a copy/paste prompt modal (the ready-made prompt targets the matching gtm-system skill —
    /reply-draft-assistant
    ,
    /campaign-challenger
    ,
    /sales-nav-search-builder
    ,
    /won-deal-icp-finder
    ) to paste into a new conversation.

工件渲染完成后,提供简短的交接说明(无需分步讲解):
  • 待办事项标签页 = 本周工作重点:需执行的操作、需处理的回复(按优先级排序)、以及仅需关注的🔴需优化营销活动。每周绩效标签页 = 统计数据:包含周环比/30天变化的关键指标、基于回复量加权的健康度仪表盘,以及完整的营销活动全景视图。
  • 每周刷新:若用户已启用例行任务(阶段4.5),则↻按钮和周一定时任务会保持仪表盘数据最新;否则用户可随时重新运行本技能(并在此时启用例行任务)。累计2周及以上快照后,变化量和30天趋势数据将生效。
  • 例行任务状态:确认是否已设置周一自动刷新任务(阶段4.5)。若用户跳过该设置,提醒用户在例行任务创建前,↻按钮将无法生效。
  • 在LGM中分类回复:提醒用户在LGM收件箱中标记回复(感兴趣/不感兴趣),这将使下周的积极回复统计和趋势数据更精准。
  • 工件中的“立即优化”按钮:打开预填充提示的模态框(现成提示针对gtm-system中的对应技能——
    /reply-draft-assistant
    /campaign-challenger
    /sales-nav-search-builder
    /won-deal-icp-finder
    ),用户可将提示复制到新对话中使用。

THE ENGINE (inline — reproduce exactly)

引擎逻辑(内置——需严格复刻)

All scoring is deterministic. Percentages are whole numbers. Use en-dash-free copy (plain hyphens).
所有评分均为确定性计算。百分比取整数。使用无连字符的文本(仅用普通短横线)。

E1. Pull (scoped to the selected identity/identities)

E1. 数据拉取(限定于所选身份)

  1. list_identities
    → resolve the selected identity id(s) and name(s).
  2. list_campaigns {status:"RUNNING"}
    (paginate) → keep campaigns whose
    identity.id
    ∈ selected.
  3. get_campaign_stats
    per kept campaign → per-channel counters.
  4. Replies — two distinct pulls (do not conflate them):
    • Actionable "to handle" list
      get_conversations_to_reply {identityIds:[...selected]}
      : threads currently awaiting your reply. Drives E8 (the rows shown on the To do tab).
    • This-week count set
      search_conversations
      filtered to RECEIVED this week (the lead replied since Monday), scoped to the selected identities — regardless of whether you've already answered. Drives the E9 count KPIs. This is what makes the hero count accurate: an "interested" lead you already replied to has left the to-handle queue but must still be counted this week.
    • For any thread in either set not yet in the latest snapshot's
      classifiedReplyIds
      , read
      get_conversation_messages
      and classify (incremental — don't re-classify known ids).
  1. list_identities
    → 解析所选身份的ID和名称。
  2. list_campaigns {status:"RUNNING"}
    (支持分页)→ 保留
    identity.id
    属于所选身份的营销活动。
  3. 为每个保留的营销活动调用
    get_campaign_stats
    → 获取各渠道统计数据。
  4. 回复数据——需执行两次独立拉取(请勿混淆):
    • 需处理的“待办”列表
      get_conversations_to_reply {identityIds:[...selected]}
      :当前等待用户回复的对话线程。用于生成E8(待办事项标签页显示的行数据)。
    • 本周统计数据集
      search_conversations
      筛选本周收到的回复(潜在客户自周一以来的回复),限定于所选身份——无论用户是否已回复。用于生成E9的统计关键指标。这确保核心统计数据准确:用户已回复的“感兴趣”潜在客户虽已移出待办队列,但仍需计入本周统计。
    • 对于任一列表中未包含在最新快照
      classifiedReplyIds
      中的线程,调用
      get_conversation_messages
      并进行分类(增量处理——无需重新分类已知ID)。

E2. Normalize each campaign

E2. 标准化每个营销活动

campaign = {
  id, name, contacted,
  li: {accept, reply, csent, msent} | null,     // % values; csent = connection-request sends, msent = message sends
  em: {sent, deliv, open, reply, click, bounce, atag, eng} | null
}
  • atag
    = the email step contains a tracked
    <a href>
    link (only then is click a real KPI).
  • eng
    = email had any engagement to score = (email reply > 0) OR (email click > 0).
  • A campaign with
    contacted < 20
    is low-sample: list it, do not score or rank it.
campaign = {
  id, name, contacted,
  li: {accept, reply, csent, msent} | null,     // 百分比数值;csent = 发送的连接请求数,msent = 发送的消息数
  em: {sent, deliv, open, reply, click, bounce, atag, eng} | null
}
  • atag
    = 邮件步骤包含可追踪的
    <a href>
    链接(仅此时点击量才是真实关键指标)。
  • eng
    = 邮件产生了可评分的互动 = (邮件回复量 > 0) OR (邮件点击量 > 0)。
  • 若营销活动的
    contacted < 20
    ,则视为样本量不足:仅列出该活动,不进行评分或排序

E3. Benchmark constants (BAKED — never cited, no source/brand name in the artifact)

E3. 基准常量(内置——无需引用,工件中不显示来源/品牌名称)

3 zones per KPI: 🟢 on target / 🟡 watch / 🔴 to fix.
(good, floor, direction)
:
linkedin_acceptance = (30, 20, up)
linkedin_reply      = (25, 15, up)
email_open          = (60, 45, up)
email_reply         = (6,  3,  up)      # cold-email calibration
email_click         = (8,  4,  up)      # shown, NOT status-driving
email_bounce        = (15, 25, down)    # lower is better
email_deliverability= (90, 80, up)      # not shown as a gauge (see note)
  • No deliverability gauge. In LGM
    Delivered = Sent − Bounced
    , so "deliverability" is just
    100 − bounce
    — not a true inbox-placement signal. We track bounce instead (the actionable email technical-health metric). The five portfolio gauges are: LinkedIn acceptance, LinkedIn reply, email bounce, email open, email reply.
  • MIN_SEND = 10
    : a KPI or step needs ≥10 sends to be scored, else "insufficient volume".
zone(k, v): up →
g if v≥good else y if v≥floor else r
. down →
g if v<good else y if v≤floor else r
. sev(k, v) (how far below floor, ≥0): up →
max(0,(floor−v)/floor)
; down →
max(0,(v−floor)/floor)
; round 3.
每个关键指标分为三个区间:🟢达标 / 🟢需关注 / 🔴需优化。格式为
(良好值, 下限值, 趋势方向)
linkedin_acceptance = (30, 20, up)
linkedin_reply      = (25, 15, up)
email_open          = (60, 45, up)
email_reply         = (6,  3,  up)      # 冷邮件校准值
email_click         = (8,  4,  up)      # 仅显示,不影响状态
email_bounce        = (15, 25, down)    # 值越低越好
email_deliverability= (90, 80, up)      # 不显示为仪表盘指标(见备注)
  • 无送达率仪表盘。在LGM中,
    已送达 = 发送量 − 退信量
    ,因此“送达率”仅为
    100 − 退信率
    ——并非真实的收件箱投递指标。我们改为跟踪退信率(可操作的邮件技术健康指标)。五个组合仪表盘指标为:领英接受率、领英回复率、邮件退信率、邮件打开率、邮件回复率。
  • MIN_SEND = 10
    :关键指标或步骤需**≥10次发送量**才可进行评分,否则显示“样本量不足”。
zone(k, v)函数逻辑:趋势向上 →
若v≥良好值则为🟢,否则若v≥下限值则为🟡,否则为🔴
;趋势向下 →
若v<良好值则为🟢,否则若v≤下限值则为🟡,否则为🔴
sev(k, v)函数逻辑(低于下限的程度,≥0):趋势向上 →
max(0,(下限值−v)/下限值)
;趋势向下 →
max(0,(v−下限值)/下限值)
;保留3位小数。

E4. Per-campaign KPI set (
kpis_for
)

E4. 每个营销活动的关键指标集(
kpis_for

Emit ordered
(kpi, value, state, driving)
:
  • If
    li
    :
    linkedin_acceptance
    (scored if
    csent≥10
    else insuf),
    linkedin_reply
    (scored if
    msent≥10
    else insuf).
  • If
    em
    and
    em.sent≥10
    and
    em.eng
    :
    email_open
    ,
    email_reply
    , then
    email_click
    only if
    em.atag
    (non-driving), then
    email_bounce
    .
  • If
    em
    and
    em.sent≥10
    and not
    em.eng
    : no email KPIs scored → render the line "Email: {sent} sent · {open}% open · 0 replies · 0 clicks - delivered, no engagement to score".
输出有序的
(关键指标, 数值, 状态, 是否影响整体状态)
  • 若存在
    li
    数据:
    linkedin_acceptance
    (若
    csent≥10
    则评分,否则显示样本量不足)、
    linkedin_reply
    (若
    msent≥10
    则评分,否则显示样本量不足)。
  • 若存在
    em
    数据且
    em.sent≥10
    em.eng
    为真:
    email_open
    email_reply
    ,然后仅当
    em.atag
    为真时显示
    email_click
    (不影响整体状态),最后显示
    email_bounce
  • 若存在
    em
    数据且
    em.sent≥10
    em.eng
    为假:不评分任何邮件关键指标 → 渲染文本*“邮件:已发送{sent}封 · 打开率{open}% · 0条回复 · 0次点击 - 已送达,但无互动可评分”*。

E5. Primary-channel weighting → status

E5. 主渠道权重计算 → 整体状态

  • li_sends = li.msent (or 0)
    ,
    em_raw = em.sent (or 0)
    ,
    total = li_sends + em_raw
    .
  • primary = 'li' if li_sends ≥ em_raw else 'email'
    .
    SEC_MIN = 0.30
    .
  • balanced = li_sends>0 AND em scored AND min(li_share, em_share) ≥ 0.30
    .
  • is_driving(k):
    • email_click
      → never driving.
    • linkedin_*
      li present AND li.msent≥10 AND (primary=='li' OR balanced)
      .
    • email_bounce
      → driving whenever email is scored (technical health always counts).
    • email_open
      /
      email_reply
      email scored AND (primary=='email' OR balanced)
      .
  • driving_reds
    /
    driving_yellows
    = driving KPIs at 🔴 / 🟡.
  • status =
    To fix
    if any driving_reds, else
    Watch
    if any driving_yellows, else
    On target
    . (Internally "On target" is the healthy state; never print the words "Healthy" or "needs work".)
  • Secondary-channel red (a 🔴 KPI that is NOT driving, on linkedin_acceptance/linkedin_reply/ email_open/email_reply) → don't flip the whole campaign; attach a "email leg to fix" or "LinkedIn leg to fix" chip instead.
  • li_sends = li.msent(或0)
    em_raw = em.sent(或0)
    total = li_sends + em_raw
  • primary = 'li'(若li_sends ≥ em_raw),否则为'email'
    SEC_MIN = 0.30
  • balanced = li_sends>0 且 邮件已评分 且 min(li_share, em_share) ≥ 0.30
  • is_driving(k)逻辑
    • email_click
      → 绝不影响整体状态。
    • linkedin_*
      存在领英数据 且 li.msent≥10 且 (主渠道为'li' 或 渠道平衡)
    • email_bounce
      → 只要邮件已评分,就影响整体状态(技术健康始终重要)。
    • email_open
      /
      email_reply
      邮件已评分 且 (主渠道为'email' 或 渠道平衡)
  • driving_reds
    /
    driving_yellows
    = 影响整体状态的🔴/🟡关键指标数量。
  • status =
    需优化
    (若存在任何driving_reds),否则为
    需关注
    (若存在任何driving_yellows),否则为
    达标
    。(内部“达标”为健康状态;绝不使用“健康”或“需要改进”等表述。)
  • 次要渠道异常(不影响整体状态的🔴关键指标,涉及linkedin_acceptance/linkedin_reply/email_open/email_reply)→ 不改变整个营销活动的状态,而是添加**“需优化邮件环节”“需优化领英环节”**标签。

E6. Fix #1 (diagnosis) for To-fix campaigns

E6. 需优化营销活动的首要优化建议(诊断)

  • Among
    driving_reds
    , pick the weakest step in funnel order, EXCLUDING the terminal breakup step:
    FUNNEL = [email_bounce, linkedin_acceptance, email_open, linkedin_reply, email_reply]
    → take the first in this order that is red.
  • s = sev(k, v)
    ;
    conf = high if s≥0.4 else medium
    . Cap conf to medium when the flagged step has
    <20
    sends (driving evidence is thin). When you show verbatim "current copy", annotate the step type (Intro / Follow-up / BreakUp); the flagged step must not be the breakup.
  • Cause + routing skill per KPI:
    linkedin_acceptance -> "targeting or connection note" -> sales-nav-search-builder
    linkedin_reply      -> "message copy"                 -> campaign-challenger
    email_open          -> "subject line or setup"        -> campaign-challenger
    email_reply         -> "message copy"                 -> campaign-challenger
    email_bounce        -> "list quality / warm-up"       -> won-deal-icp-finder   (also flag list hygiene / email verification)
  • Channel tip (
    reco
    ): if both LinkedIn reply and email reply are scored and one is red while the other is green/yellow, recommend favoring the stronger channel and reworking/dropping the weaker leg.
  • Ranking:
    prio = maxsev(driving_reds) × contacted
    . To-fix cards sorted by
    prio
    desc.
  • driving_reds
    中,按漏斗顺序选择最薄弱的环节,排除最终终止环节:
    FUNNEL = [email_bounce, linkedin_acceptance, email_open, linkedin_reply, email_reply]
    → 选择该列表中第一个处于🔴状态的环节。
  • s = sev(k, v)
    conf = 高可信度(若s≥0.4),否则为中可信度
    。当标记环节的发送量
    <20
    时,将可信度上限设为中可信度(驱动证据不足)。显示“当前文案”时,需标注环节类型(介绍/跟进/终止);标记环节不得为终止环节。
  • 原因 + 关联技能对应每个关键指标:
    linkedin_acceptance -> "目标受众或连接请求文案" -> sales-nav-search-builder
    linkedin_reply      -> "消息文案"                 -> campaign-challenger
    email_open          -> "主题或设置"              -> campaign-challenger
    email_reply         -> "消息文案"                 -> campaign-challenger
    email_bounce        -> "列表质量/预热"           -> won-deal-icp-finder  (同时标记列表维护/邮箱验证问题)
  • 渠道建议
    reco
    ):若领英回复率和邮件回复率均已评分,且其中一个为🔴状态而另一个为🟢/🟡状态,则建议优先使用表现较好的渠道,重新优化或放弃表现较差的渠道环节。
  • 排序规则
    prio = maxsev(driving_reds) × contacted
    。需优化营销活动卡片按
    prio
    降序排列。

E7. Volume-weighted portfolio gauges

E7. 基于回复量加权的组合仪表盘

For each of the five gauge KPIs, aggregate Σnumerator / Σdenominator across channel-active, scored campaigns (not a mean of percentages). Round to whole %.
N_LI
= # campaigns feeding the LinkedIn gauges;
N_EM
= # feeding the email gauges. Gauge zone =
zone(k, weightedValue)
.
对于五个仪表盘指标中的每一个,汇总所有渠道活跃且已评分营销活动的Σ分子 / Σ分母(而非百分比平均值)。取整为整数百分比。
N_LI
= 为领英仪表盘提供数据的营销活动数量;
N_EM
= 为邮件仪表盘提供数据的营销活动数量。仪表盘区间 =
zone(k, weightedValue)

E8. Reply classification + urgency sort

E8. 回复分类 + 优先级排序

  • Classify each new RECEIVED reply into
    interested / neutral / not_interested / wrong_fit
    from the thread.
    hot
    = explicit call/meeting request.
    corr
    = LGM auto-qualify said interested but you corrected it here.
    chan
    ∈ {LINKEDIN, EMAIL}.
    act
    (actionable) =
    cls ∈ {interested, neutral}
    .
  • waited days =
    floor((asOf − lastMessageAt)/86400000)
    , min 0;
    urgent
    = actionable AND waited > 3.
  • Urgency sort (actionable only): group 0 = call requests (
    hot
    ), 1 = interested, 2 = neutral; within a group, longest-waiting first. Show a "waited Xd" badge per row (urgent → red marker).
  • Only interested + neutral are listed as rows.
    not_interested
    /
    wrong_fit
    are collapsed to a count behind an "open in LGM inbox ↗" link; keep a small "N corrected" tally visible there so auto-qualify corrections stay surfaced. No write-back to LGM (the user validates in LGM).
  • 将每个新收到的回复从对话线程中分类为
    interested / neutral / not_interested / wrong_fit
    hot
    = 明确的电话/会议请求。
    corr
    = LGM自动标记为感兴趣,但在此处已修正分类。
    chan
    ∈ {LINKEDIN, EMAIL}。
    act
    (可操作)=
    cls ∈ {interested, neutral}
  • 等待天数 =
    floor((当前时间 − 最后消息时间)/86400000)
    ,最小值为0;
    urgent
    = 可操作且等待天数 > 3。
  • 优先级排序(仅针对可操作回复):组0 = 电话请求(
    hot
    ),组1 = 感兴趣,组2 = 中性;同一组内按等待时间从长到短排序。每行显示**“已等待Xd”**标签(紧急状态显示红色标记)。
  • 仅列出感兴趣+中性回复
    not_interested
    /
    wrong_fit
    回复折叠为计数,显示在*“在LGM收件箱中打开 ↗”链接后;保留一个小型*“已修正N条”**统计,以便展示对自动分类的修正。不向LGM写回数据(用户需在LGM中验证分类)。

E9. Count KPIs (North Star, portfolio-wide, this week) — refresh-safe

E9. 统计关键指标(核心指标,全组合范围,本周数据)——支持刷新

Source the counts from the this-week RECEIVED set (E1 step 4b,
search_conversations
), not from the to-handle queue, so leads you've already answered still count.
  • TOTAL_POSITIVE_REPLIES
    (hero) = count of this-week received threads classified
    interested
    (incl. call requests), portfolio-wide.
  • TOTAL_REPLIES
    (secondary) = count of this-week received threads (any lead reply this week).
  • Week-cumulative + refresh-safe: persist this week's positive and total counts (and the
    classifiedReplyIds
    ) in the snapshot. On a re-run within the same ISO week, take the union of already-counted ids and the fresh set — a refresh may only add, never drop, a reply already counted this week. (Across weeks the count resets per week, as expected.)
  • Never render a "0 positive leads" hero; if zero, show
    0
    plainly with the delta caveat.
统计数据来源于本周收到的回复数据集(E1步骤4b,
search_conversations
),而非待办队列,因此用户已回复的潜在客户仍需计入统计。
  • TOTAL_POSITIVE_REPLIES
    (核心指标)= 本周收到的分类为
    interested
    的对话线程数量(包含电话请求),全组合范围。
  • TOTAL_REPLIES
    (次要指标)= 本周收到的对话线程数量(本周内潜在客户的所有回复)。
  • 本周累计 + 支持刷新:将本周的积极回复数和总回复数(以及
    classifiedReplyIds
    )持久化到快照中。在同一ISO周内重新运行时,取已统计ID与新拉取数据集的并集——刷新仅可增加统计数量,绝不删除本周已统计的回复。(跨周时统计数据按周重置,符合预期。)
  • 绝不渲染“0个积极潜在客户”的核心指标;若为0,则直接显示
    0
    并标注变化量说明。

E10. Period comparison (deltas)

E10. 周期对比(变化量)

From the rolling snapshot history in
./.lgm-wpa/
(keep ≥5 weeks):
  • For each count KPI and each gauge, show vs last week and vs trailing-30-day weekly average (last ≤4 prior weeks). Arrow ▲/▼; up = green, down = red — inverted for bounce (down is good).
  • Units: counts have no unit; gauges use
    pt
    . Zero delta →
    +0
    .
  • No history yet → render
    — · trend starts after 2+ weeks
    and caption "Baseline week - trends start after 2+ weeks of history." With history, caption is "Deltas compare this week vs last week and vs the trailing 30-day weekly average."
./.lgm-wpa/
中的滚动快照历史(保留≥5周)获取数据:
  • 对于每个统计关键指标和仪表盘,显示与上周对比与过去30天周平均值对比(最近≤4周)。使用箭头▲/▼;上升为绿色,下降为红色——退信率反向显示(下降为好)。
  • 单位:统计数量无单位;仪表盘使用
    pt
    。变化量为0时显示
    +0
  • 尚无历史数据 → 渲染
    — · 2周后开始显示趋势
    并标注说明*“基准周 - 累计2周及以上数据后开始显示趋势。”。有历史数据时,标注说明“变化量为本周与上周、以及与过去30天周平均值的对比。”*

E11. Health cards (under the gauges, Weekly performance tab)

E11. 健康卡片(仪表盘下方,每周绩效标签页)

Replace any single-sentence "verdict" with two cards:
  • 🟢 On target — lists the gauges currently green (`"LinkedIn acceptance 53%, email bounce 7% ...
    • all on target."`).
  • 🟡 Watch — for each non-green gauge,
    "<KPI> <v>% - <gap>pt under/over the <good>% target, <note>"
    where note =
    just optimization, not urgent
    if gap ≤ 3, else
    worth a pass
    (or, if that gauge is red,
    needs work
    ). Add the pill
    N campaign(s) to fix
    . Then a red line:
    "Real fix: N campaign(s) to fix on their main channel - <name> (<KPI> <v>%); ... Rewrite that copy first."
    — so 🔴 campaigns stay visible on this tab and point to the To do tab.
  • Empty state: no 🔴 campaigns → the To-fix cards region shows "No 🔴 campaigns this week - every running campaign is On target or Watch on its primary channel."
将任何单句“结论”替换为两张卡片:
  • 🟢达标 — 列出当前处于绿色状态的仪表盘指标(
    “领英接受率53%,邮件退信率7%……全部达标。”
    )。
  • 🟡需关注 — 对于每个非绿色指标,显示
    “<关键指标> <v>% - 与<良好值>%目标相差<gap>pt,<说明>”
    ,其中说明 = 若差距≤3则为“仅需优化,非紧急”,否则为“值得关注”(若指标为红色则为“需优化”)。添加标签
    N个需优化营销活动
    。然后显示一条红色提示
    “重点优化:N个主渠道需优化的营销活动 - <名称>(<关键指标> <v>%);……优先重写该文案。”
    ——确保🔴营销活动在本标签页可见,并指向待办事项标签页。
  • 空状态:无🔴营销活动 → 需优化卡片区域显示*“本周无🔴营销活动 - 所有运行中的营销活动主渠道状态均为达标或需关注。”*

E12. Status lexicon (use these three words everywhere)

E12. 状态术语(所有场景统一使用以下三个词)

🟢 On target · 🟡 Watch · 🔴 To fix — identical on the gauge legend, the two health cards, the panorama badges, and the campaign cards. Do not print "Healthy", "needs work", or "To improve".

🟢达标 · 🟡需关注 · 🔴需优化 — 在仪表盘图例、两张健康卡片、全景视图标签和营销活动卡片中保持一致。绝不使用“健康”“需要改进”或“有待提升”等表述。

FILL CONTRACT — placeholders in
assets/dashboard-template.html

填充规则 —
assets/dashboard-template.html
中的占位符

Read
assets/dashboard-template.html
, compute the values below, replace every
{{...}}
, and render the result as a live artifact. Escape all user-supplied text (campaign names, reply notes, lead names) for HTML. Gauge colored bands and the target tick are derived from the E3 constants at fill-time (see the gauge snippet) — never hardcode band widths; change a threshold and the bands move.
PlaceholderSource / value
{{WEEK_LABEL}}
Monday of the current week, e.g.
Jul 6, 2026
(title only).
{{LAST_UPDATE}}
Date the pull ran, e.g.
Jul 7, 2026
.
{{REFRESH_TASK_ID}}
The scheduled-task id captured at runtime in Phase 4.5 (this user's own task). If no routine was created, fill with an empty string — the ↻ button then falls back to a friendly alert. Never ship a real id in the template file.
{{SR_SUMMARY}}
One-line screen-reader summary:
Weekly Performance Advisor, week of {WEEK_LABEL}: {posReplies} positive replies of {totalReplies}; {tofixCount} campaigns to fix; {nAct} actionable replies including {nHot} call requests.
{{TODO_COUNT}}
nAct
(actionable replies) — the To-do tab pill count.
{{MOVES}}
2-3
<li>...</li>
items (see snippet M). Built from calls, interested, neutrals, and the to-fix count.
{{N_ACT}}
actionable reply count (used in 3 spots).
{{N_HOT}}
call-request count.
{{REPLY_PROMPT}}
escaped reply-triage prompt (snippet P).
{{REPLY_ROWS}}
one
<tr>
per actionable reply, urgency-sorted (snippet R).
{{INBOX_LINK}}
if any non-actionable replies: the inbox link with the corrected tally (snippet I); else empty string.
{{TOFIX_CARDS}}
To-fix cards sorted by
prio
(snippet C); or the empty-state card (E11).
{{TOTAL_POSITIVE_REPLIES}}
posReplies
(E9).
{{TOTAL_REPLIES}}
totalReplies
(E9).
{{POS_REPLIES_DELTA}}
/
{{TOTAL_REPLIES_DELTA}}
delta span for each count KPI (snippet D).
{{DEALS_VALUE}}
by default; deal count/€ if the deal layer ran (Phase 3).
{{DEALS_NOTE}}
connect HubSpot to pull deal data
by default; else a short deals note.
{{DELTA_CAPTION}}
E10 caption (history vs baseline).
{{N_LI}}
/
{{N_EM}}
gauge feed counts (E7).
{{GAUGES}}
the five portfolio gauges in order: linkedin_acceptance, linkedin_reply, email_bounce, email_open, email_reply (snippet G, each wrapped in
.stat
with a delta).
{{HEALTH_CARDS}}
the
.hcards
block (E11, snippet H).
{{PANORAMA_ROWS}}
one
prow
+
drow
pair per scored campaign, To-fix first then Watch/On-target by contacted desc (snippet PANO).
{{LOW_SAMPLE_ROWS}}
the low-sample header row + one row per low-sample campaign (snippet LOW); empty string if none.
读取
assets/dashboard-template.html
,计算以下值,替换所有
{{...}}
占位符,并将结果渲染为实时工件。对用户提供的文本(营销活动名称、回复说明、潜在客户名称)进行HTML转义仪表盘彩色区间和目标刻度需在填充时从E3常量推导(见仪表盘代码片段)——绝不硬编码区间宽度;修改阈值后区间会自动调整。
占位符来源 / 取值
{{WEEK_LABEL}}
当前周的周一日期,例如
Jul 6, 2026
(仅用于标题)。
{{LAST_UPDATE}}
数据拉取完成的日期,例如
Jul 7, 2026
{{REFRESH_TASK_ID}}
阶段4.5运行时捕获的定时任务ID(用户专属任务)。若未创建例行任务,则填充空字符串——此时↻按钮会显示友好提示。绝不在模板文件中嵌入真实ID
{{SR_SUMMARY}}
一行屏幕阅读器摘要:
Weekly Performance Advisor,{WEEK_LABEL}周:{posReplies}条积极回复,总回复{totalReplies}条;{tofixCount}个需优化营销活动;{nAct}条可操作回复,其中包含{nHot}个电话请求。
{{TODO_COUNT}}
nAct
(可操作回复数量)——待办事项标签页的徽章计数。
{{MOVES}}
2-3个
<li>...</li>
项(见代码片段M)。基于电话请求、感兴趣回复、中性回复和需优化活动数量构建。
{{N_ACT}}
可操作回复数量(用于3个位置)。
{{N_HOT}}
电话请求数量。
{{REPLY_PROMPT}}
转义后的回复优先级处理提示(见代码片段P)。
{{REPLY_ROWS}}
每个可操作回复对应一个
<tr>
,按优先级排序(见代码片段R)。
{{INBOX_LINK}}
若存在不可操作回复:包含修正统计的收件箱链接(见代码片段I);否则为空字符串。
{{TOFIX_CARDS}}
prio
排序的需优化活动卡片(见代码片段C);或空状态卡片(E11)。
{{TOTAL_POSITIVE_REPLIES}}
posReplies
(E9)。
{{TOTAL_REPLIES}}
totalReplies
(E9)。
{{POS_REPLIES_DELTA}}
/
{{TOTAL_REPLIES_DELTA}}
每个统计关键指标的变化量 span(见代码片段D)。
{{DEALS_VALUE}}
默认值为
;若交易层已运行(阶段3),则显示交易数量/金额。
{{DEALS_NOTE}}
默认值为
connect HubSpot to pull deal data
;否则显示简短的交易说明。
{{DELTA_CAPTION}}
E10的说明文字(有历史数据/基准周)。
{{N_LI}}
/
{{N_EM}}
仪表盘数据来源数量(E7)。
{{GAUGES}}
五个组合仪表盘,顺序为:linkedin_acceptance、linkedin_reply、email_bounce、email_open、email_reply(见代码片段G,每个包裹在
.stat
中并包含变化量)。
{{HEALTH_CARDS}}
.hcards
区块(E11,见代码片段H)。
{{PANORAMA_ROWS}}
每个已评分营销活动对应一对
prow
+
drow
,需优化活动优先,然后按联系人数降序排列需关注/达标活动(见代码片段PANO)。
{{LOW_SAMPLE_ROWS}}
样本量不足的标题行 + 每个样本量不足活动对应一行(见代码片段LOW);若无则为空字符串。

Snippet G — gauge (bands derived from constants)

代码片段G — 仪表盘(区间从常量推导)

For an "up" KPI with
(good, floor)
; needle left =
clamp(value,0,100)%
;
z = zone(k,value)
:
<div class="stat"><div class="k">{LABEL}</div>
 <div class="gauge"><span class="gbands">
  <span class="gb r" style="left:0;width:{floor}%"></span>
  <span class="gb y" style="left:{floor}%;width:{good-floor}%"></span>
  <span class="gb g" style="left:{good}%;width:{100-good}%"></span>
  <span class="gtick" style="left:{good}%"></span>
  <span class="gneedle {z}" style="left:{value}%"></span></span>
  <span class="gval {z}">{value}%</span><span class="gtgt">target ≥{good}%</span></div>
 <div class="dwrap">{DELTA}</div></div>
For a "down" KPI (email_bounce): bands are
g
(0→good),
y
(good→floor),
r
(floor→100), tick at
good
, target text
target &lt;{good}%
. Labels:
LinkedIn acceptance
,
LinkedIn reply
,
Email bounce
,
Email open
,
Email reply
. The same gauge markup (row layout via
.dg
) is reused inside campaign detail rows — there without the
.stat
/delta wrapper.
对于趋势向上的关键指标,参数为
(良好值, 下限值)
;指针位置 =
clamp(value,0,100)%
z = zone(k,value)
<div class="stat"><div class="k">{LABEL}</div>
 <div class="gauge"><span class="gbands">
  <span class="gb r" style="left:0;width:{floor}%"></span>
  <span class="gb y" style="left:{floor}%;width:{good-floor}%"></span>
  <span class="gb g" style="left:{good}%;width:{100-good}%"></span>
  <span class="gtick" style="left:{good}%"></span>
  <span class="gneedle {z}" style="left:{value}%"></span></span>
  <span class="gval {z}">{value}%</span><span class="gtgt">target ≥{good}%</span></div>
 <div class="dwrap">{DELTA}</div></div>
对于趋势向下的关键指标(email_bounce):区间为
g
(0→良好值)、
y
(良好值→下限值)、
r
(下限值→100),刻度位于
良好值
位置,目标文本为
target &lt;{good}%
。标签:
LinkedIn acceptance
LinkedIn reply
Email bounce
Email open
Email reply
。相同的仪表盘标记(通过
.dg
实现行布局)可复用在营销活动详情行中——此时无需
.stat
/变化量包裹。

Snippet D — delta span

代码片段D — 变化量span

<span class="delta"><span class="dl">vs last wk</span> <b class="d {cls}">{▲/▼ ±d}{unit}</b><span class="dl">· vs 30d</span> <b class="d {cls}">{▲/▼ ±d}{unit}</b></span>
cls
∈ up/down/flat. No history →
<span class="delta none">- · trend starts after 2+ weeks</span>
.
<span class="delta"><span class="dl">vs last wk</span> <b class="d {cls}">{▲/▼ ±d}{unit}</b><span class="dl">· vs 30d</span> <b class="d {cls}">{▲/▼ ±d}{unit}</b></span>
cls
∈ up/down/flat。无历史数据时 →
<span class="delta none">- · trend starts after 2+ weeks</span>

Snippet M — moves list (example shape; adapt to the data)

代码片段M — 行动列表(示例格式;需根据数据调整)

<li><b>Answer the {nHot} call requests</b> ({callNames}){ - firstCall waited Xd if urgent}. Then reply to {firstInterested} and nudge the {nNeutral} warm neutrals.</li>
<li><b>Rewrite the flagged copy</b> on the {N} campaign(s) leaking their main-channel reply rate.</li>
<li><b>Keep classifying replies in LGM</b> so next week's trend stays live.</li>
Drop line 1 if no replies, line 2 if no to-fix campaigns. Never fabricate; only mention names/counts present.
<li><b>回复{nHot}个电话请求</b> ({callNames}){ 若紧急则添加 - 最早的请求已等待Xd}。然后回复{firstInterested},并跟进{nNeutral}个中性潜在客户。</li>
<li><b>重写标记的文案</b>,修复{N}个主渠道回复率下滑的营销活动。</li>
<li><b>持续在LGM中分类回复</b>,确保下周趋势数据准确。</li>
若无回复则删除第1行,若无需优化活动则删除第2行。绝不编造内容;仅提及实际存在的名称/数量。

Snippet R — reply row (actionable only, urgency-sorted)

代码片段R — 回复行(仅可操作回复,按优先级排序)

<tr><td class="cname">{lead}{ <span class="hotpill">CALL</span> if hot}{ <span class="corrpill" title="LGM auto-qualify said interested; corrected">corrected</span> if corr}</td>
<td><span class="wbadge{ urgent}">waited {X}d</span></td>
<td><span class="chan {li|em}">{LINKEDIN|EMAIL}</span></td>
<td><span class="rcls {good|neu}">{interested|neutral}</span></td>
<td class="rnote">{why}</td></tr>
<tr><td class="cname">{lead}{ 若为hot则添加<span class="hotpill">CALL</span>}{ 若为corr则添加<span class="corrpill" title="LGM自动标记为感兴趣;已修正">corrected</span>}</td>
<td><span class="wbadge{ 若为urgent则添加}">waited {X}d</span></td>
<td><span class="chan {li|em}">{LINKEDIN|EMAIL}</span></td>
<td><span class="rcls {good|neu}">{interested|neutral}</span></td>
<td class="rnote">{why}</td></tr>

Snippet I — inbox link (with corrected tally)

代码片段I — 收件箱链接(包含修正统计)

<a class="inboxlink" href="https://app.lagrowthmachine.com/" target="_blank" rel="noopener">{N} more replies (not interested / wrong fit){, M corrected} - open in LGM inbox ↗</a>
<a class="inboxlink" href="https://app.lagrowthmachine.com/" target="_blank" rel="noopener">{N}条其他回复(不感兴趣/不符合需求){, M条已修正} - 在LGM收件箱中打开 ↗</a>

Snippet P — reply-triage prompt (goes in the button's data-prompt, escaped)

代码片段P — 回复优先级处理提示(放入按钮的data-prompt,需转义)

Use the /reply-draft-assistant skill. Handle my {nAct} actionable replies across all running campaigns, most urgent first: {nHot} call requests ({callNames}) first, then {nInterested} interested and {nNeutral} warm neutrals to nudge (some have waited over a week). Draft each in the thread language for my approval. If the /reply-draft-assistant skill is not installed, download it from https://github.com/LaGrowthMachine/gtm-system first, then run it.
Use the /reply-draft-assistant skill. Handle my {nAct} actionable replies across all running campaigns, most urgent first: {nHot} call requests ({callNames}) first, then {nInterested} interested and {nNeutral} warm neutrals to nudge (some have waited over a week). Draft each in the thread language for my approval. If the /reply-draft-assistant skill is not installed, download it from https://github.com/LaGrowthMachine/gtm-system first, then run it.

Snippet C — to-fix card

代码片段C — 需优化活动卡片

Card with
card-name
, a
badge tofix
+
contacted N
meta, and a Fix-this button whose
data-prompt
(escaped) is built per the routing skill:
  • campaign-challenger
    :
    Use the /campaign-challenger skill. Challenge campaign "{name}" ({label} {value}%, below the {floor}% floor, likely {cause}): rewrite the current copy of the flagged step. If the /campaign-challenger skill is not installed, download it from https://github.com/LaGrowthMachine/gtm-system first, then run it.
  • sales-nav-search-builder
    :
    ... Rebuild the targeting for campaign "{name}" ({label} {value}%, below the {floor}% floor): draft a tighter Sales Navigator search and connection note. ...
  • won-deal-icp-finder
    :
    ... Clean the audience for campaign "{name}" ({label} {value}%, below the {floor}% floor): rebuild it from a verified ICP list. ...
Then the
fix1
block (Fix #1 tag, KPI label,
{conf} confidence
,
{value}% now · target ≥{good}% · floor {floor}% · {gap} pt(s) under target
,
Likely cause: {cause}
), optional channel-tip
reco
box and watch/leg chips, an optional
diag-out
diagnosis line +
focus
"Current copy to rewrite" block (verbatim step copy, channel + step type), and a
<details>
with the full-funnel gauges. Use the exact class names from the template's CSS.
卡片包含
card-name
badge tofix
+
contacted N
元数据,以及一个立即优化按钮,其
data-prompt
(已转义)需根据关联技能构建:
  • campaign-challenger
    :
    Use the /campaign-challenger skill. Challenge campaign "{name}" ({label} {value}%, below the {floor}% floor, likely {cause}): rewrite the current copy of the flagged step. If the /campaign-challenger skill is not installed, download it from https://github.com/LaGrowthMachine/gtm-system first, then run it.
  • sales-nav-search-builder
    :
    ... Rebuild the targeting for campaign "{name}" ({label} {value}%, below the {floor}% floor): draft a tighter Sales Navigator search and connection note. ...
  • won-deal-icp-finder
    :
    ... Clean the audience for campaign "{name}" ({label} {value}%, below the {floor}% floor): rebuild it from a verified ICP list. ...
然后是
fix1
区块(首要优化标签、关键指标标签、
{conf} confidence
{value}% now · target ≥{good}% · floor {floor}% · {gap} pt(s) under target
Likely cause: {cause}
)、可选的渠道建议
reco
区块和需关注/环节标签、可选的
diag-out
诊断行 +
focus
“需重写的当前文案”区块(环节原文,包含渠道+环节类型),以及包含全漏斗仪表盘的
<details>
。需使用模板CSS中定义的精确类名。

Snippet PANO / LOW — panorama rows

代码片段PANO / LOW — 全景视图行

prow
(clickable) + hidden
drow
detail per scored campaign: columns Campaign, Contacted, Accept, LI reply, Email open, Email reply, Status badge, Fix #1. Missing KPI →
; insufficient/no-engagement →
n/a
(class
zi
). Low-sample block: a
lowhead
row
Below sample floor - listed for completeness, not scored
, then one
prow low
per low-sample campaign whose detail says
{contacted} contacted · ... - not scored (below the 20-contact floor; rates on so few sends aren't reliable).

prow
(可点击) + 隐藏的
drow
详情,对应每个已评分营销活动:列包括营销活动、联系人数、接受率、领英回复率、邮件打开率、邮件回复率、状态标签、首要优化建议。缺失的关键指标显示
;样本量不足/无互动显示
n/a
(类名为
zi
)。样本量不足区块:包含
lowhead
Below sample floor - listed for completeness, not scored
,然后每个样本量不足活动对应一行
prow low
,其详情显示
{contacted} contacted · ... - not scored (below the 20-contact floor; rates on so few sends aren't reliable).

SNAPSHOT PERSISTENCE (in the current project)

快照持久化(当前项目中)

Create
./.lgm-wpa/
in the project where the skill runs and write
./.lgm-wpa/snapshot-<YYYY>-W<ww>.json
for the current ISO week. Store:
{
  "week": "2026-W28",
  "identities": ["<id>", ...],
  "counts": { "posReplies": N, "totalReplies": N },
  "positiveReplyIds": ["<conversationId>", ...],   // this-week ids classified interested (for the union)
  "weekReplyIds": ["<conversationId>", ...],        // this-week ids that received a lead reply
  "gauges": { "linkedin_acceptance": %, "linkedin_reply": %, "email_bounce": %, "email_open": %, "email_reply": % },
  "campaigns": [ { "id", "name", "contacted", "status", "fix1": {...}|null, "kpis": {...} } ],
  "classifiedReplyIds": ["<conversationId>", ...]   // every id already classified (skip-list, incremental)
}
  • First run = baseline: no prior snapshot → all deltas render
    and the baseline caption.
  • Before overwriting, load the latest prior snapshot to compute WoW + 30-day deltas and to skip already-classified reply ids. Keep ≥5 weeks (prune older) so the ~4-week average is computable.
  • One snapshot per ISO week. Re-running in the same week updates that week's file: union
    positiveReplyIds
    /
    weekReplyIds
    with the fresh pull, recompute
    counts
    from the unions (so the hero count is refresh-safe and only grows within the week), then persist. Deltas always compare against prior weeks' snapshots, never the current week's earlier run.

在技能运行的项目中创建
./.lgm-wpa/
目录,并为当前ISO周写入
./.lgm-wpa/snapshot-<YYYY>-W<ww>.json
文件。存储内容如下:
{
  "week": "2026-W28",
  "identities": ["<id>", ...],
  "counts": { "posReplies": N, "totalReplies": N },
  "positiveReplyIds": ["<conversationId>", ...],   // 本周分类为感兴趣的对话ID(用于并集计算)
  "weekReplyIds": ["<conversationId>", ...],        // 本周收到潜在客户回复的对话ID
  "gauges": { "linkedin_acceptance": %, "linkedin_reply": %, "email_bounce": %, "email_open": %, "email_reply": % },
  "campaigns": [ { "id", "name", "contacted", "status", "fix1": {...}|null, "kpis": {...} } ],
  "classifiedReplyIds": ["<conversationId>", ...]   // 所有已分类的对话ID(跳过列表,增量处理)
}
  • 首次运行 = 基准:无历史快照 → 所有变化量显示
    并标注基准周说明。
  • 覆盖前,加载最新的历史快照以计算周环比+30天变化量,并跳过已分类的回复ID。保留≥5周数据(删除更早的数据),以便计算约4周的平均值。
  • 每个ISO周对应一个快照。同一周内重新运行时更新该周的文件:将
    positiveReplyIds
    /
    weekReplyIds
    与新拉取数据集取并集,从并集中重新计算
    counts
    (确保核心统计数据支持刷新,且仅在本周内增加),然后持久化。变化量始终与过去几周的快照对比,而非本周内的早期运行结果。

ACCEPTANCE (self-check before finishing)

验收标准(完成前自检)

  • Fresh env, LGM absent → skill guided install, waited, re-detected, then proceeded.
  • LGM present → detected silently, asked identity, (optionally) deals, built the artifact from the user's live data. No data from anyone but the user appears anywhere.
  • HubSpot +
    campaign-impact-analyzer
    present → deal layer offered and delegated.
  • campaign-impact-analyzer
    absent → dashboard shipped anyway + install pointer in the handoff.
  • Output is a live artifact (2 tabs) rendered with the available artifact tool (no hard-coded tool name); a snapshot was written to
    ./.lgm-wpa/
    .
  • Refresh routine offered (Phase 4.5): on yes → Monday task created, its runtime id injected as
    {{REFRESH_TASK_ID}}
    , ↻ button live; on skip → empty id, button falls back gracefully. No real task id is embedded in the shipped files.
  • Counts are refresh-safe:
    posReplies
    /
    totalReplies
    come from the this-week RECEIVED set (
    search_conversations
    ), persisted and unioned within the week, so a mid-week refresh only adds and never drops an already-counted reply (fixes undercount from the to-handle queue).
  • Single status lexicon (On target / Watch / To fix) everywhere; email reply uses 🟢≥6/🟡3-6/🔴<3; bounce gauge (not deliverability); no benchmark source/brand cited; English; self-contained.
  • 全新环境,LGM未安装 → 技能引导安装、等待、重新检测,然后继续执行。
  • LGM已安装 → 静默检测、询问身份、(可选)询问交易层、基于用户实时数据构建工件。所有数据均来自用户自身,无任何其他用户数据。
  • HubSpot +
    campaign-impact-analyzer
    已安装 → 提供交易层并委托任务。
  • campaign-impact-analyzer
    未安装 → 仍交付仪表盘 + 交接语中提示安装。
  • 输出结果为实时工件(两个标签页),使用可用的工件工具渲染(无硬编码工具名称);已将快照写入
    ./.lgm-wpa/
    目录。
  • 已提供刷新例行任务设置选项(阶段4.5):同意则创建周一任务,将运行时ID注入
    {{REFRESH_TASK_ID}}
    ,↻按钮生效;拒绝则填充空ID,按钮显示友好提示。交付文件中无真实任务ID。
  • 统计数据支持刷新
    posReplies
    /
    totalReplies
    来自本周收到的回复数据集(
    search_conversations
    ),在本周内持久化并取并集,因此周中刷新仅增加统计数量,绝不删除已统计的回复(解决待办队列导致的统计不足问题)。
  • 所有场景统一使用状态术语(达标/需关注/需优化);邮件回复率采用🟢≥6/🟡3-6/🔴<3;显示退信率仪表盘(而非送达率);未提及基准来源/品牌;英文术语正确;完全独立运行。