Cxas Dfcx Migration 标志

Cxas Dfcx Migration

组织
GoogleCloudPlatform
cxas-dfcx-migration

将 Dialogflow CX(DFCX)智能体迁移到 CXAS(Customer Experience Agent Studio)智能体。用户提到 DFCX 迁移、迁移智能体、将 DFCX 转换为 CXAS、移植智能体、智能体迁移或迁移后优化/整合时,请使用此技能。包含 4 个可独立运行的脚本:migrate.py(1:1)、stage_1.py(变量去重与整合)、stage_2.py(指令状态机、工具模拟、lint 和报告)、stage_3.py(根据源依赖图重新连接整合后的拓扑;仅在 stage_1 执行了整合时需要)。脚本之间的状态通过 <target>_ir.json 持久保存,因此每个脚本都可独立运行、重新运行或恢复执行。

Add to TypingMind

概览

发布者GoogleCloudPlatform
代码仓库cxas-scrapi
技能名称cxas-dfcx-migration
星标数
113
复刻数
106
附带文件
9
许可协议Apache-2.0
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 9 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 GoogleCloudPlatform 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Cxas Dfcx Migration AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/GoogleCloudPlatform/cxas-scrapi/tree/main/.agents/skills/cxas-dfcx-migration
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/GoogleCloudPlatform/cxas-scrapi.git /tmp/cxas-scrapi
mkdir -p .claude/skills
cp -r /tmp/cxas-scrapi/.agents/skills/cxas-dfcx-migration .claude/skills/cxas-dfcx-migration
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Cxas Dfcx Migration,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Cxas Dfcx Migration。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Cxas Dfcx Migration 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

DFCX to CXAS Migration

Four small scripts, one persistent IR bundle:

ScriptWhat it doesRuntimeOutput
migrate.py1:1 conversion of every selected playbook/flow into the IR, and deploys base resources only (app, variables, tools). Agent deployment is DEFERRED to stage_1.py so large sources don't exceed the CXAS 100-agent cap — the compiled agents are saved in <target>_ir.json, not pushed. Pass --no-consolidate to push the full 1:1 agent set immediately (only safe below ~100 agents).~30 min for ~40 flows<target>_ir.json, <target>_migration_report.md, <target>_unit_tests.json
stage_1.pyLoads the IR bundle, runs CXASOptimizer.optimize_stage1 (variable dedup) and Gemini structural consolidation (N→M agent grouping). This is the first agent push to CXAS — only the consolidated (N→M) agents are deployed; the raw 1:1 originals are never pushed (consolidate() drops them and the pre-consolidation snapshot is used transiently for the integrity check only, never persisted). CXAS Version 0.0.2 (dedup) and 0.0.3 (consolidation).~15 minUpdated <target>_ir.json, <target>_grouping.json
stage_2.pyLoads the IR bundle, runs CXASOptimizer.optimize_stage2 (instruction state machines + tool mocks). Pushes via update-pass deploys. CXAS Version 0.0.4. Re-generates unit tests. Lints. Writes the audit report.~10 minUpdated <target>_ir.json, <target>_optimization_report.md, regenerated <target>_unit_tests.json
stage_3.pyOnly after Stage 1 consolidation. Rewires the consolidated agents' parent → children topology by mapping the SOURCE DFCX dep graph onto the new groups (rather than relying on what the synthesized PIF XML happened to reference) according to Spoke-Hub architecture style. Sets app root_agent to the is_root group. Idempotent — safe to re-run. CXAS Version 0.0.5.~10 secUpdated <target>_ir.json stage history; CXAS app's child_agents set per group

State flows through <target>_ir.json (a Pydantic IRBundle containing the MigrationConfig, source DFCXAgentIR, target MigrationIR, stage history, and version checkpoints). Each stage loads it from disk, mutates it, and writes it back. No re-fetching or re-compiling between stages.

When to use this skill vs. the CLI directly

This skill (InquirerPy prompts + HTML pre-flight preview + Gemini model picker) is the right entry when you want to interactively drive a migration with rich pre-flight context. The same MigrationService.run_stage* methods this skill calls are also exposed via the canonical CLI for scripted / CI use:

bash
# Same E2E plumbing, non-interactive (standard optimized profile by default):
cxas migrate dfcx --run --source-agent-id … --project-id … --target-name …

# Non-interactive Stage Checkpoint optimization runs:
cxas migrate dfcx --optimize --stage 1 --target-name my_app
cxas migrate dfcx --optimize --stage 2 --target-name my_app
cxas migrate dfcx --optimize --stage 3 --target-name my_app --architecture hub-and-spoke
cxas migrate dfcx --optimize --stage resume --target-name my_app  # interactive stage picker

The skill, the dashboard, and the E2E / Checkpoint commands all go through the same MigrationService.run_stage_1/run_stage_2/run_stage_3 methods — pick whichever entry point matches your workflow.

