$npx -y skills add GoogleCloudPlatform/cxas-scrapi --skill drawioExtracts conversational transcripts from .drawio XML files.
| 1 | # Draw.io Ingestor Skill |
| 2 | |
| 3 | Use this skill when you need to extract dialogue turns and conversation flows |
| 4 | from `.drawio` diagram files. |
| 5 | |
| 6 | ## Protocol for Flowchart & Diagram Traversal |
| 7 | |
| 8 | When processing `.drawio` flowchart designs, you must parse them as **complete |
| 9 | directed graphs** to construct dialogue paths, rather than extracting flat text |
| 10 | turns. |
| 11 | |
| 12 | ### 1. Parse Graph Structural Topology |
| 13 | |
| 14 | * Scan `<mxCell>` tags where `vertex="1"`. Extract their `id` and `value` |
| 15 | (text label). |
| 16 | * Scan `<mxCell>` tags where `edge="1"`. Match `source` and `target` vertex |
| 17 | IDs to identify directed pathways. |
| 18 | * Clean cell text by stripping internal HTML styling, tags, and formatting |
| 19 | metadata (e.g., `<div>`, `<font>`, CSS styles). Unescape HTML entities |
| 20 | (e.g., `"` or `<`) to obtain clean text. |
| 21 | |
| 22 | ### 2. Dialogue State & Path Traversal |
| 23 | |
| 24 | * Locate the start node (typically a top-level cell labeled "Start", |
| 25 | "Welcome", or "Entry"). |
| 26 | * Perform a step-by-step traversal (DFS/BFS) along the directed edges. Each |
| 27 | unique path from start to a terminal node constitutes a distinct |
| 28 | conversation flow. |
| 29 | * **State Mapping**: |
| 30 | * **Prompt Node**: Maps to an **Agent Turn** (using the node's cleaned |
| 31 | label). |
| 32 | * **Directed Edge Label**: Maps to a **User Input** (representing speech |
| 33 | utterances or DTMF keys that trigger that transition). |
| 34 | * **Computational Node**: Maps to a **System Action / Webhook** (e.g., |
| 35 | database lookups or validation calls). |
| 36 | * **Decision Diamond**: Represents logical branching. |
| 37 | |
| 38 | ### 3. Brand and Domain Consistency Mapping |
| 39 | |
| 40 | Ensure that you map all domain concepts consistently to the target brand or |
| 41 | theme requested by the user or specified in the requirements. Do not mix |
| 42 | multiple industrial domains in a single report. |
| 43 | |
| 44 | * If the target brand has specific concepts, map requirements to fit that |
| 45 | brand's services. |
| 46 | * If no brand is specified, use clean, generic customer service phrasing |
| 47 | suitable for the context. |
| 48 | * Avoid using technical or backend-specific terminology in spoken Agent turns. |
| 49 | |
| 50 | ### 4. Format the Resulting CXAS Transcript |
| 51 | |
| 52 | Compile the traversed paths into a structured CXAS YAML format complying with |
| 53 | the root-level turn structures (`turns` containing `speaker: Agent|User`, |
| 54 | `text`, and optional actions). Ensure every scenario starts with the |
| 55 | standardized Agent welcome greeting, is voice-realistic, and ends with the |
| 56 | standardized sign-off calling the `end_session` tool. |
| 57 | |
| 58 | ## Example Target Schema |
| 59 | |
| 60 | ```yaml |
| 61 | subintent_id: check_loyalty_status |
| 62 | subintent_name: "Check Loyalty VIP Status" |
| 63 | parent_cuj: "Loyalty Rewards" |
| 64 | turns: |
| 65 | - speaker: Agent |
| 66 | text: "Hello! Thanks for calling [Brand]. How can I help you today?" |
| 67 | - speaker: User |
| 68 | text: "I need to check my loyalty rewards point balance." |
| 69 | - speaker: Agent |
| 70 | text: "I'd be happy to help you check your loyalty rewards point balance. May I have your membership phone number?" |
| 71 | - speaker: User |
| 72 | text: "Yes, it is 555-0199." |
| 73 | - speaker: Agent |
| 74 | text: "Thank you. Let me verify your rewards balance." |
| 75 | webhook_call: |
| 76 | name: check_rewards_balance |
| 77 | payload: |
| 78 | phone_number: "5550199" |
| 79 | response: |
| 80 | vip_status: "ELITE" |
| 81 | points_balance: 1500 |
| 82 | - speaker: Agent |
| 83 | text: "I've found your account. You are an Elite member with a balance of 1,500 points. Is there anything else I can help you with today?" |
| 84 | - speaker: User |
| 85 | text: "No, that's all. Thank you." |
| 86 | - speaker: Agent |
| 87 | text: "Thank you for calling [Brand]! Goodbye." |
| 88 | tool_call: |
| 89 | name: end_session |
| 90 | payload: |
| 91 | session_escalated: false |
| 92 | reason: "Conversation completed successfully" |
| 93 | ``` |
| 94 | |
| 95 | ## Linguistic & Voice Naturalness Standards |
| 96 | |
| 97 | All generated spoken dialogue turns (Agent voice turns) MUST strictly adhere to |
| 98 | high-fidelity spoken voice standards. Subagents must ensure: |
| 99 | |
| 100 | 1. **Numeric Voice Normalization**: Spoken Agent turns MUST NOT contain raw |
| 101 | digits, formatted currencies, or punctuation symbols representing numbers |
| 102 | (e.g., do NOT write `"450"`, `"$909"`, `"555-0199"`). Instead, numbers must |
| 103 | be explicitly spelled out phonetically: |
| 104 | * *Correct*: `"four hundred fifty points"`, `"nine hundred nine dollars"`. |
| 105 | * *IDs and Phone Numbers*: Must be written digit-by-digit separated by |
| 106 | spaces or commas: `"five five five, zero, one, nine, nine"`. |
| 107 | 2. **Spoken Breath Span Limit**: Agent turns must remain concise, natural, and |
| 108 | conversational. Individual spoken text blocks MUST NOT exceed **300 |
| 109 | characters** inside a single turn. |
| 110 | 3. **Vocabulary Smoothness**: Avoid robotic repetitions of the same long words |
| 111 | (do not repeat the same word of length 5+ more than 4 times in a single |
| 112 | turn). |
| 113 | 4. **Conversational Politeness**: Agent turns must maintain standard polite |
| 114 | voice markers (`please`, `thank you`, `thanks`, `certainly`, `happy to |