uipath-rpa
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseUiPath RPA Assistant
UiPath RPA 助手
Full assistant for creating, editing, managing, and running UiPath automation projects — both coded workflows (C#) and low-code RPA workflows (XAML).
Reading the referenced files is imperative — read each required file in full. This SKILL.md is a router: it tells you which reference to open, not what it says. When a rule, the Task Navigation table, or a section points you to a reference for the task at hand, open it and read the whole file before acting — do not grep it for a keyword, skim the first screen, fall back to, or substitute prior knowledge. Exception: files whose rule prescribes a targeted lookup (Grep--helpfor the table of contents, flags via^##) — these are catalogs: read the matching sections, never the whole file. Most errors that slip past<command> --helpand surface atvalidateor runtime trace back to a reference that was skipped or only partially read.build
用于创建、编辑、管理和运行UiPath自动化项目的全能助手 — 支持代码化工作流(C#)和低代码RPA工作流(XAML)。
必须阅读参考文件 — 完整阅读每个所需文件。 本SKILL.md是一个路由文件:它仅告知你需要打开哪个参考文件,而非文件内容。当规则、任务导航表或某个章节指向与当前任务相关的参考文件时,请打开并完整阅读该文件后再执行操作 — 不要仅通过关键词搜索、浏览首屏内容、依赖命令或凭已有经验替代。例外情况:规则中规定需定向查找的文件(通过--help查看目录,通过Grep ^##查看参数)—— 这类文件属于目录型文件:只需阅读匹配的章节,无需通读全文。大多数能通过<command> --help但在validate或运行时暴露的错误,都源于跳过或仅部分阅读了参考文件。build
When to Use This Skill
何时使用此技能
- User wants to create a new UiPath automation project (coded or XAML)
- User wants to add a workflow, test case, or source file to an existing project
- User wants to edit an existing workflow or test case
- User wants to modify project configuration (dependencies, entry points)
- User asks about UiPath activities or how to automate something
- User wants to validate, build, run, or debug a workflow
- User wants to add dependencies or NuGet packages to a project
- User wants to create test cases with assertions
- User wants to call an Integration Service connector (Jira, Salesforce, ServiceNow, Slack, etc.)
- User wants to use UI automation to interact with desktop or web applications
- 用户想要创建新的UiPath自动化项目(代码化或XAML类型)
- 用户想要向现有项目添加工作流、测试用例或源文件
- 用户想要编辑现有工作流或测试用例
- 用户想要修改项目配置(依赖项、入口点)
- 用户询问UiPath活动或如何实现某类自动化
- 用户想要验证、构建、运行或调试工作流
- 用户想要向项目添加依赖项或NuGet包
- 用户想要创建带断言的测试用例
- 用户想要调用集成服务连接器(Jira、Salesforce、ServiceNow、Slack等)
- 用户想要使用UI自动化与桌面或Web应用交互
UI Automation Capabilities
UI自动化能力
One UIA activity set covers every UI target:
- Multi-platform — Windows and macOS.
- Desktop and web — native desktop applications and browsers, driven through the same activities.
- Resilient targeting — targets are configured with strict or fuzzy selectors (reinforced by anchors), Computer Vision, or semantic matching; picks the route and falls back between them automatically.
uia-configure-target - Combined in a single automation — desktop and browser apps interoperate in one workflow with no bridge or handoff. Multi-screen, multi-application flows (read from a desktop app, act in a browser, verify across both) are first-class.
一套UIA活动集可覆盖所有UI目标:
- 多平台支持 — Windows和macOS系统。
- 桌面与Web兼容 — 原生桌面应用和浏览器,可通过相同活动驱动。
- 弹性定位 — 目标可通过严格或模糊选择器(辅以锚点)、计算机视觉或语义匹配进行配置;会自动选择合适的方式并在不同方式间 fallback。
uia-configure-target - 单自动化流程内协同 — 桌面和浏览器应用可在同一工作流中交互,无需桥接或切换。多屏幕、多应用流程(从桌面应用读取数据,在浏览器中操作,跨应用验证)是一等公民特性。
UIA Prerequisites
UIA前置条件
Required package: — minimum version (): , from the official UiPath NuGet feed (no prerelease flag needed). The CLI, the package docs, and the UIA skills require or newer — before any UIA work, check the installed version in under . Do not hardcode the version from memory; this section is the only source of truth.
UiPath.UIAutomation.Activities<MIN_VERSION>26.10.2uip rpa uia<MIN_VERSION>project.jsondependenciesUpgrades require explicit user consent. Never install or upgrade UIA silently. Consent comes from one of:
- Plan-mode: approval of a plan whose Task 0 names the upgrade explicitly — both package ID and version. Plan approval IS the consent — do NOT re-ask at execution time.
- Interactive mode (no plan): a direct prompt before runs.
packages install
| Scenario | Behavior |
|---|---|
| No UIA installed, request needs UIA | Ask before installing |
Major-version upgrade (e.g. | Ask. Breaking changes are possible across major versions. |
| Minor / patch / build upgrade | Ask before installing the newer build. |
Already at or above | Proceed without prompting. |
Discovery (non-mutating, no consent required):
bash
uip rpa packages versions --package-id UiPath.UIAutomation.Activities --include-prerelease --project-dir "$PROJECT_DIR" --output jsonInstall / upgrade (mutating — only after consent per the table above):
bash
uip rpa packages install --packages 'id=UiPath.UIAutomation.Activities,version=<MIN_VERSION>' --project-dir "$PROJECT_DIR" --output jsonOmit to resolve the latest compatible build (at or above ).
,version=<MIN_VERSION><MIN_VERSION>必需包: — 最低版本():,需从官方UiPath NuGet源获取(无需预发布标记)。 CLI、包文档和UIA技能均要求或更高版本 — 在进行任何UIA工作前,请检查的中已安装的版本。不要凭记忆硬编码版本;本节内容是唯一的权威来源。
UiPath.UIAutomation.Activities<MIN_VERSION>26.10.2uip rpa uia<MIN_VERSION>project.jsondependencies升级需明确获得用户同意。 切勿静默安装或升级UIA包。同意需来自以下任一情况:
- 计划模式: 用户批准的计划中,任务0明确提及升级内容 — 包括包ID和版本。计划批准即视为同意 — 执行时无需再次询问。
- 交互模式(无计划): 在运行前直接向用户提示。
packages install
| 场景 | 行为 |
|---|---|
| 未安装UIA,但请求需要UIA | 询问用户是否从官方UiPath源安装 |
大版本升级(如 | 询问用户。跨大版本可能存在破坏性变更。 |
| 小版本/补丁/构建版本升级 | 询问用户是否安装新版本。 |
已安装版本等于或高于 | 无需提示,直接继续。 |
发现操作(非变更操作,无需同意):
bash
uip rpa packages versions --package-id UiPath.UIAutomation.Activities --include-prerelease --project-dir "$PROJECT_DIR" --output json安装/升级(变更操作 — 仅在符合上表中的同意条件后执行):
bash
uip rpa packages install --packages 'id=UiPath.UIAutomation.Activities,version=<MIN_VERSION>' --project-dir "$PROJECT_DIR" --output json省略将自动解析为最新兼容版本(等于或高于)。
,version=<MIN_VERSION><MIN_VERSION>Precondition: Project Context
前置条件:项目上下文
Before doing any work, check if exists in the project directory.
.claude/rules/project-context.mdIf the file exists → check for staleness:
- Read the first line of to extract the metadata comment:
.claude/rules/project-context.md<!-- discovery-metadata: cs=N xaml=N deps=N --> - Count current files: Glob (excluding
**/*.csand.local/) and.codedworkflows/in the project directory**/*.xaml - Count current dependencies: read and count keys in the
project.jsonobject.dependencies - Compare the current counts against the stored metadata values
- For each count (cs, xaml, deps), compute the percentage difference:
abs(current - stored) / max(stored, 1) * 100 - If any individual count differs by 60–70% or more → run the discovery flow below
- If all counts are within the threshold → context is fresh, proceed with the skill workflow
If the file does NOT exist → run the skip gate below; if it does not trip, run the discovery flow.
在进行任何工作前,请检查项目目录中是否存在文件。
.claude/rules/project-context.md如果文件存在 → 检查是否过期:
- 读取的第一行,提取元数据注释:
.claude/rules/project-context.md<!-- discovery-metadata: cs=N xaml=N deps=N --> - 统计当前文件数量:在项目目录中匹配(排除
**/*.cs和.local/)和.codedworkflows/文件**/*.xaml - 统计当前依赖项数量:读取并统计
project.json对象中的键数量.dependencies - 将当前统计值与存储的元数据值进行比较
- 对每个统计值(cs、xaml、deps)计算百分比差异:
abs(current - stored) / max(stored, 1) * 100 - 如果任一统计值差异达到60–70%或更高 → 运行下方的发现流程
- 如果所有统计值都在阈值范围内 → 上下文是最新的,继续执行技能工作流
如果文件不存在 → 运行下方的跳过检查;如果未触发,则运行发现流程。
Skip gate: nothing to discover yet
跳过检查:暂无内容可发现
Discovery on a project with no authored content returns empty tables and costs a subagent round-trip. Do NOT spawn the discovery agent when any row matches:
| Condition | How to check |
|---|---|
Greenfield — no | Step 0 found no |
| Empty project — 0 authored workflow files | Glob |
| Freshly scaffolded — only the untouched entry point | Count 1; file is a scaffold entry point ( |
Gate tripped: write no context files now, proceed with the skill workflow. After the build, write both context files yourself from what you just created — same paths and marker logic as discovery-flow step 3.
AGENTS.mdDiscovery flow (used for both missing and stale context):
- Spawn the project discovery agent and wait for it to complete. Its definition lives inside this skill at . Use whichever spawn mechanism your host supports:
agents/uipath-project-discovery-agent.md- Host registers plugin agents by name (e.g., Claude Code) → trigger the registered agent.
uipath-project-discovery-agent - Host only spawns its own predefined subagents (e.g., UiPath Autopilot) → spawn a subagent and pass it that file (relative to this skill) as its instructions / custom skill. Grant it write access so it can produce the context files itself; a read-only subagent still works via step 3.
- Host registers plugin agents by name (e.g., Claude Code) → trigger the registered
- The agent writes the context files itself and returns a status line followed by the context document. Use the returned document as this session's project context — do NOT re-read the files it just wrote, and do NOT rewrite them.
context-files: - Only when the agent reports (read-only subagent host, or a write error) → write the returned content to both:
context-files: not-written- (create
.claude/rules/project-context.mddirectory if needed) — auto-loaded by Claude Code in future sessions.claude/rules/ - at project root — the shared cross-agent context convention (read by UiPath Autopilot in Studio Desktop and other AGENTS.md-aware hosts). If
AGENTS.mdalready exists, look forAGENTS.md/<!-- PROJECT-CONTEXT:START -->markers and replace only between them; if no markers exist, append the fenced block at the end<!-- PROJECT-CONTEXT:END -->
- If the agent returns instead of a document, treat it as a gate trip: no context files now, write them yourself after the build.
SKIP: <reason> - Then proceed with the skill workflow
对没有已编写内容的项目执行发现流程会返回空表格,且会消耗子代理的往返调用。当以下任一条件匹配时,请勿启动发现代理:
| 条件 | 检查方式 |
|---|---|
全新项目 — 无 | 步骤0未找到 |
| 空项目 — 0个已编写的工作流文件 | 匹配 |
| 刚搭建的项目 — 仅包含未修改的入口点 | 数量为1;文件是搭建好的入口点( |
触发跳过检查:现在无需写入上下文文件,继续执行技能工作流。构建完成后,根据你刚刚创建的内容自行写入两个上下文文件 — 路径和标记逻辑与发现流程步骤3相同。
AGENTS.md发现流程(用于上下文缺失或过期的情况):
- 启动项目发现代理并等待其完成。代理定义位于本技能的。使用宿主支持的启动机制:
agents/uipath-project-discovery-agent.md- 宿主按名称注册插件代理(如Claude Code)→ 触发已注册的代理。
uipath-project-discovery-agent - 宿主仅启动预定义的子代理(如UiPath Autopilot)→ 启动子代理并将该文件(相对于本技能的路径)作为其指令/自定义技能。授予其写入权限,以便它能自行生成上下文文件;只读子代理仍可通过步骤3完成操作。
- 宿主按名称注册插件代理(如Claude Code)→ 触发已注册的
- 代理会自行写入上下文文件,并返回包含状态行的上下文文档。使用返回的文档作为本次会话的项目上下文 — 不要重新读取它刚刚写入的文件,也不要重写这些文件。
context-files: - 仅当代理返回(宿主为只读子代理,或写入错误)时 → 将返回的内容写入两个位置:
context-files: not-written- (若需则创建
.claude/rules/project-context.md目录)— 供Claude Code在未来会话中自动加载.claude/rules/ - 项目根目录下的— 跨代理共享上下文的约定(供Studio Desktop中的UiPath Autopilot和其他支持AGENTS.md的宿主读取)。如果
AGENTS.md已存在,查找AGENTS.md/<!-- PROJECT-CONTEXT:START -->标记并仅替换标记之间的内容;如果没有标记,则在末尾追加代码块<!-- PROJECT-CONTEXT:END -->
- 如果代理返回而非文档,则视为触发跳过检查:现在无需写入上下文文件,构建完成后自行写入。
SKIP: <reason> - 然后继续执行技能工作流
Step 0: Resolve PROJECT_DIR
步骤0:解析PROJECT_DIR
Before creating or modifying anything, determine which project to work with. See references/environment-setup.md for the full procedure.
Quick check: Find to establish . That's it — no Studio Desktop check needed for the standard loop. auto-launches a headless Studio (UiPath.Studio.Helm NuGet) on first call. Studio Desktop is required only for , , and regenerating coded UI automation's (the class — see Rule 7 and environment-setup.md).
project.json{projectRoot}uip rpafiles difffocus-activityObjectRepository.csDescriptors.*在创建或修改任何内容前,确定要处理的项目。请参阅references/environment-setup.md获取完整流程。
快速检查: 找到以确定。仅此而已 — 标准流程无需检查Studio Desktop。会在首次调用时自动启动无头Studio(UiPath.Studio.Helm NuGet包)。仅在执行、和重新生成代码化UI自动化的(类 — 请参阅规则7和environment-setup.md)时才需要Studio Desktop。
project.json{projectRoot}uip rpafiles difffocus-activityObjectRepository.csDescriptors.*Project Type Detection
项目类型检测
After establishing , first check for :
PROJECT_DIRproject.jsontargetFramework- (or field absent in an older project) → Legacy mode. Stop here and switch to the Legacy-mode workflow: references/legacy/legacy-mode-guide.md. Legacy projects use the standalone
targetFramework: "Legacy"CLI, .NET Framework 4.6.1, classic activities (no "X" suffix), anduip rpa-legacyassembly references. The rest of this SKILL.md (modern mode) does NOT apply to Legacy projects.mscorlib - or
targetFramework: "Windows"(Cross-platform) → Modern mode, continue below."Portable"
For modern projects, determine whether this is a coded or XAML project:
- Coded mode — files with
.csor[Workflow]attributes exist AND no[TestCase]workflow files (beyond scaffolded.xaml)Main.xaml - XAML mode — workflow files exist AND no coded workflow
.xamlfiles.cs - Hybrid — Both exist → consult coded-vs-xaml-guide.md to pick the right mode for each new file; default to matching the user's current request
- New project — Neither exists → default to XAML. Switch to coded only when the user explicitly says "coded", ".cs", "C# workflow", "coded test case", or names a coded-specific trigger (custom data models / DTOs, unit-testable business logic). For all other phrasings ("create a workflow", "automate X", "build an automation"), use XAML. See coded-vs-xaml-guide.md for the full decision flowchart.
Routing: Once mode is determined, use the Task Navigation table below to find the right reference files. For guidance on choosing between coded and XAML approaches, see coded-vs-xaml-guide.md. For Legacy projects, follow references/legacy/legacy-mode-guide.md instead.
确定后,首先检查中的:
PROJECT_DIRproject.jsontargetFramework- (或旧项目中缺少此字段)→ 旧版模式。 在此处停止并切换到旧版模式工作流:references/legacy/legacy-mode-guide.md。旧版项目使用独立的
targetFramework: "Legacy"CLI、.NET Framework 4.6.1、经典活动(无"X"后缀)和uip rpa-legacy程序集引用。本SKILL.md的其余内容(现代模式)不适用于旧版项目。mscorlib - 或
targetFramework: "Windows"(跨平台)→ 现代模式,继续下文。"Portable"
对于现代项目,确定其为代码化还是XAML项目:
- 代码化模式 — 存在带或
[Workflow]属性的[TestCase]文件,且无.cs工作流文件(搭建好的.xaml除外)Main.xaml - XAML模式 — 存在工作流文件,且无代码化工作流
.xaml文件.cs - 混合模式 — 两者都存在 → 请参阅coded-vs-xaml-guide.md为每个新文件选择合适的模式;默认匹配用户当前的请求
- 新项目 — 两者都不存在 → 默认使用XAML。仅当用户明确要求"代码化"、".cs"、"C#工作流"、"代码化测试用例",或指定代码化特定触发条件(自定义数据模型/DTO、可单元测试的业务逻辑)时,才切换到代码化模式。对于其他表述("创建工作流"、"自动化X"、"构建自动化"),均使用XAML。请参阅coded-vs-xaml-guide.md获取完整决策流程图。
路由: 确定模式后,使用下方的任务导航表找到对应的参考文件。如需在代码化和XAML方法之间选择,请参阅coded-vs-xaml-guide.md。对于旧版项目,请遵循references/legacy/legacy-mode-guide.md。
Authoring Mode Selection
创作模式选择
Default to matching the project's existing mode. For new projects or ambiguous cases, default to XAML — it is the more common mode, has the widest activity coverage, and is the unmarked term in user vocabulary ("create a workflow" means XAML; "create a coded workflow" means coded). Switch to coded only on explicit user phrasing or a coded-specific trigger from the table below.
| Scenario | Mode | Why |
|---|---|---|
| Standard RPA (Excel, email, file ops) | XAML (default) | Direct activity support, no code needed |
| UI automation | XAML (default) | Full activity support; coded also works via |
| Integration Service connectors (XAML) | XAML | IS connector activities use XAML-specific dynamic activity config |
| No matching activity for a subtask | Coded fallback | Small .cs invoked from XAML via |
| Complex data transforms, HTTP, parsing | Coded | C# is more natural than nested XAML activities |
| Tempted to call a PowerShell script | Coded | Prefer a coded workflow. If PS is genuinely needed (admin cmdlets, existing |
| Custom data models / DTOs | Coded Source File | XAML cannot define types — plain |
| Unit tests with assertions | Coded Test Case | |
| User explicitly requests coded/XAML | User's choice | Never second-guess explicit preference |
默认匹配项目现有模式。对于新项目或模糊情况,默认使用XAML — 这是更常见的模式,活动覆盖范围最广,且是用户词汇中的默认术语("创建工作流"指XAML;"创建代码化工作流"指代码化)。仅在用户明确表述或出现下表中的代码化特定触发条件时,才切换到代码化模式。
| 场景 | 模式 | 原因 |
|---|---|---|
| 标准RPA(Excel、邮件、文件操作) | XAML(默认) | 直接支持活动,无需代码 |
| UI自动化 | XAML(默认) | 完整支持活动;代码化模式也可通过 |
| 集成服务连接器(XAML) | XAML | IS连接器活动使用XAML特定的动态活动配置 |
| 子任务无匹配活动 | 代码化 fallback | 从XAML通过 |
| 复杂数据转换、HTTP请求、解析 | 代码化 | C#比嵌套XAML活动更自然 |
| 倾向于调用PowerShell脚本 | 代码化 | 优先使用代码化工作流。如果确实需要PS(管理命令、现有 |
| 自定义数据模型/DTO | 代码化源文件 | XAML无法定义类型 — 使用普通 |
| 带断言的单元测试 | 代码化测试用例 | 使用 |
| 用户明确要求代码化/XAML | 用户选择 | 切勿质疑用户的明确偏好 |
UI Automation Boundaries
UI自动化边界
For any task whose business behavior is "open an app/browser, click, type, scrape visible UI, submit a form, or verify UI state", the interaction layer MUST be UiPath UI Automation — plus UIA activities (XAML), or / plus Object Repository descriptors (coded). Do NOT substitute , PowerShell, Selenium, Playwright, Chrome DevTools Protocol, raw DOM JavaScript, HTTP form posts, or external browser-driver scripts. The coded fallback rows above apply only to non-UI helper logic (data transforms, parsing, DTOs, calculations, API-only integrations).
NApplicationCarduiAutomation.OpenAttachInvokeCodeIf target configuration is unavailable, fall back to the documented UIA indication path — never to an external browser automation shortcut.
The full prohibited-tool list, the UIA-only exploration requirement, and the / exception scope are in the UIA package guide () § Mandatory: Generate Targets Before Writing Any UI Code — read it in full per Rule 7 before any UIA work.
InvokeJSInjectJsScript{PROJECT_DIR}/.local/docs/packages/UiPath.UIAutomation.Activities/ui-automation-guide.md对于任何业务行为为"打开应用/浏览器、点击、输入、抓取可见UI、提交表单或验证UI状态"的任务,交互层必须是UiPath UI自动化 — XAML中使用加UIA活动,代码化模式中使用/加对象库描述符。切勿使用、PowerShell、Selenium、Playwright、Chrome DevTools协议、原始DOM JavaScript、HTTP表单提交或外部浏览器驱动脚本替代。上述代码化fallback仅适用于非UI辅助逻辑(数据转换、解析、DTO、计算、仅API集成)。
NApplicationCarduiAutomation.OpenAttachInvokeCode如果目标配置不可用,请回退到文档化的UIA指示路径 — 切勿使用外部浏览器自动化捷径。
完整的禁用工具列表、仅UIA探索要求以及/例外范围,均在UIA包指南()的§ Mandatory: Generate Targets Before Writing Any UI Code章节中 — 在进行任何UIA工作前,请根据规则7完整阅读该章节。
InvokeJSInjectJsScript{PROJECT_DIR}/.local/docs/packages/UiPath.UIAutomation.Activities/ui-automation-guide.mdPlaceholder-Selector Stub Pattern (when live app access is unavailable)
占位符选择器存根模式(无实时应用访问时)
When generating a UI automation workflow without live app access (target capture cannot be run because the app is not installed, the agent has no UI, or the user explicitly deferred capture to a developer), emit real UIA activities with placeholder selectors and markers — never stubs.
TODO IndicateLogForbidden: a workflow whose UI-interaction steps are with a comment. The workflow passes build/validate and runs cleanly, but does nothing. This is the most expensive kind of stub — it looks complete, the validator says it's fine, and the failure mode is silent.
Log("LoginWorkflow: type username")// TODO[selectors]:Required: the real UIA activity (, , , , etc.) with the target descriptor's selector left as a placeholder string and a marker embedded in the activity's (XAML) or in a comment immediately adjacent to the coded call. A developer opens Studio, clicks Indicate on each marked activity, and the workflow runs.
NTypeIntoNClickNGetTextNApplicationCardTODO IndicateDisplayName// TODO[Indicate]This applies to both XAML and coded modes. The full pattern with XAML and coded examples is in uia-starter-guide.md § Placeholder-Selector Stub Pattern — read it before authoring stub-mode workflows. It requires no UIA package or CLI.
Hybrid pattern — XAML orchestration + coded fallback for logic with no matching activity:
Main.xaml ← orchestration (XAML)
└── InvokeWorkflowFile → ProcessData.cs ← coded logicFor the full decision flowchart, InvokeCode extraction rules, and detailed hybrid patterns, see coded-vs-xaml-guide.md.
当无实时应用访问时生成UI自动化工作流(因应用未安装、代理无UI或用户明确将捕获延迟给开发人员而无法运行目标捕获),请生成带占位符选择器和标记的真实UIA活动 — 切勿使用存根。
TODO IndicateLog禁止: 工作流的UI交互步骤为并附带注释。此类工作流可通过build/validate并正常运行,但实际无任何操作。这是最昂贵的存根类型 — 它看起来完整,验证器显示正常,但失败模式是静默的。
Log("LoginWorkflow: type username")// TODO[selectors]:要求: 使用真实的UIA活动(、、、等),将目标描述符的选择器留为占位符字符串,并在活动的(XAML)中嵌入标记,或在代码化调用紧邻处添加注释。开发人员打开Studio后,点击每个标记活动的Indicate按钮,即可运行工作流。
NTypeIntoNClickNGetTextNApplicationCardDisplayNameTODO Indicate// TODO[Indicate]此模式适用于XAML和代码化两种模式。包含XAML和代码化示例的完整模式,请参阅uia-starter-guide.md § Placeholder-Selector Stub Pattern — 在创作存根模式工作流前请阅读该章节。此模式无需UIA包或CLI。
混合模式 — XAML编排 + 代码化fallback处理无匹配活动的逻辑:
Main.xaml ← 编排(XAML)
└── InvokeWorkflowFile → ProcessData.cs ← 代码化逻辑如需完整决策流程图、InvokeCode提取规则和详细混合模式,请参阅coded-vs-xaml-guide.md。
Capture-First Fast Path
捕获优先快速路径
When the request is "automate this dialog/form" or "build a UI test from these manual steps" — i.e. the bulk of the work is target capture, not coding — defer authoring-phase prerequisites until target capture is complete. The capture surface is interactive, app-state-sensitive, and time-bound; project-context discovery adds nothing during capture and steals time from it.
Fast-path order for capture-first tasks. Read the UIA package guide () in full first (Rule 7) — it mandates the target-capture orchestration reference used in step 3. Then:
{PROJECT_DIR}/.local/docs/packages/UiPath.UIAutomation.Activities/ui-automation-guide.md- Pre-flight Window Baseline — list top-level windows once; decide whether to launch the app (package guide § Window Baseline).
- Inventory targets from manual steps (Test Manager test case, PDD, or written script). Each "Click X" / "Enter Y" / "Select Z" / "Verify W" step maps to one OR element. Group by screen state (package guide § Capturing from Manual Test Steps).
- Capture all targets screen by screen via and screen advancement (package guide § Multi-Step UI Flows).
uia-configure-target - Then enter authoring phase: project-context discovery (the precondition above), write code, validate.
Skip this path when the task has no UI surface (data transforms, IS connector calls, headless file/email automation). Also skip it when the task HAS a UI surface but no live app to capture against (app not installed, no GUI, capture deferred to a developer) — there is nothing to capture, so use the § Placeholder-Selector Stub Pattern above instead. The Window Baseline does not tell you if the app is installed and has a GUI — validate that separately (e.g. look for the executable on disk) or ask the user.
当请求为"自动化此对话框/表单"或"根据这些手动步骤构建UI测试"时 — 即工作重点为目标捕获而非编码 — 将创作阶段的前置条件延迟到目标捕获完成后。捕获界面是交互式的、依赖应用状态且有时间限制;项目上下文发现对捕获无帮助,还会占用捕获时间。
捕获优先任务的快速路径顺序。首先完整阅读UIA包指南()(规则7)— 它规定了步骤3中使用的目标捕获编排参考。然后:
{PROJECT_DIR}/.local/docs/packages/UiPath.UIAutomation.Activities/ui-automation-guide.md- 预飞窗口基线 — 列出一次顶级窗口;决定是否启动应用(包指南§ Window Baseline)。
- 从手动步骤盘点目标(测试管理器测试用例、PDD或书面脚本)。每个"点击X" / "输入Y" / "选择Z" / "验证W"步骤对应一个OR元素。按屏幕状态分组(包指南§ Capturing from Manual Test Steps)。
- 逐屏捕获所有目标 — 通过和屏幕推进(包指南§ Multi-Step UI Flows)。
uia-configure-target - 然后进入创作阶段: 项目上下文发现(上述前置条件)、编写代码、验证。
当任务无UI界面(数据转换、IS连接器调用、无头文件/邮件自动化)时,跳过此路径。当任务有UI界面但无实时应用可捕获(应用未安装、无GUI、捕获延迟给开发人员)时,也跳过此路径 — 无内容可捕获,因此请使用上述§ Placeholder-Selector Stub Pattern。窗口基线无法告知你应用是否已安装且有GUI — 需单独验证(如查找磁盘上的可执行文件)或询问用户。
Session Pre-warm
会话预预热
First heavy call pays a ~22s Studio host cold-start (shared across ////). When more than one is expected this session, background a cheap warm-up at session start so the tax hides behind planning:
uip rpavalidatebuildrunactivities get-default-xamlanalyzer-rules listbash
uip rpa activities find --query log --output json > /dev/null 2>&1 &On Windows PowerShell, doesn't background — use (not ). Never (or any ): Windows opens it in Notepad, not PowerShell.
&Start-Process powershell.exe -ArgumentList ...pwshStart-Process -FilePath "uip".ps1Skip when 0 or 1 heavy calls are expected (read-only Q&A, single-file inspection) — the warm-up doesn't reclaim its cost.
uip rpa首次调用会产生约22秒的Studio主机冷启动时间(////共享此时间)。当预计本次会话会多次调用时,在会话开始时后台执行一次低成本的预热操作,以便将冷启动时间隐藏在规划过程中:
uip rpavalidatebuildrunactivities get-default-xamlanalyzer-rules listbash
uip rpa activities find --query log --output json > /dev/null 2>&1 &在Windows PowerShell中,无法后台执行 — 请使用(不要使用)。切勿使用(或任何):Windows会在记事本中打开它,而非PowerShell。
&Start-Process powershell.exe -ArgumentList ...pwshStart-Process -FilePath "uip".ps1跳过预热:当预计本次会话仅会调用0次或1次(只读问答、单文件检查)时 — 预热无法收回其成本。
uip rpaCritical Rules
关键规则
Rule numbering. Common Rules use 1–12. continues 13–19. is an independent 16–24 sequence, so numbers 16/17/18/19 appear in both mode-specific sections — the / prefix on each rule disambiguates. Cross-references in this file ("Common Rule 10", "Common Rule 12", "Rule 21", "Rule 24") always point to a uniquely-numbered rule.
### Coded-Specific Rules### XAML-Specific Rules[Coded][XAML]规则编号。通用规则使用1–12。继续13–19。是独立的16–24序列,因此编号16/17/18/19会出现在两个模式特定章节中 — 每个规则前的 / 前缀用于区分。本文件中的交叉引用("通用规则10"、"通用规则12"、"规则21"、"规则24")始终指向唯一编号的规则。
### Coded-Specific Rules### XAML-Specific Rules[Coded][XAML]Common Rules (Both Modes)
通用规则(两种模式)
-
NEVER create a project without confirming none exists. Follow Step 0 resolution: check explicit path, project name, then CWD for. Only create when confirmed no project matches AND user explicitly requests creation.
project.json -
ALWAYS useto create new projects — never write
uip rpa initor scaffolding manually.project.json- Before creating, decide if a template is needed. If the user names a template ("REFramework", "Robotic Enterprise Framework", "based on the X template"), an industry/domain pattern (SAP, ERP, banking, mainframe), or otherwise hints at a non-blank starter, run first. Selection rule against
uip rpa templates search --query "<term>" --output json:Data[*]- User named a specific non-Official template (e.g. "Enhanced REFramework", "Lite ReFrameWork") AND a item's
Marketplaceortitlesubstring-matches the user's specific qualifier → ask the user (Official + that Marketplace item are both candidates). Do NOT auto-pick.packageId - Exactly one match AND user did not name a non-Official template → use it; pass
source == "Official"to--template-package-id <packageId> --template-package-version <version>. Proceed without asking.init - Multiple matches OR only
Officialmatches → present candidates (Marketplace,packageId,version,source) to the user and ask which to use. Never silently pick a Marketplace template.title - No matches → fall back to a built-in and tell the user nothing was found.
--template-id
- User named a specific non-Official template (e.g. "Enhanced REFramework", "Lite ReFrameWork") AND a
- Built-in keywords map without a search:
--template-id→library,LibraryProcessTemplate/test automation→test project, otherwiseTestAutomationProjectTemplate. WhenBlankTemplateis set,--template-package-idis ignored. Full decision flow: environment-setup.md § Template selection. 2a. Pass--template-idAND--target-frameworkexplicitly on every--expression-language— never omit them. Both are immutable after creation (Rule 23); omittinguip rpa initsilently yields a Windows project. Choose framework by where the automation runs: cross-platform / non-Windows runtime (Linux, container, serverless) or Studio Web editing →--target-framework(Cross-platform); Windows runtime using Windows-only capabilities (Excel COM, classic Office, WPF /Portable, Windows-only UIA) or Studio Desktop as the edit surface →PresentationFramework(not editable in Studio Web). A request needing both a cross-platform runtime and a Windows-only capability is contradictory — surface it, don't silently pick. Windows - Legacy is a last resort (explicit ask or hard .NET 4.6.1 need; never inferred from VB.NET or non-"X" classic activities) — create it in Legacy mode, not modernWindows. No signal →init(Windows vs Cross-platform), framed around the runtime host.AskUserQuestion: default--expression-language,VisualBasiconly on explicit request.CSharp
- Before creating, decide if a template is needed. If the user names a template ("REFramework", "Robotic Enterprise Framework", "based on the X template"), an industry/domain pattern (SAP, ERP, banking, mainframe), or otherwise hints at a non-blank starter, run
-
Phase-gated validation. Two-phase validation:
- Per-file (after every create or edit): until 0 errors. Catches structural XAML, missing references, analyzer-rule violations, schema violations. Fix one thing per iteration.
uip rpa validate --file-path "<FILE>" --project-dir "<PROJECT_DIR>" --output json - Project-level build (after per-file is clean across all files in the edit session, and before declaring done):
validateuntil clean. Catches whatuip rpa build "<PROJECT_DIR>" --output jsonmisses (unknown members, invalid enums, CacheMetadata / member resolution, attribute-form C# JIT) — full list at cli-reference.md § Errorsvalidatecatches thatbuildmisses. Ifvalidateerrors, identify the offending file from the output and re-runbuildon it.validate --file-path - 5-attempt cap per loop — 5 attempts for each file's per-file loop; a separate 5 attempts for the project-level
validateloop. Fix one root cause per iteration.build - Smoke-test shortcut: A successful substitutes for the standalone end-of-session
uip rpa run—buildcompiles internally. Preferrunwhenrun --skip-buildhas just passed; see cli-reference.md § Smoke Test.build - Do NOT run as an authoring prerequisite.
uip rpa analyzer-rules listandvalidatealready enforce the enabled analyzer rules and report violations with rule IDs and recommendations — pre-fetching the rule list is speculative cost (the unscoped call can take a minute or more). It is an on-demand command: run it when the user asks about the project's best-practice/analyzer rules, or when repeated violations of the same rule family suggest authoring against the full rule set. See cli-reference.md § analyzer-rules list.build
See cli-reference.md § Validation Iteration Loop. - Per-file (after every create or edit):
-
ALWAYS bring every touched file to per-fileclean AND verify the project builds before declaring done. Cadence per Rule 18: batch-author, then validate. Project-level
validateruns once at the end of the edit session (or at any compile-verification gate) — not after every Edit, becausebuildis project-scoped and rebuilds the entire project regardless of which file changed.buildclean alone is not "validated"; it cannot see member or enum errors — the project-levelvalidateis mandatory before declaring done. And a clean gate is not runtime proof — for observable-output workflows, end the gate with onebuildand check outputs (execution-maps-guide.md § Gate ≠ runtime proof). See cli-reference.md § Validation Iteration Loop.run -
Prefer UiPath built-in activities for Orchestrator integration, UI automation, and document handling. Prefer plain .NET / third-party packages for pure data transforms, HTTP calls, parsing.
-
ALWAYS ensure required package dependencies are inbefore using their activities or services. 6a. Pre-edit verification gate. Two authoring actions are hard to roll back once
project.jsonfails — verify before serialization, not after.build- Removing a dependency — grep the project for usages before deleting an entry. A package may be the sole supplier of an activity used elsewhere (lives in the IntelligentOCR.StudioWeb family).
MergePDFs - Writing a new activity tag — confirm via and use the returned
uip rpa activities find --query "<verb>" --output json. Do not derive tag names from Studio display names. See common-pitfalls.md § Common Activity Name Confusions.ClassName
- Removing a dependency — grep the project for usages before deleting an entry. A package may be the sole supplier of an activity used elsewhere (
-
[UIA] Before writing ANY UIA activity (XAMLor coded
<uix:N*>/uiAutomation.*), MUST read references/uia-starter-guide.md IN FULL, and the UIA package's authoring guide it mandates (Descriptors.*) IN FULL — including the mode-specific section (For Coded Workflows or For XAML Workflows). No exceptions for "simple" UIs. Skipping this rule is the most common cause of hallucinated selectors, wrong target XML, and missing OR descriptors. NEVER hand-write selectors — use{PROJECT_DIR}/.local/docs/packages/UiPath.UIAutomation.Activities/ui-automation-guide.mdexclusively (the package guide explains how). The package guide exists only after the package is installed — verify § UIA Prerequisites first (Rule 7a); if the package is installed but the guide file is absent, the installed version predates it — treat as below the minimum version. The starter guide owns the skill-side UIA policies: run/debug procedure + runtime selector recovery, the stub-mode deliverable pattern, and UI Library publishing. 7a. [UIA] Verify UIA prerequisites before invokinguia-configure-target. The minimum version and the prerequisite check live in § UIA Prerequisites (top of this file) — run that check first (do not hardcode the version from memory; that section is the only source of truth). Ifuia-configure-targetis below the minimum orUiPath.UIAutomation.Activitiesis absent (Rule 7 treats a missing guide as below-minimum), the{PROJECT_DIR}/.local/docs/packages/UiPath.UIAutomation.Activities/ui-automation-guide.mdCLI is unavailable — and both target capture and indication depend on it, so indication is not a fallback when the package itself is missing. Ask the user to install/upgrade per § UIA Prerequisites. If they decline or the package cannot be installed, fall back to the Placeholder-Selector Stub Pattern (§ above) — real activities withuip rpa uiamarkers need no CLI. Never silently route to a non-existent skill path. Use indication capture only when a compatible UIA package is installed butTODO Indicatecannot see the element; recorduia-configure-targetin the plan header to skipUI capture: indication-onlyin that case. Runtime failure counts too: when the package is present but the UIA snapshot CLI's live scans fail persistently (driver/COM errors on every scan), first rule out a locked or non-interactive Windows session (uia-configure-targetrunning = lock screen) — that needs an unlock, not a fallback. Only if scans still fail on an unlocked interactive session, treat capture as unavailable and use the Placeholder-Selector Stub Pattern.LogonUI -
Useon all CLI commands whose output is parsed programmatically. 8a.
--output json/runsuccess/failure verdict comes from the outerdebug start(and equivalently the innerResult), NEVER from any log entry'sHasErrors. A successful workflow may emitLevelactivities atLog MessageorErrorlevel as observability — those are workflow-emitted data, not CLI failures. Compile failures, validation failures, and unhandled runtime exceptions all flipWarningand propagate to the outerHasErrors. Treating log-entry levels as a failure signal flips green runs to "failed" and burns retries on healthy workflows. In a debug session, checkResultfirst — aDebugStateresponse means an exception awaits your decision (continue / retry / ignore / cancel) whileSuspendedis stillHasErrors. See cli-reference.md § run and debugging.md § Reading Debug Output Effectively.false -
For "leverage / reuse / find shared libraries" requests, search the tenant feed — not the local filesystem, NuGet.org, or keyword-permutation loops. Run. On zero results from the filtered call, take the fallback branch — do not re-keyword. Skip when an SDD already records §16 "Shared libraries referenced" or the user has said "no shared libraries" earlier in the session. See tenant-library-search-guide.md for the full procedure.
uip or libraries list --limit 500 --output-filter "<JMESPath>" --output json -
Register every test case file in→
project.json. Applies to both XAML and coded test cases. Required keys, GUID format, JSON snippet, and full schema (includingdesignOptions.fileInfoCollectionfor data-driven anddataVariationFilePathfor coded): references/testing-guide.md § project.json Registration and assets/json-template.md.publishAsTestCase -
Test case structure: Given-When-Then. Applies to both XAML and coded test cases. See references/testing-guide.md § XAML Test Case Structure for the canonical patterns (the section's lead also points to the coded variant in).
coded/operations-guide.md -
Trigger activity placement. Two trigger types — identify fromby reading
uip rpa activities find --query "<event>" --output jsonandisTrigger. Placement rules differ.triggerTypeIntegration triggers (,isTrigger: true) — strict placement. MUST be the first activity oftriggerType: "integration"'s rootMain.xaml; CANNOT be placed insideSequence. Bindui:TriggerScopeto a workflow-scope variable; the rest of theResultis the handler. Connection asset (Sequence) required for IS-based triggers (Mail / GSuite / O365 / Salesforce / Jira / Slack / ServiceNow / anyConnectionIdpackage); not required for Orchestrator-native triggers (*.IntegrationService.Activities,TimeTrigger,QueueTrigger).ManualTriggerLocal triggers (,isTrigger: true) — flexible placement. Place EITHER as the first activity oftriggerType: "local"'s rootMain.xaml(Orchestrator dispatches a fresh job per event) OR insideSequencewith handler in<ui:TriggerScope.Triggers>(robot stays alive while the scope is active; trigger fires in-process). Both placements are valid — choose by runtime model. No connection asset required.<ui:TriggerScope.Action>Unknown(forward-compat — e.g. a futuretriggerType) → read the bundled doc and ask the user. Do not assume placement."scheduled"Reading existing XAML: activity insidemust be a local trigger; an integration trigger there is broken — flag to the user. Activity at workflow root can be either type — check<ui:TriggerScope.Triggers>to disambiguate.triggerTypeSee trigger-pattern-guide.md for worked examples, thereference, the catalog of trigger activities, and the procedure for editing existingSchedulingModeworkflows.ui:TriggerScope
-
创建项目前必须确认不存在现有项目。遵循步骤0的解析流程:检查明确路径、项目名称,然后检查当前工作目录中的。仅当确认无匹配项目且用户明确要求创建时,才可创建项目。
project.json -
**必须使用**创建新项目 — 切勿手动编写
uip rpa init或搭建项目结构。project.json- 创建前,决定是否需要模板。如果用户指定模板("REFramework"、"Robotic Enterprise Framework"、"基于X模板")、行业/领域模式(SAP、ERP、银行、大型机),或暗示需要非空白启动模板,请先运行。针对
uip rpa templates search --query "<term>" --output json的选择规则:Data[*]- 用户指定了特定的非官方模板(如"Enhanced REFramework"、"Lite ReFrameWork"),且项的
Marketplace或title包含用户指定的限定词 → 询问用户(官方模板和该Marketplace项均为候选)。切勿自动选择。packageId - 恰好有一个匹配项,且用户未指定非官方模板 → 使用该模板;将
source == "Official"传递给--template-package-id <packageId> --template-package-version <version>。无需询问,直接继续。init - 多个匹配项或仅
Official匹配项 → 向用户展示候选项(Marketplace、packageId、version、source)并询问使用哪个。切勿静默选择Marketplace模板。title - 无匹配项 → 回退到内置并告知用户未找到匹配模板。
--template-id
- 用户指定了特定的非官方模板(如"Enhanced REFramework"、"Lite ReFrameWork"),且
- 内置关键字无需搜索即可映射:
--template-id→library,LibraryProcessTemplate/test automation→test project,否则为TestAutomationProjectTemplate。当设置BlankTemplate时,--template-package-id会被忽略。完整决策流程:environment-setup.md § Template selection。 2a. 每次--template-id必须显式传递uip rpa init和--target-framework— 切勿省略。两者创建后均不可变(规则23);省略--expression-language会默认创建Windows项目。根据自动化运行位置选择框架:跨平台/非Windows运行时(Linux、容器、无服务器)或Studio Web编辑 →--target-framework(跨平台);使用Windows专属功能(Excel COM、经典Office、WPF /Portable、Windows专属UIA)的Windows运行时,或使用Studio Desktop作为编辑界面 →PresentationFramework(不可在Studio Web中编辑)。如果请求同时需要跨平台运行时和Windows专属功能,则存在矛盾 — 需向用户说明,切勿静默选择。Windows - Legacy是最后选择(明确要求或必须使用.NET 4.6.1;切勿从VB.NET或非"X"经典活动推断)— 在旧版模式中创建,而非使用现代Windows。无信号时 →init(Windows vs 跨平台),围绕运行时宿主进行说明。AskUserQuestion:默认--expression-language,仅在明确要求时使用VisualBasic。CSharp
- 创建前,决定是否需要模板。如果用户指定模板("REFramework"、"Robotic Enterprise Framework"、"基于X模板")、行业/领域模式(SAP、ERP、银行、大型机),或暗示需要非空白启动模板,请先运行
-
分阶段验证。两阶段验证:
- 单文件验证(每次创建或编辑后):,直到无错误。捕获结构性XAML错误、缺失引用、分析器规则违规、架构违规。每次迭代修复一个问题。
uip rpa validate --file-path "<FILE>" --project-dir "<PROJECT_DIR>" --output json - 项目级构建(编辑会话中所有文件的单文件均通过后,且在宣布完成前):
validate,直到无错误。捕获uip rpa build "<PROJECT_DIR>" --output json未发现的问题(未知成员、无效枚举、CacheMetadata / 成员解析、属性形式的C# JIT)— 完整列表请参阅cli-reference.md § Errorsvalidatecatches thatbuildmisses。如果validate出错,从输出中找出有问题的文件并重新运行build。validate --file-path - 每次循环最多尝试5次 — 每个文件的单文件循环最多尝试5次;项目级
validate循环单独最多尝试5次。每次迭代修复一个根本原因。build - 冒烟测试捷径: 成功执行可替代会话结束时的独立
uip rpa run—build会在内部编译。当run刚通过时,优先使用build;请参阅cli-reference.md § Smoke Test。run --skip-build - 切勿将作为创作前置条件。
uip rpa analyzer-rules list和validate已强制执行启用的分析器规则,并会报告带有规则ID和建议的违规情况 — 预获取规则列表是推测性成本(无范围的调用可能需要一分钟或更长时间)。这是一个按需命令:当用户询问项目的最佳实践/分析器规则,或同一规则家族重复违规表明需根据完整规则集进行创作时,才运行它。请参阅cli-reference.md § analyzer-rules list。build
请参阅cli-reference.md § Validation Iteration Loop。 - 单文件验证(每次创建或编辑后):
-
宣布完成前,必须确保所有修改的文件通过单文件并验证项目可构建。根据规则18的节奏:批量创作,然后验证。项目级
validate在编辑会话结束时运行一次(或在任何编译验证检查点)— 并非每次编辑后都运行,因为build是项目范围的,无论哪个文件更改都会重新构建整个项目。仅build通过并不代表"已验证";它无法检测成员或枚举错误 — 项目级validate是宣布完成前的强制步骤。通过检查并不代表运行时无问题 — 对于有可观察输出的工作流,检查结束时需执行一次build并检查输出(execution-maps-guide.md § Gate ≠ runtime proof)。请参阅cli-reference.md § Validation Iteration Loop。run -
优先使用UiPath内置活动进行Orchestrator集成、UI自动化和文档处理。对于纯数据转换、HTTP请求、解析,优先使用普通.NET/第三方包。
-
使用活动或服务前,必须确保所需包依赖项已在中。 6a. 编辑前验证检查。有两种创作操作在
project.json失败后难以回滚 — 请在序列化前验证,而非之后。build- 移除依赖项 — 删除条目前,在项目中搜索其用法。某个包可能是其他地方使用的活动的唯一提供者(属于IntelligentOCR.StudioWeb家族)。
MergePDFs - 编写新活动标签 — 通过确认并使用返回的
uip rpa activities find --query "<verb>" --output json。切勿从Studio显示名称推导标签名称。请参阅common-pitfalls.md § Common Activity Name Confusions。ClassName
- 移除依赖项 — 删除条目前,在项目中搜索其用法。某个包可能是其他地方使用的活动的唯一提供者(
-
[UIA] 在编写任何UIA活动(XAML或代码化
<uix:N*>/uiAutomation.*)前,必须完整阅读references/uia-starter-guide.md,以及它规定的UIA包创作指南(Descriptors.*) — 包括模式特定章节(For Coded Workflows或For XAML Workflows)。"简单"UI也不例外。跳过此规则是产生幻觉选择器、错误目标XML和缺失OR描述符的最常见原因。切勿手动编写选择器 — 仅使用{PROJECT_DIR}/.local/docs/packages/UiPath.UIAutomation.Activities/ui-automation-guide.md(包指南解释了如何使用)。包指南仅在包安装后存在 — 请先验证§ UIA Prerequisites(规则7a);如果已安装包但指南文件缺失,则安装的版本早于指南版本 — 视为低于最低版本。入门指南负责技能端的UIA策略:运行/调试流程 + 运行时选择器恢复、存根模式交付物模式和UI库发布。 7a. [UIA] 调用uia-configure-target前,验证UIA前置条件。最低版本和前置条件检查位于§ UIA Prerequisites(本文件顶部)— 请先运行该检查(不要凭记忆硬编码版本;本节是唯一权威来源)。如果uia-configure-target版本低于最低版本,或UiPath.UIAutomation.Activities缺失(规则7将缺失指南视为低于最低版本),则{PROJECT_DIR}/.local/docs/packages/UiPath.UIAutomation.Activities/ui-automation-guide.mdCLI不可用 — 且目标捕获和指示都依赖它,因此当包本身缺失时,指示并非fallback选项。请要求用户根据§ UIA Prerequisites安装/升级。如果用户拒绝或无法安装包,请回退到Placeholder-Selector Stub Pattern(上述章节)— 带uip rpa uia标记的真实活动无需CLI。切勿静默路由到不存在的技能路径。仅当已安装兼容UIA包但TODO Indicate无法看到元素时,才使用指示捕获;在计划标题中记录uia-configure-target,以便在该情况下跳过UI capture: indication-only。运行时失败也需考虑: 当包存在但UIA快照CLI的实时扫描持续失败(每次扫描都出现驱动/COM错误)时,首先排除锁定或非交互式Windows会话(uia-configure-target运行 = 锁屏)— 这需要解锁,而非fallback。仅当在已解锁的交互式会话中扫描仍失败时,才视为捕获不可用并使用Placeholder-Selector Stub Pattern。LogonUI -
所有输出需被程序化解析的CLI命令,请使用。 8a.
--output json/run的成功/失败判断来自外部debug start(等效于内部Result),而非任何日志条目的HasErrors。成功的工作流可能会以Level或Error级别输出Warning活动作为可观察性数据 — 这些是工作流输出的数据,而非CLI失败。编译失败、验证失败和未处理的运行时异常都会翻转Log Message并传播到外部HasErrors。将日志条目级别视为失败信号会将成功运行标记为"失败",并在健康工作流上浪费重试次数。在调试会话中,请先检查Result—DebugState响应表示存在异常等待你的决策(继续/重试/忽略/取消),而此时Suspended仍为HasErrors。请参阅cli-reference.md § run和debugging.md § Reading Debug Output Effectively。false -
对于"利用/复用/查找共享库"请求,请搜索租户源 — 而非本地文件系统、NuGet.org或关键词排列循环。运行。如果过滤调用无结果,则执行回退分支 — 不要重新调整关键词。当SDD已记录§16 "Shared libraries referenced",或用户在会话早期表示"无共享库"时,跳过此步骤。请参阅tenant-library-search-guide.md获取完整流程。
uip or libraries list --limit 500 --output-filter "<JMESPath>" --output json -
在的
project.json中注册每个测试用例文件。适用于XAML和代码化测试用例。必填键、GUID格式、JSON片段和完整架构(包括数据驱动的designOptions.fileInfoCollection和代码化的dataVariationFilePath):请参阅references/testing-guide.md § project.json Registration和assets/json-template.md。publishAsTestCase -
测试用例结构:Given-When-Then。适用于XAML和代码化测试用例。请参阅references/testing-guide.md § XAML Test Case Structure获取标准模式(该章节开头还指向中的代码化变体)。
coded/operations-guide.md -
触发活动放置。两种触发类型 — 通过读取
uip rpa activities find --query "<event>" --output json和isTrigger进行识别。放置规则不同。triggerType集成触发器(,isTrigger: true)— 严格放置。必须是triggerType: "integration"根Main.xaml的第一个活动;不能放置在Sequence内。将ui:TriggerScope绑定到工作流范围变量;Result的其余部分是处理程序。基于IS的触发器(邮件/GSuite/O365/Salesforce/Jira/Slack/ServiceNow/任何Sequence包)需要连接资产(*.IntegrationService.Activities);Orchestrator原生触发器(ConnectionId、TimeTrigger、QueueTrigger)不需要。ManualTrigger本地触发器(,isTrigger: true)— 灵活放置。可放置为triggerType: "local"根Main.xaml的第一个活动(Orchestrator为每个事件调度新作业),或放置在Sequence内并在<ui:TriggerScope.Triggers>中设置处理程序(机器人在范围活动期间保持存活;触发在进程内执行)。两种放置方式均有效 — 根据运行时模型选择。无需连接资产。<ui:TriggerScope.Action>未知(向前兼容 — 如未来的triggerType)→ 阅读捆绑文档并询问用户。切勿假设放置方式。"scheduled"读取现有XAML:内的活动必须是本地触发器;集成触发器放置在此处会导致损坏 — 需向用户标记。工作流根的活动可以是任意类型 — 检查<ui:TriggerScope.Triggers>进行区分。triggerType请参阅trigger-pattern-guide.md获取示例、参考、触发活动目录以及编辑现有SchedulingMode工作流的流程。ui:TriggerScope
Destination Preflight (Both Modes)
目标预检查(两种模式)
Studio Web destination → Solution-wrapped deliverable, not a bare project. Studio Web ingests Solutions only; a bare project folder is invisible in both SW workspace tabs. Treat these phrases as SW signals in the request: "Studio Web", "SW", "upload to web", "browser editor", "cloud workspace edit". On match, build the RPA project normally per the rest of this skill, then hand off to to wrap and ship it: → → . The final deliverable is the Solution, not the bare project folder. Local execution () and the Orchestrator package flow ( → — there is no ) are fine with a bare project — only an SW destination changes the deliverable shape.
uipath-solutionuip solution init <NAME>uip solution projects import "<PROJECT_DIR>" --solutionFile <SOLUTION>.uipxuip solution upload "<SOLUTION_DIR>"uip rpa runuip rpa packuip or packages uploaduip rpa publishStudio Web目标 → 解决方案打包的交付物,而非裸项目。Studio Web仅接收解决方案;裸项目文件夹在SW工作区标签中不可见。请求中的以下表述视为SW信号:"Studio Web"、"SW"、"上传到Web"、"浏览器编辑器"、"云工作区编辑"。匹配时,先按照本技能的其余内容正常构建RPA项目,然后交给进行打包和交付: → → 。最终交付物是解决方案,而非裸项目文件夹。本地执行()和Orchestrator包流程( → — 无命令)支持裸项目 — 只有SW目标会改变交付物形态。
uipath-solutionuip solution init <NAME>uip solution projects import "<PROJECT_DIR>" --solutionFile <SOLUTION>.uipxuip solution upload "<SOLUTION_DIR>"uip rpa runuip rpa packuip or packages uploaduip rpa publishExecution Discipline (Both Modes)
执行规范(两种模式)
Run to completion — do not declare work done while plan tasks remain. If a plan file exists at referenced by this request (or discoverable there for this feature), read its header before acting and during every checkpoint.
docs/plans/*.md- If the header has : continue until ALL plan task checkboxes are
Execution autonomy: autonomousOR a concrete item from the plan's[x]section is hit.Stop conditions - If the header has , or no plan file exists: use judgment and confirm with the user on material decisions.
Execution autonomy: interactive - Before declaring the task done, re-read the plan and enumerate any unchecked boxes. If unchecked tasks remain and no Stop condition was hit, keep going — do not summarize partial work as "Done".
- "Feels expensive", "many tool calls used", "natural pause point", "partial result looks usable", and "too complex to continue in one session" are NOT Stop conditions. Only the concrete hard blockers in the plan's section count.
Stop conditions - Plan decisions already made are authoritative. Do not about structure, file count, selector strategy, or capture approach when the plan specifies them — those questions belonged to the planner.
AskUserQuestion
运行至完成 — 计划任务未完成时切勿宣布工作完成。如果本次请求引用了中的计划文件(或可在此处找到针对此功能的计划文件),请在执行前和每个检查点阅读其标题。
docs/plans/*.md- 如果标题包含:继续执行,直到所有计划任务复选框为
Execution autonomy: autonomous,或触发计划的[x]部分中的具体项。Stop conditions - 如果标题包含,或无计划文件:自行判断并在重大决策时与用户确认。
Execution autonomy: interactive - 宣布任务完成前,请重新阅读计划并列出所有未勾选的复选框。如果未勾选的任务仍存在且未触发停止条件,请继续执行 — 切勿将部分工作总结为"已完成"。
- "感觉成本高"、"使用了很多工具调用"、"自然暂停点"、"部分结果看起来可用"和"太复杂无法在一个会话中继续"不是停止条件。只有计划的部分中的具体硬阻塞项才算停止条件。
Stop conditions - 已做出的计划决策具有权威性。当计划指定了结构、文件数量、选择器策略或捕获方法时,切勿— 这些问题属于规划阶段。
AskUserQuestion
Error Handling (Both Modes)
错误处理(两种模式)
Wrap external interactions (UI, file, network, DB) in Try/Catch and classify failures — for bad input data (no retry; needs a human), system exceptions for transient faults (retry then escalate). Don't blanket-wrap pure logic, don't leave a Catch empty, and (never ) to preserve the stack trace. For exception taxonomy, Retry Scope count/interval semantics, ContinueOnError suppression, screenshot-on-error, the Global Exception Handler recipe (scaffold + registration + verdict logic), and the resilience patterns — recovering to a known app state before retrying, per-item transaction boundaries, idempotent/compensating writes to avoid duplicate creates and partial writes, sensitive-data redaction, and retry ownership across queue/Retry-Scope/GEH/job layers — read references/error-handling-guide.md in full before adding resilience to a workflow.
BusinessRuleExceptionRethrowThrow New Exception(ex.Message)project.json将外部交互(UI、文件、网络、数据库)包装在Try/Catch中并对失败进行分类 — 用于错误输入数据(无需重试;需人工干预),系统异常用于临时故障(重试后升级)。不要盲目包装纯逻辑,不要留空Catch块,且要(切勿)以保留堆栈跟踪。如需异常分类、Retry Scope计数/间隔语义、ContinueOnError抑制、错误时截图、全局异常处理程序方案(搭建 + 注册 + 裁决逻辑)和弹性模式 — 重试前恢复到已知应用状态、每个项目的事务边界、幂等/补偿写入以避免重复创建和部分写入、敏感数据脱敏以及队列/Retry-Scope/GEH/作业层的重试所有权 — 在向工作流添加弹性前,请完整阅读references/error-handling-guide.md。
BusinessRuleExceptionRethrowThrow New Exception(ex.Message)project.jsonExecution Maps (Both Modes)
执行映射(两种模式)
Follow the journey map in execution-maps-guide.md for every build or edit — it fixes which tool calls batch into which assistant turn (greenfield ≤5 turns, brownfield ≤4). Within a turn: chain dependent calls with in one ; emit independent // calls as parallel tool uses. Split turns only where a call needs an earlier call's stdout or a file mutation. Rule 21 discovery for off-card activities fans out inside T1/T2 — all K s parallel, then all K doc s, then all K s — never one activity at a time.
uip&&BashBashReadEditfindReadget-default-xamlSequential by design — never batch across: → (Rule 2 decision gate); any or consent gate; UIA state advances and indication (the UIA journey in the guide encodes its per-screen gating).
templates searchinitAskUserQuestion每次构建或编辑都遵循execution-maps-guide.md中的旅程映射 — 它规定了哪些工具调用应批量到哪个助手回合(全新项目≤5回合,已有项目≤4回合)。在一个回合内:将依赖的调用用链接到一个中;将独立的//调用作为并行工具使用。仅当某个调用需要之前调用的stdout或文件变更时,才拆分回合。规则21针对卡片外活动的发现会在T1/T2内展开 — 所有K个并行执行,然后所有K个文档,然后所有K个 — 切勿逐个活动执行。
uip&&BashBashReadEditfindReadget-default-xaml按设计顺序执行 — 切勿跨以下步骤批量执行: → (规则2决策检查点);任何或同意检查点;UIA状态推进和指示(指南中的UIA旅程编码了其逐屏检查点)。
templates searchinitAskUserQuestionCoded-Specific Rules
代码化特定规则
- [Coded] ALWAYS inherit from base class for workflow and test case classes (NOT for Coded Source Files).
CodedWorkflow - [Coded] ALWAYS use or
[Workflow]attribute on the[TestCase]method.Execute - [Coded] Update →
project.jsonwhen adding/removing workflow files in Process projects. Tests and Library projects do NOT useentryPoints— skip this step for those project types. ForentryPoints(required for every test case in every project type — XAML and coded alike), see Common Rule 10.fileInfoCollection - [Coded] One workflow/test case class per file, class name must match file name.
- [Coded] Namespace = sanitized project name from . Sanitize: remove spaces, replace hyphens with
project.json, ensure valid C# identifier._ - [Coded] Entry method is always named .
Execute - [Coded] Use Coded Source Files for reusable code — plain files without
.csinheritance, no entry point.CodedWorkflow
- [Coded] 工作流和测试用例类必须继承自基类(不适用于代码化源文件)。
CodedWorkflow - [Coded] 方法必须使用
Execute或[Workflow]属性。[TestCase] - [Coded] 添加/移除流程项目中的工作流文件时,更新的
project.json。测试和库项目不使用entryPoints— 这些项目类型跳过此步骤。对于entryPoints(所有项目类型的每个测试用例都需要 — XAML和代码化均适用),请参阅通用规则10。fileInfoCollection - [Coded] 每个文件对应一个工作流/测试用例类,类名必须与文件名匹配。
- [Coded] 命名空间 = 中的清理后项目名称。清理:移除空格,将连字符替换为
project.json,确保为有效的C#标识符。_ - [Coded] 入口方法始终命名为。
Execute - [Coded] 使用代码化源文件存储可重用代码 — 普通文件,无需
.cs继承,无入口点。CodedWorkflow
XAML-Specific Rules
XAML特定规则
- [XAML] Activity docs are the source of truth — check first. Always.
{projectRoot}/.local/docs/packages/{PackageId}/ - [XAML] MUST understand project structure — read , check expression language, scan existing patterns. NEVER generate XAML blind.
project.json - [XAML] Batch-author, single gate — author the complete workflow in one pass, sourcing each activity card → memory → Rule 21 triple (precedence in execution-maps-guide.md). Then per-file to clean, then one project
validate(Rule 3 cadence, 5-attempt caps unchanged); for observable-output workflows the gate ends with onebuild+ output check (execution-maps-guide.md § Gate ≠ runtime proof). On failure: fix by error category (Rule 19); card-covered activities stay card-sourced — a gate failure does NOT reopenrun/activities find; >2 errors with ambiguous origin → bisect (stub out half the new activities, re-validate).get-default-xaml - [XAML] Fix errors by category — Package → Structure → Type → Activity Properties → Logic.
- [XAML] Flowchart node structure + ViewState both decide whether a Flowchart renders. Structure first: every /
FlowStep/FlowDecisionMUST be a direct child ofFlowSwitch(only direct children are added to the<Flowchart>collection), wired throughFlowchart.Nodes/Flowchart.StartNode/branches withFlowStep.Next+<x:Reference>. NEVER build the flow as a nested chain — onex:Namephysically nested inside the previous one'sFlowStep— because nested-only steps are absent from<FlowStep.Next>and the designer renders almost nothing, regardless of ViewState. Then ViewState: when generating new Flowchart/StateMachine/ProcessDiagram workflows, per-node ViewState is MANDATORY —Flowchart.Nodes+ShapeLocationon every node (ShapeSizeoptional, Studio auto-routes). Without it Studio stacks every node at (0,0) so they overlap into what looks like a single node, and Studio does NOT auto-arrange on open (see canvas-layout-guide.md). When editing existing files, do NOT modify ViewState on nodes you are not changing. For Sequences, ViewState is optional.ConnectorLocation - [XAML] Reading from
<Activity>.mdis a precondition for{PROJECT_DIR}/.local/docs/packages/...— for every activity not on the common-activity card.activities get-default-xaml- Card-listed activities and patterns: check references/common-activity-card.md and references/common-pattern-card.md first; on a card hit, author from the card entry alone — skip , skip
activities find, skip the per-activity MD read. Precedence: card → agent memory (execution-maps-guide.md § Cross-session memory) → full triple. A memory hit substitutes for the triple only;activities get-default-xaml/validatestill gate.build - All other activities: (1) → class name, (2) read
activities findfirst and extract a property checklist (required + use-case-relevant), (3)<Activity>.md→ starter element, (4) diff your checklist against the starter and add what's missing — an empty checklist means you skipped step 2, go back.activities get-default-xaml - Doc lookup order: primary ; fallback
{PROJECT_DIR}/.local/docs/packages/<PackageId>/activities/<Activity>.mdfor older package versions wherereferences/activity-docs/<PackageId>/<closest-version>/<Activity>.mdis empty. Exception —.local/docshas no bundled fallback:UiPath.UIAutomation.Activities(present only after the package is installed) is its sole activity-doc source. If it is absent, do not hunt for a bundled copy — follow Rule 7a (install with consent per § UIA Prerequisites, or use the Placeholder-Selector Stub Pattern — uia-starter-guide.md)..local/docs - Trigger activities are special — read BOTH docs. When the class name ends in , the namespace contains
Trigger, or the description mentions "starts a job" / "Monitor Events" / "Trigger Scope", also read the bundled.Triggersand the package's bundledreferences/activity-docs/<PackageId>/<closest-version>/activities/<Activity>.md. The auto-generatedoverview.mdversion is sparse for triggers; the bundled hand-written docs carry placement guidance (entry-point vs..local/docs), deployment context, and cross-cutting namespace/assembly gotchas that the extractor does not capture. See Common Rule 12 and trigger-pattern-guide.md.ui:TriggerScope - Skip-tax — concrete: omits any property whose value equals the type default. For
activities get-default-xamlthe starter is literallyNGetTextwith zero output properties — authoring from this alone produces<uix:NGetText HealingAgentBehavior="SameAsCard" />(does not exist; the output member isNGetText.Value="..."), whichTextStringaccepts andvalidaterejects. Forbuildthat's 2 of 20 properties hidden.NTypeInto - Self-extending the card — "this activity feels simple, I'll add it to the card mentally" — is the failure mode. The card is the only allowlist; for non-card activities the MD read is the only check.
- Full procedure: xaml/xaml-basics-and-rules.md § Activity Property Surface.
21a. [XAML] Built-in workflow activities: use the card only for this allowlist. Fast-path card activities are: ,
Sequence,If,Switch<T>,TryCatch,While,DoWhile,ForEach<T>,Assign,LogMessage,WriteLine,Delay,Throw. If the activity is on this list, open references/common-activity-card.md and author from the card. If it is not on this list, check references/common-pattern-card.md next — its patterns cover e.g. text-file read/append/write, file copy, CSV, DataTable→CSV, queue publish, retry wrap,Rethrow, InvokeCode rows, HTTP→JSON — and follow full Rule 21 only when BOTH cards miss.InvokeWorkflowFile,Pick, andParallelare intentionally on neither card; use full Rule 21. Studio's "While" / "Do While" / "For Each" toolbox items emit UiPath wraps (ParallelForEach<T>/UiPath.Core.Activities.InterruptibleWhile/InterruptibleDoWhile), not the frameworkUiPath.Core.Activities.ForEach<T>/System.Activities.Statements.While/DoWhile.ForEach<T>
- Card-listed activities and patterns: check references/common-activity-card.md and references/common-pattern-card.md first; on a card hit, author from the card entry alone — skip
- [XAML] MUST read references/xaml/xaml-basics-and-rules.md before generating or editing any XAML — then vet the plan against references/xaml/common-pitfalls.md. common-pitfalls.md is a catalog of independent gotcha sections — do NOT read it end-to-end: list its headings (Grep on the file), then Read every section whose heading matches an activity, property, or feature in the workflow you are about to author. Unsure whether a section applies → read it. This is an authoring-time gate, not only a troubleshooting resource — consulting it first is cheaper than debugging a gotcha
^##cannot see.validate - [XAML] NEVER change or
expressionLanguageon an existing project. Decide both proactively at init time (Common Rule 2a); this rule covers the immutability afterward. Both fields intargetFrameworkare fixed at creation time and apply to every XAML file in the project — flippingproject.json(VisualBasic ↔ CSharp) invalidates every expression, and flippingexpressionLanguage(Windows ↔ Portable/cross-platform, or Legacy) invalidates package references and activity compatibility. Do not attempt in-place conversion. If the user wants to convert an existing project, confirm with them, copy the project to a temporary folder, create a new project viatargetFramework(for a target of Windows - Legacy, create it in Legacy mode instead — modernuip rpa init --expression-language <VisualBasic|CSharp> --target-framework <Windows|Portable>is not the legacy creation path), make sure all the defined workflows in the old project have an equivalent in the new project. Delete the copied project just after the new project has been successfully generated and the user agree with the changes.init - [XAML] Wrap every container-activity body/branch in — even single-activity bodies. Studio's designer expects the wrap as a drop zone; Studio's emitter produces it.
<Sequence>andvalidateaccept the bare form, so neither catches missing wrappers. Applies to creation and editing alike. Slots includebuild/If.Then,If.Else/Whilebody,DoWhile,ForEach.Body/TryCatch.Try/Catch,Finally+ each case,Switch.Default/PickBranch.Trigger,Action. Full table with examples: xaml/xaml-basics-and-rules.md § Container Activity Bodies — Wrap in Sequence.NApplicationCard.Body
- [XAML] 活动文档是权威来源 — 首先检查。始终如此。
{projectRoot}/.local/docs/packages/{PackageId}/ - [XAML] 必须了解项目结构 — 阅读,检查表达式语言,扫描现有模式。切勿盲目生成XAML。
project.json - [XAML] 批量创作,单次检查 — 一次性完成工作流创作,每个活动卡片 → 内存 → 规则21三重检查(优先级在execution-maps-guide.md中)。然后进行单文件以修复错误,再进行一次项目
validate(规则3节奏,5次尝试上限不变);对于有可观察输出的工作流,检查结束时需执行一次build+ 输出检查(execution-maps-guide.md § Gate ≠ runtime proof)。失败时:按错误类别修复(规则19);卡片覆盖的活动保持卡片来源 — 检查失败不重新执行run/activities find;>2个来源模糊的错误 → 二分法(存根化一半新活动,重新验证)。get-default-xaml - [XAML] 按类别修复错误 — 包 → 结构 → 类型 → 活动属性 → 逻辑。
- [XAML] 流程图节点结构 + ViewState共同决定流程图是否渲染。结构优先: 每个/
FlowStep/FlowDecision必须是FlowSwitch的直接子元素(只有直接子元素会被添加到<Flowchart>集合),通过Flowchart.Nodes/Flowchart.StartNode/分支使用FlowStep.Next+<x:Reference>连接。切勿将流程构建为嵌套链 — 一个x:Name物理嵌套在前一个FlowStep的FlowStep内 — 因为仅嵌套的步骤不会出现在<FlowStep.Next>中,无论ViewState如何,设计器几乎不会渲染任何内容。然后是ViewState: 生成新的流程图/状态机/流程图表工作流时,每个节点的ViewState是必需的 — 每个节点都要有Flowchart.Nodes+ShapeLocation(ShapeSize可选,Studio会自动路由)。没有ViewState,Studio会将每个节点堆叠在(0,0)位置,导致它们重叠成一个节点,且Studio打开时不会自动排列(请参阅canvas-layout-guide.md)。编辑现有文件时,切勿修改未更改节点的ViewState。对于Sequence,ViewState是可选的。ConnectorLocation - [XAML] 对于所有不在通用活动卡片中的活动,读取中的
{PROJECT_DIR}/.local/docs/packages/...是<Activity>.md的前置条件。activities get-default-xaml- 卡片列出的活动和模式: 首先检查references/common-activity-card.md和references/common-pattern-card.md;如果匹配卡片条目,仅根据卡片条目创作 — 跳过、
activities find和每个活动的MD阅读。优先级:卡片 → 代理内存(execution-maps-guide.md § Cross-session memory)→ 完整三重检查。内存匹配仅替代三重检查;activities get-default-xaml/validate仍需检查。build - 所有其他活动: (1) → 类名,(2) 首先阅读
activities find并提取属性清单(必填 + 与用例相关),(3)<Activity>.md→ 起始元素,(4) 将你的清单与起始元素对比并添加缺失的内容 — 空清单表示你跳过了步骤2,请返回。activities get-default-xaml - 文档查找顺序: 首选;对于
{PROJECT_DIR}/.local/docs/packages/<PackageId>/activities/<Activity>.md为空的旧包版本,回退到.local/docs。例外 —references/activity-docs/<PackageId>/<closest-version>/<Activity>.md无捆绑回退:UiPath.UIAutomation.Activities(仅在包安装后存在)是其唯一的活动文档来源。如果缺失,请勿寻找捆绑副本 — 遵循规则7a(根据§ UIA Prerequisites获得同意后安装,或使用Placeholder-Selector Stub Pattern — uia-starter-guide.md)。.local/docs - 触发活动特殊 — 需阅读两个文档。当类名以结尾、命名空间包含
Trigger或描述提及"启动作业" / "监控事件" / "Trigger Scope"时,还需阅读捆绑的.Triggers和包的捆绑references/activity-docs/<PackageId>/<closest-version>/activities/<Activity>.md。自动生成的overview.md版本对触发器的描述较为简略;捆绑的手写文档包含放置指南(入口点 vs.local/docs)、部署上下文以及提取器未捕获的跨领域命名空间/程序集陷阱。请参阅通用规则12和trigger-pattern-guide.md。ui:TriggerScope - 跳过成本 — 具体表现: 会省略任何值等于类型默认值的属性。对于
activities get-default-xaml,起始元素实际上是NGetText,无输出属性 — 仅从此创作会产生<uix:NGetText HealingAgentBehavior="SameAsCard" />(不存在;输出成员是NGetText.Value="..."),TextString会接受但validate会拒绝。对于build,20个属性中有2个会被隐藏。NTypeInto - 自行扩展卡片 — "此活动看起来简单,我会将其添加到卡片中" — 是失败模式。卡片是唯一的允许列表;对于非卡片活动,MD阅读是唯一的检查方式。
- 完整流程:xaml/xaml-basics-and-rules.md § Activity Property Surface。
21a. [XAML] 内置工作流活动:仅针对此允许列表使用卡片。快速路径卡片活动包括:、
Sequence、If、Switch<T>、TryCatch、While、DoWhile、ForEach<T>、Assign、LogMessage、WriteLine、Delay、Throw。如果活动在此列表中,请打开references/common-activity-card.md并根据卡片创作。如果不在此列表中,请接下来检查references/common-pattern-card.md — 其模式涵盖例如文本文件读取/追加/写入、文件复制、CSV、DataTable→CSV、队列发布、重试包装、Rethrow、InvokeCode行、HTTP→JSON — 仅当两个卡片都未命中时,才遵循完整规则21。InvokeWorkflowFile、Pick和Parallel故意不在任何卡片中;请使用完整规则21。Studio的"While" / "Do While" / "For Each"工具箱项会生成UiPath包装器(ParallelForEach<T>/UiPath.Core.Activities.InterruptibleWhile/InterruptibleDoWhile),而非框架的UiPath.Core.Activities.ForEach<T>/System.Activities.Statements.While/DoWhile。ForEach<T>
- 卡片列出的活动和模式: 首先检查references/common-activity-card.md和references/common-pattern-card.md;如果匹配卡片条目,仅根据卡片条目创作 — 跳过
- [XAML] 生成或编辑任何XAML前,必须阅读references/xaml/xaml-basics-and-rules.md — 然后根据references/xaml/common-pitfalls.md检查计划。common-pitfalls.md是独立陷阱章节的目录 — 请勿从头到尾阅读:列出其标题(对文件执行),然后阅读标题与你即将创作的工作流中的活动、属性或功能匹配的每个章节。不确定章节是否适用 → 阅读它。这是创作时的检查点,而非仅用于故障排除 — 先查阅它比调试
Grep ^##无法检测到的陷阱更划算。validate - [XAML] 切勿更改现有项目的或
expressionLanguage。在init时主动决定两者(通用规则2a);本规则涵盖创建后的不可变性。targetFramework中的两个字段在创建时固定,并适用于项目中的每个XAML文件 — 翻转project.json(VisualBasic ↔ CSharp)会使所有表达式无效,翻转expressionLanguage(Windows ↔ Portable/跨平台,或Legacy)会使包引用和活动兼容性无效。请勿尝试就地转换。如果用户想要转换现有项目,请与他们确认,将项目复制到临时文件夹,通过targetFramework创建新项目(对于Windows - Legacy目标,在旧版模式中创建 — 现代uip rpa init --expression-language <VisualBasic|CSharp> --target-framework <Windows|Portable>不是旧版创建路径),确保旧项目中所有定义的工作流在新项目中都有等效项。新项目成功生成且用户同意更改后,删除复制的项目。init - [XAML] 将每个容器活动的主体/分支包装在中 — 即使是单活动主体。Studio设计器期望此包装作为放置区域;Studio的发射器会生成它。
<Sequence>和validate接受裸形式,因此两者都不会捕获缺失的包装器。适用于创建和编辑。插槽包括build/If.Then、If.Else/While主体、DoWhile、ForEach.Body/TryCatch.Try/Catch、Finally+ 每个案例、Switch.Default/PickBranch.Trigger、Action。包含示例的完整表格:xaml/xaml-basics-and-rules.md § Container Activity Bodies — Wrap in Sequence。NApplicationCard.Body
Task Navigation
任务导航
| I need to... | Mode | Read these |
|---|---|---|
| Work in a Legacy (.NET 4.6.1) project | Legacy | legacy/legacy-mode-guide.md — entry point. Modern-mode rules below do not apply. |
| Plan the build's turn structure | Both | execution-maps-guide.md — read first for any build/edit journey |
| Choose coded vs XAML | Both | coded-vs-xaml-guide.md |
| Work in a hybrid project | Hybrid | coded-vs-xaml-guide.md → environment-setup.md § Designing Project Structure |
| Create a new project | Both | environment-setup.md |
| Add/edit a coded workflow | Coded | coded/operations-guide.md — includes § Coding Guidelines |
| Add a coded test case | Coded | coded/operations-guide.md — remember: register in |
| Set up data-driven testing | Both | testing-guide.md § Data-Driven Testing — remember: register in |
| Create XAML test case (Given-When-Then) | XAML | testing-guide.md § XAML Test Case Structure — remember: register in |
| Use mock testing | XAML | testing-guide.md § Mock Testing (WIP) — requires CLI command not yet available |
| Use XAML test activities | XAML | testing-guide.md § XAML Test Activities |
| Use execution templates | XAML | testing-guide.md § Execution Templates |
| Set up Test Manager for the project (server URL + default project) | Both | cli-reference.md § Test Manager — |
| Create/edit XAML workflow | XAML | xaml/xaml-basics-and-rules.md — authoring workflow + anatomy + safety rules |
| Add error handling / resilience (Try/Catch, Retry Scope, BusinessRuleException, ContinueOnError, screenshot-on-error, Global Exception Handler, recover app state, transaction boundary, idempotency / avoid duplicate creates, queue vs local retry ownership) | Both | error-handling-guide.md |
Use a common activity ( | XAML | common-activity-card.md |
| Author a common multi-activity pattern (text file read/append/write · file copy · CSV · DataTable→CSV · queue publish · retry wrap · invoke workflow · InvokeCode rows · HTTP→JSON) | XAML | common-pattern-card.md — read alongside the activity card, not instead of it |
| Create/edit Flowchart | XAML | xaml/canvas-layout-guide.md — § Flowchart Structure & Wiring, then § Flowchart Layout |
| Create StateMachine | XAML | xaml/xaml-basics-and-rules.md § State Machine → xaml/canvas-layout-guide.md § State Machine Layout |
| Create/edit Long Running Workflow (ProcessDiagram) | XAML | xaml/long-running-workflow-guide.md → xaml/canvas-layout-guide.md |
| Write UI automation | Both | UIA package guide |
| Build multi-screen UIA XAML workflow | XAML | UIA package guide (Rule 7) § Multi-Screen Authoring |
| Share Object Repository selectors across projects (UI Library) | Both | uia-starter-guide.md § Object Repository as a Published UI Library |
| Run / debug a UIA workflow | Both | uia-starter-guide.md § Running UI Automation Workflows — baseline, debug session, window cleanup, selector recovery |
| Drive a captured control (date inputs, native vs custom dropdowns, buttons disabled during async) | Both | UIA package guide § Control-Specific Interaction Patterns |
| Use Excel/Word/Mail/etc. | Both | Service table below → |
| Manipulate data (DataTable/LINQ, strings, RegEx, DateTime, collections, JSON) | Both | data-manipulation-guide.md |
| Use Data Fabric entities | XAML | xaml/xaml-basics-and-rules.md → activity-docs overview |
| Query Data Fabric with filters | XAML | data-service-filter-builder-guide.md → QueryEntityRecords |
| Call an IS connector (coded) | Coded | coded/integration-service-guide.md |
| Call an IS connector (XAML) | XAML | is-connector-xaml-guide.md — includes connector discovery + connection lifecycle |
| Build an event-triggered workflow (O365 / Gmail / Salesforce / Jira / Slack / ServiceNow / time / queue / file watcher / UI click) | XAML | trigger-pattern-guide.md → |
| Inspect Integration Service trigger lifecycle (webhook vs. polling, filter fields, webhook URL retrieval) | Both | trigger-pattern-guide.md § Connection Handling and § Server-Side Filtering |
Read or edit an existing | XAML | trigger-pattern-guide.md § Reading and Editing Existing TriggerScope XAML |
| Build/run/validate | Both | cli-reference.md — includes § Validation Iteration Loop + § Smoke Test |
| Profile a slow workflow / verify UI automation correctness | Both | debugging.md § Profiling Workflow Performance |
| Pack & publish project to Orchestrator | Both | cli-reference.md § Pack & Publish to Orchestrator |
| List project best-practice / analyzer rules | Both | cli-reference.md § analyzer-rules list |
| Add a NuGet package | Coded | coded/operations-guide.md § Add Dependency → coded/codedworkflow-reference.md § Third-Party NuGet Packages |
| Find / reuse existing tenant libraries | Both | tenant-library-search-guide.md |
| Extract reusable logic into a library | Both | library-authoring-guide.md — public-workflow contract, argument naming, private helpers |
| Publish a library | Both | library-authoring-guide.md § Pack & Publish — tenant libraries feed, versioning |
| Invoke a PowerShell script from a workflow | Both | powershell-interop-guide.md |
| List / install Data Fabric entities | Both | cli-reference.md § Data Fabric Entities |
| Discover activity APIs | Coded | coded/codedworkflow-reference.md § Inspect NuGet Package Tool |
| Troubleshoot coded errors | Coded | coded/operations-guide.md § Common Issues and Fixes |
| Troubleshoot XAML errors | XAML | xaml/common-pitfalls.md → cli-reference.md § Validation Iteration Loop |
| Understand project structure | Both | environment-setup.md § Project Structure Reference |
| 我需要... | 模式 | 阅读这些文件 |
|---|---|---|
| 在旧版(.NET 4.6.1)项目中工作 | 旧版 | legacy/legacy-mode-guide.md — 入口点。下文的现代模式规则不适用。 |
| 规划构建的回合结构 | 两种模式 | execution-maps-guide.md — 任何构建/编辑旅程都请首先阅读 |
| 选择代码化还是XAML | 两种模式 | coded-vs-xaml-guide.md |
| 在混合项目中工作 | 混合 | coded-vs-xaml-guide.md → environment-setup.md § Designing Project Structure |
| 创建新项目 | 两种模式 | environment-setup.md |
| 添加/编辑代码化工作流 | 代码化 | coded/operations-guide.md — 包括§ Coding Guidelines |
| 添加代码化测试用例 | 代码化 | coded/operations-guide.md — 请记住:在 |
| 设置数据驱动测试 | 两种模式 | testing-guide.md § Data-Driven Testing — 请记住:在 |
| 创建XAML测试用例(Given-When-Then) | XAML | testing-guide.md § XAML Test Case Structure — 请记住:在 |
| 使用模拟测试 | XAML | testing-guide.md § Mock Testing (WIP) — 需要尚未可用的CLI命令 |
| 使用XAML测试活动 | XAML | testing-guide.md § XAML Test Activities |
| 使用执行模板 | XAML | testing-guide.md § Execution Templates |
| 为项目设置测试管理器(服务器URL + 默认项目) | 两种模式 | cli-reference.md § Test Manager — |
| 创建/编辑XAML工作流 | XAML | xaml/xaml-basics-and-rules.md — 工作流创作 + 结构 + 安全规则 |
| 添加错误处理/弹性(Try/Catch、Retry Scope、BusinessRuleException、ContinueOnError、错误时截图、全局异常处理程序、恢复应用状态、事务边界、幂等性/避免重复创建、队列 vs 本地重试所有权) | 两种模式 | error-handling-guide.md |
使用通用活动( | XAML | common-activity-card.md |
| 创作通用多活动模式(文本文件读取/追加/写入 · 文件复制 · CSV · DataTable→CSV · 队列发布 · 重试包装 · 调用工作流 · InvokeCode行 · HTTP→JSON) | XAML | common-pattern-card.md — 请与活动卡片一起阅读,而非替代 |
| 创建/编辑流程图 | XAML | xaml/canvas-layout-guide.md — § Flowchart Structure & Wiring,然后§ Flowchart Layout |
| 创建状态机 | XAML | xaml/xaml-basics-and-rules.md § State Machine → xaml/canvas-layout-guide.md § State Machine Layout |
| 创建/编辑长期运行工作流(ProcessDiagram) | XAML | xaml/long-running-workflow-guide.md → xaml/canvas-layout-guide.md |
| 编写UI自动化 | 两种模式 | UIA包指南 |
| 构建多屏幕UIA XAML工作流 | XAML | UIA包指南(规则7)§ Multi-Screen Authoring |
| 跨项目共享对象库选择器(UI库) | 两种模式 | uia-starter-guide.md § Object Repository as a Published UI Library |
| 运行/调试UIA工作流 | 两种模式 | uia-starter-guide.md § Running UI Automation Workflows — 基线、调试会话、窗口清理、选择器恢复 |
| 驱动捕获的控件(日期输入、原生 vs 自定义下拉菜单、异步期间禁用的按钮) | 两种模式 | UIA包指南 § Control-Specific Interaction Patterns |
| 使用Excel/Word/Mail等 | 两种模式 | 下方服务表 → |
| 操作数据(DataTable/LINQ、字符串、正则表达式、DateTime、集合、JSON) | 两种模式 | data-manipulation-guide.md |
| 使用Data Fabric实体 | XAML | xaml/xaml-basics-and-rules.md → activity-docs overview |
| 使用过滤器查询Data Fabric | XAML | data-service-filter-builder-guide.md → QueryEntityRecords |
| 调用IS连接器(代码化) | 代码化 | coded/integration-service-guide.md |
| 调用IS连接器(XAML) | XAML | is-connector-xaml-guide.md — 包括连接器发现 + 连接生命周期 |
| 构建事件触发的工作流(O365 / Gmail / Salesforce / Jira / Slack / ServiceNow / 时间 / 队列 / 文件监视器 / UI点击) | XAML | trigger-pattern-guide.md → |
| 检查集成服务触发器生命周期(Webhook vs 轮询、过滤器字段、Webhook URL检索) | 两种模式 | trigger-pattern-guide.md § Connection Handling和§ Server-Side Filtering |
读取或编辑现有 | XAML | trigger-pattern-guide.md § Reading and Editing Existing TriggerScope XAML |
| 构建/运行/验证 | 两种模式 | cli-reference.md — 包括§ Validation Iteration Loop + § Smoke Test |
| 分析缓慢的工作流 / 验证UI自动化正确性 | 两种模式 | debugging.md § Profiling Workflow Performance |
| 打包并发布项目到Orchestrator | 两种模式 | cli-reference.md § Pack & Publish to Orchestrator |
| 列出项目最佳实践/分析器规则 | 两种模式 | cli-reference.md § analyzer-rules list |
| 添加NuGet包 | 代码化 | coded/operations-guide.md § Add Dependency → coded/codedworkflow-reference.md § Third-Party NuGet Packages |
| 查找/复用现有租户库 | 两种模式 | tenant-library-search-guide.md |
| 将可重用逻辑提取到库中 | 两种模式 | library-authoring-guide.md — 公共工作流契约、参数命名、私有助手 |
| 发布库 | 两种模式 | library-authoring-guide.md § Pack & Publish — 租户库源、版本控制 |
| 从工作流调用PowerShell脚本 | 两种模式 | powershell-interop-guide.md |
| 列出/安装Data Fabric实体 | 两种模式 | cli-reference.md § Data Fabric Entities |
| 发现活动API | 代码化 | coded/codedworkflow-reference.md § Inspect NuGet Package Tool |
| 排查代码化错误 | 代码化 | coded/operations-guide.md § Common Issues and Fixes |
| 排查XAML错误 | XAML | xaml/common-pitfalls.md → cli-reference.md § Validation Iteration Loop |
| 了解项目结构 | 两种模式 | environment-setup.md § Project Structure Reference |
Coded Workflows Quick Reference
代码化工作流快速参考
Coded workflows use standard C# development: create file → write code → validate → run. Activity discovery (, ) is XAML-specific — for coded mode, check first for service API docs, then fall back to , then to the bundled per-package coded docs at . See coded/codedworkflow-reference.md § Inspect NuGet Package Tool.
activities findactivities get-default-xaml{projectRoot}/.local/docs/packages/{PackageId}/coded/coded-api.mdpackages inspectreferences/activity-docs/<PackageId>/<closest-version>/coded/代码化工作流使用标准C#开发:创建文件 → 编写代码 → 验证 → 运行。活动发现(、)是XAML特定的 — 对于代码化模式,请首先检查获取服务API文档,然后回退到,再回退到捆绑的每个包的代码化文档。请参阅coded/codedworkflow-reference.md § Inspect NuGet Package Tool。
activities findactivities get-default-xaml{projectRoot}/.local/docs/packages/{PackageId}/coded/coded-api.mdpackages inspectreferences/activity-docs/<PackageId>/<closest-version>/coded/Three Types of .cs Files
三种.cs文件类型
| Type | Base Class | Attribute | Entry Point | Purpose |
|---|---|---|---|---|
| Coded Workflow | | | Process only | Executable automation logic |
| Coded Test Case | | | Process only | Automated test with assertions |
| Coded Source File | None (plain C#) | None | No | Reusable models, helpers, utilities, hooks |
| 类型 | 基类 | 属性 | 入口点 | 用途 |
|---|---|---|---|---|
| 代码化工作流 | | | 仅流程项目 | 可执行自动化逻辑 |
| 代码化测试用例 | | | 仅流程项目 | 带断言的自动化测试 |
| 代码化源文件 | 无(普通C#) | 无 | 无 | 可重用模型、助手、工具、钩子 |
Service-to-Package Mapping
服务到包的映射
Each service on requires its NuGet package in . Without it: .
CodedWorkflowproject.jsonCS0103| Service Property | Required Package |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
For infrastructure/cloud packages (azure, gcp, aws, azureAD, citrix, hyperv, etc.), see coded/codedworkflow-reference.md.
For IS connectors from coded workflows via : — see coded/integration-service-guide.md.
ConnectorConnection.ExecuteAsyncUiPath.IntegrationService.ActivitiesCodedWorkflowproject.jsonCS0103| 服务属性 | 必需包 |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
对于基础设施/云包(azure、gcp、aws、azureAD、citrix、hyperv等),请参阅coded/codedworkflow-reference.md。
对于通过从代码化工作流调用IS连接器:需要 — 请参阅coded/integration-service-guide.md。
ConnectorConnection.ExecuteAsyncUiPath.IntegrationService.ActivitiesCodedWorkflow Base Class
CodedWorkflow基类
All workflow/test case files inherit from , providing built-in methods (, , ), service properties, and the property for strongly-typed invocation. Extendable with Before/After hooks via .
CodedWorkflowLogDelayRunWorkflowworkflowsIBeforeAfterRunFull reference: coded/codedworkflow-reference.md
所有工作流/测试用例文件都继承自,提供内置方法(、、)、服务属性和用于强类型调用的属性。可通过扩展Before/After钩子。
CodedWorkflowLogDelayRunWorkflowworkflowsIBeforeAfterRun完整参考:coded/codedworkflow-reference.md
Templates
模板
- assets/codedworkflow-template.md — Workflow, test case, helper-class, and Before/After-hooks boilerplate (all coded templates)
- assets/json-template.md — and
entryPointssnippetsfileInfoCollection - environment-setup.md § Designing Project Structure — Project structure design guidelines (mode-agnostic)
- assets/codedworkflow-template.md — 工作流、测试用例、助手类和Before/After钩子的模板(所有代码化模板)
- assets/json-template.md — 和
entryPoints片段fileInfoCollection - environment-setup.md § Designing Project Structure — 项目结构设计指南(模式无关)
XAML Workflows Quick Reference
XAML工作流快速参考
XAML workflows follow a discovery-first, phase-based approach: Discovery → Generate/Edit → Validate & Fix → Response. See xaml/xaml-basics-and-rules.md § Authoring Workflow for the full phase workflow.
XAML工作流遵循发现优先、分阶段方法:发现 → 生成/编辑 → 验证与修复 → 响应。请参阅xaml/xaml-basics-and-rules.md § Authoring Workflow获取完整阶段工作流。
Workflow Types
工作流类型
| Type | When to Use |
|---|---|
| Sequence | Linear step-by-step logic; most common for simple automations |
| Flowchart | Branching/looping logic with multiple decision points |
| State Machine | Long-running processes with distinct states and transitions |
| Long Running Workflow | BPMN-style horizontal flow; event-driven processes with long waits. Requires |
| 类型 | 使用场景 |
|---|---|
| Sequence | 线性分步逻辑;最适用于简单自动化 |
| Flowchart | 带有多个决策点的分支/循环逻辑 |
| State Machine | 具有不同状态和转换的长期运行流程 |
| Long Running Workflow | BPMN风格的水平流程;带有长时间等待的事件驱动流程。需要 |
Expression Language
表达式语言
Check in . VB.NET uses for expressions; C# uses / . Default for new XAML projects is VB.NET.
expressionLanguageproject.json[brackets]CSharpValue<T>CSharpReference<T>检查中的。VB.NET使用表示表达式;C#使用 / 。新XAML项目默认使用VB.NET。
project.jsonexpressionLanguage[brackets]CSharpValue<T>CSharpReference<T>Key CLI Commands
关键CLI命令
| Command | Purpose |
|---|---|
| Discover activities by keyword |
| Get starter XAML for an activity |
| List enabled Workflow Analyzer rules — on demand only (user asks about project rules, or repeated violations of one rule family); |
| Per-file static validation (structure, references, analyzer rules) |
| Compile-time validation (member names, enum values, JIT expressions) — run after |
| 命令 | 用途 |
|---|---|
| 通过关键词发现活动 |
| 获取活动的起始XAML |
| 列出启用的工作流分析器规则 — 仅按需使用(用户询问项目规则,或同一规则家族重复违规); |
| 单文件静态验证(结构、引用、分析器规则) |
| 编译时验证(成员名称、枚举值、JIT表达式) — 在 |
Common Activities
通用活动
| Activity | Package | Purpose |
|---|---|---|
| UI automation (Use Application/Browser, Click, Type Into, Get Text, Select Item, …) | | Never author from memory or from this row. Selectors and targets are captured, not hand-written — read the UIA package guide ( |
| If | built-in | Conditional branching |
| Assign | built-in | Set variable/argument values |
| For Each | built-in | Iterate over a collection |
| Invoke Workflow File | built-in | Call another workflow file |
| Create Entity Record | | Create a Data Fabric entity record |
| Query Entity Records | | Query Data Fabric records with filters — see filter builder guide |
| 活动 | 包 | 用途 |
|---|---|---|
| UI自动化(Use Application/Browser、Click、Type Into、Get Text、Select Item等) | | 切勿凭记忆或本行内容创作。选择器和目标是捕获的,而非手动编写 — 请首先完整阅读UIA包指南( |
| If | 内置 | 条件分支 |
| Assign | 内置 | 设置变量/参数值 |
| For Each | 内置 | 遍历集合 |
| Invoke Workflow File | 内置 | 调用另一个工作流文件 |
| Create Entity Record | | 创建Data Fabric实体记录 |
| Query Entity Records | | 使用过滤器查询Data Fabric记录 — 请参阅过滤器构建指南 |
XAML File Anatomy
XAML文件结构
The XAML file anatomy template (namespace declarations, root Activity element, body structure) is in xaml/xaml-basics-and-rules.md — read it before generating or editing any XAML.
XAML文件结构模板(命名空间声明、根Activity元素、主体结构)位于xaml/xaml-basics-and-rules.md — 生成或编辑任何XAML前请阅读。
Key References
关键参考
- xaml/xaml-basics-and-rules.md — XAML anatomy, safety rules, editing operations (read before any XAML work)
- xaml/common-pitfalls.md — Activity gotchas, scope requirements, property conflicts
- data-manipulation-guide.md — DataTable LINQ (filter/sort/group/join/diff), strings, RegEx, DateTime, type conversion, collections, JSON; VB + C# forms
- error-handling-guide.md — Modern-mode error handling & resilience: exception taxonomy, Try/Catch discipline, Retry Scope, ContinueOnError, Throw/Rethrow, screenshot-on-error, Global Exception Handler (scaffold + registration + verdict logic), state recovery before retry, transaction boundaries, idempotent/compensating writes (duplicate-create safety), sensitive-data redaction, and retry ownership across layers
- reframework-guide.md — REFramework execution modes, SetTransactionStatus queue-guard fix, Config.xlsx leftover trap
- xaml/csharp-activity-binding-guide.md — Canonical C# binding forms per common activity property (flat lookup table + recipes) + § C# Expression Pitfalls (attribute-form VB JIT, ThrowIfNotInTree, OutArgument parse errors)
- xaml/canvas-layout-guide.md — Flowchart node vocabulary, structure & wiring, node registration, forbidden nested-chain pattern + Flowchart/State Machine/LRW canvas layout with ViewState
- xaml/long-running-workflow-guide.md — LRW package dependency, node vocabulary, gateway patterns, suspend/resume persistence
- xaml/jit-custom-types-schema.md — JIT custom type discovery
- library-authoring-guide.md — Produce reusable libraries: public-workflow contract, activity layout sidecar (display name, icon, widgets), error contract, SemVer, pack & publish to the libraries feed
- xaml/xaml-basics-and-rules.md — XAML结构、安全规则、编辑操作(任何XAML工作前请阅读)
- xaml/common-pitfalls.md — 活动陷阱、范围要求、属性冲突
- data-manipulation-guide.md — DataTable LINQ(过滤/排序/分组/连接/差异)、字符串、正则表达式、DateTime、类型转换、集合、JSON;VB + C#形式
- error-handling-guide.md — 现代模式错误处理与弹性:异常分类、Try/Catch规范、Retry Scope、ContinueOnError、Throw/Rethrow、错误时截图、全局异常处理程序(搭建 + 注册 + 裁决逻辑)、重试前状态恢复、事务边界、幂等/补偿写入(重复创建安全)、敏感数据脱敏以及跨层重试所有权
- reframework-guide.md — REFramework执行模式、SetTransactionStatus队列保护修复、Config.xlsx遗留陷阱
- xaml/csharp-activity-binding-guide.md — 通用活动属性的标准C#绑定形式(扁平查找表 + 方案) + § C#表达式陷阱(属性形式VB JIT、ThrowIfNotInTree、OutArgument解析错误)
- xaml/canvas-layout-guide.md — 流程图节点词汇、结构与连接、节点注册、禁止的嵌套链模式 + 流程图/状态机/LRW画布布局与ViewState
- xaml/long-running-workflow-guide.md — LRW包依赖、节点词汇、网关模式、暂停/恢复持久化
- xaml/jit-custom-types-schema.md — JIT自定义类型发现
- library-authoring-guide.md — 生成可重用库:公共工作流契约、活动布局侧载(显示名称、图标、小部件)、错误契约、语义化版本控制、打包并发布到库源
Multi-Screen UI Automation Workflows
多屏幕UI自动化工作流
For XAML workflows spanning multiple capture screens, default to author-once-after-capture with a single + gate (Rule 18); per-screen authoring interleave only on long captures (5+ screens). Turn structure: execution-maps-guide.md § Journey: UIA capture + build. Capture loop and the Complete-then-advance rule: UIA package guide § Multi-Screen Authoring (Rule 7) — it mandates the target-capture orchestration reference to read IN FULL first.
validatebuild对于跨多个捕获屏幕的XAML工作流,默认捕获完成后一次性创作,进行单次+检查(规则18);仅在长捕获(5+屏幕)时才逐屏交替创作。回合结构:execution-maps-guide.md § Journey: UIA capture + build。捕获循环和完成后推进规则:UIA包指南§ Multi-Screen Authoring(规则7)— 它规定了需首先完整阅读的目标捕获编排参考。
validatebuildResolving Packages & Activity Docs
解析包与活动文档
Follow this flow whenever you need to use an activity package:
每当需要使用活动包时,请遵循此流程:
Step 1 — Ensure the package is installed
步骤1 — 确保包已安装
Check → for the required package.
project.jsondependenciesAlways query versions with . Many UiPath activity packages ship as between stable releases, and the latest preview routinely contains new activities, fixed signatures, and updated content that activity generation depends on. Without the flag, the listing hides these and the agent will pick a stale stable.
--include-prerelease-preview.local/docs- If present → note the installed version. Then list available versions with and compare:
--include-prerelease- If a newer version (stable or preview) exists, inform the user: state the installed version, the latest available version, and that newer packages offer the best support for activity generation (latest activity surface, accurate , fewer signature mismatches). Ask whether to upgrade. Never force-upgrade an already-installed package.
.local/docs - If the installed version is already the latest, proceed to Step 2.
- If a newer version (stable or preview) exists, inform the user: state the installed version, the latest available version, and that newer packages offer the best support for activity generation (latest activity surface, accurate
- If absent → install the latest version returned by (preview is acceptable):
packages versions --include-prerelease
bash
uip rpa packages versions --package-id <PackageId> --include-prerelease --project-dir "<PROJECT_DIR>" --output json
uip rpa packages install --packages 'id=<PackageId>,version=<LATEST_VERSION>' --project-dir "<PROJECT_DIR>" --output json检查的中是否存在所需包。
project.jsondependencies始终使用查询版本。许多UiPath活动包在稳定版本之间以形式发布,最新预览版通常包含活动生成依赖的新活动、修复的签名和更新的内容。如果没有此标志,列表会隐藏这些版本,代理会选择陈旧的稳定版。
--include-prerelease-preview.local/docs- 如果已存在 → 记录已安装版本。然后使用列出可用版本并比较:
--include-prerelease- 如果存在更新版本(稳定或预览),告知用户:说明已安装版本、最新可用版本,以及新版本为活动生成提供的最佳支持(最新活动界面、准确的、更少的签名不匹配)。询问用户是否升级。切勿强制升级已安装的包。
.local/docs - 如果已安装版本已是最新,继续步骤2。
- 如果存在更新版本(稳定或预览),告知用户:说明已安装版本、最新可用版本,以及新版本为活动生成提供的最佳支持(最新活动界面、准确的
- 如果不存在 → 安装返回的最新版本(预览版可接受):
packages versions --include-prerelease
bash
uip rpa packages versions --package-id <PackageId> --include-prerelease --project-dir "<PROJECT_DIR>" --output json
uip rpa packages install --packages 'id=<PackageId>,version=<LATEST_VERSION>' --project-dir "<PROJECT_DIR>" --output jsonStep 2 — Find activity docs (priority order)
步骤2 — 查找活动文档(优先级顺序)
- Check — auto-generated, most accurate. Use
{PROJECT_DIR}/.local/docs/packages/{PackageId}/+Glob(notRead—Grepis gitignored)..local/ - Fall back to bundled references at — pick the version folder closest to what is installed.
references/activity-docs/{PackageId}/
- 检查— 自动生成,最准确。使用
{PROJECT_DIR}/.local/docs/packages/{PackageId}/+Glob(不要使用Read—Grep已被git忽略)。.local/ - 回退到捆绑参考— 选择与已安装版本最接近的版本文件夹。
references/activity-docs/{PackageId}/
UI Automation References
UI自动化参考
UIA references live in two locations. Always cite by location so the reader knows which tree to open:
- This skill (, relative to this SKILL.md) — policy this skill owns: prerequisites/version gating, run/debug orchestration, stub-mode deliverables, UI Library publishing.
references/ - UIA activity pack (, installed via
{PROJECT_DIR}/.local/docs/packages/UiPath.UIAutomation.Activities/) — the UIA authoring guide, target-capture orchestration, single-purpose task guides, concreteuip rpa packages installCLI syntax, per-activity property surfaces, coded API surface, and the UIA skill internal procedures. Co-versioned with the package, so always source-of-truth over anything in this skill when they diverge.uip rpa uia
UIA参考位于两个位置。请始终按位置引用,以便读者知道打开哪个目录:
- 本技能(,相对于本SKILL.md)— 本技能负责的策略:前置条件/版本控制、运行/调试编排、存根模式交付物、UI库发布。
references/ - UIA活动包(,通过
{PROJECT_DIR}/.local/docs/packages/UiPath.UIAutomation.Activities/安装)— UIA创作指南、目标捕获编排、单任务指南、具体uip rpa packages installCLI语法、每个活动的属性界面、代码化API界面以及UIA技能内部流程。与包版本同步,因此当与本技能内容冲突时,始终以此为权威来源。uip rpa uia
In this skill (references/
, relative to this SKILL.md)
references/本技能中(references/
,相对于本SKILL.md)
references/- uia-starter-guide.md — read first for any UIA work (Rule 7). Mandates the package guide read, then owns the skill-side UIA policies: run/debug procedure (baseline → debug → cancel → window cleanup) + profiling + runtime selector failure recovery, the placeholder-stub deliverable pattern, and UI Library publishing. Version gating and upgrade consent: SKILL.md § UIA Prerequisites.
- uia-starter-guide.md — 任何UIA工作都请首先阅读(规则7)。规定了包指南的阅读要求,然后负责技能端的UIA策略:运行/调试流程(基线 → 调试 → 取消 → 窗口清理)+ 分析 + 运行时选择器失败恢复、占位符存根交付物模式和UI库发布。版本控制和升级同意:SKILL.md § UIA Prerequisites。
In the UIA activity pack ({PROJECT_DIR}/.local/docs/packages/UiPath.UIAutomation.Activities/
)
{PROJECT_DIR}/.local/docs/packages/UiPath.UIAutomation.Activities/UIA活动包中({PROJECT_DIR}/.local/docs/packages/UiPath.UIAutomation.Activities/
)
{PROJECT_DIR}/.local/docs/packages/UiPath.UIAutomation.Activities/- — the entry point for all UIA authoring (Rule 7; read in full first — also the Rule 7a availability probe). Window baseline, capture orchestration, common pitfalls, control-specific interaction, coded and XAML patterns. Its § Documentation routes to everything else in the pack: target-capture orchestration, task guides, CLI command inventory, per-activity property surfaces, coded API surface, and the UIA skills (
ui-automation-guide.md,uia-configure-target).uia-improve-selector
- — 所有UIA创作的入口点(规则7;请首先完整阅读 — 也是规则7a的可用性探测)。窗口基线、捕获编排、常见陷阱、控件特定交互、代码化和XAML模式。其§ Documentation指向包中的所有其他内容:目标捕获编排、任务指南、CLI命令清单、每个活动的属性界面、代码化API界面以及UIA技能(
ui-automation-guide.md、uia-configure-target)。uia-improve-selector
Completion Output
完成输出
Before reporting "done", verify the plan is complete. If a plan file at drove this work:
docs/plans/*.md- Re-read the plan and scan its task checkboxes.
- If any boxes remain AND the plan's header says
[ ]AND noExecution autonomy: autonomousitem was hit — do not report done. Resume execution on the next unchecked task.Stop conditions - If unchecked boxes remain because a Stop condition was hit, name the exact stop-condition item in the report.
- If the plan is fully checked off, or execution autonomy is , proceed to the report format below.
interactive
Then, if the harness provides persistent memory, save validated patterns per execution-maps-guide.md § Cross-session memory before reporting.
When you finish a task, report to the user:
- What was done — files created, edited, or deleted (list file paths)
- Validation status — per-file result (all files passed, or remaining errors) and project-level
validateresult. Both must be clean to claim verification —uip rpa buildclean alone is insufficient (it does not detect unknown member names or invalid enum values). Ifvalidatehas not run since the last edit, say so explicitly rather than claiming success.build - Plan completion — which task checkboxes in are now
docs/plans/*.md; list any still[x]and, for each, the Stop-condition item that interrupted it (or "not reached" if execution was cut short another way)[ ] - How to run — the (or
uip rpa run) command (if applicable)uip rpa debug start - Next steps — follow-up actions (configure connections, add OR elements, fill placeholders)
- Trouble? — if the user hit issues during this session, mention: "If something didn't work as expected, use to send a report."
/uipath-feedback
Do NOT use framing like "complete", "done", "finished", or "the automation is built" unless every plan task is checked off. "Partial", "stopped at <task N>", or "blocked by <stop condition>" is the honest framing otherwise.
报告"完成"前,请验证计划已完成。如果中的计划文件驱动了本次工作:
docs/plans/*.md- 重新阅读计划并扫描其任务复选框。
- 如果任何复选框仍存在,且计划标题包含
[ ],且未触发Execution autonomy: autonomous中的项 — 请勿报告完成。继续执行下一个未勾选的任务。Stop conditions - 如果未勾选的任务存在是因为触发了停止条件,请在报告中明确说明触发的停止条件项。
- 如果计划已完全勾选,或执行自主性为,请继续下文的报告格式。
interactive
然后,如果工具提供持久内存,请在报告前根据execution-maps-guide.md § Cross-session memory保存已验证的模式。
完成任务后,向用户报告:
- 已完成的工作 — 创建、编辑或删除的文件(列出文件路径)
- 验证状态 — 单文件结果(所有文件通过,或剩余错误)以及项目级
validate结果。两者都必须通过才能声称已验证 — 仅uip rpa build通过不足够(它无法检测未知成员名称或无效枚举值)。如果自上次编辑后未运行validate,请明确说明,而非声称成功。build - 计划完成情况 — 中的哪些任务复选框现在为
docs/plans/*.md;列出仍为[x]的任务,以及每个任务被中断的停止条件项(或"未执行",如果执行因其他原因中断)[ ] - 运行方式 — (或
uip rpa run)命令(如适用)uip rpa debug start - 下一步 — 后续操作(配置连接、添加OR元素、填充占位符)
- 遇到问题? — 如果用户在本次会话中遇到问题,请提及:"如果某些内容未按预期工作,请使用发送报告。"
/uipath-feedback
除非所有计划任务都已勾选,否则请勿使用"完成"、"done"、"finished"或"自动化已构建"等表述。否则请使用"部分完成"、"在<任务N>处停止"或"被<停止条件>阻塞"等诚实表述。",