$npx -y skills add GoogleCloudPlatform/cxas-scrapi --skill dfcxParsing and Ingestion directives for the Dialogflow CX (DFCX) agent structure.
| 1 | # Dialogflow CX Ingestor Skill |
| 2 | |
| 3 | This skill standardizes the ingestion, parsing, and behavior extraction of |
| 4 | conversational agents exported in the official, public Dialogflow CX (DFCX) |
| 5 | format. |
| 6 | |
| 7 | -------------------------------------------------------------------------------- |
| 8 | |
| 9 | ## 1. DFCX Export Package Layout |
| 10 | |
| 11 | An official Dialogflow CX agent export is packaged as a `.zip` archive. When |
| 12 | extracted, it conforms to the following public directory layout: |
| 13 | |
| 14 | ``` |
| 15 | <agent_zip_root>/ |
| 16 | ├── agent.json # Global agent metadata (default language, timezone, display name) |
| 17 | ├── intents/ # Declared intents and training phrases |
| 18 | │ └── <intent_name>/ |
| 19 | │ └── <intent_name>.json # Intent configuration |
| 20 | ├── entityTypes/ # Custom entity declarations |
| 21 | │ └── <entity_name>/ |
| 22 | │ └── <entity_name>.json # Entity configuration and synonyms |
| 23 | ├── transitionRouteGroups/ # Shared flow-level transition groups |
| 24 | ├── webhooks/ # Declared webhooks and backend REST integrations |
| 25 | │ └── <webhook_name>.json # Webhook configuration (defining target URI and credentials) |
| 26 | └── flows/ # Subfolders representing individual Flows |
| 27 | └── <flow_name>/ # Flow directory (e.g., Default Start Flow, Billing) |
| 28 | ├── <flow_name>.json # Flow configuration listing flow-level transition routes and entry points |
| 29 | ├── transitionRouteGroups/ # Shared transition route groups specific to this flow |
| 30 | └── pages/ # Directory containing individual page configurations |
| 31 | └── <page_name>.json # Page definition containing entry prompts, form parameters, and transitions |
| 32 | ``` |
| 33 | |
| 34 | -------------------------------------------------------------------------------- |
| 35 | |
| 36 | ## 2. Ingestion & Flow Tracing Directives |
| 37 | |
| 38 | The Ingestor Agent MUST parse the extracted file structures using standard |
| 39 | directory traversal and JSON parsing, mapping them to the primary coverage |
| 40 | checklist: |
| 41 | |
| 42 | ### A. CUJ Mapping |
| 43 | |
| 44 | * **CUJ Discovery**: Treat each **Flow folder** under `flows/` (e.g., |
| 45 | `flows/Default Start Flow/` or `flows/Billing Flow/`) as a high-level |
| 46 | **Parent CUJ**. The folder's directory name represents the CUJ title. |
| 47 | |
| 48 | ### B. Sub-intent & Trigger Extraction |
| 49 | |
| 50 | For each Flow, traverse `<flow_name>.json` and all `.json` files inside its |
| 51 | `pages/` subdirectory: |
| 52 | |
| 53 | 1. **Flow-Level Transition Routes**: |
| 54 | - Parse the `"transitionRoutes"` array inside `<flow_name>.json`. |
| 55 | - Identify each transition triggered by an intent (where `"intent"` is |
| 56 | declared, e.g., `projects/.../intents/<intent_id>`). |
| 57 | - Map each unique triggered transition as a **Sub-intent / Scenario** |
| 58 | (using the target page/flow name to synthesize its name). |
| 59 | 2. **Page-Level Transition Routes**: |
| 60 | - For each page `.json` inside `pages/`, parse the `"transitionRoutes"` |
| 61 | array to map conversational branches and trigger conditions. |
| 62 | 3. **Form Parameter nodes**: |
| 63 | - Parse the `"form.parameters"` array inside a page JSON. |
| 64 | - Each parameter collected (e.g., email_address, postal_code) represents a |
| 65 | sub-intent step in the conversational walkthrough. |
| 66 | 4. **Fulfillment Webhooks**: |
| 67 | - Identify `"triggerFulfillment.webhook"` inside transition routes or page |
| 68 | configs. |
| 69 | - Resolve the webhook's target endpoint destination URI by looking up its |
| 70 | matching configuration file inside the global `webhooks/` directory |
| 71 | (e.g. `webhooks/<webhook_name>.json`'s `"genericWebService.uri"`). |
| 72 | - **Note**: Webhooks represent standard REST integrations defined as |
| 73 | **toolsets** (indexed via OpenAPI specifications `open_api_schema.yaml` |
| 74 | under the `toolsets/` directory). |
| 75 | |
| 76 | ### C. Alignment with Canonical `cxas-agent-migration` Standards |
| 77 | |
| 78 | When parsing Dialogflow CX layouts, the Ingestor Agent SHOULD align the |
| 79 | extracted behaviors with the open-source `cxas-agent-migration` topology (N->M |
| 80 | agents consolidation): |
| 81 | |
| 82 | 1. **Playbook/Flow to Agent Persona**: Each extracted Flow directory represents |
| 83 | a distinct sub-agent boundary. Treat the flow's transitions and event |
| 84 | handlers as the sub-agent's private prompt limits and routing callbacks. |
| 85 | 2. **Deduplicate & Group Variables**: Consolidate intent parameters and page |
| 86 | forms variables using `cxas-agent-migration` Stage 1 rules (variable |
| 87 | deduplication) to avoid parameter bloat in transcripts. |
| 88 | 3. **Topological Rewiring**: Track the source dependency graph (parent flows -> |
| 89 | children flows) using `cxas-agent-migration` Stage 3 rules, ensuring that |
| 90 | transitions from steering accurately reflect the legacy DFCX intent routing. |
| 91 | |
| 92 | -------------------------------------------------------------------------------- |
| 93 | |
| 94 | ## 3. Dialogue Simulation & Transcript Guidelines |
| 95 | |
| 96 | When simulating conversation tr |