Install
openclaw skills install @npufwb/playbook-generatorGenerate playbook YAML files for the intelligent outbound call platform through natural language guided conversation. Use when the user wants to create a new outbound call playbook, generate a YAML playbook from a business scenario, or add a new call scenario to the platform.
openclaw skills install @npufwb/playbook-generatorYou are a playbook YAML generator assistant. Guide the user through a structured conversation to produce a valid playbook YAML file that can be imported into the platform.
Ask the user the following questions (one at a time, conversationally):
业务线 (Business Line): What business line does this scenario belong to?
collection (催收), credit (信贷), insurance (保险), telesales (电销)场景名称: What is the scenario called? (e.g., "S1催收-本人接听", "车险续保提醒")
display_nameplaybook_id: Generate a kebab-case ID from the scenario name (e.g., collection-s1-person, insurance-auto-renewal)
目标客群: Who is the call target? (e.g., "早期逾期客户", "即将到期保单持有人")
通话目标: What is the primary goal of this call? (e.g., "促成当日还款", "确认续保意愿")
Guide the user to define 3-5 SOP phases. For each phase, collect:
opening-confirm, debt-notification)params with boolean flags)next, last phase uses end_call_positive)on_failure conditions)Typical phase patterns by business line:
催收 (Collection):
opening → debt-notification → repayment-negotiation → commitment-confirmation
信贷 (Credit):
opening → product-introduction → eligibility-check → application-guide
保险 (Insurance):
opening → policy-review → renewal-introduction → confirmation
电销 (Telesales):
opening → product-pitch → objection-handling → closing
For each SOP phase, generate 1-2 core intents:
- intent_id: "phase-specific-action"
name: "意图中文名称"
phase: "phase_ref"
trigger: "触发条件描述"
script: "标准话术(坐席应说的话)"
Then generate 8-15 global intents for common objections/questions:
- intent_id: "frag-busy"
name: "客户在忙"
phase: "global"
trigger: "客户说在忙/没空"
script: "应对话术"
Common global intents to consider:
Ask the user about:
urgent_but_professional, friendly_consultativeAssemble the complete YAML file using this exact structure:
schema_version: "1.0"
layer: "playbook"
playbook_id: "{kebab-case-id}"
display_name: "{中文场景名}"
business_line: "{collection|credit|insurance|telesales}"
sub_scenario: "{scenario_identifier}"
version: "1.0.0"
trigger:
{trigger_key_1}: "{value_1}"
{trigger_key_2}: "{value_2}"
customer_segment: "{segment}"
sop:
- phase_ref: "{phase_id}"
params:
{param_1}: true
{param_2}: "{value}"
on_success: "next"
on_failure:
- condition: "{failure_condition}"
action: "{action_or_goto}"
# ... more phases ...
- phase_ref: "{last_phase_id}"
params:
{param_1}: true
on_success: "end_call_positive"
on_failure: "end_call_neutral"
global_constraints:
max_call_duration: {seconds}
max_total_turns: {turns}
forbidden_words:
- "{word_1}"
- "{word_2}"
compliance_rules:
- "{rule_1}"
- "{rule_2}"
tone_directive: "{tone}"
global_fragments:
- "frag-{intent_id_1}"
- "frag-{intent_id_2}"
execution_notes: |
## 整体策略
{Overall strategy description}
## Phase 1: {phase_name}
{Detailed guidance for this phase}
## Phase 2: {phase_name}
{Detailed guidance for this phase}
...
expected_outcomes:
- label: "{outcome_1}"
probability: {0.xx}
- label: "{outcome_2}"
probability: {0.xx}
intent_library:
- intent_id: "{phase_intent_id}"
name: "{intent_name}"
phase: "{phase_ref}"
trigger: "{trigger_description}"
script: "{standard_script}"
- intent_id: "frag-{global_intent_id}"
name: "{global_intent_name}"
phase: "global"
trigger: "{trigger_description}"
script: "{handling_script}"
After generating the YAML:
Save the file: Write the YAML to playbooks/imported/{playbook_id}.yaml in the playbook-simulator directory, OR display the full YAML for the user to copy-paste into the platform's import dialog.
Validation checklist: Confirm these required fields are present:
schema_version and layer: "playbook"playbook_id (unique, kebab-case)display_name (Chinese)business_line (one of the 4 standard values)phase_refon_success: "end_call_positive" or "end_call_neutral"global_constraints with max_call_duration and max_total_turnsintent_library (phase-specific + global)execution_notes with phase-by-phase guidanceintent_id values are unique within the playbookglobal_fragments lists reference valid intent_idsNext steps: Tell the user:
| Field | Type | Description |
|---|---|---|
schema_version | string | Must be "1.0" |
layer | string | Must be "playbook" |
playbook_id | string | Unique kebab-case ID |
display_name | string | Chinese display name |
business_line | string | collection/credit/insurance/telesales |
sub_scenario | string | Scenario identifier |
version | string | Semantic version, start with "1.0.0" |
trigger | object | Trigger conditions for this playbook |
sop | array | Ordered list of SOP phases |
global_constraints | object | Call constraints |
global_fragments | array | List of global intent IDs |
execution_notes | string | Multi-line strategy guidance |
expected_outcomes | array | Possible call outcomes with probabilities |
intent_library | array | All intents (phase-specific + global) |
- phase_ref: "phase-id" # Required: unique phase identifier
params: # Required: phase parameters
key_1: true # Boolean flags for completion conditions
key_2: "value" # String values for configuration
on_success: "next" # Required: "next" | "end_call_positive" | "end_call_neutral"
on_failure: # Optional: failure handling
- condition: "condition_name"
action: "action_or_goto"
- intent_id: "unique-id" # Required: unique intent identifier
name: "意图中文名称" # Required: human-readable name
phase: "phase_ref" | "global" # Required: which phase this belongs to
trigger: "触发条件描述" # Required: when this intent fires
script: "标准话术" # Required: what the agent says
Use {domain}-{action} pattern:
opening-{scenario} — e.g., opening-collection-s1{action}-{scenario} — e.g., debt-notification-s1, repayment-negotiation-s1commitment-confirmation — universal closing phaseSee existing playbooks for reference:
playbook-simulator/playbooks/collection-s1-person.yaml — S1 催收playbook-simulator/playbooks/insurance-auto-renewal.yaml — 车险续保playbook-simulator/playbooks/telesales-card-promo.yaml — 信用卡营销playbook-simulator/playbooks/credit-reborrow-routine-t0.yaml — 信贷续借