# Execution Journeys Catalog — turn-budgeted build journeys

<!--skill-flavor:host-scope:start-->
<!--skill-flavor:host-scope:end-->
Catalog — read the one journey the task runs, never end-to-end: Grep `^## `, then Read that journey through the next `## ` heading. What every journey shares — source precedence, gate versus runtime proof, sequential gates, failure exits, cross-session memory — is [execution-maps-guide.md](execution-maps-guide.md), read whole first.

## Journey: Greenfield XAML (no UIA)

Skip project discovery: no `project.json` exists before T1, only the untouched scaffold after it ([environment-setup.md § Skip gate](environment-setup.md)). The parent-directory `ls` is the first link of T1's `Bash` chain, not a turn. Write `project-context.md` and `AGENTS.md` at T5.

| Turn | Emit in ONE assistant message |
|---|---|
| **T1 — Scaffold + context** | Run one `Bash` chain: `uip rpa init --name "<NAME>" --location "<PARENT_DIR>" --template-id BlankTemplate --expression-language <VisualBasic\|CSharp> --target-framework <Windows\|Portable> --output json` (Rule 2a; both flags explicit) `&&` one `uip rpa packages versions --package-id <PackageId> --include-prerelease --project-dir "<PROJECT_DIR>" --output json` per request-known package `&&` `node -e "require('fs').rmSync(process.argv[1],{force:true})" "<PROJECT_DIR>/Main.xaml"`; in parallel, plain full-`Read` [xaml/xaml-basics-and-rules.md](xaml/xaml-basics-and-rules.md) (Rule 22); `Grep` `^### ` on [common-activity-card.md](common-activity-card.md) and [common-pattern-card.md](common-pattern-card.md) for their entries (Rule 21 card lookup); `Grep` `^## ` on [xaml/common-pitfalls.md](xaml/common-pitfalls.md) for headings (Rule 22, step 1); ask the package version question ([execution-maps-guide.md § Sequential gates](execution-maps-guide.md#sequential-gates--never-batch-across-these)); recall memory; and fan out Rule 21 `activities find` for off-card activities. |
| **T2 — Vet** | In parallel, `Read` the card entries the plan needs, a card whole when it needs more than 5 of them (Rule 21); `Read` every [xaml/common-pitfalls.md](xaml/common-pitfalls.md) section whose T1 heading matches a planned activity, property, or feature; when unsure, read it (Rule 22, step 2); `Read` `project.json`; read needed [xaml/xaml-editing-catalog.md](xaml/xaml-editing-catalog.md) entries for operations beyond the cards; and perform Rule 21 doc `Read`s plus `get-default-xaml` for off-card activities. Do not read `Main.xaml`; T1 deleted the scaffold. This is the only pitfalls-gate turn. |
| **T3 — Author + install** | For row processing, make the design fork first: complex bulk processing (per-row parse + validate + branch + accumulate) escalates to code per [data-manipulation-guide.md § Code vs activity chains](data-manipulation-guide.md); the pattern card's `ForEach` shapes cover only the simple one-`If`/`Switch` case. Then `Write` one complete file per workflow (Rule 18), `Edit` `project.json` for `fileInfoCollection` test cases (Rule 10), and run ONE `Bash` `uip rpa packages install` for all needed packages at the versions T1's question settled, using [cli-reference.md § packages install](cli-reference.md#packages-install); on `Invalid packages input`, run `uip rpa packages install --help` again. `dependencies` remains CLI-owned. |
| **T4 — Gate** | Run one sequential `Bash` chain/loop for every edited file: `uip rpa validate --file-path "<RELATIVE_FILE>" --project-dir "<PROJECT_DIR>" --output json` per file `&&` `uip rpa build "<PROJECT_DIR>" --output json` `&&`, when outputs are observable and no external system/UI is needed, `uip rpa run --file-path "<RELATIVE_FILE>" --project-dir "<PROJECT_DIR>" --skip-build --output json` on the entry point (`--file-path` required) `&&` `cat` every requested output file. This output check is part of the chain. `--file-path` is relative to the project directory; absolute paths falsely fail due to a separator bug ([cli-reference.md § validate](cli-reference.md#validate)). |
| **T5 — Report** | Send one message with no shell calls. Judge T4 verdict fields and `cat` output against the request; wrong/empty output with a clean gate indicates silent failure ([execution-maps-guide.md § Failure exits](execution-maps-guide.md#failure-exits)). In that message, make parallel calls: `Write` `.claude/rules/project-context.md` and `Write` `AGENTS.md` with paths, metadata, and markers per [environment-setup.md § Project Context Discovery](environment-setup.md) step 3 (first line `<!-- discovery-metadata: cs=N xaml=N deps=N -->`; put the same block in `AGENTS.md` between `<!-- PROJECT-CONTEXT:START -->` / `<!-- PROJECT-CONTEXT:END -->`; do not `Read`/`Grep` first), qualifying memory `Write`s, and SKILL.md § Completion Output. Run nothing afterward. |

T1 is one message: `init`, every read, [xaml/xaml-basics-and-rules.md](xaml/xaml-basics-and-rules.md), and the card and pitfalls heading `Grep`s all ride together; only entry and section reads wait for T2. Do not open any other reference before T3, including `environment-setup.md`. The first chain call pays the cold Helm restore (30–90 s); do not split it to check progress. `init` may return `success: false` while creating files; check that `project.json` exists before retrying ([environment-setup.md](environment-setup.md)). Install dependencies only through `packages install`; never hand-edit `project.json` `dependencies`.

**Repair cycle (validate/build failure):** use one turn for an `Edit` fixing one root cause (Rule 19, Package first: a skipped `packages install` fails before activity issues), then one turn to rerun the batched gate. Card-covered failures do not reopen discovery; recheck the card. Retain each validation result and build only when all files are error-free. If >2 errors have ambiguous origin, bisect by stubbing half the new activities and re-validating. Maximum 5 attempts per loop (Rule 3).

## Journey: Brownfield XAML edit

| Turn | Emit in ONE assistant message |
|---|---|
| **T1 — Context** | Run SKILL.md § Precondition context check: skip gate first, then the discovery subagent, which writes `project-context.md` + `AGENTS.md` ([environment-setup.md § Project Context Discovery](environment-setup.md)). In parallel, `Read` `project.json`, target `.xaml`, and [xaml/xaml-basics-and-rules.md](xaml/xaml-basics-and-rules.md) (Rule 22, plain full read); `Grep` `^### ` on [common-activity-card.md](common-activity-card.md) and [common-pattern-card.md](common-pattern-card.md) (Rule 21 card lookup) and `^## ` on [xaml/common-pitfalls.md](xaml/common-pitfalls.md); run `packages versions` in `Bash` for every package the edit uses; recall memory; and fan out off-card `activities find`. |
| **T2 — Vet** | `Read` the card entries the plan needs, a card whole when it needs more than 5 of them (Rule 21), matching [xaml/common-pitfalls.md](xaml/common-pitfalls.md) sections (Rule 22), needed [xaml/xaml-editing-catalog.md](xaml/xaml-editing-catalog.md) entries, and off-card Rule 21 docs; ask the package version question when one is due ([execution-maps-guide.md § Sequential gates](execution-maps-guide.md#sequential-gates--never-batch-across-these)). |
| **T3 — Edit** | Batch `Edit`s, anchoring each on its own target block; same-file edits serialize and overlapping anchors fail. Run `packages install` in `Bash` at the versions T2's question settled. |
| **T4 — Gate** | Run one sequential `Bash` chain/loop covering every edited file: per-file `validate` with relative `--file-path` `&&` `build` `&&` optional `run --file-path "<RELATIVE_FILE>" --skip-build` `&&` `cat` every output file, per [execution-maps-guide.md § Gate ≠ runtime proof](execution-maps-guide.md#gate--runtime-proof). |
| **T5 — Report** | Send one message with no shell calls: judge T4 verdict and `cat` output; emit SKILL.md § Completion Output and qualifying memory `Write`s in parallel. The discovery agent wrote context files in T1: do not read, edit, or rewrite them after the gate. The next session judges staleness by file/dependency counts ([environment-setup.md § Project Context Discovery](environment-setup.md)). If the skip gate tripped, write both files exactly as greenfield T5 does. |

## Journey: Greenfield coded

`init` always scaffolds XAML; use the same command and flags as above, then add `.cs` files ([environment-setup.md](environment-setup.md)).

| Turn | Emit in ONE assistant message |
|---|---|
| **T1 — Scaffold + context** | Run ONE `Bash` chain: `init` with the XAML journey flags `&&` `packages versions` per known package, and ask the package version question beside it ([execution-maps-guide.md § Sequential gates](execution-maps-guide.md#sequential-gates--never-batch-across-these)). In parallel, `Read` [assets/codedworkflow-template.md](../assets/codedworkflow-template.md) and [coded/operations-guide.md § Coding Guidelines](coded/operations-guide.md#coding-guidelines), then recall memory. |
| **T2 — Author + install** | `Write` each `.cs` (Rules 13–19); `Read` `project.json`; `Edit` it for `entryPoints` (Rule 15) and `fileInfoCollection` (Rule 10); run `packages install` in `Bash`; read `.local/docs/packages/<PackageId>/coded/coded-api.md` for installed services. |
| **T3 — Gate** | Run one sequential `Bash` chain/loop over every edited file: per-file relative-`--file-path` `validate` `&&` `build` `&&` optional `run --file-path "<RELATIVE_FILE>" --skip-build` `&&` `cat` every output file, per [execution-maps-guide.md § Gate ≠ runtime proof](execution-maps-guide.md#gate--runtime-proof). |
| **T4 — Report** | Send one message with no shell calls, using greenfield XAML T5's shape: judge T3 verdict and `cat` output, then parallel `Write`s for both context files, qualifying memory, and SKILL.md § Completion Output. |

## Journey: Brownfield coded edit

Use the brownfield XAML journey with coded reads and no pitfalls-vet turn: T1 `Read` target `.cs` plus `.local/docs/.../coded/coded-api.md` for touched services, and `packages versions` for every package the edit uses; T2 `Edit`s, plus the package version question when one is due; T3 `packages install` at the settled versions `&&` gate; T4 report.

## Journey: UIA capture + build (XAML)

Budget: **~4 fixed turns + ~3 turns per capture-screen + 2-turn debug cycle; a greenfield project adds T1–T2.** Serialize capture across screens by application state (Complete-then-advance, the target-capture orchestration reference routed from the UIA package guide); never batch across an advance. Route concrete UIA CLI syntax through `{PROJECT_DIR}/.local/docs/packages/UiPath.UIAutomation.Activities/ui-automation-guide.md` § Documentation.

| Turn | Emit in ONE assistant message |
|---|---|
| **T1 — Scaffold (greenfield only)** | Run greenfield XAML T1's `init` chain with `UiPath.UIAutomation.Activities` among its `packages versions` calls, and ask the package version question beside it ([execution-maps-guide.md § Sequential gates](execution-maps-guide.md#sequential-gates--never-batch-across-these)). In parallel, `Read` [uia-starter-guide.md](uia-starter-guide.md) in full and plain full-`Read` [xaml/xaml-basics-and-rules.md](xaml/xaml-basics-and-rules.md) (Rule 22); `Grep` `^### ` on [common-activity-card.md](common-activity-card.md) and [common-pattern-card.md](common-pattern-card.md), and `^## ` on [xaml/common-pitfalls.md](xaml/common-pitfalls.md). |
| **T2 — Install (greenfield only)** | Run ONE `Bash` `packages install` at the versions T1's question settled. The UIA package docs exist only after it, so T0 cannot share this turn. |
| **T0 — Reads + pre-flight** | In parallel, `Read` [uia-starter-guide.md](uia-starter-guide.md) unless T1 read it, the UIA package core guide (Rule 7), and its mandated target-capture orchestration reference, all in full; check prerequisites ([uia-starter-guide.md § UIA Prerequisites](uia-starter-guide.md), Rule 7a); run ONE `Bash` window-baseline via the UIA snapshot CLI; build the element inventory/checklist from the user's manual steps. |
| **Per capture-screen** | Run the `uia-configure-target` flow once for ALL checklist elements on the screen through OR registration; make ONE state advance with the interact CLI only to reach the next screen, never to test behavior. |
| **T-vet — after ALL screens captured** | In parallel, `Read` the package's XAML authoring guide in full and the task guides it makes mandatory for the captured controls (both routed from the core guide § Documentation); the [xaml/common-pitfalls.md](xaml/common-pitfalls.md) sections matching the plan and the card entries it needs (on an existing project, first the Rule 22 reads greenfield T1 does); and, for each off-card activity, its Rule 21 doc plus `get-default-xaml`. |
| **T-author** | Complete Capture-First Fast Path scaffolding/authoring prerequisites; `Write` every screen's activities once (Rule 18). |
| **T-gate** | Run one sequential `Bash` chain/loop: attach the OR targets per the package's target-attachment guide `&&` per-file relative-`--file-path` `validate` over every edited file `&&` `build`. |
| **Debug cycle (consent-gated, [uia-policies-catalog.md § Running UI Automation Workflows](uia-policies-catalog.md))** | Run ONE `Bash` chain: window baseline `&&` `debug start` `&&` `execution cancel` `&&` re-list windows. In the next turn, diff, reset the apps the run drove, and close stray windows via one interact-CLI `Bash`; a reset that raises a prompt the run never captured adds one snapshot-and-answer turn before the close. In the message that finishes cleanup, report with parallel context-file `Write`s, qualifying memory `Write`s, and SKILL.md § Completion Output as in greenfield T5. Read the verdict from the `debug start` envelope; never redirect it to a file and parse it in extra turns. |

Batch Object Repository definition updates, registration, and linking as sequential CLI loops/chains in one `Bash` call per phase, not one turn per entry. Split only when later calls need returned references or a file edit; keep screen-before-element linking and verify links in files. State advances and consent remain gates.

For coded mode, install needed packages and `Write` the empty `[Workflow]` stub (SKILL.md § Capture-First Fast Path step 2) BEFORE T0's window-baseline `Bash`. The first `uip rpa` command that loads the project snapshots coded partials from the packages and `.cs` files present at that moment; if the stub is missing then, authoring gets `CS0246`/`CS0103`. In T-vet, run ONE `Bash` per-file `validate` to regenerate `.local/.codedworkflows/ObjectRepository.cs`; `Read` it at the start of T-author, and author targets as `Descriptors.*`, never string names.

Default to author-once-after-capture; all OR refs are then in conversation. For long captures (5+ screens) with real context pressure, interleave per-screen authoring instead; run `validate`/`build` once at the end either way. For later screens in the same window, carry the prior OR screen reference into the next `uia-configure-target` invocation to skip OR-screen lookup; use the package's invocation guide routed from package-guide § Documentation. Keep indication fallback (physical user click) and every interact advance sequential, never batched or parallel. At debug-time selector failure, run the recover selector flow; never hand-edit selectors.
