|
npx skills add https://github.com/microsoft/agentic-journeys --skill journey-runner
Run a journey like a learner would, but with strict preflight, isolated state, evidence-backed verification, and scoped cleanup. The workflow must work on Windows, Mac, and Linux.
The runner itself requires:
azd) 1.28.0 or laterScreenshot runs additionally require the local Playwright package and bundled Chromium under scripts/. Installation options for all operating systems are in ../../../docs/tool-installation.md.
Do not install system tools during a run. Report the missing tool, its install link, and the validation command, then stop before generating code or creating Azure resources. Project-local npm ci for the checked-in runner helpers is allowed only during explicit runner setup, not as a surprise halfway through a journey.
Inputs:
journeys/smart-todo/after-verification or leave-runningDefaults:
| Behavior | Default |
|---|---|
| Deploy to Azure | Yes, when the journey contains a deployment phase |
| Cleanup | after-verification |
| Stack | Use the only option; ask before starting when multiple materially different stacks exist |
| Verification failure | Record the failure, attempt one evidence-based repair, then stop that phase if it still fails |
| Output | Concise phase summary plus artifact paths and actual command results |
Only use leave-running when the user explicitly requests it.
Read the journey's README.md, PLAN.md when present, and every associated journey skill. Extract:
Build a prerequisite list from the journey's own prerequisite section. Do not rely on a hard-coded generic list when the journey requires sqlcmd, Azure Functions Core Tools, or another host tool. AIMarket deployment images must build in ACR, and Superset must run Helm and kubectl inside Azure through AKS run command.
Before execution, print a plan containing the journey, stack, host OS/architecture, phases, required tools, optional tools, planned ports, deployment choice, and cleanup policy.
Detect the host with Node.js process.platform, process.arch, and os.release(). Never infer the operating system from path syntax.
Run the helper from this skill directory:
node scripts/check-prerequisites.mjs --required node,az,azd,copilot,<journey-tools> --optional <optional-tools>
Journey-specific minimums:
| Journey | Additional required tools | Optional or platform-gated tools |
|---|---|---|
| Grafana | None | Playwright for screenshots |
| n8n | Node.js LTS or later | Playwright for screenshots |
| Superset | Node.js LTS or later | Playwright for screenshots; local kubectl and Helm only for optional direct cluster work |
| AIMarket | Node.js LTS or later, GitHub CLI | Playwright; Docker only for optional local container work |
| SmartTodo | Node.js LTS or later, Azure Functions Core Tools v4, sqlcmd | Project-local Azurite for local execution; Docker for alternate stacks or local SQL; Xcode 16+ only for Mac iOS execution |
| WeatherView | Node.js LTS or later | Project-local Playwright and bundled Chromium; ARM64 may require the documented temporary x64 Azure publisher or an approved x64 host if the SWA client returns an architecture error |
Check Azure CLI and azd separately:
az account show must succeed and show the intended subscription.azd to reuse Azure CLI authentication with azd config set auth.useAzCliAuth true.azd command that reads account/environment state before creating resources.azd still reports an expired token, stop and report the mismatch. Do not assume az login fixed azd.For Container Apps images, compare host architecture with the required linux/amd64 target.
linux/amd64 on every host architecture.Any missing required prerequisite stops the journey before Phase 1.
Create a unique directory without shell-specific date or path expressions. Use Node.js filesystem APIs or the active agent's file tools.
Recommended shape:
<journey-runs-root>/<journey-name>-<UTC timestamp>/
Copy only PLAN.md and other explicitly required source documents. Never write generated application files into the source journey directory.
Record:
Before starting a local server, test whether its preferred port is available. Select a supported free port rather than stopping an unrelated process.
Copilot CLI accepts prompt text with -p; it does not accept a --prompt-file CLI option. Do not launch background jobs with an unverified flag.
Write each prompt to a UTF-8 file, then use the cross-platform helper:
node scripts/run-copilot-prompt.mjs --prompt-file <prompt-path> --cwd <workspace> --allow-dir <repository-root> --allow-all-tools --allow-all-urls
The helper reads the file and calls copilot -p <prompt> with shell: false, avoiding Bash and PowerShell quoting differences. Non-interactive runs must explicitly opt into the tools and URLs required by the journey, and must add the repository root when the workspace is a child directory; otherwise Copilot cannot request approval and silently loses access to commands or parent skills.
Before launching a batch, run copilot --help and one harmless prompt smoke test. If that fails, do not start parallel or background journey processes.
Execute prompts sequentially within a journey. Wait for each prompt to finish, inspect the files it produced, and only then continue.
Do not execute a fenced bash block verbatim in PowerShell.
Priority order:
shell: false.Generated azd lifecycle hooks must be CommonJS .js or .ts files referenced directly from azure.yaml; azd 1.28.0 rejects .mjs hook paths. Do not generate .sh hooks, shell: sh, chmod, shell traps, command substitution, or pipelines for required deployment behavior.
For n8n, setting WEBHOOK_URL creates a replacement Container App revision. The generated post-provision hook must poll both /healthz and / for up to five minutes and require six consecutive HTTP 200 results over 30 seconds. Do not accept one successful probe while the old revision is still deprovisioning. When uniqueString() output crosses a Bicep module boundary, constrain that parameter to exactly 13 characters.
For Superset, a clean environment may not contain SUPERSET_SECRET_KEY or SUPERSET_ADMIN_PASSWORD. The generated Node hook must create cryptographically random values when absent, persist them with azd env set, never print them, and reuse existing values on reruns before creating Kubernetes secrets.
For SmartTodo, resolve and persist AZURE_PRINCIPAL_ID, AZURE_PRINCIPAL_LOGIN, and AZURE_PRINCIPAL_TYPE before azd up; handle interactive users and service principals separately and fail before provisioning if any value is unavailable. If raw Foundry resources are generated, put the model child in a nested Bicep module that runs after account creation. Name the Azure-services SQL firewall rule AllowAzureServices or another neutral name, never one containing the reserved word WINDOWS.
For WeatherView, require only Microsoft.Web on the normal path, use Azure Static Web Apps Free with provider: Custom, map azure.yaml service web to azd-service-name: web, and normalize unsupported Static Web Apps locations to eastus2. Do not accept a generated application backend, deployment token file, GitHub workflow, storage account, persistent application container, local Docker requirement, or unrelated provider registration. The documented ARM64 recovery is a conditional exception for one approved temporary publisher.
Before deploying WeatherView, record process.platform and process.arch, but do not reject ARM64 automatically. Windows 11 on ARM can run many x64 applications through emulation. Use the README recovery only after the SWA publish phase returns the documented architecture error. A temporary x64 Azure publisher requires explicit approval, secure in-memory token handling, deletion in finally, and an exact absence check. Never install privileged emulation silently.
For development servers:
Run the journey's build, lint, and tests before Azure deployment. Verification must assert behavior, not merely process exit.
For each check, record:
If a check fails, make one targeted repair based on the real error and rerun the failing check. Never replace unavailable execution with plausible output.
Before azd up:
azd environment name, intended resource-group name, expected managed resource groups, deployment tags, and names of soft-deletable resources.az account show --query id -o tsv, then pass that value to azd env set AZURE_SUBSCRIPTION_ID <value> without shell command substitution.azure.yaml.Run azd up and capture its real output. Monitor long-running deployment processes rather than assuming they completed.
For Container Apps using ACR, verify all of these before the first private image deployment:
AcrPull is assigned to that identity.identity: system.linux/amd64.A filtered deployment of a service declared in azure.yaml can skip project-level hooks, so run the documented hook directly afterward and repeat production verification. AIMarket's web Container App is not an azd service; rebuild it with node infra/hooks/postdeploy.js, not azd deploy web.
Run the journey's portable verification script against live outputs. Do not stop at HTTP 200 when the journey requires data, authentication, images, or mutations.
Examples:
/api/health reports database ok./healthz HTTP 200 and owner-setup or login page renders.1/1 Running, /health HTTP 200, login succeeds with the documented selectors.Temporary verification records must be deleted in finally.
The runner helper uses Playwright's bundled Chromium. Do not require the branded Chrome channel, especially on Linux ARM64.
One-time runner setup from the scripts/ directory:
npm ci
npx playwright install chromium
Linux hosts may require the administrator-approved command npx playwright install --with-deps chromium. Do not run it silently.
Capture a public page:
node scripts/capture-screenshot.mjs --url <url> --output <png> --fail-on-resource-errors true
For Superset login, additionally pass:
--username admin --password <secret> --username-selector #username --password-selector #password --submit-selector "input[type='submit'], button[type='submit']" --success-path /superset/welcome/
Never print credentials. Visually inspect the saved image and review failed document, script, XHR, fetch, and image requests. A broken product image fails AIMarket acceptance.
Skip screenshots for API-only journeys and for iOS on Windows/Linux. A mobile screenshot is only required on a suitable Mac/Xcode host.
With the default after-verification policy, preserve reports and screenshots, then run:
azd down --force --purge --no-prompt
Cleanup must use the ownership inventory recorded before deployment. Delete only the exact azd environment, resource groups, managed resource groups, and soft-deleted resources created by this run.
Verify cleanup with live Azure queries:
azd-env-name tag.If cleanup fails, report the exact remaining resource IDs. Never broaden deletion scope to make the report look clean.
Write run-report.md and include:
Write sanitized journey defects to that journey's issues.md. Keep shared orchestration defects in the runner issue section. Never include credentials, tokens, cookies, connection strings, SQL passwords, or authorization headers.
azd env get-value without shell substitution.Take microsoft/journey-runner from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.
The instructions reference npx.
Without those the skill loads but fails at the first command.