Token导航 LogoToken导航TokenDH.com
研究检索需要联网clawhub未标认证来源可访问clear审计提醒

fix-lifecycle-stages修复生命周期阶段

Agent Skill

fix-lifecycle-stages 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

3,070

周安装

123

GitHub Stars

公开资料未说明

下载量

994
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:fix-lifecycle-stages(修复生命周期阶段)
来源仓库:https://github.com/tomgranot/fix-lifecycle-stages
安装命令:
openclaw skills install fix-lifecycle-stages
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install fix-lifecycle-stages

简介

确保联系人和公司记录具有正确的生命周期阶段。fix-lifecycle-stages 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

  • 通过 API 回填缺失阶段并修复无效状态记录。
  • 适用于 CRM 数据维护与客户旅程管理优化场景。
  • 使用前需确认 API 权限和环境变量配置是否正确。
  • 建议配合备份机制操作,防止误改导致数据丢失。

SKILL.md

name
fix-lifecycle-stages
description
Ensure all contacts and companies have appropriate lifecycle stages. Backfills missing stages via API, fixes records stuck at disallowed stages, and creates prevention workflows to stop future gaps.
license
MIT
metadata
author
tomgranot
version
1.0
category
data-enrichment

Fix Lifecycle Stages

Ensure every contact and company has an appropriate lifecycle stage. This includes backfilling missing stages, correcting disallowed stage values, and creating prevention workflows that automatically assign stages to new records.

Why This Matters

Records without a lifecycle stage are invisible in pipeline reports, excluded from stage-based workflows, and cannot be properly segmented. Even a small percentage of missing lifecycle stages corrupts funnel reporting and makes pipeline analytics unreliable. Lifecycle stage data is also a prerequisite for lead scoring models and lifecycle progression workflows.

Prerequisites

  • Phase 1 hygiene processes completed (invalid/deleted contacts removed first)
  • Access to Contacts and Companies with bulk edit permissions
  • Access to Automation > Workflows
  • Understanding of HubSpot's lifecycle stage progression rules (see Critical Concept below)

Critical Concept: Forward-Only Lifecycle Progression

HubSpot has forward-only lifecycle progression by default. The built-in order is:

Subscriber > Lead > MQL > SQL > Opportunity > Customer > Evangelist

To move a record from a later stage (e.g., "Other", "Evangelist") to an earlier one (e.g., "Lead"), you must:

  1. FIRST clear the lifecycle stage (set to blank/empty)
  2. THEN set the new value

A direct set to an earlier stage will be silently rejected — no error, no warning, the value simply does not change. This is the single most common gotcha when fixing lifecycle stages.

# WRONG — silently fails if current stage is "later" than target
api_client.crm.contacts.basic_api.update(
    contact_id=contact_id,
    simple_public_object_input={"properties": {"lifecyclestage": "lead"}}
)

# CORRECT — clear first, then set
api_client.crm.contacts.basic_api.update(
    contact_id=contact_id,
    simple_public_object_input={"properties": {"lifecyclestage": ""}}
)
api_client.crm.contacts.basic_api.update(
    contact_id=contact_id,
    simple_public_object_input={"properties": {"lifecyclestage": "lead"}}
)

Plan

  1. Audit missing and disallowed lifecycle stages (before state)
  2. Define which stages are "disallowed" for your business and map them to correct stages
  3. Fix contacts with disallowed stages (clear + re-set)
  4. Set missing stages to appropriate defaults based on associated company context
  5. Create prevention workflows for contacts and companies
  6. Verify 100% coverage (after state)

Before State

Audit Script

import os
from hubspot import HubSpot
from dotenv import load_dotenv

load_dotenv()
api_client = HubSpot(access_token=os.getenv("HUBSPOT_API_TOKEN"))