Prerequisites

bash
# Ensure cxas_scrapi is installed editable (so this skill picks up local changes)
pip install -e .

# Auth
gcloud auth application-default login
gcloud auth list   # confirm the account has read on source + admin on target

InquirerPy is required for the interactive prompts (matches the agent-foundry skill):

bash
pip install InquirerPy

Driving the flow interactively (from Claude)

When invoked through Claude, lead the user through one question at a time. The scripts will prompt for missing inputs via InquirerPy, but you should pre-collect:

  1. GCP project ID (target — where the new CXAS app will live).
  2. Location — default us. Do NOT default to global — it does not work for CXAS apps in most projects.
  3. Source agent — DFCX agent ID (full resource name) or path to a local .zip export.
  4. Target name — display name for the new CXAS app.

Optional follow-ups: --env (PROD/AUTOPUSH), --model (Gemini), --migration-version (1.0/2.0).

Quick Reference

bash
# 1:1 migration (interactive — InquirerPy will prompt for project + location)
python .agents/skills/cxas-dfcx-migration/scripts/migrate.py

# Fully scripted
python .agents/skills/cxas-dfcx-migration/scripts/migrate.py \
  --source-agent-id "projects/<src_proj>/locations/us/agents/<uuid>" \
  --project-id <target_proj> --location us \
  --target-name my_cxas_app --yes

# Pre-flight HTML preview only (no migration)
python .agents/skills/cxas-dfcx-migration/scripts/migrate.py \
  --source-agent-id "<id>" --project-id <proj> --target-name preview_only \
  --preview-only --yes

# Stage 1 — variable dedup + Gemini consolidation
python .agents/skills/cxas-dfcx-migration/scripts/stage_1.py --target-name my_cxas_app

# Stage 1 — replay a saved grouping JSON
python .agents/skills/cxas-dfcx-migration/scripts/stage_1.py \
  --target-name my_cxas_app --grouping-json my_cxas_app_grouping.json --yes

# Stage 2 — instruction state machines + tool mocks + lint + report
python .agents/skills/cxas-dfcx-migration/scripts/stage_2.py --target-name my_cxas_app

# Stage 3 — rewire consolidated agent parent-child topology (idempotent)
python .agents/skills/cxas-dfcx-migration/scripts/stage_3.py --target-name my_cxas_app --architecture hub-and-spoke

What lives in the skill vs. in cxas_scrapi

The skill is a thin orchestrator. Every migration / optimization step lives in src/cxas_scrapi/migration/ and is reachable via MigrationService.run_stage_* methods, so the same logic powers all three entry points: this skill, cxas migrate dfcx (interactive TUI), and non-interactive command modes (--run / --optimize).

Operationsrc/ entry point
Source agent fetch / zip parsemigration/dfcx_exporter.py:ConversationalAgentsAPI
1:1 migrationmigration/service.py:MigrationService.run_migration
Stage 1 orchestrator (variable dedup + consolidation + integrity + topology link + orphan cleanup + versions + bundle persist)migration/service.py:MigrationService.run_stage_1
Stage 2 orchestrator (state machines + tool mocks + unit-test regen + lint + audit report + bundle persist)migration/service.py:MigrationService.run_stage_2
Stage 3 orchestrator (parent-child topology wiring)migration/service.py:MigrationService.run_stage_3
Bundle persist conveniencemigration/service.py:MigrationService.persist_bundle
Variable dedup primitive (Stage 1)migration/optimizer.py:CXASOptimizer.optimize_stage1
Instruction restructuring + tool mocks primitive (Stage 2)migration/optimizer.py:CXASOptimizer.optimize_stage2
Gemini N→M grouping + per-group PIF XML synthesismigration/structural_consolidator.py:StructuralConsolidator
Pre-deploy integrity checksmigration/integrity_checks.py:check_consolidation_integrity
Parent-child topology + orphan cleanupmigration/topology_wirer.py
Update-pass redeploysmigration/service.py:MigrationService._deploy_base_resources(is_update_pass=True) + _deploy_pending_agents(is_update_pass=True)
Topology linkmigration/cxas_topology_linker.py
Version checkpointscore/versions.py:Versions.create_version
Topology SVGmigration/graph_visualizer.py:HighLevelGraphVisualizer
Per-resource Rich treesmigration/playbook_visualizer.py + migration/flow_visualizer.py
Deterministic unit testsmigration/eval_generator.py:DeterministicEvalGenerator
Migration reportmigration/dfcx_migration_reporter.py
Optimization audit reportmigration/optimization_reporter.py:OptimizationReporter
Grouping review TUI (accept / re-propose / merge / split / rename)cli/grouping_review.py:interactive_review
HTML pre-flight previewmigration/html_preview.py
Post-deploy lintermigration/post_deploy_lint.py
IR bundle persistencemigration/data_models.py:IRBundle

