uipath-rpa
Always invoke for `.xaml` or `.cs` workflow files. UiPath RPA — create, edit, build, run, debug `.cs` coded workflows and `.xaml` workflows. UI automation with Object Repository selectors, test case authoring, Integration Service connector calls. Live desktop/browser UI exploration and control. Deploy via `.uipx`→uipath-solution. Non-solution Orchestrator ops→uipath-platform. Test reports→uipath-test. Agents→uipath-agents.
Skill body
UiPath RPA Assistant
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
--help, or substitute prior knowledge. Most errors that slip pastvalidateand surface atbuildor runtime trace back to a reference that was skipped or only partially read.
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
Precondition: Project Context
Before doing any work, check if .claude/rules/project-context.md exists in the project directory.
If the file exists → check for staleness:
- Read the first line of
.claude/rules/project-context.mdto extract the metadata comment:<!-- discovery-metadata: cs=N xaml=N deps=N --> - Count current files: Glob
**/*.cs(excluding.local/and.codedworkflows/) and**/*.xamlin the project directory - Count current dependencies: read
project.jsonand count keys in the.dependenciesobject - 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 discovery flow below.
Discovery flow (used for both missing and stale context):
- Trigger the
uipath-project-discovery-agentand wait for it to complete - The agent returns the generated context document as its response
- Write the returned content to both:
.claude/rules/project-context.md(create.claude/rules/directory if needed) — auto-loaded by Claude Code in future sessionsAGENTS.mdat project root — read by UiPath Autopilot in Studio Desktop. IfAGENTS.mdalready exists, look for<!-- PROJECT-CONTEXT:START -->/<!-- PROJECT-CONTEXT:END -->markers and replace only between them; if no markers exist, append the fenced block at the end
- Then proceed with the skill workflow
Step 0: Resolve 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 project.json to establish {projectRoot}. That’s it — no Studio Desktop check needed. uip rpa auto-launches a headless Studio (UiPath.Studio.Helm NuGet) on first call. Studio Desktop is required only for files diff and focus-activity.
Project Type Detection
After establishing PROJECT_DIR, first check project.json for targetFramework:
targetFramework: "Legacy"(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 standaloneuip rpa-legacyCLI, .NET Framework 4.6.1, classic activities (no “X” suffix), andmscorlibassembly references. The rest of this SKILL.md (modern mode) does NOT apply to Legacy projects.targetFramework: "Windows"or"Portable"(Cross-platform) → Modern mode, continue below.
For modern projects, determine whether this is a coded or XAML project:
- Coded mode —
.csfiles with[Workflow]or[TestCase]attributes exist AND no.xamlworkflow files (beyond scaffoldedMain.xaml) - XAML mode —
.xamlworkflow files exist AND no coded workflow.csfiles - 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.
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 uiAutomation service |
| 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 Invoke Workflow File |
| 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 .ps1), use the InvokePowerShell<T> activity — never Invoke Process + powershell.exe. See powershell-interop-guide.md |
| Custom data models / DTOs | Coded Source File | XAML cannot define types — plain .cs, no CodedWorkflow base |
| Unit tests with assertions | Coded Test Case | [TestCase] with Arrange/Act/Assert |
| User explicitly requests coded/XAML | User’s choice | Never second-guess explicit preference |
UI Automation Boundaries
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 — NApplicationCard plus UIA activities (XAML), or uiAutomation.Open/Attach plus Object Repository descriptors (coded). Do NOT substitute InvokeCode, 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).
If target configuration is unavailable, fall back to the documented UIA indication path — never to an external browser automation shortcut.
ui-automation-guide.md MUST be read IN FULL first — § Mandatory: Generate Targets Before Writing Any UI Code covers the full prohibited-tool list, the UIA-only exploration requirement, and the InvokeJS/InjectJsScript exception scope.
Placeholder-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 TODO Indicate markers — never Log stubs.
Forbidden: a workflow whose UI-interaction steps are Log("LoginWorkflow: type username") with a // TODO[selectors]: 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.
Required: the real UIA activity (NTypeInto, NClick, NGetText, NApplicationCard, etc.) with the target descriptor’s selector left as a placeholder string and a TODO Indicate marker embedded in the activity’s DisplayName (XAML) or in a // TODO[Indicate] comment immediately adjacent to the coded call. A developer opens Studio, clicks Indicate on each marked activity, and the workflow runs.
This applies to both XAML and coded modes. ui-automation-guide.md MUST be read IN FULL first — § Placeholder-Selector Stub Pattern has the full pattern with XAML and coded examples.
Hybrid pattern — XAML orchestration + coded fallback for logic with no matching activity:
Main.xaml ← orchestration (XAML)
└── InvokeWorkflowFile → ProcessData.cs ← coded logic
For the full decision flowchart, InvokeCode extraction rules, and detailed hybrid patterns, see 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 and analyzer rules add nothing during capture and steal time from it.
Fast-path order for capture-first tasks. ui-automation-guide.md MUST be read IN FULL first; uia-configure-target-workflows.md MUST also be read IN FULL first (used in step 3). Then:
- Pre-flight Window Baseline — list top-level windows once; decide whether to launch the app (§ Pre-flight: 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 (§ Capturing from Manual Test Steps).
- Capture all targets screen by screen via
uia-configure-targetand screen advancement (§ Multi-Step UI Flows). - Then enter authoring phase: project-context discovery (the precondition above), analyzer rules (Critical Rule 3 — Authoring-phase start), write code, validate.
Skip this path when the task has no UI surface (data transforms, IS connector calls, headless file/email automation).
Session Pre-warm
First heavy uip rpa call pays a ~22s Studio host cold-start (shared across validate/build/run/activities get-default-xaml/analyzer-rules list). When more than one is expected this session, background a cheap warm-up at session start so the tax hides behind planning:
uip rpa activities find --query log --output json > /dev/null 2>&1 &
Skip when 0 or 1 heavy uip rpa calls are expected (read-only Q&A, single-file inspection) — the warm-up doesn’t reclaim its cost.
Critical Rules
Rule numbering. Common Rules use 1–12. ### Coded-Specific Rules continues 13–19. ### XAML-Specific Rules is an independent 16–24 sequence, so numbers 16/17/18/19 appear in both mode-specific sections — the [Coded] / [XAML] 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.
Common Rules (Both Modes)
- NEVER create a project without confirming none exists. Follow Step 0 resolution: check explicit path, project name, then CWD for
project.json. Only create when confirmed no project matches AND user explicitly requests creation. - ALWAYS use
uip rpa initto create new projects — never writeproject.jsonor scaffolding manually.- 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
uip rpa templates search --query "<term>" --output jsonfirst. Selection rule againstData[*]:- User named a specific non-Official template (e.g. “Enhanced REFramework”, “Lite ReFrameWork”) AND a
Marketplaceitem’stitleorpackageIdsubstring-matches the user’s specific qualifier → ask the user (Official + that Marketplace item are both candidates). Do NOT auto-pick. - Exactly one
source == "Official"match AND user did not name a non-Official template → use it; pass--template-package-id <packageId> --template-package-version <version>toinit. Proceed without asking. - Multiple
Officialmatches OR onlyMarketplacematches → present candidates (packageId,version,source,title) to the user and ask which to use. Never silently pick a Marketplace template. - No matches → fall back to a built-in
--template-idand tell the user nothing was found.
- User named a specific non-Official template (e.g. “Enhanced REFramework”, “Lite ReFrameWork”) AND a
- Built-in
--template-idkeywords map without a search:library→LibraryProcessTemplate,test automation/test project→TestAutomationProjectTemplate, otherwiseBlankTemplate. When--template-package-idis set,--template-idis ignored. Full decision flow: environment-setup.md § Template selection. 2a. Pass--target-frameworkAND--expression-languageexplicitly on everyuip rpa init— never omit them. Both are immutable after creation (Rule 23); omitting--target-frameworksilently yields a Windows project. Choose framework by where the automation runs: cross-platform / non-Windows runtime (Linux, container, serverless) or Studio Web editing →Portable(Cross-platform); Windows runtime using Windows-only capabilities (Excel COM, classic Office, WPF /PresentationFramework, Windows-only UIA) or Studio Desktop as the edit surface →Windows(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 moderninit. No signal →AskUserQuestion(Windows vs Cross-platform), framed around the runtime host.--expression-language: defaultVisualBasic,CSharponly on explicit request.
- 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: analyzer rules run at AUTHORING-phase start, not session start. Three-phase validation:
- Authoring-phase start (immediately before creating or editing any workflow file —
.cswith[Workflow]/[TestCase], or.xaml):uip rpa analyzer-rules list --project-dir "<PROJECT_DIR>" --output jsonto list the enabled Workflow Analyzer rules. Apply everyerrorandwarningrule during authoring so generated code passesanalyzeandbuildon the first attempt. Run once at this point; re-run only when project dependencies change. DO NOT run at session start — the call can take a minute or more (use--scope <Activity|Workflow|Coded Workflow|Project>to narrow if it times out, see cli-reference.md § analyzer-rules list). For capture-first tasks (target capture from manual test steps, dialog automation), this prerequisite is deferred until capture is complete — see § Capture-First Fast Path below. - Per-file (after every create or edit):
uip rpa validate --file-path "<FILE>" --project-dir "<PROJECT_DIR>" --output jsonuntil 0 errors. Catches structural XAML, missing references, analyzer rules, schema violations. Fix one thing per iteration. - Project-level build (after per-file
validateis clean across all files in the edit session, and before declaring done):uip rpa build "<PROJECT_DIR>" --output jsonuntil clean. Catches whatvalidatemisses (unknown members, invalid enums, CacheMetadata / member resolution, attribute-form C# JIT) — full list at validation-guide.md § Errorsbuildcatches thatvalidatemisses. Ifbuilderrors, identify the offending file from the output and re-runvalidate --file-pathon it. - 5-attempt cap per loop — 5 attempts for each file’s per-file
validateloop; a separate 5 attempts for the project-levelbuildloop. Fix one root cause per iteration. - Smoke-test shortcut: A successful
uip rpa runsubstitutes for the standalone end-of-sessionbuild—runcompiles internally. Preferrun --skip-buildwhenbuildhas just passed; see validation-guide.md § Smoke Test.
- Authoring-phase start (immediately before creating or editing any workflow file —
- ALWAYS validate files as you go AND verify the project builds before declaring done. After every create or edit: per-file
validateto clean. Project-levelbuildruns 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.validateclean alone is not “validated”; it cannot see member or enum errors — the project-levelbuildis mandatory before declaring done. See references/validation-guide.md. - 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 in
project.jsonbefore using their activities or services. 6a. Pre-edit verification gate. Two authoring actions are hard to roll back oncebuildfails — verify before serialization, not after.- Removing a dependency — grep the project for usages before deleting an entry. A package may be the sole supplier of an activity used elsewhere (
MergePDFslives in the IntelligentOCR.StudioWeb family). - Writing a new activity tag — confirm via
uip rpa activities find --query "<verb>" --output jsonand use the returnedClassName. Do not derive tag names from Studio display names. See common-pitfalls.md § Common Activity Name Confusions.
- 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 (XAML
<uix:N*>or codeduiAutomation.*/Descriptors.*), MUST read references/ui-automation-guide.md IN FULL — including the mode-specific section (For Coded Workflows or For XAML Workflows) and Running UI Automation 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 — useuia-configure-targetexclusively (the guide explains how). 7a. [UIA] Verify UIA prerequisites before invokinguia-configure-target. UIA minimum is26.4.1-preview(source-of-truth: uia-prerequisites.md — kept in sync with that file). Run the prerequisite check in that file. IfUiPath.UIAutomation.Activitiesis below the minimum or{PROJECT_DIR}/.local/docs/packages/UiPath.UIAutomation.Activities/skills/uia-configure-target/SKILL.mdis absent: ask the user to upgrade or fall back to indication authoring — never silently route to a non-existent skill path. If the plan header recordsUI capture: indication-only, skipuia-configure-targetentirely and use indication authoring. - Use
--output jsonon all CLI commands whose output is parsed programmatically. 8a.run/debug startsuccess/failure verdict comes from the outerResult(and equivalently the innerHasErrors), NEVER from any log entry’sLevel. A successful workflow may emitLog Messageactivities atErrororWarninglevel as observability — those are workflow-emitted data, not CLI failures. Compile failures, validation failures, and unhandled runtime exceptions all flipHasErrorsand propagate to the outerResult. Treating log-entry levels as a failure signal flips green runs to “failed” and burns retries on healthy workflows. See cli-reference.md § run and debugging.md § Reading Debug Output Effectively. - For “leverage / reuse / find shared libraries” requests, search the tenant feed — not the local filesystem, NuGet.org, or keyword-permutation loops. Run
uip resource libraries list --limit 500 --output-filter "<JMESPath>" --output json. 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. -
Register every test case file in
project.json→designOptions.fileInfoCollection. Applies to both XAML and coded test cases. Required keys, GUID format, JSON snippet, and full schema (includingdataVariationFilePathfor data-driven andpublishAsTestCasefor coded): references/testing-guide.md § project.json Registration and assets/json-template.md. -
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 from
uip rpa activities find --query "<event>" --output jsonby readingisTriggerandtriggerType. Placement rules differ.Integration triggers (
isTrigger: true,triggerType: "integration") — strict placement. MUST be the first activity ofMain.xaml’s rootSequence; CANNOT be placed insideui:TriggerScope. BindResultto a workflow-scope variable; the rest of theSequenceis the handler. Connection asset (ConnectionId) required for IS-based triggers (Mail / GSuite / O365 / Salesforce / Jira / Slack / ServiceNow / any*.IntegrationService.Activitiespackage); not required for Orchestrator-native triggers (TimeTrigger,QueueTrigger,ManualTrigger).Local triggers (
isTrigger: true,triggerType: "local") — flexible placement. Place EITHER as the first activity ofMain.xaml’s rootSequence(Orchestrator dispatches a fresh job per event) OR inside<ui:TriggerScope.Triggers>with handler in<ui:TriggerScope.Action>(robot stays alive while the scope is active; trigger fires in-process). Both placements are valid — choose by runtime model. No connection asset required.Unknown
triggerType(forward-compat — e.g. a future"scheduled") → read the bundled doc and ask the user. Do not assume placement.Reading existing XAML: activity inside
<ui:TriggerScope.Triggers>must be a local trigger; an integration trigger there is broken — flag to the user. Activity at workflow root can be either type — checktriggerTypeto disambiguate.See trigger-pattern-guide.md for worked examples, the
SchedulingModereference, the catalog of trigger activities, and the procedure for editing existingui:TriggerScopeworkflows.
Execution Discipline (Both Modes)
Run to completion — do not declare work done while plan tasks remain. If a plan file exists at docs/plans/*.md referenced by this request (or discoverable there for this feature), read its header before acting and during every checkpoint.
- If the header has
Execution autonomy: autonomous: continue until ALL plan task checkboxes are[x]OR a concrete item from the plan’sStop conditionssection is hit. - If the header has
Execution autonomy: interactive, or no plan file exists: use judgment and confirm with the user on material decisions. - 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
Stop conditionssection count. - Plan decisions already made are authoritative. Do not
AskUserQuestionabout structure, file count, selector strategy, or capture approach when the plan specifies them — those questions belonged to the planner.
Coded-Specific Rules
- [Coded] ALWAYS inherit from
CodedWorkflowbase class for workflow and test case classes (NOT for Coded Source Files). - [Coded] ALWAYS use
[Workflow]or[TestCase]attribute on theExecutemethod. - [Coded] Update
project.json→entryPointswhen adding/removing workflow files in Process projects. Tests and Library projects do NOT useentryPoints— skip this step for those project types. ForfileInfoCollection(required for every test case in every project type — XAML and coded alike), see Common Rule 10. - [Coded] One workflow/test case class per file, class name must match file name.
- [Coded] Namespace = sanitized project name from
project.json. Sanitize: remove spaces, replace hyphens with_, ensure valid C# identifier. - [Coded] Entry method is always named
Execute. - [Coded] Use Coded Source Files for reusable code — plain
.csfiles withoutCodedWorkflowinheritance, no entry point.
XAML-Specific Rules
- [XAML] Activity docs are the source of truth — check
{projectRoot}/.local/docs/packages/{PackageId}/first. Always. - [XAML] MUST understand project structure — read
project.json, check expression language, scan existing patterns. NEVER generate XAML blind. - [XAML] Start minimal, iterate to correct — build one activity at a time, validate after each addition.
- [XAML] Fix errors by category — Package → Structure → Type → Activity Properties → Logic.
- [XAML] ViewState handling depends on the operation. When editing existing files, do NOT modify ViewState on nodes you are not changing. When generating new Flowchart/StateMachine/ProcessDiagram workflows, generate ViewState for each node (see canvas-layout-guide.md). For Sequences, ViewState is optional.
- [XAML] Reading
<Activity>.mdfrom{PROJECT_DIR}/.local/docs/packages/...is a precondition foractivities get-default-xaml— for every activity not on the common-activity card.- Card-listed activities: check references/common-activity-card.md first; if the activity is on the card, author from the card entry alone — skip
activities find, skipactivities get-default-xaml, skip the per-activity MD read. - All other activities: (1)
activities find→ class name, (2) read<Activity>.mdfirst and extract a property checklist (required + use-case-relevant), (3)activities get-default-xaml→ starter element, (4) diff your checklist against the starter and add what’s missing — an empty checklist means you skipped step 2, go back. - Doc lookup order: primary
{PROJECT_DIR}/.local/docs/packages/<PackageId>/activities/<Activity>.md; fallbackskills/uipath-rpa/references/activity-docs/<PackageId>/<closest-version>/<Activity>.mdfor older package versions where.local/docsis empty. - Trigger activities are special — read BOTH docs. When the class name ends in
Trigger, the namespace contains.Triggers, or the description mentions “starts a job” / “Monitor Events” / “Trigger Scope”, also read the bundledreferences/activity-docs/<PackageId>/<closest-version>/activities/<Activity>.mdand the package’s bundledoverview.md. The auto-generated.local/docsversion is sparse for triggers; the bundled hand-written docs carry placement guidance (entry-point vs.ui:TriggerScope), deployment context, and cross-cutting namespace/assembly gotchas that the extractor does not capture. See Common Rule 12 and trigger-pattern-guide.md. - Skip-tax — concrete:
activities get-default-xamlomits any property whose value equals the type default. ForNGetTextthe starter is literally<uix:NGetText HealingAgentBehavior="SameAsCard" />with zero output properties — authoring from this alone producesNGetText.Value="..."(does not exist; the property isText), whichvalidateaccepts andbuildrejects. ForNTypeIntothat’s 2 of 20 properties hidden. - 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,Rethrow. 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, follow full Rule 21.InvokeWorkflowFile,Pick,Parallel, andParallelForEach<T>are intentionally off-card; use full Rule 21. Studio’s “While” / “Do While” / “For Each” toolbox items emit UiPath wraps (UiPath.Core.Activities.InterruptibleWhile/InterruptibleDoWhile/UiPath.Core.Activities.ForEach<T>), not the frameworkSystem.Activities.Statements.While/DoWhile/ForEach<T>.
- Card-listed activities: check references/common-activity-card.md first; if the activity is on the card, author from the card entry alone — skip
- [XAML] MUST read references/xaml/xaml-basics-and-rules.md before generating or editing any XAML.
- [XAML] NEVER change
expressionLanguageortargetFrameworkon an existing project. Decide both proactively at init time (Common Rule 2a); this rule covers the immutability afterward. Both fields inproject.jsonare fixed at creation time and apply to every XAML file in the project — flippingexpressionLanguage(VisualBasic ↔ CSharp) invalidates every expression, and flippingtargetFramework(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 viauip rpa init --expression-language <VisualBasic|CSharp> --target-framework <Windows|Portable>(for a target of Windows - Legacy, create it in Legacy mode instead — moderninitis 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. - [XAML] Wrap every container-activity body/branch in
<Sequence>— even single-activity bodies. Studio’s designer expects the wrap as a drop zone; Studio’s emitter produces it.validateandbuildaccept the bare form, so neither catches missing wrappers. Applies to creation and editing alike. Slots includeIf.Then/If.Else,While/DoWhilebody,ForEach.Body,TryCatch.Try/Catch/Finally,Switch.Default+ each case,PickBranch.Trigger/Action,NApplicationCard.Body. Full table with examples: xaml/xaml-basics-and-rules.md § Container Activity Bodies — Wrap in Sequence.
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. |
| Choose coded vs XAML | Both | coded-vs-xaml-guide.md |
| Work in a hybrid project | Hybrid | coded-vs-xaml-guide.md → project-structure.md |
| Create a new project | Both | environment-setup.md |
| Add/edit a coded workflow | Coded | coded/operations-guide.md → coded/coding-guidelines.md |
| Add a coded test case | Coded | coded/operations-guide.md — remember: register in fileInfoCollection (Common Rule 10) |
| Set up data-driven testing | Both | testing-guide.md § Data-Driven Testing — remember: register in fileInfoCollection (Common Rule 10) |
| Create XAML test case (Given-When-Then) | XAML | testing-guide.md § XAML Test Case Structure — remember: register in fileInfoCollection (Common Rule 10) |
| 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 |
| Create/edit XAML workflow | XAML | xaml/workflow-guide.md → xaml/xaml-basics-and-rules.md |
Use a common activity (Sequence / If / Switch<T> / TryCatch / While / DoWhile / ForEach<T> / Assign / LogMessage / WriteLine / Delay / Throw / Rethrow) |
XAML | common-activity-card.md |
| Create Flowchart/StateMachine/LRW | XAML | xaml/workflow-guide.md → xaml/canvas-layout-guide.md |
| Write UI automation | Both | ui-automation-guide.md → uia-configure-target-workflows.md |
| Build multi-screen UIA XAML workflow | XAML | ui-automation-guide.md → uia-configure-target-workflows.md § Multi-Step UI Flows |
| Use Excel/Word/Mail/etc. | Both | Service table below → .local/docs/packages/{PackageId}/ → fallback: references/activity-docs/{PackageId}/{closest}/ |
| Call an IS connector (coded) | Coded | coded/integration-service-guide.md |
| Call an IS connector (XAML) | XAML | is-connector-xaml-guide.md → connector-capabilities.md |
| Build an event-triggered workflow (O365 / Gmail / Salesforce / Jira / Slack / ServiceNow / time / queue / file watcher / UI click) | XAML | trigger-pattern-guide.md → activity-docs/{PackageId}/{closest}/activities/<TriggerActivity>.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 ui:TriggerScope workflow |
XAML | trigger-pattern-guide.md § Reading and Editing Existing TriggerScope XAML |
| Build/run/validate | Both | cli-reference.md → validation-guide.md |
| Profile a slow workflow / verify UI automation correctness | Both | debugging.md § Profiling Workflow Performance |
| Pack & publish project to Orchestrator | Both | publishing-guide.md |
| 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/third-party-packages-guide.md |
| Find / reuse existing tenant libraries | Both | tenant-library-search-guide.md |
| 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/inspect-package-guide.md |
| Troubleshoot coded errors | Coded | coded/coding-guidelines.md § Common Issues |
| Troubleshoot XAML errors | XAML | xaml/common-pitfalls.md → validation-guide.md |
| Understand project structure | Both | project-structure.md |
Coded Workflows Quick Reference
Coded workflows use standard C# development: create file → write code → validate → run. Activity discovery (activities find, activities get-default-xaml) is XAML-specific — for coded mode, check {projectRoot}/.local/docs/packages/{PackageId}/coded/coded-api.md first for service API docs, then fall back to packages inspect. See coded/inspect-package-guide.md.
Three Types of .cs Files
| Type | Base Class | Attribute | Entry Point | Purpose |
|---|---|---|---|---|
| Coded Workflow | CodedWorkflow |
[Workflow] |
Process only | Executable automation logic |
| Coded Test Case | CodedWorkflow |
[TestCase] |
Process only | Automated test with assertions |
| Coded Source File | None (plain C#) | None | No | Reusable models, helpers, utilities, hooks |
Service-to-Package Mapping
Each service on CodedWorkflow requires its NuGet package in project.json. Without it: CS0103.
| Service Property | Required Package |
|---|---|
system |
UiPath.System.Activities |
testing |
UiPath.Testing.Activities |
uiAutomation |
UiPath.UIAutomation.Activities |
excel |
UiPath.Excel.Activities |
word |
UiPath.Word.Activities |
powerpoint |
UiPath.Presentations.Activities |
mail |
UiPath.Mail.Activities |
office365 |
UiPath.MicrosoftOffice365.Activities |
google |
UiPath.GSuite.Activities |
For infrastructure/cloud packages (azure, gcp, aws, azureAD, citrix, hyperv, etc.), see coded/codedworkflow-reference.md.
For IS connectors from coded workflows via ConnectorConnection.ExecuteAsync: UiPath.IntegrationService.Activities — see coded/integration-service-guide.md.
CodedWorkflow Base Class
All workflow/test case files inherit from CodedWorkflow, providing built-in methods (Log, Delay, RunWorkflow), service properties, and the workflows property for strongly-typed invocation. Extendable with Before/After hooks via IBeforeAfterRun.
Full reference: coded/codedworkflow-reference.md
Templates
- assets/codedworkflow-template.md — Workflow boilerplate
- assets/testcase-template.md — Test case boilerplate
- assets/helper-utility-template.md — Helper class boilerplate
- assets/json-template.md —
entryPointsandfileInfoCollectionsnippets - assets/before-after-hooks-template.md — Before/After hooks
- references/project-structure-guide.md — Project structure design guidelines (mode-agnostic)
XAML Workflows Quick Reference
XAML workflows follow a discovery-first, phase-based approach: Discovery → Generate/Edit → Validate & Fix → Response. See references/xaml/workflow-guide.md for the full phase 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 |
Expression Language
Check expressionLanguage in project.json. VB.NET uses [brackets] for expressions; C# uses CSharpValue<T> / CSharpReference<T>. Default for new XAML projects is VB.NET.
Key CLI Commands
| Command | Purpose |
|---|---|
activities find --query "<keyword>" |
Discover activities by keyword |
activities get-default-xaml --activity-class-name "<class>" |
Get starter XAML for an activity |
analyzer-rules list --project-dir "<dir>" |
List enabled Workflow Analyzer rules — run before generating |
validate --file-path "<file>" |
Per-file static validation (structure, references, analyzer rules) |
build "<PROJECT_DIR>" |
Compile-time validation (member names, enum values, JIT expressions) — run after validate is clean |
Common Activities
| Activity | Package | Purpose |
|---|---|---|
| Use Application/Browser | UiPath.UIAutomation.Activities |
Scope for all UI automation actions |
| Click | UiPath.UIAutomation.Activities |
Click a UI element |
| Type Into | UiPath.UIAutomation.Activities |
Type text into a field |
| Get Text | UiPath.UIAutomation.Activities |
Extract text from a UI element |
| 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 |
XAML File Anatomy
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.
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
- 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 (LogMessage, GetText, StartProcess, …) — flat lookup table + recipes
- xaml/csharp-expression-pitfalls.md — C#-specific expression failures (attribute-form VB JIT, ThrowIfNotInTree, OutArgument parse errors)
- xaml/canvas-layout-guide.md — Flowchart, State Machine, and Long Running Workflow canvas layout with ViewState
- xaml/jit-custom-types-schema.md — JIT custom type discovery
Multi-Screen UI Automation Workflows
For XAML workflows spanning multiple capture screens, add each screen’s activities to the workflow as its targets get registered in the OR — validating with validate after each batch. uia-configure-target-workflows.md MUST be read IN FULL first (see § Multi-Step UI Flows for the capture loop and the Complete-then-advance rule).
Resolving Packages & Activity Docs
Follow this flow whenever you need to use an activity package:
Step 1 — Ensure the package is installed
Check project.json → dependencies for the required package.
Always query versions with --include-prerelease. Many UiPath activity packages ship as -preview between stable releases, and the latest preview routinely contains new activities, fixed signatures, and updated .local/docs content that activity generation depends on. Without the flag, the listing hides these and the agent will pick a stale stable.
- If present → note the installed version. Then list available versions with
--include-prereleaseand compare:- 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
.local/docs, fewer signature mismatches). Ask whether to upgrade. Never force-upgrade an already-installed package. - 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
packages versions --include-prerelease(preview is acceptable):
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
Step 2 — Find activity docs (priority order)
- Check
{PROJECT_DIR}/.local/docs/packages/{PackageId}/— auto-generated, most accurate. UseGlob+Read(notGrep—.local/is gitignored). - Fall back to bundled references at
references/activity-docs/{PackageId}/— pick the version folder closest to what is installed.
UI Automation References
UIA references live in two locations. Always cite by location so the reader knows which tree to open:
- This skill (
skills/uipath-rpa/references/) — policy, decision logic, target-capture orchestration, debug/recovery flows. - UIA activity pack (
{PROJECT_DIR}/.local/docs/packages/UiPath.UIAutomation.Activities/, installed viauip rpa packages install) — concreteuip rpa uiaCLI 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.
In this skill (skills/uipath-rpa/references/)
- ui-automation-guide.md — Mode-specific UIA patterns (coded vs XAML), prohibited-tool list, exploration-tool boundaries, Running & debugging procedure. MUST be read IN FULL before any UIA work.
- uia-prerequisites.md — Package version requirements, upgrade-consent rules
- uia-configure-target-workflows.md — Target-capture orchestration, multi-step UI flows, indication-fallback routing
In the UIA activity pack ({PROJECT_DIR}/.local/docs/packages/UiPath.UIAutomation.Activities/)
overview.md— Package overview and entry pointreferences/cli-reference.md— Fulluip rpa uiaCLI: subcommands, flags, accepted values, artifact filenamesreferences/object-repository.md— Object Repository concepts and CLI flowsreferences/selector-variables.md— Selector variable substitutionreferences/uia-target-attachment-guide.md— Attaching OR targets to XAML activities (TargetApp / TargetAnchorable)references/indication-fallback-workflow.md— Indication-mode capture whenuia-configure-targetis unavailablecoded/coded-api.md— Coded API surface foruiAutomation.*service callsactivities/<Activity>.md— Per-activity property surface (NClick,NTypeInto,NApplicationCard, …)activities/common/<Type>.md— Shared enums and types (NHealingAgentBehavior,Target,NClickType, …)skills/uia-configure-target/{SKILL.md,USAGE.md}— Target-configuration skill: procedure + invocation modesskills/uia-improve-selector/{SKILL.md,USAGE.md}— Selector recovery / improvement skill
Completion Output
Before reporting “done”, verify the plan is complete. If a plan file at docs/plans/*.md drove this work:
- Re-read the plan and scan its task checkboxes.
- If any
[ ]boxes remain AND the plan’s header saysExecution autonomy: autonomousAND noStop conditionsitem was hit — do not report done. Resume execution on the next unchecked task. - 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
interactive, proceed to the report format below.
When you finish a task, report to the user:
- What was done — files created, edited, or deleted (list file paths)
- Validation status — per-file
validateresult (all files passed, or remaining errors) and project-leveluip rpa buildresult. Both must be clean to claim verification —validateclean alone is insufficient (it does not detect unknown member names or invalid enum values). Ifbuildhas not run since the last edit, say so explicitly rather than claiming success. - Plan completion — which task checkboxes in
docs/plans/*.mdare now[x]; list any still[ ]and, for each, the Stop-condition item that interrupted it (or “not reached” if execution was cut short another way) - How to run — the
uip rpa run(oruip rpa debug start) command (if applicable) - 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
/uipath-feedbackto send a report.”
Do NOT use framing like “complete”, “done”, “finished”, or “the automation is built” unless every plan task is checked off. “Partial”, “stopped at