# Count contacts with no lifecycle stage
result = api_client.crm.contacts.search_api.do_search(
    public_object_search_request={
        "filterGroups": [{
            "filters": [{
                "propertyName": "lifecyclestage",
                "operator": "NOT_HAS_PROPERTY"
            }]
        }],
        "limit": 0
    }
)
print(f"Contacts missing lifecycle stage: {result.total}")

# Count contacts at each stage
stages = ["subscriber", "lead", "marketingqualifiedlead", "salesqualifiedlead",
          "opportunity", "customer", "evangelist", "other"]
for stage in stages:
    result = api_client.crm.contacts.search_api.do_search(
        public_object_search_request={
            "filterGroups": [{
                "filters": [{
                    "propertyName": "lifecyclestage",
                    "operator": "EQ",
                    "value": stage
                }]
            }],
            "limit": 0
        }
    )
    if result.total > 0:
        print(f"  {stage}: {result.total}")

# Repeat for companies
result = api_client.crm.companies.search_api.do_search(
    public_object_search_request={
        "filterGroups": [{
            "filters": [{
                "propertyName": "lifecyclestage",
                "operator": "NOT_HAS_PROPERTY"
            }]
        }],
        "limit": 0
    }
)
print(f"\
Companies missing lifecycle stage: {result.total}")

Define Disallowed Stages

Decide which lifecycle stage values should not exist in your database. The table below shows common examples -- your disallowed stages and their correct mappings will depend on how your organization uses the CRM. Review your own stage distribution and decide what makes sense for your business:

Example Disallowed StageCommon ReasonExample Correct Stage
(empty/blank)Invisible to reportsLead (default)
SubscriberOften misapplied when not used for newsletter-only contactsLead
OtherMeaningless catch-allLead
EvangelistRarely used correctly in most organizationsCustomer (if actual customer) or Lead

These are starting-point examples only. Your mapping will differ based on your sales process, integrations, and how stages are currently used. Define your specific mapping before executing.

Execute

Step 1: Fix Contacts at Disallowed Stages

For contacts at "Subscriber", "Other", or "Evangelist" that should be moved to "Lead":

# Pattern: Clear then set (required for backward movement)
DISALLOWED_TO_LEAD = ["subscriber", "other", "evangelist"]

for stage in DISALLOWED_TO_LEAD:
    # Search for contacts at this stage
    # Paginate through all results
    # For each batch:
    #   1. Clear lifecycle stage (set to "")
    #   2. Set lifecycle stage to "lead"
    # Use batch API for efficiency (100 per call)
    pass

Important: The clear-then-set must happen as two separate API calls. You cannot clear and set in one call.

Step 2: Set Missing Contact Stages with Context

Do not set all missing contacts to "Lead" blindly. Check their associated company context:

  1. Contacts at Customer companies -> set to "Customer"
  2. Contacts at Opportunity companies -> set to "Opportunity"
  3. All remaining contacts -> set to "Lead"
# Pattern for context-aware assignment:
# 1. Search for contacts with no lifecycle stage
# 2. For each, get their primary associated company
# 3. Check the company's lifecycle stage
# 4. Set the contact's stage to match (or "lead" as default)

Manual approach via lists:

  1. Create a list: Lifecycle stage is unknown AND Associated company lifecycle stage is Customer -> bulk edit to "Customer"
  2. Create a list: Lifecycle stage is unknown AND Associated company lifecycle stage is Opportunity -> bulk edit to "Opportunity"
  3. Remaining contacts in the "no lifecycle stage" list -> bulk edit to "Lead"

Step 3: Fix Companies Without Lifecycle Stage

  1. Check companies with associated deals:

- Companies with closed-won deals -> set to "Customer" - Companies with open deals -> set to "Opportunity"

  1. All remaining companies without a stage -> set to "Lead"

Step 4: Fix Stuck Records

Some records may fail to update due to the forward-only progression rule. Run a "fix stuck" script:

# Pattern: Find records that should be at a stage but are not
# For each:
#   1. Read current lifecycle stage
#   2. If current stage is "later" than target, clear first
#   3. Set the target stage