Skill-local helpers (UX glue only — InquirerPy prompts + thin delegations to MigrationCLI):

  • _prompts.py — InquirerPy prompt library (matches agent-foundry).
  • _shared.py — InquirerPy variants of project/location prompts, source loader, and MigrationConfig assembly; plus pure delegations to MigrationCLI for check_auth, run_dependency_analysis, select_resources, show_visualizations.

The stage scripts now import the promoted modules directly: from cxas_scrapi.migration.data_models import IRBundle (plus html_preview in migrate.py and phase_tracker) and call sites use the canonical model names (IRBundle, phase_tracker.PhaseTracker, html_preview.generate_html_report) — no re-export shim layer.

The skill's stage scripts (migrate.py / stage_1.py / stage_2.py / stage_3.py) are now ~80-200 line shells: parse args → restore service from bundle → call the matching MigrationService.run_stage_* → print summary. There is no orchestration logic left in the skill — only InquirerPy prompts and the HTML preview that's specific to the skill's pre-flight UX.HTML preview that's specific to the skill's pre-flight UX.

IR bundle (<target>_ir.json)

The unit of state shared across the three scripts. Pydantic IRBundle model:

jsonc
{
  "schema_version": "1",
  "created_at": "2026-05-14T15:30:00",
  "config": { /* MigrationConfig */ },
  "source_agent_data": { /* DFCXAgentIR — needed for tool-mock context */ },
  "ir": { /* MigrationIR — mutated by each stage */ },
  "stage_history": [
    {"phase": "migrate", "status": "ok", ...},
    {"phase": "stage1",  "status": "ok", ...}
  ],
  "app_url": "https://ces.cloud.google.com/...",
  "version_checkpoints": [["0.0.1", "Stage 1: ..."]],
  "grouping": { /* present if Stage 1 ran consolidation */ }
}

Killing a stage script mid-run leaves the bundle untouched (only persisted on success). Re-running picks up where the last successful stage left off.

Pre-flight HTML preview

migrate.py generates <target>_tree_preview.html in ~5 seconds after source loading. Open it in any browser to see:

  • Source overview (resource counts, estimated migration time).
  • Topology graph (graphviz SVG when dot is on PATH; Mermaid fallback otherwise).
  • Per-playbook and per-flow Rich trees.

migrate.py --preview-only exits after the preview without running the migration.

Troubleshooting

  • create_app returns 404 / 501 / MethodNotImplemented — your --location is wrong. CXAS apps in most projects live in us, not global. Pass --location us.
  • AlreadyExists: App with same display name — pick a different --target-name. Old runs leave deployed apps behind even on partial failure.
  • Stage 1 / Stage 2 fail with No IR bundle found — run migrate.py first to produce <target>_ir.json, or pass --ir-bundle <path> explicitly.
  • Synthesis (Stage 1 consolidation) hangs on Gemini — fixed with per-group asyncio.wait_for(timeout=600s) in structural_consolidator.synthesize_instructions. Override via SYNTHESIS_TIMEOUT_S env var. Hung groups fall back to the concatenated instruction.
  • gemini-2.5-flash-001 not found during AI augment — the Gemini call uses locations/global for the model; sometimes that endpoint is project-restricted. The migration continues with empty AI descriptions. Pick a different --model if you need them.

Detailed reference

See references/migration-options.md for full parameter / flag descriptions and the IR bundle schema.

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Cxas Dfcx Migration AI 技能有什么作用?

将 Dialogflow CX(DFCX)智能体迁移到 CXAS(Customer Experience Agent Studio)智能体。用户提到 DFCX 迁移、迁移智能体、将 DFCX 转换为 CXAS、移植智能体、智能体迁移或迁移后优化/整合时,请使用此技能。包含 4 个可独立运行的脚本:migrate.py(1:1)、stage_1.py(变量去重与整合)、stage_2.py(指令状态机、工具模拟、lint 和报告)、stage_3.py(根据源依赖图重新连接整合后的拓扑;仅在 stage_1 执行了整合时需要)。脚本之间的状态通过 <target>_ir.json 持久保存,因此每个脚本都可独立运行、重新运行或恢复执行。

为什么在 TypingMind 中使用 Cxas Dfcx Migration?

因为您只需安装一次,就能搭配任何模型使用。Cxas Dfcx Migration 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Cxas Dfcx Migration?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/GoogleCloudPlatform/cxas-scrapi/tree/main/.agents/skills/cxas-dfcx-migration。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Cxas Dfcx Migration?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Cxas Dfcx Migration 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Cxas Dfcx Migration 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Cxas Dfcx Migration AI 技能免费吗?

是的。GoogleCloudPlatform 已在 GitHub 上根据 Apache-2.0 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