SuperAPI AI Directory

lcrm-business-record

General & other

View repository

Updated 10-15 21:41

About this skill

Business Record Filling

Objective

After the sales input is provided in natural language, automatically organize it and create a business record. If information is missing, remind the user to supplement it first. Before submission, the user must confirm.

Note: The business record query function has been moved to the lcrm-search skill. This skill is only responsible for creating business records.

Script Entry

  • Main script:node scripts/business-record.mjs <action> [options]
  • Environment variables:
    • Required:LCRM_API_KEY
    • Optional:LCRM_BASE_URL(default https://crm.langcore.net)

Target API

  • POST /api/business-records

Key fields of the request body:

  • Required:
    • customerId or leadId(choose one; for sales scenarios, prefer customerId)
    • followUpType(enum)
    • contactedPerson
    • description(at least 10 characters after removing HTML)
  • Optional:
    • opportunityId
    • opportunityStatus
    • estimatedCloseDate
    • actualCloseDate
    • attachments

followUpType enum:

  • 微信 电话 线上会议 邮件 现场拜访 商务活动 其他

Mandatory Process

  1. Parse the user input and extract:
    • Customer name
    • Contact name
    • Follow-up type (if it cannot be determined, leave it empty first)
    • Record content
  2. Convert customer name to ID:
    • Script:node scripts/business-record.mjs find-customer --company-name "<客户名>" --limit 5
    • No result: inform the user that the customer does not exist and ask the user to supplement the exact name.
    • Multiple results: list the candidates and ask the user to confirm the unique customer.
  3. Contact validation (recommended):
    • Script:node scripts/business-record.mjs customer-detail --customer-id "<customerId>", check whether the contact exists.
    • If not matched, do not block, but prompt "The contact was not matched in the system, and will be written into contactedPerson as text."
  4. Assemble the payload and perform local validation:
    • description length >= 10
    • followUpType must be in the enum
  5. Confirm before submission (mandatory):
    • Output a confirmation card, including at least:
      • customerId + customer name
      • contactedPerson
      • followUpType
      • description summary
    • Only execute POST when the user explicitly replies "confirm/submit/yes".
  6. Submit and return the result:
    • Script:node scripts/business-record.mjs create --payload '<JSON>' or --payload-file <file>
    • Success: return id and key fields.
    • Failure: expose the backend error and provide suggestions for the next step.

Command Examples

node scripts/business-record.mjs create \
  --customer-id "<customerId>" \
  --follow-up-type "电话" \
  --contacted-person "张三" \
  --description "已与客户确认POC范围和预算,预计下周提交技术方案。"

Missing Information Prompt Templates

When the following fields are missing, directly ask the user:

  • Missing customer name:请补充客户名称。
  • Missing contact:请补充本次对接人姓名。
  • Missing follow-up type:请补充跟进类型(微信/电话/线上会议/邮件/现场拜访/商务活动/其他)。
  • Missing record content or fewer than 10 characters:请补充更完整的跟进记录(至少 10 个字)。
  • Request returned an error:请先完善联系人信息(姓名、电话、角色)后再新增商务记录(At this point, the user needs to go to the LCRM system web end to complete the contact information).