Step 5: Create Prevention Workflows

Contact prevention workflow:

  1. Go to Automation > Workflows > Create workflow
  2. Select Contact-based > Blank workflow
  3. Name: AUTO-FIX: Set Default Lifecycle Stage (Lead)
  4. Enrollment trigger: Contact property > Lifecycle stage > is unknown
  5. Enable re-enrollment
  6. Action: Set contact property > Lifecycle stage > Lead
  7. Activate and enroll existing contacts

Company prevention workflow:

  1. Create another workflow: Company-based > Blank workflow
  2. Name: AUTO-FIX: Set Default Company Lifecycle Stage (Lead)
  3. Enrollment trigger: Company property > Lifecycle stage > is unknown
  4. Enable re-enrollment
  5. Action: Set company property > Lifecycle stage > Lead
  6. Activate and enroll existing companies

Optional: Disallowed stage correction workflows:

If contacts keep getting set to disallowed stages (e.g., by imports or integrations):

  1. Create a workflow: Trigger = Lifecycle stage changed to "Subscriber" (or other disallowed value)
  2. Action 1: Clear lifecycle stage (set to blank)
  3. Action 2: Set lifecycle stage to "Lead"

This prevents disallowed stages from recurring.

After State

# Re-run the before-state audit
result = api_client.crm.contacts.search_api.do_search(
    public_object_search_request={
        "filterGroups": [{
            "filters": [{
                "propertyName": "lifecyclestage",
                "operator": "NOT_HAS_PROPERTY"
            }]
        }],
        "limit": 0
    }
)
print(f"Contacts missing lifecycle stage: {result.total} (should be 0)")

result = api_client.crm.companies.search_api.do_search(
    public_object_search_request={
        "filterGroups": [{
            "filters": [{
                "propertyName": "lifecyclestage",
                "operator": "NOT_HAS_PROPERTY"
            }]
        }],
        "limit": 0
    }
)
print(f"Companies missing lifecycle stage: {result.total} (should be 0)")

Verification checklist:

  1. 0 contacts with missing lifecycle stage
  2. 0 companies with missing lifecycle stage
  3. 0 contacts at disallowed stages (Subscriber, Other, Evangelist, or whatever you defined)
  4. Spot-check contacts from Customer sub-list -> their lifecycle stage is "Customer"
  5. Spot-check contacts from Opportunity sub-list -> their lifecycle stage is "Opportunity"
  6. Test the prevention workflow: create a test contact with no lifecycle stage, wait a few minutes, confirm it gets set to "Lead". Delete the test contact.
  7. Funnel reports now show all records with no "unknown" bucket

Key Technical Learnings

  • Forward-only progression is the biggest gotcha. Direct API updates to an "earlier" stage are silently rejected. You MUST clear first, then set. This applies to both API and workflow actions.
  • "Lead" is the safest default. It is early in the progression and will not block forward movement from workflows or deal progression. "Subscriber" is NOT a good default unless you know the contacts subscribed to a newsletter.
  • Context-aware assignment matters. Setting a contact at a Customer company to "Lead" instead of "Customer" degrades data quality. Take the time to check associated company context.
  • Prevention is more important than cleanup. The prevention workflows ensure the problem never recurs. Without them, new records from imports, integrations, or manual entry will immediately re-create the gap.
  • Lifecycle stage and deals interact. HubSpot can automatically advance lifecycle stage when deals are created or won. Your prevention workflows will not interfere because they only trigger when lifecycle stage is unknown.
  • Batch edit limitations. The UI may time out on very large bulk edits. Process one page at a time, or use the API approach for large volumes.
  • The sub-list approach is important. Do not skip context-aware assignment and set everyone to "Lead". Contacts associated with Customer or Opportunity companies deserve the correct stage.

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

92.85%
按下载量换算923

安全审计

VirusTotal

通过

ClawScan

可疑

Static analysis

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills